eclipse / elk

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

Layout option to force global `container: root` coordinates for all children and edges #1012

Open snelsi opened 6 months ago

snelsi commented 6 months ago

New to Elk , I will be glad for any help.

I have a nested layout with cross-parent edges. After enabling "hierarchyHandling": "INCLUDE_CHILDREN" layout option, I noticed that some of the edges are using startPoint / endPoint sections relative to the container coordinates they are located.

Is there a layout option I can enable to force all children and edges to use global container: root coordinates instead?

lredor commented 6 months ago

Hi snemsi, You have a documentation about coordinates system here. There is no link between this coordinates system and the layout options. Regards, Laurent

snelsi commented 6 months ago

Sorry, I don't follow you. Is there a way to force all childrens/edges to use global root coordinates?

lredor commented 6 months ago

No, not that I know of.

Eddykasp commented 5 months ago

Hi @snelsi, as I understand it, you want to be able to configure whether to use absolute or relative coordinates. This is currently not possible and also probably out of the scope of ELK. Is there any obstacle to simply computing the absolute coordinates from the layout results produced by ELK?

soerendomroes commented 5 months ago

This should be addressed when fixing https://github.com/eclipse/elk/issues/901

snelsi commented 5 months ago

@Eddykasp,

I'm currently using elkjs along with xyflow/react and integrating my custom edge renderer.

xyflow organizes nodes and edges separately into two flat arrays without nested hierarchy. While it handles nodes with parent-relative coordinates well, I'm unsure if it can manage edges with parent-relative coordinates.

This means I have to calculate and convert all edges to absolute coordinates, which is a bit inconvenient and increases the chance of mistakes.

I had hoped that elk would provide an option to use flat children/edges output with absolute coordinates.

Eddykasp commented 5 months ago

I see, I previously misunderstood the problem.