Config for Minimum distance between 2 elements(shapes) with ports in JointJS + ElkJS?

306 Views Asked by At

Attached image, it is seen that the link is too small, I need the elements to be farther apart so that the link label and port labels is seen

Is there a way to specify the minimum distance between the elements(shapes) with ports in JointJS + elkJS?also the link between them should be of a specific length. Issue faced: There are 2 squares and the link between them is too tiny, unable to put labels for link & ports.

Tried port label placement, port order etc.

1

There are 1 best solutions below

0
On

I'm not sure if you meant to attach an image, but no image is visible.

There are many layout options for nodes and edges available here: https://www.eclipse.org/elk/reference/options.html

You could increase the distance between nodes via the Node Node Between Layers Spacing option. https://www.eclipse.org/elk/reference/options/org-eclipse-elk-layered-spacing-nodeNodeBetweenLayers.html

You could use it as follows:

"layoutOptions": {
    "spacing.nodeNodeBetweenLayers": 50
},

There are also many options for placing labels, etc.