documentationfor yFiles for HTML 3.0.0.3

TreeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the TreeLayout.

Inheritance Hierarchy

Examples

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

Creating an instance of TreeLayoutData
const layoutData = new TreeLayoutData()
layoutData.nodeMargins = new Insets(15)
layoutData.treeRoot.item = rootNode

graph.applyLayout(new TreeLayout(), layoutData)

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

Using an object initializer for easy creation of TreeLayoutData
const layoutData = new TreeLayoutData({
  nodeMargins: new Insets(15),
  treeRoot: (node) => node === rootNode,
})

graph.applyLayout(new TreeLayout(), layoutData)

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods