Specific parameters of ULEL

The following parameters are specific to the IlvUniformLengthEdgesLayout class.

Link style (ULEL)

When the layout algorithm moves the nodes, straight-line links (such as instances of IlvLinkImage) will automatically “follow” the new positions of their end nodes. If the grapher contains other types of links (for example, IlvPolylineLinkImage or IlvSplineLinkImage), the shape of the link might not be appropriate because the intermediate points of the link are not moved. In this case, you can ask the layout algorithm to automatically remove all the intermediate points of the links (if any).
To specify that the algorithm automatically removes all the intermediate points of the links (if any):
In CSS
Add to the GraphLayout section:
linkStyle: "STRAIGHT_LINE_STYLE";
In Java
Use this method:
void setLinkStyle(int style)  
The valid values for style are:
  • IlvUniformLengthEdgesLayout.NO_RESHAPE_STYLE
    None of the links is reshaped in any way.
  • IlvUniformLengthEdgesLayout.STRAIGHT_LINE_STYLE
    All the intermediate points of the links (if any) are removed. This value is the default.
Note
If you use CSS in a diagram component (instance of IlvDiagrammer), you must specify the correct link class in the style sheet. We recommend that you use IlvGeneralLink or IlvSimpleLink as classes for links in this case. If you call layout on an IlvGrapher directly in Java, you can use the method EnsureAppropriateLinkTypes or EnsureAppropriateLinks defined in the class IlvGraphLayoutUtil to replace inappropriate links automatically, either before layout or when the IlvInappropriateLinkException is caught. For details on these methods, see the Java API Reference Manual. For details on the graph model, see Using the graph model.
Note
If you call layout on an IlvGrapher directly in Java, you can use the method EnsureAppropriateLinkTypes or EnsureAppropriateLinks defined in the class IlvGraphLayoutUtil to replace inappropriate links automatically, either before layout or when the IlvInappropriateLinkException is caught. For details on these methods, see the Java API Reference Manual. For details on the graph model, see Using the graph model.

Connect links to node center (ULEL)

This feature is shared by all subclasses of the Basic Link Style Layout. See Connect links to node center for details.

Multilink and self-link features (ULEL)

These features are shared by all subclasses of the Basic Link Style Layout. See Multilink and self-link features for details.

Number of iterations (ULEL)

The iterative computation of the layout algorithm is stopped if the time exceeds the allowed time (see Allowed time) or if the number of iterations exceeds the allowed number of iterations.
To specify the number of iterations:
In CSS
Add to the GraphLayout section:
allowedNumberOfIterations: "5";
In Java
Use the method:
void setAllowedNumberOfIterations(int iterations)  

Preferred length (ULEL)

The main objective of this layout algorithm is to obtain a layout where all the links have the same length, called the “preferred length”.
To specify the preferred length:
Globally
  • In CSS
    Add to the GraphLayout section:
    preferredLinksLength: "70.0";
    
Individually
It is also possible to specify a length for individual links. To do so:
  • In CSS
    Specify a rule that selects the link:
    #link27 {
      PreferredLength: "80.0";
    }
    
If a specific length is not specified for a link, the global settings are used.
Globally
  • In Java
    Use the method:
    void setPreferredLinksLength(float length)
    
    The default value is 60.0.
Individually
It is also possible to specify a length for individual links.
  • In Java
    Use the method:
    void setPreferredLength(Object link, float length)  
    
    To obtain the current value, use the method:
    float getPreferredLength(Object link)  
    
If a specific length is not specified for a link, the global settings are used.

Respect node sizes (ULEL)

By default, the layout algorithm ignores the size (width and height) of the nodes. For efficiency reasons, the nodes are approximated with points placed in the center of the bounding box of the nodes. When dealing with large nodes, the preferred length parameter can be increased in such a way that the nodes do not overlap.
To improve the support for graphs with heterogeneous node sizes, the algorithm provides a special mode in which the particular size of each node is taken into consideration.
To set this mode:
In CSS
Add to the GraphLayout section:
respectNodeSizes: "true";
In Java
Use the method:
void setRespectNodeSizes(boolean respect)     
The default value is false .

Force fit to layout region (ULEL)

It is difficult to choose an appropriate size for the layout region of this layout algorithm. If the specified layout region is too small for a particular graph, the resulting layout is not the best. For this reason, by default, the Uniform Length Edges Layout algorithm does not use the layout region parameter.
It can use as much space as it needs to lay out the grapher.
To specify whether the layout algorithm must use the layout region:
In CSS
Add to the GraphLayout section:
forceFitToLayoutRegion: "true";
In Java
Use the method:
void setForceFitToLayoutRegion(boolean option)  
The default value of the parameter is false .

Layout mode

To fit various needs, the algorithm provides three optional layout modes:
Incremental mode
The algorithm starts from the current position and iteratively tries to converge towards the optimal layout. In some cases, this mode avoids a major reorganization of the graph, which helps to preserve the mental map of the user as much as possible. However, it is not guaranteed and depends on how far the initial position of the nodes is from the position that satisfies the criteria of the algorithm.
Non-incremental mode
The algorithm is free to reorganize the graph without trying to stay close to the initial positions. Often, non-incremental mode is faster than incremental mode, although sometimes at the cost of lower quality.
Fast multilevel mode
The algorithm uses a multilevel graph decomposition strategy that leads to a significant gain in speed. This mode is usually the fastest for medium and large graphs.
The default value is IlvUniformLengthEdgesLayout.INCREMENTAL_MODE.
To set the layout mode:
In CSS
Add to the GraphLayout section:
layoutMode: "FAST_MULTILEVEL_MODE";
In Java
Use the method:
void setLayoutMode(int mode)