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

Node widths not being respected when node has children with widths. #311

Open
chanpod opened this issue Nov 28, 2024 · 2 comments
Open

Node widths not being respected when node has children with widths. #311

chanpod opened this issue Nov 28, 2024 · 2 comments

Comments

@chanpod
Copy link

chanpod commented Nov 28, 2024

If I have this setup

{ width: 1000 children: [{ width: 200 }, { width: 200 }] }

When I run it through the algorithm, it overrides the parents width and the width will be 400 (400 plus some padding it seems. Usually something like 420 or so). I have tried various settings but I can't seem to get the correct setup to make it keep my widths. I tried node size constraints but it didn't seem to want to honor that either (possible I didn't do it quite right). Any help would be greatly appreciated as getting it to respect the widths I set is the last big barrier to this project. Thanks!

This is via the javascript library. So I very well may have not setup the constraints minimum correctly as the documentation isn't super clear how that works.

global layout setup

"layoutOptions": { "elk.algorithm": "layered", "elk.edgeRouting": "ORTHOGONAL", "elk.direction": "DOWN", "elk.spacing.nodeNode": "200", "elk.spacing.componentComponent": "200", "elk.edgeLabels.placement": "TAIL", "elk.nodeSize.constraints": "MINIMUM_SIZE", "elk.layered.spacing.nodeNodeBetweenLayers": "200", "elk.layered.spacing.edgeNodeBetweenLayers": "200", "elk.layered.nodePlacement.favorStraightEdges": "true", "elk.portConstraints": "FIXED_ORDER", "elk.spacing.edgeEdge": "75", "elk.edge.thickness": "10", "elk.spacing.edgeNode": "150", "elk.hierarchyHandling": "INCLUDE_CHILDREN", "elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES" },

@chanpod
Copy link
Author

chanpod commented Nov 28, 2024

omg I think I finally figured out the correct way to do the KVector. I would say the documentation needs to be updated to show how to do this in javascript land. a value type of KVector doesn't tell me much :(

"elk.nodeSize.constraints": "MINIMUM_SIZE", "elk.nodeSize.minimum": (320, 100)

@soerendomroes
Copy link
Member

Thank you for the issue.
If the question is solved, I keep this open to remind us of the documentation fix.

If you ever happen to run into similar problems, try the elklive elkt editor, which has content-assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants