documentationfor yFiles for HTML 3.0.0.3

PlaceNodesAtBarycenterStageData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the PlaceNodesAtBarycenterStage.

Inheritance Hierarchy
LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
PlaceNodesAtBarycenterStageData

Examples

The following example shows how to create a new instance of PlaceNodesAtBarycenterStageData<TNode,TEdge,TNodeLabel,TEdgeLabel> and use it with a PlaceNodesAtBarycenterStage:

Creating an instance of PlaceNodesAtBarycenterStageData
const layoutData = new PlaceNodesAtBarycenterStageData({
  affectedNodes: graphComponent.selection.nodes,
})

// Combine the layout data of the stage and the core layout
const compositeLayoutData = coreLayoutData.combineWith(layoutData)

graphComponent.graph.applyLayout(
  new PlaceNodesAtBarycenterStage(coreLayout),
  compositeLayoutData,
)

In many cases the complete initialization of PlaceNodesAtBarycenterStageData<TNode,TEdge,TNodeLabel,TEdgeLabel> can also be done in a single object initializer:

Using an object initializer for easy creation of PlaceNodesAtBarycenterStageData
const layoutData = new PlaceNodesAtBarycenterStageData({
  affectedNodes: graphComponent.selection.nodes,
})

graphComponent.graph.applyLayout(
  new PlaceNodesAtBarycenterStage(coreLayout),
  coreLayoutData.combineWith(layoutData),
)

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods