-
Notifications
You must be signed in to change notification settings - Fork 142
GSoC 2025 Week 4-5: feat(Masonry): Complete Brick Tower Rendering System Implementation #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| return estimateTextWidth(label); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is temporary to render stuff right now, will be updated later, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I figured the previous method to determine the label width in justin's model wasn't rendering correct, so I used this one, we can enhance this further in time as required. Right now for rendering in storybooks this method works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model does not decide the label length, the component does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no function in the model to determine the label width. That was done by the react component itself. The model is only responsible to determine and pass down the props and has no connection(functions related to) to rendering the brick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had temporarily added estimateTextWidth(label) inside the model just to visually unblock layout issues in Storybook for now. But yes, this is something we can definitely clean up by moving all layout-related measurements (like label width) to the React view layer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no function in the model to determine the label width. That was done by the react component itself. The model is only responsible to determine and pass down the props and has no connection(functions related to) to rendering the brick.
initially the label widths were being calculated in a fixed way for all label width, no function in the model to determine the label width hence it did not return correct bounding boxes and the position for the origin of the argument bricks for short and long labels did not render correctly. So I made a function to calculate label width
Now it is working correctly .
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
Signed-off-by: karan-palan <[email protected]>
…onenent Signed-off-by: karan-palan <[email protected]>
|
Updates done:
|
Signed-off-by: karan-palan <[email protected]>
…ager Signed-off-by: karan-palan <[email protected]>
…mplify code and add stories Signed-off-by: karan-palan <[email protected]>
…UD operations using towers and handles connection logic Signed-off-by: karan-palan <[email protected]>
|
Changes made:
Screencast.from.2025-07-02.17-56-39.webm |



Description
This PR implements a fully functional tree rendering system for the MusicBlocks (Masonry module), including hierarchical brick layout, dynamic SVG-based rendering, a factory system for brick creation, and complete testing coverage.
Tree Rendering & Layout
Tree Model: Parent-child brick management with nested, argument, and stacked connections
TreeView: Recursive SVG renderer with auto layout and bounding box calculations
Dynamic Geometry: Canvas-based text measurement and positioning
Brick Factory
Factories: Create simple, expression, and compound bricks with defaults
UUID Management: Auto ID generation and tracking
Flexible Overrides: Easily customize brick creation
Testing & Stories
Storybook: Render single, stacked, argument, and compound bricks with controls
Unit Tests: Validate tree creation, connections, and layout logic