This ILayoutStage removes node overlaps and guarantees a certain minimum distance between nodes.
Remarks
Layout Style
This stage only removes overlaps between nodes of the input graph. To do so, overlapping nodes will be moved apart. Results often look like a stretched version of the original graph. Before removing the node overlaps, an optional core layout algorithm is applied.
Features
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
coreLayout | null |
Type Details
- yfiles module
- layout-organic
- yfiles-umd modules
- layout-multipage, layout-organic, layout
- Legacy UMD name
- yfiles.organic.RemoveOverlapsStage
See Also
Constructors
Creates a new RemoveOverlapsStage instance with a given minimum node distance.
Remarks
Parameters
A map of options to pass to the method.
- minimumNodeDistance - number
- a non-negative minimum distance value
- coreLayout - ILayoutAlgorithm
The core layout algorithm that is wrapped by this stage and is applied before removing node overlaps. This option sets the coreLayout property on the created object.
Throws
- Exception({ name: 'ArgumentError' })
- if the given distance is negative
Properties
Gets or sets the core layout algorithm that is wrapped by this stage and is applied before removing node overlaps.
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 minimum node distance needs to be non-negative.
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