kieler / elkjs

ELK's layout algorithms for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Force the positioning of a node

CrashLaker opened this issue · comments

hi all,
just bumped to this amazing library. thanks!

wondering if there's a way to force the position of a node.

for example i'd like to force the position of the leftmost node to the middle of the diagram

image

Please have a look at this blogpost.
TLDR: It is possible to constrain the relative position of nodes, but not the coordinates and you have to constrain all of them in some way.

You can also set a different node placement strategy https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-nodePlacement-strategy.html or try setting bk.fixedAlignment to BALANCED for the default BRANDES_KOEPF strategy.

maan! awesome.
thank you for the fast reply.

worked with:
'elk.layered.nodePlacement.bk.fixedAlignment': 'BALANCED',

tyty!

image