Combines several LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> instances.
Inheritance Hierarchy
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.
Type Parameters
TNode
TEdge
TNodeLabel
TEdgeLabel
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)See Also
Developer's Guide
Members
Show:
Constructors
Creates a new instance that combines the given items.
Creates a new instance that combines the given
items.Parameters
- 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.
Gets or sets a collection of composed layout data objects.
conversionfinal
Methods
combineWith
(data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>): LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>Combines this instance with the given layout data.
combineWith
(data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>): LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>Combines this instance with the given layout data.
This keeps the current instance unmodified and instead returns a new instance that dynamically combines the contents of all involved instances.
final
Parameters
- data: LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>
- The LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> to combine this instance with.
Return Value
- LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel>
- The combined layout data.
See Also
Developer's Guide
API
- CompositeLayoutData, GenericLayoutData