C

CoordinateAssigner

This class is a ICoordinateAssigner implementation based on LayoutGraphAlgorithms.simplexRankAssignment.
Inheritance Hierarchy

Remarks

The algorithm works with integer values and rounds double values to integers using sophisticated quantizing.

Default Values of Properties

NameDefaultDescription
groupCompactionfalse
No group compaction is performed.
horizontalCompactionfalse
labelCompactionfalse
layoutGridCrossingWeight0.0
The algorithm ignores edges crossing grid borders.
maximumPortDeviation3.0
Ports may only move very short distances.
minimumSublayerDistance15.0d
nodeCompactionfalse
Nodes are not placed in a compact style.
stopDurationTimeSpan.MAX_VALUE
The layout algorithm runs unrestricted.
symmetryOptimizationStrategySymmetryOptimizationStrategy.STRONG

See Also

Developer's Guide

Members

Show:

Constructors

Properties

Gets or sets whether or not the CoordinateAssigner should improve the horizontal compactness of group nodes.
final

Property Value

true if group compaction should be enabled, false otherwise

Default Value

The default value is: false
No group compaction is performed.
Gets or sets whether or not the CoordinateAssigner tries to create a maximally compact horizontal layout at the cost of more bends.
For best results, breakLongSegments and labelCompaction should also be enabled.
final

Property Value

true if a maximally compact horizontal layout is created, false otherwise

Default Value

The default value is: false

See Also

API
labelCompaction, breakLongSegments
Gets or sets whether or not the CoordinateAssigner places labels in a more compact style.
If this option is enabled, the algorithm tries to place adjacent label elements in a stacked style, i.e., horizontally interleaving.
This option has no effect with customized IDrawingDistanceCalculators, see HierarchicalLayoutCore.drawingDistanceCalculator.
final

Property Value

true if labels are placed compact, false otherwise

Default Value

The default value is: false
The maximum distance a port may be moved to avoid bends in the first/last edge segment.

Allowing straightening (values > 0) produces non-uniform port distributions and may violate the edge distance (HierarchicalLayout.edgeDistance) and the border-to-port gap implied by HierarchicalLayoutNodeDescriptor.borderToPortGapRatio.

With the small default value, these deviations are typically hard to notice. For pixel-precise adherence to these constraints, set this property to zero. Large values are not recommended, as results may look less balanced despite having fewer bends.

Fixed ports are never moved. The algorithm also does not introduce additional edge overlaps.

This option is only considered when property nodeCompaction of the CoordinateAssigner is disabled.
final

Property Value

The non-negative threshold for the distance which ports are allowed to move to straighten edges. If 0, ports are never moved to straighten edges.

Default Value

The default value is: 3.0
Ports may only move very short distances.

Sample Graphs

Shown Setting: 0.0
Gets or sets the minimum distance between the upper and lower sublayer.

A too small distance value may prevent adjacent nodes from being placed in a stacked style (horizontally interleaving) because the vertical distance between these nodes must be greater than or equal to the value specified by HierarchicalLayoutNodeDescriptor.minimumDistance.

Values should be greater than 0.

This option is only considered if the node compaction is enabled.
final

Property Value

the minimum distance

Throws

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

Default Value

The default value is: 15.0d

Sample Graphs

Shown Setting: Minimum distance 15.0d

See Also

API
nodeCompaction
Gets or sets whether or not nodes should be placed in a more compact style with respect to layout width.
If enabled, the algorithm may place the nodes of a layer in a stacked style (horizontally interleaving), i.e., it splits the layer into an upper and lower sublayer and places adjacent nodes into different sublayers if this reduces the width of the layer.
Enabling this option increases the required layout height.
Nodes within a tabular group are never placed in a stacked style.
This option does not work with customized IDrawingDistanceCalculators, see HierarchicalLayoutCore.drawingDistanceCalculator.
final

Property Value

true if nodes are placed in a compact style, false otherwise

Default Value

The default value is: false
Nodes are not placed in a compact style.

Sample Graphs

Shown Setting: false

See Also

Developer's Guide
API
minimumSublayerDistance
Gets or sets the time limit set for the layout algorithm.
Values have to be greater than or equal to TimeSpan.ZERO.
Restricting the stop duration may result in a lower layout quality. Furthermore, the real runtime may exceed the stop duration since the layout algorithm still has to find a valid solution.
conversionfinal

Property Value

a non-negative value that specifies the time limit

Throws

Exception ({ name: 'ArgumentError' })
if the stop duration is negative

Default Value

The default value is: TimeSpan.MAX_VALUE
The layout algorithm runs unrestricted.
Gets or sets the optimization strategy for the symmetry of the resulting layout.
conversionfinal

Property Value

  • Strong – Symmetry is prioritized over performance and other layout qualities like compactness.
  • Weak – Symmetry is prioritized over performance but not over other layout qualities like compactness.
  • None – Symmetry is not prioritized.

Default Value

Sample Graphs

See Also

Developer's Guide

Methods

Assigns preliminary y-coordinates for each layer of a hierarchical layout.
The distance between two layers will be adjusted later by the edge routing algorithm. This method is responsible for assigning the relative positions of the nodes within each layer.

Parameters

graph: LayoutGraph
The input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext containing information about the elements, as well as the HierarchicalLayoutContext.layers that will be calculated by this method.
Determines the resulting x-coordinates of a hierarchical layout.
The minimum distance between each pair of nodes of the graph is determined by a IDrawingDistanceCalculator instance.

Parameters

graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext containing information about the elements, as well as the HierarchicalLayoutContext.layers that will be calculated by this method.
drawingDistanceCalculator: IDrawingDistanceCalculator
the given IDrawingDistanceCalculator instance
Specifies the minimum allowed distance between two nodes of the same given layer.
This callback method is used by assignSequenceCoordinates.
protectedfinal

Parameters

graph: LayoutGraph
the graph that contains the nodes
layer: HierarchicalLayoutLayer
the layer that contains the nodes
predNode: LayoutNode
the node to the left of the other one, may be null to indicate a border line
succ: LayoutNode
the node to the right of the other one, may be null to indicate a border line

Return Value

number
the minimum distance allowed between those two nodes ( >=0 )

See Also

API
getMinimumDistance
Returns the minimum height of a given layer.
This callback method is used by assignLayerCoordinates.
protected

Parameters

graph: LayoutGraph
the given graph
context: HierarchicalLayoutContext
the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances
layer: HierarchicalLayoutLayer
the layer whose height is calculated

Return Value

number
the minimum height
Returns whether the given node should be treated as a node with fixed (given) coordinates, that is, its hint is IncrementalNodeHint.EXACT_COORDINATES or created via factory method IncrementalNodeHint.createExactCoordinatesHint.

This callback method is used by both assignLayerCoordinates and assignSequenceCoordinates.

If inLayer argument is true, this method is called from within the method assignLayerCoordinates.

protectedfinal

Parameters

graph: LayoutGraph
the given graph
layoutContext: HierarchicalLayoutContext
the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances
node: LayoutNode
the given node
inLayer: boolean
true if the layer coordinate of the node is queried, false if the sequence coordinate is queried

Return Value

boolean
true if the node should be treated as fixed, false otherwise