documentationfor yFiles for HTML 2.6

GivenCoordinatesStageData

Specifies custom layout data for the GivenCoordinatesStage.

Inheritance Hierarchy
LayoutData
GivenCoordinatesStageData

Examples

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

Creating an instance of GivenCoordinatesStageData
const layoutData = new GivenCoordinatesStageData()
// Resize all nodes to same size
layoutData.nodeSizes.constant = new Size(30, 30)
// Reset all edge paths
layoutData.edgePaths.constant = IEnumerable.from([])

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

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

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

Using an object initializer for easy creation of GivenCoordinatesStageData
const layoutData = new GivenCoordinatesStageData({
  // Resize all nodes to same size
  nodeSizes: new Size(30, 30),
  // Reset all edge paths
  edgePaths: IListEnumerable.EMPTY
})

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

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

Type Details

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

Constructors

Properties

Methods