This interface determines the minimum distances between elements that belong to the same layer.
Remarks
IDrawingDistanceCalculator is implemented by a helper class used by HierarchicalLayout during the phase of node placement (i.e. when the final coordinates for all nodes are calculated). ICoordinateAssigner 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 HierarchicalLayoutContext while information about layers is given through HierarchicalLayoutLayer (describes a single layer of the hierarchical layout) or layers (the list of layers of the hierarchical layout).
Implementations not needed anymore should be disposed of using method dispose.
The default implementation used by the HierarchicalLayout is DrawingDistanceCalculator.
Type Details
- yFiles module
- algorithms
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
- layoutContext - HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances, as well as the layers instance that will be used during subsequent calls.
See Also
getMinimumDistance
(graph: LayoutGraph, layer: HierarchicalLayoutLayer, layoutContext: HierarchicalLayoutContext, left: LayoutNode, right: LayoutNode) : numberMain interface method called by ICoordinateAssigner instances to determine the minimum distance between LayoutNodes of the same layer.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layer - HierarchicalLayoutLayer
- the layer object that will be used during subsequent calls
- layoutContext - HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances
- left - LayoutNode
- the left of the two LayoutNodes whose minimum distance is to be determined or
null
if only the left border of the right LayoutNode is of interest - right - LayoutNode
- the right of the two LayoutNodes whose minimum distance is to be determined or
null
if only the right border of the left LayoutNode is of interest
Returns
- ↪number
- the minimum distance between two LayoutNodes of the same layer
null
if its border is not of interest. In that case, only the border of the non-null
LayoutNode instance should be considered.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
- layoutContext - HierarchicalLayoutContext
- The HierarchicalLayoutContext instance which provides access to context information for the graph elements.