This class is a IDrawingDistanceCalculator implementation that returns the minimum distances for each kind of node pair based on their type as returned by type.
Default Values of Properties
edgeToEdgeDistance | 10.0d | |
minimumFirstSegmentLength | 15.0d | |
nodeToEdgeDistance | 15.0d | |
nodeToNodeDistance | 30.0d |
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.TypeBasedDrawingDistanceCalculator
Constructors
Creates a new instance of TypeBasedDrawingDistanceCalculator with default settings.
Parameters
A map of options to pass to the method.
- 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.
- minimumFirstSegmentLength - number
The minimum length of the first segment of the edge path (at the source node). This option sets the minimumFirstSegmentLength property on the created object.
Properties
Gets or sets whether or not the compaction option is enabled.
Default Value
false
.Compaction is disabled.
See Also
Gets or sets the minimum distance between two edges.
Remarks
0
.Default Value
10.0d
.Throws
- Exception({ name: 'ArgumentError' })
- if the minimum distance is negative
Sample Graphs
Gets or sets the minimum length of the first segment of the edge path (at the source node).
Remarks
The minimum length should be greater than 0
.
If the value is 0.0d
the first segment does not need to be orthogonal.
Default Value
15.0d
.Throws
- Exception({ name: 'ArgumentError' })
- if the minimum length of the first segment is negative
Sample Graphs
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) : numberMain interface method called by IHierarchicLayoutNodePlacer instances to determine the minimum distance between YNodes of 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 implementation which provides access to the INodeData and IEdgeData instances
- left - YNode
- right - YNode
Returns
- ↪number
- the minimum distance between two YNodes of the 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