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.

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.

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:
- The connection pins are spaced along the node border at a distance equal to the link offset parameter. See Spacing parameters for the short link layout as an example.
- The connector pins are evenly spaced along the node border, preserving a margin which is determined by the setEvenlySpacedPinsMarginRatio parameter. See the method setEvenlySpacedPinsMarginRatio. See Spacing parameters for the short link layout as an example.
-
This style uses the connector style ibm_ilog.graphlayout.shortlink.ShortLinkLayout.FIXED_OFFSET_PINS except if it pushes a connection point outside the border the link is attached to, in which case it uses the connector style ibm_ilog.graphlayout.shortlink.ShortLinkLayout.EVENLY_SPACED_PINS. See Spacing parameters for the short link layout as an example.
- Each node can have a different connector style. The style of each individual node can be set to have different connector styles occurring in the same graph.
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);
The valid values for
style
are: