Combines several LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> instances.
Inheritance Hierarchy
LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
CompositeLayoutData
Remarks
This is especially useful if several layouts are run at once, for example a general layout and a subsequent edge routing.
The layout data instances are applied in the order as they appear in the items collection. This may influence which property "wins" when there are multiple data instances that define the same mapping or collection, e.g. LayoutAbortController, or affected nodes. Generally those should only ever be set on one of the child layout data instances.
Examples
The following example shows how CompositeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> can be used to combine multiple layout data instances:
// Create layout data to be combined first
// Wrap them into CompositeLayoutData
const layoutData = new CompositeLayoutData(
fixNodeLayoutData,
organicLayoutData,
edgeRouterData,
)
// Run the combined layout
const layout = new EdgeRouter(
new LayoutAnchoringStage(new OrganicLayout()),
)
graphComponent.graph.applyLayout(layout, layoutData)
Type Parameters
- TNode
- TEdge
- TNodeLabel
- TEdgeLabel
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new instance that combines the given items
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- items - LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> to combine.
Properties
Gets or sets a collection of composed layout data objects.
Methods
combineWith
(data: LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>…) : LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>Combines this instance with the given layout data.
Remarks
This keeps the current instance unmodified and instead returns a new instance that dynamically combines the contents of all involved instances.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- data - LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> to combine this instance with.
Returns
- ↪LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
- The combined layout data.
See Also
CompositeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>,
GenericLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>,
Combining Layout Data