Skip to content
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

Set Node minimum size based on PortGroup size #162

Merged
merged 3 commits into from
Jun 28, 2020

Conversation

ajuhos
Copy link

@ajuhos ajuhos commented Jun 9, 2020

Use react-resize-observer in Ports and notify the Node about size changes. In Node, set the minimum size (minWidth and minHeight css props) based on the size of Ports. Size of Ports is calculated from max(top.width, bottom.width) and max(left.height, right.height).

This way node size is still calculated based on NodeInner's size, but cannot be smaller than the minimal size specified by the ports. Also this magically solves the issue with Links getting rendered at the wrong place when PortGroup is larger than the side of the Node (as it won't be larger ever).

Use react-resize-observer in the port groups and notify the node about size changes. In the node set the minimum size based on the port group size.
@ajuhos ajuhos changed the title Fix #160 Set Node minimum size based on PortGroup size Jun 9, 2020
@MrBlenny MrBlenny merged commit cb38dea into MrBlenny:master Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants