kieler / elkjs

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

Partitioning is not working properly #295

Closed MuttakinHasib closed 3 months ago

MuttakinHasib commented 3 months ago

I am trying to implement the partition on my project but it's not working at all. I have 4 layers of nodes that will be placed horizontally.

Here is the elklive Example

Expected behavior CleanShot 2024-08-03 at 12  49 20@2x

Help me @Eddykasp @soerendomroes Thanks

soerendomroes commented 3 months ago

You need to set separateConnectedComponents to false

soerendomroes commented 3 months ago

Per default everything that is not connected will be handled as a separate graph that has its on layer grid.

MuttakinHasib commented 3 months ago

@soerendomroes can you share an example?

soerendomroes commented 3 months ago

Here you can see how it is set to true, which is the default value.

https://rtsys.informatik.uni-kiel.de/elklive/examples.html?e=general%2Fspacing%2Fcomponents

An here to false.

https://rtsys.informatik.uni-kiel.de/elklive/examples.html?e=user-hints%2Finteractive-constraints%2FinteractiveLayeredLayout_separateComponents

MuttakinHasib commented 3 months ago

BTW, I want to make the layout like this: top alignment

image

Not this: middle alignment

image

@soerendomroes

soerendomroes commented 3 months ago

This depends on the nodePlacement strategy you might be using.

This example works for me. Can you share a minimal example in elklive that reproduces your problem?

MuttakinHasib commented 3 months ago

@soerendomroes Thanks