documentationfor yFiles for HTML 3.0.0.2

CompositeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

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.

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

Properties

Methods