documentationfor yFiles for HTML 2.6

BalloonLayoutData

Specifies custom data for the BalloonLayout.

Inheritance Hierarchy
LayoutData
BalloonLayoutData

Examples

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

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

graphComponent.graph.applyLayout(new BalloonLayout(), layoutData)const layoutData = new BalloonLayoutData()
// 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 BalloonLayout(), layoutData)

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

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

graphComponent.graph.applyLayout(new BalloonLayout(), layoutData)const layoutData = new BalloonLayoutData({
  // 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 BalloonLayout(), layoutData)

Type Details

yfiles module
view-layout-bridge
yfiles-umd modules
view-layout-bridge
Legacy UMD name
yfiles.tree.BalloonLayoutData

See Also

Constructors

Properties

Methods