Drawing in radial layout mode and free
layout mode can be adjusted according to the aspect ratio of the
drawing area. To balance the height and depth of the drawing, free
layout mode can also use tip-over alignment.
Tip-over alignment can be specified
explicitly for individual nodes. The Tree Layout algorithm also has
layout modes that automatically use tip-over alignment when needed.
The tip-over layout modes work as follows:
Several trial layouts are performed in free
layout mode.
For each trial, tip-over alignment is set
for certain individual nodes, while the specified alignment of all
other nodes is preserved.
The algorithm picks the trial layout that
best fits the specified aspect ratio of the drawing area.
The aspect ratio can be set in CSS and in Java, by one of the
methods in the Radial Layout Mode; see Aspect ratio :
void setAspectRatio(IlvRect rect);
void setAspectRatio(float aspectRatio);
The tip-over modes are slightly more
time-consuming than the other layout modes.
For large trees, it is recommended that
you set the allowed layout time to a high value (for instance,
60 seconds) when using the tip-over modes.
To set this mode:
In CSS
Add to the
GraphLayout
section:
allowedTime: "60000";
In Java
Call:
layout.setAllowedTime(60000);
By using this call, you avoid running short
of time for sufficient iterations of the layout algorithm. Because
it would be too time-consuming to check all possibilities of
tip-over alignment use, heuristics exist that check only certain
trials according to the following different strategies shown in the
following figure.
![Picture
of tree layouts illustrating the different Tip Over layout mode options](../../../GraphLayout/_media/Fig4-51online54_default.gif)
Tip-over strategies
Tip leaves over
To use this tip-over strategy, set the
layout mode as follows:
In CSS
Add in the
GraphLayout
section:
layoutMode: "TIP_LEAVES_OVER";
In Java
layout.setLayoutMode(IlvTreeLayout.TIP_LEAVES_OVER);
The heuristic first tries the layout
without any additional tip-over options. Then it tries to tip
over the leaves, then the leaves and their parents, then
additionally the parents of these parents, and so on. As a
result, the nodes closest to the root use normal alignment and
the nodes closest to the leaves use tip-over alignment.
Tip roots over
To use this tip-over strategy, set the
layout mode as follows:
In CSS
Add in the
GraphLayout
section:
layoutMode: "TIP_ROOTS_OVER";
In Java
layout.setLayoutMode(IlvTreeLayout.TIP_ROOTS_OVER);
The heuristic first tries the layout
without any additional tip-over options. Then it tries to tip
over the root node, then the root and its child nodes, then
additionally the child nodes of these child nodes, and so on.
As a result, the nodes closer to the leaves use normal
alignment and the nodes closer to the root use tip-over
alignment.
Tip roots and leaves over
To use this tip-over strategy, set the
layout mode as follows:
In CSS
Add in the
GraphLayout
section:
layoutMode: "TIP_ROOTS_AND_LEAVES_OVER";
In Java
layout.setLayoutMode(IlvTreeLayout.TIP_ROOTS_AND_LEAVES_OVER);
The heuristic first tries the layout
without any additional tip-over options. Then it tries to tip
over the root node and the leaves simultaneously; then the root
and its child nodes, and the leaves and its parent; then
additionally the child nodes of these child nodes and the parents
of these parents, and so on. The result is that the nodes in the
middle of the tree use normal alignment and the nodes closest to
the root or leaves use the tip-over alignment.
This strategy is the slowest, because it includes all trials of
the strategy tip leaves over as well
as all trials of the strategy tip
roots over.
Tip over fast
The fast tip-over provides a compromise
between all other strategies. The heuristic tries a small
selection of the other strategies, not all possibilities.
Therefore, it is the fastest strategy for large graphs.
To use this strategy, set the layout
mode as follows:
In CSS
Add in the
GraphLayout
section:
layoutMode: "TIP_OVER";
In Java
layout.setLayoutMode(IlvTreeLayout.TIP_OVER);
It is possible that all four strategies
yield the same result because the strategies are not disjoint;
that is, certain trials are performed in all four strategies. In
addition, the tip-over modes do not necessarily produce the
optimal layout that gives the best possible fit to the aspect
ratio. The reason is that some unusual configurations of tip-over
alignment are never tried because doing so would cause the
running time to be too high.