Spacing parameters in short link layout

Since the short link mode places the links freely in the space, only two parameters are necessary to control the spacing: the minimum distance between links and the minimum length of the final segment.
Figure Spacing parameters for the short link layout shows the spacing parameters used in short link mode.
Graph
showing the use of spacing parameters in short link mode
Spacing parameters for the short link layout

Link offset

The layout algorithm computes the final connecting segments of the links (that is, the segments near the origin and destination nodes) to obtain parallel lines spaced at a user-defined distance. In short link mode, the algorithm takes into account the width of the links when computing the offset.
Example of specifying link offset (Link Layout algorithm)
To specify the offset:
Use the method setLinkOffset.
layout.setLinkOffset(10);
The offset is measured from the border of one link to the nearest border of the other link. Therefore, if the specified offset is zero, the border of a link touches the border of its neighboring link.

Minimum final segment length

You can specify a minimum value for the length of the final connecting segments of the links (that is, the segments near the origin and destination nodes).
Example of specifying minimum final segment length (Link Layout algorithm)
Use the method setMinFinalSegmentLength.
layout.setMinFinalSegmentLength(20);

Connector style

The layout algorithm positions the end points of links (the connector pins) at the nodes automatically. The connector style parameter specifies how these end points are calculated.
Two interconnected
nodes showing automatic connections and then the connector styles:
fixed-offset and evenly spaced
Connector styles
The layout algorithm provides two connector styles. You can set the connector style globally, in which case all the nodes (hence, all the links) have the same connector style, or locally on each node (that is, for all the links connected to the node), in which case different connector styles occur in the same drawing.

Global connector style

Example of specifying the global connector style (Link Layout algorithm)
To specify the global connector style:
Use the method setGlobalConnectorStyle.
layout.setGlobalConnectorStyle(ibm_ilog.graphlayout.shortlink.ShortLinkLayout.FIXED_OFFSET_PINS);
The valid values for the style are:

Individual connector style

All nodes have the same connector style unless the global connector style is ibm_ilog.graphlayout.shortlink.ShortLinkLayout.MIXED_STYLE.
Only when the global connector style is set to MIXED_STYLE can each node have an individual connector style.
Example of specifying individual node connector style (Link Layout algorithm)
To specify the connector style of an individual node:
Use the following methods:
layout.setConnectorStyle(node, ibm_ilog.graphlayout.shortlink.ShortLinkLayout.FIXED_OFFSET_PINS);
var style = layout.getConnectorStyle(node);