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

[Question] Set node spacing for nested children #326

Open
Jaywhisker opened this issue Feb 28, 2025 · 3 comments
Open

[Question] Set node spacing for nested children #326

Jaywhisker opened this issue Feb 28, 2025 · 3 comments
Labels

Comments

@Jaywhisker
Copy link

I would like to know if there is any option to adjust the spacing between the nodes in nested children. Currently my elk option is the following:

const elkOptions = {
'elk.algorithm': 'layered',
'elk.layered.spacing.nodeNodeBetweenLayers': '50',
'elk.spacing.nodeNode': '80',
'elk.direction': 'RIGHT',
'elk.edgeRouting': 'POLYLINE',
'elk.layered.considerModelOrder': 'true',
'elk.hierarchyHandling': 'INCLUDE_CHILDREN',
}

I retrieve a result like this
Image

The nested children (as seen in the grey sections) seem to follow the default spacing of 20, instead of the assigned 80. I have tried setting a width and height for the parent node as well, but elk always defaults it back this size regardless. I am hoping to be able to adjust the size of the parent node to be able to achieve graphs similar to this in the future.

Image

@Jaywhisker
Copy link
Author

To add on, while I understand I could set the parent node size with elk.nodeSize.minimum, I do not know how to align the child nodes to the right. I've tried elk.alignment without any success

@soerendomroes
Copy link
Member

Hi, add layout options only for the current hierarchy level. Hence, you need to specify the spacing on the "Frame 100" node.

@soerendomroes
Copy link
Member

To add on, while I understand I could set the parent node size with elk.nodeSize.minimum, I do not know how to align the child nodes to the right. I've tried elk.alignment without any success

Could you create an example in elklive?

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

No branches or pull requests

2 participants