documentationfor yFiles for HTML 3.0.0.3

RadialTreeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the RadialTreeLayout.

Inheritance Hierarchy

Examples

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

Creating an instance of RadialTreeLayoutData
const layoutData = new RadialTreeLayoutData()
// Use the node whose label says "Root" as root node for the tree
layoutData.treeRoot = (node: INode): boolean =>
  node.labels.get(0).text === 'Root'
// Place children of nodes with many children interleaved
layoutData.interleavedNodes = (node: INode) =>
  graphComponent.graph.outDegree(node) > 5

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

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

Using an object initializer for easy creation of RadialTreeLayoutData
const layoutData = new RadialTreeLayoutData({
  // Use the node whose label says "Root" as root node for the tree
  treeRoot: (node: INode): boolean =>
    node.labels.get(0).text === 'Root',
  // Place children of nodes with many children interleaved
  interleavedNodes: (node: INode): boolean =>
    graphComponent.graph.outDegree(node) > 5,
})

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

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods