The long link mode places the links on a grid. Four parameters
control the grid offsets and five parameters control the spacing of
links in relation to other objects. Figure Spacing parameters for long link layout shows
the spacing parameters used in the long link mode.
![Graph
showing the use of spacing parameters in long link mode](../../../GraphLayout/_media/longlinkspaceparam_default.png)
Spacing parameters for long link layout
Grid offset parameters
The grid offset parameters control the
spacing between grid lines. Links are routed such that the center
of the orthogonal link segments is on the grid lines. The grid
offsets must be set to a value larger than the largest link width
value to avoid links that visually overlap.
Example of specifying grid offset
parameters (Link Layout algorithm)
To set the horizontal and vertical grid
offset:
In CSS
Add these statements to the
LinkLayout
section:
horizontalGridOffset : "5.0"; verticalGridOffset : "5.0";
In Java
Use the methods:
void setHorizontalGridOffset(float offset);
void setVerticalGridOffset(float offset);
The grid offset is the critical parameter
for the long link mode. If the grid offset is too large, there
might be no grid lines between nodes even though some free space
exists between the nodes. In this case, the link routings cannot
use the free space. However, if the grid offset is too small, the
algorithm needs a long time to traverse the grid.
Grid base parameters
Sometimes it is necessary to shift the
whole grid by a small amount because the nodes are not aligned on
the grid. For example, to have grid lines at positions 3, 13, 23,
33, and so on, you can set the grid offset to 10 and the grid
base to 3.
Example of specifying grid base
parameters (Link Layout algorithm)
To adjust the grid base:
In CSS
Add these statements to the
LinkLayout
section:
horizontalGridBase : "3.0"; verticalGridBase : "3.0";
In Java
Use the methods:
void setHorizontalGridBase(float coordinate);
void setVerticalGridBase(float coordinate);
Minimum distance parameters
The minimum distance controls how closely
a link can be placed to the border of a node that needs to be
bypassed. If the node border is not aligned to the grid, the
minimum distance specifies the next grid line close to the border
that can be used. For instance, if a node covers the
x-coordinates 25 - 65 on a grid with offset 10 and base 0, the
next grid lines used to bypass the node would normally be at 20
and 70. If you specify a minimum distance of 8, these grid lines
are too close to the node and then the grid lines at 10 and 80
would be used.
Example of specifying minimum distance
parameters (Link Layout algorithm)
To set the minimum distance:
In CSS
Add these statements to the
LinkLayout
section:
horizontalMinOffset : "10.25"; verticalMinOffset : "10.25";
In Java
Use the methods:
void setHorizontalMinOffset(float offset);
void setVerticalMinOffset(float offset);
Minimum node corner offset parameter
The minimum corner offset is the minimum distance between a node
corner and a link that connects to the node. This parameter is
used to avoid having a link that connects exactly to the corner
or outside the border of the node (see Minimum corner offset).
Example of specifying minimum node
corner offset parameter (Link Layout algorithm)
To set the minimum corner offset:
In CSS
Add to the
LinkLayout
section:
minNodeCornerOffset : "5.2";
In Java
Use the method:
void setMinNodeCornerOffset(float offset);
![Picture
illustrating the minimum corner offset parameter](../../../GraphLayout/_media/Fig4-95online102_default.gif)
Minimum corner offset
Minimum final segment length
As with the short link mode, the long
link mode respects the minimum value for the length of the
final connecting segments of the links.
Example of specifying minimum final
segment length (Link Layout algorithm)
To set the minimum length of the final
segment:
In CSS
Add to the
LinkLayout
section:
minFinalSegmentLength : "15.0";
In Java
Use the method:
void setMinFinalSegmentLength(float length)