elk icon indicating copy to clipboard operation
elk copied to clipboard

NetworkSimplex's nodeFlexibility pushes edges to the border of nodes

Open koenyskout opened this issue 3 years ago • 2 comments

Hi,

As seen in this example, using nodePlacement.networkSimplex.nodeFlexibility.default: NODE_SIZE somehow yields a weird layout where edges are pushed to the border: Screenshot 2021-08-26 at 17 32 29 Node 1 is positioned very weirdly to the right, for example. Also, the arrows leaving Node 3 leave at the edges of Node 3, while it would be nicer to have them placed at the center of the space where Node 3 and the nodes below overlap.

Is this a consequence of the algorithm, and is it possible to get a nicer layout through setting some other option?

koenyskout avatar Aug 26 '21 15:08 koenyskout

would be nicer to have them placed at the center of the space

Definitely. However, the underlying optimization process has no notion of balance/symmetry.

and is it possible to get a nicer layout through setting some other option?

Unfortunately, no.

uruuru avatar Aug 30 '21 08:08 uruuru

Thanks for the answers, I feared as much.

For now, I'll try to see if layouting in 2 passes could work: first with nodeFlexibility to determine appropriate node sizes, and then another one on the output of that but without the nodeFlexibility option set, in the hope that that puts the edges at a better location.

koenyskout avatar Aug 30 '21 11:08 koenyskout