C

OrganicLayout

This layout algorithm arranges graphs in an organic fashion.
ImplementsInheritance Hierarchy

Remarks

Layout Style

The organic layout style is characterized by a natural distribution of nodes that exhibits clusters and symmetric properties of the graph. Nodes are placed space-saving, close to their adjacent nodes. Edges maintain uniform lengths and are routed with straight-line segments without bends.

Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise networking, visualizing social networks, mesh visualization or system management.

Organic Layout obtained with default settings

Organic Layout exhibiting symmetric properties

Concept

OrganicLayout uses a force-directed approach to place the nodes of the input graph. According to this approach, the graph is modeled as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged particles with mutually repulsive forces. Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the system reaches a (local) minimum of the sum of the forces.

Features

Quality-Time-Ratio

The ratio between the layout quality and the running time is conveniently adjustable.

Layout Grid

This layout algorithm is able to consider a LayoutGrid structure. However, for common nodes (i.e. non-group nodes) it only considers single layout grid cells. Furthermore, the layout algorithm will throw a ArgumentError if there is a layout grid and the descendants of a group node are assigned to different layout grid cells or if there are group nodes that are associated with a GroupNodeHandlingPolicy other than FREE. In addition, the algorithm doesn't support multiple grids, i.e., all nodes have to be mapped to cells of the same layoutGrid.

Avoidance of Node Edge Overlaps

The layout can be configured such that overlaps between edges and nodes are avoided. However, it doesn't guarantee that they won't appear in the resulting layout. To avoid overlaps, it is possible to route the edges afterwards using an edge routing algorithm, e.g., OrganicEdgeRouter.

Maximum Duration

OrganicLayout allows restricting the duration which may be a suitable option to reduce the runtime required for large graphs. Note that restricting the stop duration may result in a lower layout quality. Furthermore, the actual runtime may exceed the stop duration since the layout algorithm still has to find a valid solution.

Substructures

The algorithm is also able to detect certain types of substructures in a graph (i.e., chains, stars, cycles, parallel, tree and group structures), and arrange these structures with special-purpose layout styles. Using substructure styles ensures that the corresponding structures are easily recognized in the graph. For the detection of substructures, it is optionally possible to consider nodeTypes, such that only nodes of the same user-defined type can form a substructure.

Organic Layout without applying specific layout styles to substructures

Organic Layout of the same graph applying specific layout styles to the detected substructures

Constraints

The placement of the nodes can be influenced and restricted by additional constraints. Among others, the layout supports the following constraints; for more constraints see OrganicConstraintData<TNode>.

Nodes can be enforced to be placed on horizontal and vertical lines addAlignmentConstraint. In this example, the nodes with label "H" are forced on a horizontal line, and nodes with label "V" are forced on a vertical line.

Nodes can be forced on rectangles and ellipses using addRectangle and addEllipse, respectively. In this example, the nodes with label "R" are forced on a square, and nodes with label "E" are forced on a circle. The sizes of the geometric structures are determined automatically.

Port Placement Constraints

This layout algorithm handles port placement constraints by applying the PortPlacementStage as a postprocessing step.

Layout Stages

This class provides a configurable pipeline that contains various ILayoutStages. Each ILayoutStage can incorporate preprocessing or postprocessing steps into the layout calculation to streamline the input graph and enhance the resulting layout. Additionally, custom ILayoutStages can be added and executed either before or after the predefined ones.

The following default ILayoutStages are included:

With these layoutStages the layout algorithm is configured well, so they usually don't need to be changed.

Performance

Specifying a stopDuration can reduce the time the OrganicLayout takes to produce a result. The acceleration is achieved by both loosening the requirements for terminating the incremental improvement of the layout and switching to faster heuristics for some features, such as overlap removal or crossing optimization for group substructures. It should be noted that the stopDuration is not a guarantee for the maximum time spent, as the algorithm still has to produce a valid result.

With disconnected graphs containing large unconnected components, it can be beneficial to change the component arrangement style of the used componentLayout from the default style PACKED_CIRCLE to the faster ROWS style.

Default Values of Properties

NameDefaultDescription
allowNodeOverlapsfalse
Node overlaps are not allowed.
automaticGroupNodeCompactiontrue
Automatic group node compaction is enabled.
avoidNodeEdgeOverlapfalse
Overlaps between nodes and edges are not avoided.
clusteringPolicyOrganicLayoutClusteringPolicy.NONE
Automatic clustering is disabled.
compactnessFactor0.5
create3DLayoutfalse
The layout algorithm doesn't produce a 3D result.
defaultMinimumNodeDistance0
defaultPreferredEdgeLength40
deterministictrue
The layout algorithm is deterministic.
edgeLabelPlacementEdgeLabelPlacement.GENERIC
Edge labels are placed by an independent labeling algorithm.
groupBoundsCalculatorGroupBoundsCalculator
groupNodeCompactness0.4
nodeLabelPlacementNodeLabelPlacement.CONSIDER
Node labels are considered.
qualityTimeRatio0.6
shapeConstraintShapeConstraint.NONE
stopDuration30s
A TimeSpan of 30 seconds

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new OrganicLayout instance with default settings.

Parameters

Properties

Gets or sets whether or not detected clusters are taken into account as group substructures.
Note that this option only has an effect if the groupSubstructureScope is set to ALL_GROUPS or GROUPS_WITHOUT_INTER_EDGES. Furthermore, the automatic clustering has to be enabled (i.e., not set to NONE).
final

Property Value

true if clusters are taken into account as group substructures, false otherwise

Default Value

The default value is: false

Sample Graphs

ShownSetting: false

See Also

API
clusteringPolicy, groupSubstructureScope
Gets or sets whether or not overlaps between nodes are allowed.
When disabled, node overlaps are resolved considering the specified minimum node distance. This procedure may affect other options like shapeConstraints and edge distances.
If only a subset of nodes is considered in the layout algorithm, there might be some overlapping nodes even if this option is disabled.
final

Property Value

true if node overlaps are allowed, false otherwise

Default Value

The default value is: false
Node overlaps are not allowed.

Sample Graphs

ShownSetting: false

See Also

Developer's Guide
API
defaultMinimumNodeDistance
Gets or sets whether or not group nodes are compacted automatically.
When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness specified by option compactnessFactor.
If this option is enabled, the value specified by option groupNodeCompactness is ignored.
final

Property Value

true if automatic group node compaction is enabled, false otherwise

Default Value

The default value is: true
Automatic group node compaction is enabled.

See Also

API
groupNodeCompactness, compactnessFactor
Gets or sets whether or not the layout algorithm tries to avoid node/edge overlaps.
The current implementation does not guarantee the non-existence of overlaps but tries to avoid them. Furthermore, the post-processing step that removes node overlaps ignores node/edge overlaps, i.e., the number of node/edge overlaps may increase if option allowNodeOverlaps is disabled.
This feature has only a small priority and can be automatically disabled by the layout algorithm in preference for other features (e.g., when edgeLabelPlacement is set to INTEGRATED or additional constraints are specified).
final

Property Value

true if the layout algorithm tries to avoid node/edge overlaps, false otherwise

Default Value

The default value is: false
Overlaps between nodes and edges are not avoided.

See Also

API
allowNodeOverlaps
Gets or sets whether or not the layout algorithm tries to straighten paths of degree-2 nodes.
If this property is set, the layout algorithm identifies maximal long chains, i.e., maximal long paths that consist of degree-2 nodes. If the nodes of such a chain lie almost on a common line, the layout algorithm snaps the nodes to this line.
This property is not enforced with high priority, but other properties (e.g., substructures) are enforced first.
If a partial layout is applied to chains, cycles, stars, trees, parallel structures or groups, the affected nodes are not recognized as part of a chain.
FIXED nodes may be part of a chain detected by this feature and will be incorporated if possible. If it is impossible to adequately form a chain with the fixed node, the chain will be ignored.
If edgeOrientations are specified that contradict the placement of the chain nodes, the chain will be ignored.
FIXED nodes may be part of a chain detected by this feature and will be incorporated if possible. If it is impossible to adequately form a chain with the fixed node, the chain may be ignored.
If edgeOrientations are specified that contradict the placement of the chain nodes, the chain may be ignored.
final

Property Value

true if the layout algorithm tries to straighten maximal long chains, false otherwise

Default Value

The default value is: false
Chains are not automatically recognized and straightened.

Sample Graphs

ShownSetting: false

See Also

Developer's Guide
Gets or sets the minimum size (number of nodes) a chain needs to have to be detected and handled as a chain substructure.
This setting has no effect if style NONE is specified.
final

Property Value

the minimum number of nodes a chain needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 2

Default Value

The default value is: 4

See Also

Developer's Guide
API
chainSubstructureStyle
Gets or sets the style specifier for chain substructures.

A chain is a simple edge path where the degree of the nodes is less than or equal to 2. Use property chainSubstructureSize to specify the minimum size a chain must have.

If there are user-defined nodeTypes, a chain substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

If the directness of edges is defined using property edgeDirectedness, all edges of the chain must have the same direction.
If the algorithm only considers a subset of nodes, see considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

one of the predefined styles for chain substructures

Default Value

See Also

Developer's Guide
API
chainSubstructureSize, edgeDirectedness
Gets or sets whether or not the layout algorithm tries to force nodes of cycles on geometric circles.
If this property is set, the layout algorithm identifies cycles in the graph that have at most one node with degree larger than 2. The nodes of every of these cycles are placed on a geometric circle. The radius of the circles are determined automatically.
This property is not enforced with high priority, but other properties (e.g. substructures) are enforced first.
If a partial layout is applied to chains, cycles, stars, trees, parallel structures or groups, the affected nodes are not recognized as part of a circle.
FIXED nodes which are not in the layout's scope may be part of a cycle detected by this feature and will be incorporated in the circle if possible. If it is impossible to adequately form a circle with the fixed node, the circle will not be entirely enforced.
If edgeOrientations are specified that contradict the placement of the cycle nodes, the cycle may be ignored.
FIXED nodes may be part of a cycle detected by this feature and will be incorporated if possible. If it is impossible to adequately form a circle with the fixed node, the circle will not be enforced.
final

Property Value

true if the layout algorithm tries to force nodes of cycles on geometric circles, false otherwise

Default Value

The default value is: false
Cycles are not automatically recognized and forced on geometric circles.

Sample Graphs

ShownSetting: false

See Also

Developer's Guide
Gets or sets the clustering policy that is applied to the input graph and before executing the arrangement algorithm.

By default, no clustering is applied, that is, NONE is set.

When a policy other than NONE is specified, the following steps are performed during the layout:

  1. A clustering algorithm is applied to the input graph.
  2. All nodes of the same cluster are put into a newly created group node.
  3. The layout is applied to the modified graph.
  4. Group nodes denoting clusters (inserted during step 2) are removed.

The user can also specify customized clusters by defining appropriate groups.

The LOUVAIN_MODULARITY is the recommended policy for many cases. It offers a good trade-off between performance and quality.
The running time of the clustering algorithm does not depend on the specified stopDuration .
If the input graph already contains group nodes, the clustering is only applied to the top-level nodes. More precisely, all nodes within a group node (including sub-groups) are associated with the same cluster.
conversionfinal

Property Value

one of the predefined clustering policies

Default Value

The default value is: OrganicLayoutClusteringPolicy.NONE
Automatic clustering is disabled.
Gets or sets the compactness factor for the layout algorithm.

Smaller values result in less compact drawings, greater values result in more compact drawings.

The compactness value needs to lie in [0,1].

final

Property Value

the compactness value in [0,1]

Throws

Exception ({ name: 'ArgumentError' })
if the specified value is outside the interval [0,1]

Default Value

The default value is: 0.5

Sample Graphs

ShownSetting: Compactness is set to 0

See Also

Developer's Guide
Gets the ComponentLayout from the layoutStages of this instance.

Several features of the OrganicLayout require specific configurations of the used componentLayout instance to work properly. Unless the default instance is replaced with another instance of componentLayout, the OrganicLayout performs the necessary configurations itself, restoring the original configuration after it terminates.

If you need to replace the instance, modify the layoutStages stack using replace. If you want to remove a stage, consider disabling it instead.

readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets or sets whether or not the layout algorithm should create a 3D result.
The z-coordinates can be retrieved with zCoordinatesResult.
For graphs drawn on a plane, disabling this option produces better results.
final

Property Value

true if the layout algorithm creates a 3D result, false otherwise

Default Value

The default value is: false
The layout algorithm doesn't produce a 3D result.

See Also

API
zCoordinatesResult
Gets or sets the minimum size (number of nodes) a cycle needs to have to be detected and handled as a cycle substructure.
This setting has no effect if style NONE is specified.
final

Property Value

the minimum number of nodes a cycle needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 3

Default Value

The default value is: 4

See Also

API
cycleSubstructureStyle
Gets or sets the style specifier for cycle substructures.

A cycle is a simple edge path where the first and last node are identical. The algorithm only considers cycles where the number of edges connecting nodes of the cycle with the remaining nodes is less than or equal to 2. To define the minimum number of nodes a cycle must contain, use property cycleSubstructureSize (default is 4).

If there are user-defined nodeTypes, a cycle substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

If the directness of edges is defined using property edgeDirectedness, all edges of the chain must have the same direction.
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

one of the predefined styles for cycle substructures

Default Value

See Also

Developer's Guide
API
cycleSubstructureSize, edgeDirectedness
Gets or sets the minimum node distance that this algorithm should enforce between all pairs of nodes.

If there is no specific minimum node distance assigned to a node, this default minimum node distance is used.

The minimum node distance needs to be non-negative.

To define an individual minimum distance per node, use the layout data property minimumNodeDistances.
If node overlaps are allowed, the specified minimum node distance will be ignored.
final

Property Value

a non-negative minimum distance between nodes

Throws

Exception ({ name: 'ArgumentError' })
if the specified minimum node distance is negative

Default Value

The default value is: 0

Sample Graphs

ShownSetting: Preferred minimum node distance 40

See Also

Developer's Guide
API
allowNodeOverlaps, minimumNodeDistances
Gets or sets the default preferred edge length.

If there is no specific preferred edge length assigned to an edge, this default preferred edge length is used.

The preferred edge length needs to be non-negative.

To define an individual preferred edge length per edge, use the layout data property preferredEdgeLengths.
If the option allowNodeOverlaps is disabled, the preferred edge length may be violated because then the nodes are moved in a post-processing step to resolve overlaps.
final

Property Value

a non-negative edge length

Throws

Exception ({ name: 'ArgumentError' })
if the specified edge length is negative

Default Value

The default value is: 40

Sample Graphs

ShownSetting: Preferred edge length 40

See Also

Developer's Guide
API
preferredEdgeLengths
Gets or sets whether or not the deterministic mode of this algorithm is enabled.
In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are given as input.
Note that when restricting the stopDuration, deterministic behavior cannot be guaranteed anymore.
final

Property Value

true if this algorithm works deterministically, false otherwise

Default Value

The default value is: true
The layout algorithm is deterministic.

See Also

Developer's Guide
Gets or sets how the layout handles the position of edge labels.

The policy INTEGRATED tries to ensure that the edges are long enough to place the associated labels without overlapping each other. However, the applied simulation-based algorithm cannot always guarantee such results. Furthermore, the labels of an edge can overlap with other graph elements, including labels of other edges. To further improve the outcome, consider enabling the genericLabeling stage using the enabled property which runs as a post-processing step that reduces such overlaps.

To obtain suitable results, the following points have to be considered:

  • Both the side and angle of the labels has to be specified relative to the edge (i.e., angleReference is set to RELATIVE_TO_EDGE_FLOW and sideReference is set to RELATIVE_TO_EDGE_FLOW). Otherwise, the resulting side/angle of the labels may be wrong.
  • If only a subset of nodes is placed, the algorithm only considers labels of edges with at least one movable endpoint (i.e., source or target node).
  • Labels of edges that connect a group node with one of its parent groups are not supported. The same applies to labels of grouped edges that are part of a substructure.
  • Self-loops and parallel edges are handled by the selfLoopRouter and parallelEdgeRouter respectively. Thus, labels of such edges are not considered by the algorithm.
conversionfinal

Property Value

INTEGRATED if the layout algorithm places the edge labels avoiding overlaps, IGNORE if the edge labels are ignored by the layout algorithm, and GENERIC if the edge labels are placed by an independent labeling algorithm.

Default Value

The default value is: EdgeLabelPlacement.GENERIC
Edge labels are placed by an independent labeling algorithm.

See Also

Developer's Guide
Gets the GenericLabeling from the layoutStages of this instance.
If you need to replace the instance, modify the layoutStages stack using replace. If you want to remove a stage, consider disabling it instead.
readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets or sets the ILayoutGroupBoundsCalculator instance used for calculating the size of group nodes.
The specified ILayoutGroupBoundsCalculator is not applied to empty group nodes (i.e. group nodes without children). Such group nodes will not be resized by the algorithm even if that leads to a violation of the minimum group node size specified by MINIMUM_GROUP_NODE_SIZE_DATA_KEY.
final

Property Value

Throws

Exception ({ name: 'ArgumentError' })
if the specified ILayoutGroupBoundsCalculator is null

Default Value

The default value is: GroupBoundsCalculator

See Also

Developer's Guide
Gets or sets the compactness of group nodes.

The compactness ranges from 0 to 1 where 0 results in group nodes not affecting the overall layout too much while 1 forces nodes in the same group to be clustered tightly.

The values need to lie in [0,1].

The specified value is only considered if automatic group node compaction is disabled and if there is no LayoutGrid structure.
final

Property Value

groupNodeCompactness the compactness value for group nodes

Throws

Exception ({ name: 'ArgumentError' })
if specified compactness value is outside the interval [0,1]

Default Value

The default value is: 0.4

Sample Graphs

ShownSetting: Compactness of group nodes is set to 0.4

See Also

API
automaticGroupNodeCompaction
Gets or sets the scope specifier for group substructures.

Group substructures that lie in the specified scope are treated as substructures in the layout process, i.e., the child nodes are arranged on a disk that is contained in the group node.

A graph with groups whose child nodes are placed on compact disks.

A group is a group substructure if it satisfies the following conditions.

  1. The group node does not contain any other group.
  2. The GroupNodeHandlingPolicy is FREE; see scopeModes.
  3. No node of the group is fixed.
  4. The group contains at least the specified minimum number of nodes

The scope specifiers indicate which group substructures are considered in the layout process.

If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

the selected scope for group substructures

Default Value

Gets or sets the minimum size (number of nodes) a group needs to have to be detected and handled as a group substructure.
This setting has no effect if the scope is set to NO_GROUPS.
final

Property Value

the minimum number of nodes a group needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 2

Default Value

The default value is: 4

See Also

API
groupSubstructureScope
Gets or sets the style specifier for group substructures.
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

one of the predefined styles for group substructures

Default Value

See Also

Developer's Guide
API
groupSubstructureScope, groupSubstructureSize
Gets or sets the layoutOrientation of the OrientationStage.
The layout orientation only has a meaningful impact if edgeOrientations are specified.
conversionfinal
Gets or sets how the layout handles the position of node labels.
If only a subset of nodes is placed, only their labels are placed by the algorithm.
conversionfinal

Property Value

CONSIDER if the layout algorithm takes the position and sizes of the node labels into account, IGNORE if the node labels are ignored by the layout algorithm, and GENERIC if the node labels are placed by an independent labeling algorithm.

Default Value

The default value is: NodeLabelPlacement.CONSIDER
Node labels are considered.

Sample Graphs

ShownSetting: IGNORE

See Also

Developer's Guide
Gets the ParallelEdgeRouter from the layoutStages of this instance.
If you need to replace the instance, modify the layoutStages stack using replace. If you want to remove a stage, consider disabling it instead.
readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets or sets the minimum size (number of nodes) a parallel structure needs to have to be detected and handled as a parallel substructure.
The size of a parallel structure is defined as the number of inner nodes, that is, the degree-two nodes sharing the same neighbor nodes.
This setting has no effect if style NONE is specified.
final

Property Value

the minimum number of nodes a parallel structure needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 2

Default Value

The default value is: 3

See Also

API
parallelSubstructureStyle
Gets or sets the style specifier for parallel substructures.

A parallel structure consists of a set of nodes (called the inner nodes) such that all nodes have degree two and are connected to the same pair of neighbors (called the outer nodes).

Use property parallelSubstructureSize to specify the minimum number of inner nodes a structure must contain to be handled as a substructure.

If there are user-defined nodeTypes, a parallel substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

If the directness of edges is defined using property edgeDirectedness, all edges of the chain must have the same direction.
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

one of the predefined styles for parallel substructures

Default Value

See Also

Developer's Guide
API
parallelSubstructureSize, edgeDirectedness
Gets or sets whether parallel substructures should be separated by the node type.
If this option is enabled and there are nodeTypes specified, all parallel substructures only contain nodes of the same type. Otherwise, if this option is disabled, a parallel substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or preferably on the same circle if the style is RADIAL).
This setting only has an effect if nodeTypes are specified and if the parallel substructure style is not NONE.
final

Property Value

true if parallel substructures are separated by node type, false if they may contain nodes of different types

Default Value

The default value is: true
Parallel substructures are strictly separated by node type.

Sample Graphs

ShownSetting: Type separation is enabled, yielding three substructures

See Also

Developer's Guide
API
parallelSubstructureStyle, nodeTypes
Gets or sets the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed.
The minimum preferred distance needs to be non-negative.
The algorithm doesn't guarantee that the specified minimum value is always maintained.
This value has an effect only if node-edge overlaps are not allowed.
final

Property Value

a non-negative minimum preferred distance

Throws

Exception ({ name: 'ArgumentError' })
if the specified distance is negative

Default Value

The default value is: 40
Gets or sets the ratio of layout quality versus running time.

The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout calculation.

The value needs to lie within [0,1].

final

Property Value

a value between 0.0 (low quality, fast) and 1.0 (high quality, slow)

Throws

Exception ({ name: 'ArgumentError' })
if the specified ratio is outside the interval [0,1]

Default Value

The default value is: 0.6

See Also

Developer's Guide
Gets the SelfLoopRouter from the layoutStages of this instance.
If you need to replace the instance, modify the layoutStages stack using replace. If you want to remove a stage, consider disabling it instead.
readonlyfinal

Throws

Exception ({ name: 'InvalidOperationError' })
If there is no instance of the respective type in the layoutStages
Gets or sets the shape constraint for the result of the layout algorithm.
If option allowNodeOverlaps is disabled, the shape constraint might be violated when node overlaps get resolved in a post-processing step.
This feature has only a small priority and can be automatically disabled by the layout algorithm in preference for other features (e.g., when edgeLabelPlacement is set to INTEGRATED or additional constraints are specified).
final

Property Value

Throws

Exception ({ name: 'ArgumentError' })
if the given restriction is null

Default Value

The default value is: ShapeConstraint.NONE

Sample Graphs

ShownSetting: No restriction

See Also

Developer's Guide
Gets or sets the minimum size (number of nodes including the root) a star needs to have to be detected and handled as a star substructure.
This setting has no effect if style NONE is specified.
final

Property Value

the minimum number of nodes, including the root, a star structure needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 3

Default Value

The default value is: 4

See Also

API
starSubstructureStyle
Gets or sets the style specifier for star substructures.

A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star). Use property starSubstructureSize to define the minimum number of nodes, including the root, a star must contain to be detected as a substructure.

If there are user-defined nodeTypes, by default, a star substructure only contains nodes of the same type or only nodes without a type (i.e. null as type), see starSubstructureTypeSeparation. This way, node types can be used to control which elements are allowed to form a substructure.

If the directness of edges is defined using property edgeDirectedness and the style is set to SEPARATED_RADIAL, all edges of the star must have the same direction. Otherwise, the edge directedness is ignored.
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

one of the predefined styles for star substructures

Default Value

See Also

Developer's Guide
API
starSubstructureSize, starSubstructureTypeSeparation, edgeDirectedness
Gets or sets whether star substructures should be separated by the node type.
If this option is enabled and there are nodeTypes specified, all star substructures only contain nodes of the same type. Otherwise, if this option is disabled, a star substructure may contain nodes of different type. The algorithm still tries to highlight the different types by choosing a suitable layout for these components (e.g., placing nodes of the same type closer together or on the same circle).
This setting only has an effect if nodeTypes are specified and if the star substructure style is not set to NONE.
If this property is enabled and there are star substructures of different type incident to the same root node the behavior is as follows: if the substructure style is set to SEPARATED_RADIAL, the algorithm creates a separate star substructure for each type that is connected to the root. Otherwise, only the nodes of the largest substructure receives a special handling while the other nodes are handled like common nodes that are not part of a star substructure.
final

Property Value

true if star substructures are separated by node type, false if they may contain nodes of different types

Default Value

The default value is: true
Star substructures are strictly separated by node type.

Sample Graphs

ShownSetting: Type separation is enabled, yielding three star structures

See Also

Developer's Guide
API
starSubstructureStyle, nodeTypes
Gets or sets the duration that this layout algorithm is allowed to run before stopping gracefully.
The duration needs to be non-negative.
If deterministic behavior is an important requirement, then the stop duration should not be limited, or it should at least be significantly higher than the actual required time.
Restricting the stop duration may result in a lower layout quality. Furthermore, the real runtime may exceed the stop duration since the layout algorithm still has to find a valid solution.
conversionfinal

Property Value

a non-negative duration

Throws

Exception ({ name: 'ArgumentError' })
if the specified duration has a negative value

Default Value

The default value is: 30s
A TimeSpan of 30 seconds

See Also

Developer's Guide
Gets or sets the minimum size (number of nodes) a tree needs to have to be detected and handled as a tree substructure.
This setting has no effect if style NONE is specified.
final

Property Value

the minimum number of nodes a tree needs to contain to be detected as a substructure

Throws

Exception ({ name: 'ArgumentError' })
if the given minimum size is less than 3

Default Value

The default value is: 4

See Also

API
treeSubstructureStyle
Gets or sets the style specifier for tree substructures.

Use property treeSubstructureSize to define the minimum number of nodes, including the root, a tree must contain to be detected as a substructure.

If there are user-defined nodeTypes, a tree substructure contains only nodes of the same type or only nodes without a type (i.e. null as type). This way, node types can be used to control which elements are allowed to form a substructure.

If the whole subtree corresponds to a chain or star substructure, the style is specified by property chainSubstructureStyle and starSubstructureStyle, respectively.
If the directness of edges is defined using property edgeDirectedness, all edges of the chain must have the same direction.
If the algorithm only considers a subset of nodes, only these nodes may be contained in a substructure.
conversionfinal

Property Value

one of the predefined styles for tree substructures

Default Value

See Also

Developer's Guide
API
treeSubstructureSize, edgeDirectedness

Methods

Calculates an organic arrangement of the graph.
In contrast to applyLayoutCore, graph and layout algorithm are prepared for an independent layout run.
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.

Parameters

graph: LayoutGraph
the input graph
Calculates an organic arrangement of the graph.
In contrast to applyLayout, graph and algorithm are not prepared specifically. This method should only be called directly when using OrganicLayout as a ILayoutStage.
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.
protectedfinal

Parameters

graph: LayoutGraph
the input graph
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the OrganicLayout.
The generic type arguments of the created layout data are compatible with instances of LayoutGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.

Parameters

graph: LayoutGraph
the graph that determines the generic type arguments of the created layout data

Return Value

OrganicLayoutData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
an instance of layout data that can be used to perform item-specific configurations for the given OrganicLayout.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the OrganicLayout.
The generic type arguments of the created layout data are compatible with instances of IGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.
This method is not available unless the module view-layout-bridge is loaded. Either load the module 'view-layout-bridge' explicitly or ensure that the LayoutExecutor type is available at runtime.

Parameters

graph?: IGraph
the graph that determines the generic type arguments of the created layout data

Return Value

OrganicLayoutData<INode, IEdge, ILabel, ILabel>
an instance of layout data that can be used to perform item-specific configurations for the given OrganicLayout.

See Also

Developer's Guide

Constants

All constants are filtered. Go to Filters.