C

DrawingDistanceCalculator

This class is a default IDrawingDistanceCalculator implementation that is used by HierarchicalLayout to configure the ICoordinateAssigner.

Members

No filters for this type

Constructors

Creates a new instance of DrawingDistanceCalculator with default settings.

Parameters

Properties

Gets or sets whether or not an adaptive minimum edge distance is used.
If this option is enabled, the minimum distance between two adjacent edges is the minimum of the current minimum edge distance and the distance of the edges' source/target points.
final

Property Value

true if an adaptive minimum distance should be used, false otherwise

Default Value

The default value is: true
An adaptive minimum distance is used.
Gets or sets whether or not the compaction option is enabled.
This option is automatically set by the layout algorithm if option nodeCompaction or labelCompaction is enabled.
final

Property Value

true if compaction is enabled, false otherwise

Default Value

The default value is: false
Compaction is disabled.
Gets or sets the minimum distance between two edges.
Minimum distance should be greater than 0.
final

Property Value

the given minimum distance

Throws

Exception ({ name: 'ArgumentError' })
if the minimum distance is negative

Default Value

The default value is: 20.0d

Sample Graphs

ShownSetting: Minimum edge to edge distance 10
Gets or sets the minimum distance between two LayoutNodes.
Minimum distance should be greater than 0.
final

Property Value

the minimum distance

Throws

Exception ({ name: 'ArgumentError' })
if the minimum distance is negative

Default Value

The default value is: 30.0d

Sample Graphs

ShownSetting: Minimum node to node distance 30
Gets or sets the minimum distance between a LayoutNode and a (non-adjacent) LayoutEdge.
Minimum distance should be greater than 0.
final

Property Value

the minimum distance

Throws

Exception ({ name: 'ArgumentError' })
if the minimum distance is negative

Default Value

The default value is: 15.0d

Sample Graphs

ShownSetting: Minimum node to edge distance 15

Methods

Disposes of internal data structures.
Implementations should release internally held data structures when they are not needed anymore.

Parameters

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.
Determines the minimum distance between two LayoutNodes of the same layer.

Parameters

graph: LayoutGraph
The input graph
layer: HierarchicalLayoutLayer
The layer object that will be used during subsequent calls
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext used for querying information
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

Return Value

number
The minimum distances between LayoutNodes of the same layer
Initializes internal data structures.
Implementations may cache lengthy calculations in the initialization phase.

Parameters

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.