documentationfor yFiles for HTML 2.6

GenericPartitionGridStageData

Specifies the layout data for the GenericPartitionGridStage.

Inheritance Hierarchy
LayoutData
GenericPartitionGridStageData

Examples

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

Creating an instance of GenericPartitionGridStageData
const layoutData = new GenericPartitionGridStageData()
// Define partition grid from custom data
layoutData.partitionGridData.rowIndices = (node) => node.tag.rowIndex
layoutData.partitionGridData.columnIndices = (node) => node.tag.columnIndex
// Define split edges from custom data
layoutData.splitEdges = (edge) => edge.tag.isSplitEdge

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

graph.applyLayout(
  new GivenCoordinatesStage(coreLayout),
  compositeLayoutData
)const layoutData = new GenericPartitionGridStageData()
// Define partition grid from custom data
layoutData.partitionGridData.rowIndices = (node: INode): number =>
  node.tag.rowIndex
layoutData.partitionGridData.columnIndices = (node: INode): number =>
  node.tag.columnIndex
// Define split edges from custom data
layoutData.splitEdges = (edge) => edge.tag.isSplitEdge

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

graph.applyLayout(
  new GivenCoordinatesStage(coreLayout),
  compositeLayoutData
)

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

Using an object initializer for easy creation of GenericPartitionGridStageData
const layoutData = new GenericPartitionGridStageData({
  // Define partition grid from custom data
  partitionGridData: new PartitionGridData({
    rowIndices: (node) => node.tag.rowIndex,
    columnIndices: (node) => node.tag.columnIndex
  }),
  // Define split edges from custom data
  splitEdges: (edge) => edge.tag.isSplitEdge
})

const compositeLayoutData = new CompositeLayoutData(
  coreLayoutData,
  layoutData
)
graph.applyLayout(
  new GenericPartitionGridStage(coreLayout),
  compositeLayoutData
)const layoutData = new GenericPartitionGridStageData({
  // Define partition grid from custom data
  partitionGridData: new PartitionGridData({
    rowIndices: (node) => node.tag.rowIndex,
    columnIndices: (node) => node.tag.columnIndex
  }),
  // Define split edges from custom data
  splitEdges: (edge: IEdge): boolean => edge.tag.isSplitEdge
})

const compositeLayoutData = new CompositeLayoutData(
  coreLayoutData,
  layoutData
)
graph.applyLayout(
  new GenericPartitionGridStage(coreLayout),
  compositeLayoutData
)

Type Details

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

See Also

Constructors

Properties

Methods