documentationfor yFiles for HTML 2.6

OrganicLayoutData

Specifies custom data for the OrganicLayout.

Inheritance Hierarchy
LayoutData
OrganicLayoutData

Examples

The following example shows how to create a new instance of OrganicLayoutData and use it with an OrganicLayout:

Creating an instance of OrganicLayoutData
const layoutData = new OrganicLayoutData()
layoutData.preferredEdgeLengths.constant = 45
layoutData.affectedNodes = graphComponent.selection.selectedNodes

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

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

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

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

Type Details

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

See Also

Constructors

Properties

Methods