C

CoordinateAssigner

This class is a ICoordinateAssigner implementation based on simplexRankAssignment.
ImplementsInheritance Hierarchy

Remarks

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

Default Values of Properties

NameDefaultDescription
bendReductiontrue
fromSketchLayerAssignmenttrue
groupCompactionfalse
No group compaction is performed.
horizontalCompactionfalse
labelCompactionfalse
layoutGridCrossingWeight0.0
The algorithm ignores edges crossing grid borders.
minimumSublayerDistance15.0d
nodeCompactionfalse
Nodes are not placed in a compact style.
stopDurationTimeSpan.MAX_VALUE
The layout algorithm runs unrestricted.
straightenEdgesfalse
A postprocessing step to reduce the number of bends is not applied.
symmetryOptimizationStrategySymmetryOptimizationStrategy.STRONG

See Also

Developer's Guide

Members

Show:

Constructors

Properties

Gets or sets whether or not an optimization step should be applied that tries to further reduce the number of bends.
Using this option may increase the running time of the layout algorithm. If the running time exceeds the stop duration (see stopDuration) the number of bends is not reduced.
Using symmetryOptimizationStrategy option NONE may further reduce the number of bends.
The optimization is not applied in case that tabular group nodes are defined (see tabularGroups).
final

Property Value

true if the bend optimization step is applied, false otherwise

Default Value

The default value is: true

See Also

API
stopDuration
Gets or sets whether or not the CoordinateAssigner should try to use the coordinates given from the current sketch for the determination of the layer coordinates.
final

Property Value

true if the current sketch is used, false otherwise

Default Value

The default value is: true

Sample Graphs

ShownSetting: Initial Graph
Gets or sets whether or not the CoordinateAssigner should improve the horizontal compactness of group nodes.
To obtain compact groups you should additionally disable option bendReduction.
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 drawingDistanceCalculator.
final

Property Value

true if labels are placed compact, false otherwise

Default Value

The default value is: false
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 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

ShownSetting: 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 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

ShownSetting: 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 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 whether or not a postprocessing step should be applied to reduce the number of bends.
Furthermore, enabling this option may violate some minimum distances specified by the user and the edge distribution is no longer uniform.
This option is only considered if option nodeCompaction is disabled.
final

Property Value

true if the number of bends is reduced, false otherwise

Default Value

The default value is: false
A postprocessing step to reduce the number of bends is not applied.

Sample Graphs

ShownSetting: false
Gets or sets the optimization strategy for the symmetry of the resulting layout.
Disabling option bendReduction may also produce more symmetric results.
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

ShownSetting: NONE

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 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 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 or not the given node should be treated as a node with fixed (given) coordinates, that is hint USE_EXACT_LAYER_COORDINATES, USE_EXACT_COORDINATES or USE_EXACT_SEQUENCE_COORDINATES.

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