documentationfor yFiles for HTML 3.0.0.3

OrganicLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the OrganicLayout.

Inheritance Hierarchy

Examples

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

Creating an instance of OrganicLayoutData
const layoutData = new OrganicLayoutData()
layoutData.preferredEdgeLengths = 45
layoutData.scope.nodes = graphComponent.selection.nodes

graphComponent.graph.applyLayout(new OrganicLayout(), layoutData)

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

Using an object initializer for easy creation of OrganicLayoutData
const layoutData = new OrganicLayoutData({
  preferredEdgeLengths: 45,
})
layoutData.scope.nodes = graphComponent.selection.nodes

graphComponent.graph.applyLayout(new OrganicLayout(), layoutData)

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods