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:
In CSS
Add to the LinkLayout section:
layoutMode : "SHORT_LINKS";
linkOffset : "3.00";
In Java
Use the method:
void setLinkOffset(float offset)    
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)
In CSS
Add to the LinkLayout section:
layoutMode : "SHORT_LINKS";
minFinalSegmentLength : "15.0";
In Java
Use the method:
void setMinFinalSegmentLength(float length)    

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:
In CSS
Add to the LinkLayout section:
globalConnectorStyle: "EVENLY_SPACED_PINS";
In Java
Use the following method:
void setGlobalConnectorStyle(int style);   
The valid values for style are:
  • IlvShortLinkLayout.FIXED_OFFSET_PINS
    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.
  • IlvShortLinkLayout.EVENLY_SPACED_PINS
    The connector pins are evenly spaced along the node border, preserving a margin which is determined by the evenlySpacedPinsMarginRatio parameter (see the accessor getEvenlySpacedPinsMarginRatio). See Spacing parameters for the short link layout as an example.
  • IlvShortLinkLayout.AUTOMATIC_PINS (the default)
    Uses the connector style 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 EVENLY_SPACED_PINS . See Spacing parameters for the short link layout as an example.
  • IlvShortLinkLayout.MIXED_STYLE
    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.
In CSS, you omit the prefix IlvShortLinkLayout when specifying the value of the connector style.

Individual connector style

All nodes have the same connector style unless the global connector style is IlvShortLinkLayout.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:
In CSS
Specify a rule that selects the node, for instance:
LinkLayout {
   globalConnectorStyle : "MIXED_STYLE";
}
#node1
{
  ConnectorStyle : "EVENLY_SPACED_PINS";
}
In Java
Use the following methods:
void setConnectorStyle(Object node, int style);   
int getConnectorStyle(Object node);    
The valid values for style are:
  • IlvShortLinkLayout.FIXED_OFFSET_PINS
  • IlvShortLinkLayout.EVENLY_SPACED_PINS
  • IlvShortLinkLayout.AUTOMATIC_PINS (the default).
The default value is 10.