documentationfor yFiles for HTML 2.6

CircularLayoutData

Specifies custom data for the CircularLayout.

Inheritance Hierarchy
LayoutData
CircularLayoutData

Examples

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

Creating an instance of CircularLayoutData
const layoutData = new CircularLayoutData()
// Put nodes of each color into their own circle
layoutData.customGroups = (node) =>
  node.style instanceof ShapeNodeStyle ? node.style.fill : {}
// Retain a bit more space around nodes
layoutData.nodeHalos.constant = NodeHalo.create(15)

const layout = new CircularLayout()
layout.layoutStyle = CircularLayoutStyle.CUSTOM_GROUPS
graphComponent.graph.applyLayout(layout, layoutData)const layoutData = new CircularLayoutData()
// Put nodes of each color into their own circle
layoutData.customGroups = (node: INode): any =>
  node.style instanceof ShapeNodeStyle ? node.style.fill : {}
// Retain a bit more space around nodes
layoutData.nodeHalos.constant = NodeHalo.create(15)

const layout = new CircularLayout()
layout.layoutStyle = CircularLayoutStyle.CUSTOM_GROUPS
graphComponent.graph.applyLayout(layout, layoutData)

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

Using an object initializer for easy creation of CircularLayoutData
const layoutData = new CircularLayoutData({
  // Put nodes of each color into their own circle
  customGroups: (node) =>
    node.style instanceof ShapeNodeStyle ? node.style.fill : {},
  // Retain a bit more space around nodes
  nodeHalos: NodeHalo.create(15)
})

const layout = new CircularLayout()
layout.layoutStyle = CircularLayoutStyle.CUSTOM_GROUPS
graphComponent.graph.applyLayout(layout, layoutData)const layoutData = new CircularLayoutData({
  // Put nodes of each color into their own circle
  customGroups: (node: INode): any =>
    node.style instanceof ShapeNodeStyle ? node.style.fill : {},
  // Retain a bit more space around nodes
  nodeHalos: NodeHalo.create(15)
})

const layout = new CircularLayout()
layout.layoutStyle = CircularLayoutStyle.CUSTOM_GROUPS
graphComponent.graph.applyLayout(layout, layoutData)

Type Details

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

See Also

Constructors

Properties

Methods