A LayoutMultiplexer delegates its layout calls to a core layout algorithm that is dynamically chosen at runtime by inspecting the nodes of the input graph.
Remarks
If a IDataProvider is registered with the given graph using the look-up key LAYOUT_DP_KEY, it is used for retrieving the ILayoutAlgorithm objects that are stored for the graph's nodes. If no such IDataProvider is registered, this layout stage's core layout algorithm (if any) is used for the layout calculation of all nodes.
Note that the first non-null
ILayoutAlgorithm instance retrieved from the IDataProvider is used for all nodes.
The main purpose of this class is to enable the use of individual layout algorithms for different components (when used as the core layout algorithm of ComponentLayout) or for the contents of group nodes (when used as the core layout algorithm of RecursiveGroupLayout).
Default Values of Properties
coreLayout | null |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.LayoutMultiplexer
See Also
Constructors
Creates a new instance of LayoutMultiplexer.
Properties
Gets or sets the core layout algorithm that is wrapped by this stage.
Methods
Retrieves and invokes the layout algorithm that is assigned to the graph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Invokes the layout process of the core layout algorithm.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Defined in
Returns the core layout algorithm associated with the nodes contained in the given graph.
Remarks
This implementation looks up the layout algorithm in the IDataProvider registered with the key LAYOUT_DP_KEY. The first non-null
layout algorithm instance found for a node of the given graph will be returned by this method. If no algorithm is registered at all, it will fall back to the default core layout algorithm.
This method is called in applyLayout and may be overridden to implement a different way of selecting the layout algorithms.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Returns
- ↪ILayoutAlgorithm
- the according layout algorithm
Constants
A data provider key for assigning layout algorithms to the nodes.
Remarks
null
ILayoutAlgorithm instance is used for the whole graph.Domain | YNode | |
Values | ILayoutAlgorithm | the layout algorithm which is associated with the node |