You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am quite noobie with elkjs. I am trying to create a graph with some nested elements inside that is center aligned. The main problem is that the last element is not aligned with the rest of the graph and the edge starts from left side of the north port instead of center like for the rest of the graph. If I remove includeChildren option then last is properly aligned with parent but the entire parent block with nested objects is put on the side instead of bottom up layout. Anybody has any ideas/suggestions on how I can properly align the nodes? Thanks a lot!
I would like to have the last element, the top most one, to be center aligned like the rest of the graph instead of hanging like on the left.
(Optional) Screenshots
As you can see in the screenshot below the last node is not center aligned like the rest of the graph. I would the last node to be center aligned vs the parent node
(Optional) ELK Version
0.9.3
The text was updated successfully, but these errors were encountered:
I tried fiddling around with it a bit but I couldn't get the desired result. To turn off hierarchyHandling: includeChildren you need to split the edge up into multiple pieces for each hierarchy level. Here if you uncomment the ports and edges you can see how to do that. As for the alignment of top node maybe @soerendomroes has more insight into how to achieve the desired positioning.
Thanks for looking into it. I played around as well, and it seems there is something that I am missing or don't fully grasp. In this simplified example if I am linking between 1 and 2 and 1 and 3 everything is properly aligned, or if I link between 111 and 2 and 111 and 3 (basically from the outside nodes to same nested node) then everything is properly aligned. It seems that if the on one side there is an edge from the parent while on the other side there and edge that starts/ends within a child it messes up the alignment. Even if i have edges linked to different children like 2 -> 11 and 3-> 111, then the alignment issue pops out. Is this how it is supposed to be?
danutzcodrescu
changed the title
[Question]
[Question] Position of elements with mix of nested elements and single nodes
Aug 1, 2024
Ask your questions
Hello, I am quite noobie with elkjs. I am trying to create a graph with some nested elements inside that is center aligned. The main problem is that the last element is not aligned with the rest of the graph and the edge starts from left side of the north port instead of center like for the rest of the graph. If I remove
includeChildren
option then last is properly aligned with parent but the entire parent block with nested objects is put on the side instead of bottom up layout. Anybody has any ideas/suggestions on how I can properly align the nodes? Thanks a lot!I have a reproducible here
If it is easier here is the json config:
(Optional) Expected behavior
I would like to have the last element, the top most one, to be center aligned like the rest of the graph instead of hanging like on the left.
(Optional) Screenshots
As you can see in the screenshot below the last node is not center aligned like the rest of the graph. I would the last node to be center aligned vs the parent node
(Optional) ELK Version
0.9.3
The text was updated successfully, but these errors were encountered: