documentationfor yFiles for HTML 2.6

AlignmentStageData

Specifies custom data for the AlignmentStage.

Inheritance Hierarchy
LayoutData
AlignmentStageData

Examples

The following example shows how to create a new instance of AlignmentStageData and use it with an AlignmentStage:

Creating an instance of AlignmentStageData
const data = new AlignmentStageData()
// define a node halo for each non-group node, reserving space at the bottom side
data.nodeHalos = (node) =>
  graph.isGroupNode(node)
    ? NodeHalo.ZERO_HALO
    : NodeHalo.create(0, 0, 40, 0)
graphComponent.graph.applyLayout(new AlignmentStage(coreLayout), data)

In many cases the complete initialization of AlignmentStageData can also be done in a single object initializer:

Using an object initializer for easy creation of AlignmentStageData
const grid = new PartitionGrid(3, 3)
const data = new AlignmentStageData({
  // specify the partition grid which is to be obeyed by the stage
  partitionGridData: new PartitionGridData({
    grid: grid,
    cellIds: (node) =>
      node == node1
        ? // node1 is assigned to the first row (index 0)
          grid.createCellId(0, 0)
        : // all other nodes are assigned to the second row (index 1)
          grid.createCellId(1, 0)
  })
})

graphComponent.graph.applyLayout(new AlignmentStage(coreLayout), data)const grid = new PartitionGrid(3, 3)
const data = new AlignmentStageData({
  // specify the partition grid which is to be obeyed by the stage
  partitionGridData: new PartitionGridData({
    grid: grid,
    cellIds: (node: INode) =>
      node == node1
        ? // node1 is assigned to the first row (index 0)
          grid.createCellId(0, 0)
        : // all other nodes are assigned to the second row (index 1)
          grid.createCellId(1, 0)
  })
})

graphComponent.graph.applyLayout(new AlignmentStage(coreLayout), data)

Type Details

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

See Also

Constructors

Properties

Methods