documentationfor yFiles for HTML 2.6

ComponentLayoutData

Specifies custom data for the ComponentLayout.

Inheritance Hierarchy
LayoutData
ComponentLayoutData

Examples

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

Creating an instance of ComponentLayoutData
const layoutData = new ComponentLayoutData()
// Only process components that contain a selected node
layoutData.affectedComponents = graphComponent.selection.selectedNodes
// Reserve additional space around nodes
layoutData.nodeHalos.constant = NodeHalo.create(15)

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

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

Using an object initializer for easy creation of ComponentLayoutData
const layoutData = new ComponentLayoutData({
  // Only process components that contain a selected node
  affectedComponents: graphComponent.selection.selectedNodes,
  // Reserve additional space around nodes
  nodeHalos: NodeHalo.create(15)
})

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

Type Details

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

Constructors

Properties

Methods