-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ability to specify size of parent nodes #1051
Comments
This may be possible to set as an option in particular layouts, but it's probably not possible in general with all the features that the API supports. For example, some layouts only apply to noncompound nodes. So, all the child nodes get positioned according to the layout algorithm (e.g. arbor or grid). A compound parent has its dimensions set automatically based on its children. If a restriction is set on compound dimensions, there is a contradiction. It would be possible to have layouts (like the upcoming CoSE2) have support for limiting compound node sizes -- but even then this is more of just a hint rather than a hard and fast restriction. Even within a layout, restricting compound size can create contradictions. Consider avoiding overlap. The compound may not have enough space to avoid its children from overlapping. |
honestly a hint would be amazing. I understand that if a person were to define too little space for a compound nodes and its child nodes, it would have to "bust out" of the size originally designed And if this could be included in an upcoming release that would be amazing. |
Limiting compound node sizes is not straightforward at all. Any particular reason that you'd like to limit a compound node's size? Can you share with us some examples where the layout inside compounds are not to your satisfaction? Have you tried increasing gravity if you think layout produces compound nodes that are too large? Also, if your compounds typically include disconnected nodes, you should turn tiling on. |
I think a layout algorithm's treatment of compound sizes is independent of whether or not the core allows resize of compounds. When you call layout, you should be ready to / expect to see node positions and compound node dimensions change! |
@dabobert Now it's possible to size compounds to be bigger than their children's bounds using the options specified under "Compound parent sizing" in Cytoscape.js documentation. This is a feature outside a layout. For a layout to support this is a separate issue; in other words, layout might change any specified size for a compound. |
I want to use dagre layout along with an option to make the child nodes have vertical alignment and compound nodes a fixed height and width. Is this possible? |
@kunalganglani Just curious were you able to accomplish this? I was looking to do the same thing I have 20 nodes inside a parent and I would like to be able to set max width on that parent and force a 4x5 layout inside that parent. |
Even though i try to specify the size of parent nodes, the width and height attributes always seems to be ignored. I would find it beneficial to limit the space that parent nodes and their children take up on the canvas
The text was updated successfully, but these errors were encountered: