Combines several LayoutData instances.
Inheritance Hierarchy
LayoutData
CompositeLayoutData
Remarks
This is especially useful if several layouts are run at once, for example a general layout and a subsequent edge routing.
The LayoutData are applied in the order as they appear in the items collection. This may influence which property "wins" when there are multiple LayoutData that define the same mapping or collection, e.g. AbortHandler, or affected nodes. Generally those should only ever be set on one of the child LayoutData instances.
Examples
The following example shows how CompositeLayoutData can be used to combine multiple LayoutData 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 FixNodeLayoutStage(new OrganicLayout()))
graphComponent.graph.applyLayout(layout, layoutData)
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.layout.CompositeLayoutData
See Also
Constructors
Creates a new instance which 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
- The LayoutData to combine.
Properties
Gets or sets a collection of composed layout data objects.
Methods
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
- The LayoutData to combine this instance with.
Returns
- ↪LayoutData
- The combined layout data.