This class is a wrapper ILayerAssigner implementation that delegates the actual layering to a delegate ILayerAssigner object.
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
considerNodeSize | true | |
desiredAspectRatio | 1 |
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new instance of AspectRatioComponentLayerAssigner using the given delegate ILayerAssigner instance.
Parameters
A map of options to pass to the method.
- singleComponentLayerAssigner - ILayerAssigner
- The delegate that defines how to assign layers for single components.
- considerNodeSize - boolean
- Whether or not the size of the nodes should be considered. This option sets the considerNodeSize property on the created object.
- desiredAspectRatio - number
- The desired aspect ratio. This option sets the desiredAspectRatio property on the created object.
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.
Remarks
Default Value
true
.Property Value
true
if the size of the node is considered, false
otherwiseSample Graphs
Gets or sets the desired aspect ratio.
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 best fulfilled.
The given aspect ratio should be greater or equal to 0
.
Default Value
1
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the aspect ratio is negative
Sample Graphs
Gets or sets the delegate ILayerAssigner instance.
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified
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.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutContext - HierarchicalLayoutContext
- the HierarchicalLayoutContext used for querying information about the nodes and edges