C

AspectRatioComponentLayerAssigner

This class is a wrapper ILayerAssigner implementation that delegates the actual layering to a delegate ILayerAssigner object.
ImplementsInheritance Hierarchy

Remarks

If the graph consists of multiple components, they will be identified and each of the components will be layered separately using the delegate ILayerAssigner instance. After that they will all be merged such that the desired aspect ratio is fulfilled best.

Sample output of AspectRatioComponentLayerAssigner with default settings on a graph with two connected components.

Default Values of Properties

NameDefault
considerNodeSizetrue
desiredAspectRatio1

See Also

API

desiredAspectRatio, MultiComponentLayerAssigner

Members

No filters for this type

Constructors

Creates a new instance of AspectRatioComponentLayerAssigner using the given delegate ILayerAssigner instance.

Parameters

singleComponentLayerAssigner: ILayerAssigner
The delegate that defines how to assign layers for single components.

Throws

Exception ({ name: 'ArgumentError' })
if the specified ILayerAssigner is null

Properties

Gets or sets whether or not the size of the nodes should be considered.
If this option is disabled, all nodes are considered to be of equal size. Hence, the given aspect ratio specifies the ratio between the number of nodes within a layer and the overall number of layers.
final

Property Value

true if the size of the node is considered, false otherwise

Default Value

The default value is: true

Sample Graphs

ShownSetting: false
Gets or sets the desired aspect ratio.

If the graph consists of multiple components, they will be identified and each of the components will be layered separately using the delegate ILayerAssigner instance. After that, they will all be merged such that the desired aspect ratio is best fulfilled.

The given aspect ratio should be greater or equal to 0.

For grouped graphs, the desired aspect ratio is also considered for each group node separately.
final

Property Value

the desired aspect ratio

Throws

Exception ({ name: 'ArgumentError' })
if the aspect ratio is negative

Default Value

The default value is: 1

Sample Graphs

ShownSetting: Aspect ratio 0.1
Gets or sets the delegate ILayerAssigner instance.
final

Property Value

an ILayerAssigner instance

Throws

Exception ({ name: 'ArgumentError' })
if the specified ILayerAssigner is null

Methods

Assigns all nodes of the graph to layers and registers them to the layers in the given layoutContext based on the given aspect ratio.
If the graph consists of multiple components, they will be identified and each of the components will be layered separately using the delegate ILayerAssigner instance. After that, they will all be merged such that the desired aspect ratio is best fulfilled.
For grouped graphs, the desired aspect ratio is also considered for each group node separately.

Parameters

graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
the HierarchicalLayoutContext used for querying information about the nodes and edges