documentationfor yFiles for HTML 2.6

PlaceNodesAtBarycenterStageData

Specifies custom data for the PlaceNodesAtBarycenterStage.

Inheritance Hierarchy
LayoutData
PlaceNodesAtBarycenterStageData

Examples

The following example shows how to create a new instance of PlaceNodesAtBarycenterStageData and use it with a PlaceNodesAtBarycenterStage:

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

// Combine the layout data of the stage and the core layout
const compositeLayoutData = new CompositeLayoutData(
  coreLayoutData,
  layoutData
)

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

In many cases the complete initialization of PlaceNodesAtBarycenterStageData 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.selectedNodes
})

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

Type Details

yfiles module
view-layout-bridge
yfiles-umd modules
view-layout-bridge
Legacy UMD name
yfiles.layout.PlaceNodesAtBarycenterStageData

Constructors

Properties

Methods