This layout stage removes node overlaps while changes to the original layout structure are avoided and a specified minimum node distance is guaranteed.
Remarks
Layout Style
Unlike the overlap removal approach implemented by RemoveOverlapsStage, this stage tries to keep the original layout structure, i.e., it tries to keep the geometric distances between the nodes.
The strategy for removing overlaps is similar to the layout strategy used by organic (force-directed) layout algorithms (e.g. OrganicLayout). Therefore, this stage is especially well suited to remove node overlaps in undirected graph drawings with straight-line edges, as produced by organic layout approaches.
Features
It is possible to define a minimum distance between nodes. This feature allows to not only remove overlaps but forces nodes to keep the specified distance to other nodes.
Nodes can be marked as fixed. Such nodes will not be moved during the overlap removal process. A IDataProvider with key FIXED_NODE_DP_KEY can be registered to mark the fixed nodes. Note that inputs with fixed nodes may significantly increase the overall runtime. Hence class ShuffleLayout may be the better choice for such inputs.
Default Values of Properties
coreLayout | null | |
maximumDuration | <code>0x7FFFFFFF</code> | |
minimumNodeDistance | 10 |
Type Details
- yfiles module
- layout-organic
- yfiles-umd modules
- layout-multipage, layout-organic, layout
- Legacy UMD name
- yfiles.organic.OrganicRemoveOverlapsStage
Constructors
Creates a new instance of OrganicRemoveOverlapsStage with an optional core layout algorithm.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- The core layout algorithm.
- maximumDuration - number
The maximum duration in milliseconds that this layout stage is allowed to run. This option sets the maximumDuration property on the created object.
- minimumNodeDistance - number
The minimum distance to be kept between any two nodes of the graph. This option sets the minimumNodeDistance property on the created object.
Properties
Gets or sets the core layout algorithm that is wrapped by this stage.
Gets or sets the maximum duration in milliseconds that this layout stage is allowed to run.
Remarks
This maximum time does not include the time required for the core layout algorithm.
The duration needs to be non-negative.
Default Value
<code>0x7FFFFFFF</code>
.Throws
- Exception({ name: 'ArgumentError' })
- if the specified duration has a negative value
Gets or sets the minimum distance to be kept between any two nodes of the graph.
Remarks
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 distance needs to be a non-negative value.
Default Value
10
.Throws
- Exception({ name: 'ArgumentError' })
- if the given minimum distance is negative
Sample Graphs
Methods
Removes node overlaps and displaces nodes of the given graph such that they keep the specified minimum distance to each other.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Invokes the layout process of the core layout algorithm.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Defined in
Constants
A data provider key for marking nodes as fixed.
Remarks
Domain | YNode | |
Values | boolean | true if the node should be fixed, false otherwise |