This interface determines the minimum distances between elements that belong to the same layer.
Remarks
IDrawingDistanceCalculator is implemented by a helper class used by HierarchicLayoutCore during the phase of node placement (i.e. when the final coordinates for all nodes are calculated). IHierarchicLayoutNodePlacer uses instances of this interface to determine the minimum distances between elements that belong to the same layer.
Information about graph elements (i.e. nodes or edges) is given using a ILayoutDataProvider while information about layers is given through ILayer (describes a single layer of the hierarchic layout) or ILayers (manages multiple layers of the hierarchic layout).
Implementations not needed any more should be disposed of.
The default implementation used by the HierarchicLayoutCore is DefaultDrawingDistanceCalculator.
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.IDrawingDistanceCalculator
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
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
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