eclipse / elk

Eclipse Layout Kernel - Automatic layout for Java applications.
https://www.eclipse.org/elk/
Other
239 stars 82 forks source link

[Question] Node height and width is not switched consistent in DOWN layout #1033

Open BjBe82 opened 2 months ago

BjBe82 commented 2 months ago

Ask your questions We observed the following behavior in a Graph, which was a little bit irritating. As it looks like, the ELK Layered Algorithm switches the minimum height/width of a Node if the layout direction is DOWN. But this is not consistent for all Nodes, i.e. this is not done for leaf nodes. Question 1: Is it intended that the width and height is switched? Question 2: What is the reason that the leaf element has not its width/height switched?

Advanced Example

Here is a simpler example: Small Example

Just remove/add C3, and the width/height of C2 is switched if C3 is present, or it is not switched if C3 was removed.

Eddykasp commented 2 months ago

This looks like a bug in elk.hierarchyHandling: INCLUDE_CHILDREN to me. In general that option is a bit unstable and I would recommend not using it if you don't strictly need it i.e. if you have no hierarchy-crossing edges. Even if you do have hierarchy-crossing edges you can split them into two edges and add a port to cross into other nodes.

no hierarchy handling

BjBe82 commented 1 month ago

Thanks for the fast answer. We are using elk.hierarchyHandling: INCLUDE_CHILDREN for a while now, since we have several hierarchy-crossing edges in the diagrams. But yes, we could think about some pre+post-processing to split the edges and then join them again after layout.

The question is what in addition to hierarchy-crossing edges support do we lose if we remove it. One thing which already comes to my mind is the direction which would need to be propagated down if there is more than one level from the root graph node.