documentationfor yFiles for HTML 3.0.0.3

AlignmentStageData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the AlignmentStage.

Inheritance Hierarchy

Examples

The following example shows how to create a new instance of AlignmentStageData<TNode,TEdge,TNodeLabel,TEdgeLabel> 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.nodeMargins = (node) =>
  graph.isGroupNode(node) ? Insets.EMPTY : new Insets(0, 0, 40, 0)
graphComponent.graph.applyLayout(new AlignmentStage(coreLayout), data)

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

Using an object initializer for easy creation of AlignmentStageData
const grid = new LayoutGrid(3, 3)
const data = new AlignmentStageData({
  // specify the layout grid which is to be obeyed by the stage
  layoutGridData: new LayoutGridData({
    layoutGridCellDescriptors:
      // node1 is assigned to the first row (index 0)
      // all other nodes are assigned to the second row (index 1)
      (node) => grid.createCellDescriptor(node == node1 ? 0 : 1, 0),
  }),
})

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

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods