This class is a default IDrawingDistanceCalculator implementation that is used by HierarchicLayoutCore to configure the IHierarchicLayoutNodePlacer.
Default Values of Properties
adaptiveMinimumEdgeDistanceEnabled | true | An adaptive minimum distance is used. |
edgeToEdgeDistance | 20.0d | |
nodeToEdgeDistance | 15.0d | |
nodeToNodeDistance | 30.0d | |
optimizeSwimlaneDistances | false |
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.DefaultDrawingDistanceCalculator
See Also
Constructors
Creates a new instance of DefaultDrawingDistanceCalculator with default settings.
Parameters
A map of options to pass to the method.
- adaptiveMinimumEdgeDistanceEnabled - boolean
Whether or not an adaptive minimum edge distance is used. This option sets the adaptiveMinimumEdgeDistanceEnabled property on the created object.
- compaction - boolean
Whether or not the compaction option is enabled. This option sets the compaction property on the created object.
- nodeToNodeDistance - number
The minimum distance between two YNodes. This option sets the nodeToNodeDistance property on the created object.
- nodeToEdgeDistance - number
The minimum distance between a YNode and an (non-adjacent) Edge. This option sets the nodeToEdgeDistance property on the created object.
- edgeToEdgeDistance - number
The minimum distance between two edges. This option sets the edgeToEdgeDistance property on the created object.
- optimizeSwimlaneDistances - boolean
Whether or not to use an optimized minimum distance calculation for swimlane layouts. This option sets the optimizeSwimlaneDistances property on the created object.
Properties
Gets or sets whether or not an adaptive minimum edge distance is used.
Remarks
Default Value
true
.An adaptive minimum distance is used.
Gets or sets whether or not the compaction option is enabled.
Default Value
false
.Compaction is disabled.
Gets or sets the minimum distance between two edges.
Remarks
0
.Default Value
20.0d
.Throws
- Exception({ name: 'ArgumentError' })
- if the minimum distance is negative
Sample Graphs
Gets or sets whether or not to use an optimized minimum distance calculation for swimlane layouts.
Remarks
true
this instance will report 0.0d
as the minimum distance between two nodes if they belong to different swimlanes. This avoids unwanted feedback between different swimlanes during node placement.Default Value
false
.Methods
Disposes of internal data structures.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph that contains all elements that are used during the node placement
- layers - ILayers
- the ILayers object that will be used during subsequent calls
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
See Also
Implements
getMinDistance
(graph: LayoutGraph, layer: ILayer, ldp: ILayoutDataProvider, left: YNode, right: YNode) : numberDetermines the minimum distance between two YNodes of the same layer.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layer - ILayer
- the ILayer object that will be used during subsequent calls
- ldp - ILayoutDataProvider
- the ILayoutDataProvider used for querying information
- left - YNode
- right - YNode
Returns
- ↪number
- the minimum distances between YNodes of same layer
Implements
Initializes internal data structures.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph that contains all elements that are used during the node placement
- layers - ILayers
- the ILayers object that will be used during subsequent calls
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances