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

Nodes proceeding hierarchies are not centered #1014

Open
dsteinbach-ep opened this issue Apr 3, 2024 · 7 comments
Open

Nodes proceeding hierarchies are not centered #1014

dsteinbach-ep opened this issue Apr 3, 2024 · 7 comments
Labels
alg-layered Affects the ELK Layered algorithm. bug Erroneous behaviour.

Comments

@dsteinbach-ep
Copy link

dsteinbach-ep commented Apr 3, 2024

As shown in the screenshot, im not sure which setting can address this but any node that proceeds a hierarchy node seems randomly placed with a left or right offset.

My layoutOptions (for all nodes)

{
  'elk.algorithm': 'layered',
  'elk.direction': 'DOWN',
  'elk.hierarchyHandling': 'INCLUDE_CHILDREN',
  'elk.layered.nodePlacement.favorStraightEdges': 'true',
  'elk.layered.spacing.baseValue': '50',
  fixedAlignment: 'BALANCED',
}

Screenshot 2024-04-03 at 1 52 37 PM

Removing the elk.hierarchyHandling=INCLUDE_CHILDREN setting aligns those nodes correctly but causes preceding nodes of hierarchies to be rendered side-by-side to the hierarchy.

Screenshot 2024-04-03 at 2 17 05 PM

@soerendomroes
Copy link
Contributor

Hi, could you create a minimal example using elklive?
https://rtsys.informatik.uni-kiel.de/elklive/elkgraph.html

@dsteinbach-ep
Copy link
Author

Sure! As you can see n4 is not centered below n2 (nor is it centered in relation to n3). n4 appears more than just "aligned left" as well - there seems to be some negative left margin added. Changing n1->n3 to n1->n2 instead helps align everything correctly, however, that's not the requirement im building for :/

Furthermore, removing 'elk.hierarchyHandling': 'INCLUDE_CHILDREN' aligns n4 correctly, however, n1 is then rendered horizontally in relation to n2.

https://rtsys.informatik.uni-kiel.de/elklive/json.html?compressedContent=N4KABGCWAmBcYCIBOB7FAXBAacYA2AhgJ4oCu6A8gA7qQoB2AzvMGAOQF4DmKSk6ACwC2beG0JEApkknQ2WdpLwBrAHTRIMgMa0Go9gBEKAdQBy8xStUDI0gki0CiACQL1oeSPS762ASVMAYQAZAFUDAFEAfUDnP2CDACUI8zAAXxwIR0g8aBl6eABtXAhWGHgEegBGbDAAdxhBeABmAAYFAUlILgF0Ftb0zIgwMrhEegAmWoboJrA2jq6evvn2sGzc-KKS4dGK+mbpxoF+xe7e-sGdgF0r4ZGoMcqAFiPZk9Wz5cuM3Guh2RcSTMMDFe57RCSGoKRhkBzAorjGpgf5gdD2IHoEGFcaHFF3XaPCqSKYwuFaBGg8ZTFEKdFITHY8avfG-CDXEBpIA

@soerendomroes soerendomroes added this to the Release 0.10.0 milestone Apr 5, 2024
@soerendomroes soerendomroes added bug Erroneous behaviour. alg-layered Affects the ELK Layered algorithm. labels Apr 5, 2024
@dsteinbach-ep
Copy link
Author

dsteinbach-ep commented Apr 12, 2024

Actually this issue still persists with a more complicated use case. Also, I cannot get north/south ports working correctly within group nodes. Example.

@soerendomroes
Copy link
Contributor

Preserving the defined port placement of unconnected nodes is definitely something that we would consider doing.

For someone who wants to tackle this:
The issue lies in the separate connected components and possible how INCLUDE_CHILDREN adds elements to the same graph.
Additionally, if considering separate connected components, we cannot really be sure whether an edge to the outside does not cross the separate port that we want to align based on the configuration.

@dsteinbach-ep
Copy link
Author

Thanks. Any suggestions for the issue where only north ports are being used in nodes within a group?

@soerendomroes
Copy link
Contributor

@dsteinbach-ep What do you mean by that?
I guess since the layout direction is DOWN, NORTH is the default port placement side if no side is specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alg-layered Affects the ELK Layered algorithm. bug Erroneous behaviour.
Projects
None yet
Development

No branches or pull requests

2 participants