This class is a wrapper ILayerAssigner implementation that delegates the actual layering to a delegate ILayerAssigner object.
Implements
- I
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.
Default Values of Properties
| Name | Default |
|---|---|
| considerNodeSize | true |
| desiredAspectRatio | 1 |
See Also
Members
No filters for this type
Constructors
Creates a new instance of AspectRatioComponentLayerAssigner using the given delegate ILayerAssigner instance.
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
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 otherwiseDefault Value
The default value is: true
Sample Graphs
ShownSetting:
falseIf 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.1Gets or sets the delegate ILayerAssigner instance.
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.
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