- I
- I
Remarks
Layout Style
This stage only removes overlaps between nodes of the input graph. To do so, overlapping nodes will be moved apart. Before removing the node overlaps, an optional coreLayout is applied.
Features
There are two strategies offered for removing overlaps:
- SHUFFLE: The fast and default policy. Results often look like a stretched version of the original graph.
- PRESERVE_RELATIVE_LOCATIONS: A more involved strategy which can generate higher quality results and tries to preserve the relative locations of neighboring elements as they are given in the input. This is especially suitable for undirected graph drawings with straight-line edges, as produced by organic layout approaches.
It is possible to define a minimum distance between nodes. This feature allows to not only remove overlaps but forces nodes to keep a specified distance to other nodes.
Default Values of Properties
| Name | Default |
|---|---|
| coreLayout | null |
| horizontalOverlapCriterion | HorizontalOverlapCriterion.LESS_MOVEMENT |
| overlapRemovalPolicy | OverlapRemovalPolicy.SHUFFLE |
| stopDuration | TimeSpan.MAX_VALUE |
See Also
Developer's Guide
Members
Constructors
Creates a new RemoveOverlapsStage instance with default settings.
Parameters
Properties
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets or sets a value that determines whether this stage should do anything but execute the coreLayout.
By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false.
Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.
Defined in
LayoutStageBase.enabledGets or sets the criterion for marking an overlap as horizontal.
Property Value
Default Value
Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too close to each other with respect to this distance will be displaced.
The minimum node distance needs to be non-negative. The default value is 0.
To define individual minimum distances, use the layout data property minimumNodeDistances.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the given minimum distance is negative
Sample Graphs
0Gets or sets the node overlap removal policy.
Property Value
Default Value
Gets or sets the duration that this layout stage is allowed to run before stopping gracefully.
This stop time does not include the time required for the coreLayout.
The duration needs to be non-negative.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified duration has a negative value
Default Value
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.
Defined in
LayoutStageBase.applyLayoutRemoves node overlaps and displaces nodes of the given graph such that they keep the specified minimum distance to each other.
Parameters
- graph: LayoutGraph
- the input graph
Overrides
LayoutStageBase.applyLayoutImplcreateLayoutData
(graph: LayoutGraph): RemoveOverlapsStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the RemoveOverlapsStage.
createLayoutData
(graph: LayoutGraph): RemoveOverlapsStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Parameters
- graph: LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- RemoveOverlapsStageData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given RemoveOverlapsStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the RemoveOverlapsStage.
LayoutExecutor type is available at runtime.Parameters
- graph?: IGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- RemoveOverlapsStageData<INode, IEdge, ILabel, ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given RemoveOverlapsStage.