kieler / elkjs

ELK's layout algorithms for JavaScript
Other
1.76k stars 97 forks source link

INCLUDE_CHILDREN and SEPARATE_CHILDREN #236

Closed Vesper0704 closed 7 months ago

Vesper0704 commented 1 year ago

Hi, I am struggling on the network architecture layout now. Since different hierarchies demand different layout style, I tried to give the root container (as the whole graph) INCLUDE_CHILDREN option to control the overall layout, and for some other containers I give them SEPARATE_CHILDREN option to let them decide a different layout style. However, I find that some options may cause an error when SEPARATE_CHILDREN is set. Here is the demo link.

I want the root container to control the relative order of ABCD and the parent, and the same for the 4 servers in inner node. But when I want to add edge between them, eg. image. the UnsupportedGraphException error was thrown. It makes sense because they are different hierarchies, but I wonder is there any way to implement this requirement?

Any guidance is appreciated. Thanks!

soerendomroes commented 1 year ago

The INCLUDE_CHILDREN property should only be used if you want to solve edge crossing problems across hierarchies. It is often however used if one wants to introduce cross-hierarchy edges. I suggest adding hierarchical ports instead as seen here.

Vesper0704 commented 1 year ago

Thanks! But doing this is not very convenient in my scenario, and I'll try to simplify the relationship/hierarchy between the nodes to yield a better layout. Would you please help me with another question about the alignment? In this demo, tree1 and tree2 are positioned on the same column as anticipated, but they are aligned in the middle. Is there any way to align them on the left? Like this: image

By the way, elk-live website seems to crash. image

soerendomroes commented 1 year ago

This should solve your problem. The crash most likely occurs because the graph is too big to encode in a link.

Vesper0704 commented 1 year ago

Thanks! It works.