documentationfor yFiles for HTML 3.0.0.3

GivenCoordinatesLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom layout data for the GivenCoordinatesLayout.

Inheritance Hierarchy

Examples

The following example shows how to create a new instance of GivenCoordinatesLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> and use it with a GivenCoordinatesLayout:

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

// Combine the layout data of the stage and the core layout
const compositeLayoutData = coreLayoutData.combineWith(layoutData)

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

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

Using an object initializer for easy creation of GivenCoordinatesLayoutData
const layoutData = new GivenCoordinatesLayoutData({
  // 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 = coreLayoutData.combineWith(layoutData)

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

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods