documentationfor yFiles for HTML 3.0.0.3

CircularLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the CircularLayout.

Inheritance Hierarchy

Examples

The following example shows how to create a new instance of CircularLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> 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.partitions = (node: INode): any =>
  node.style instanceof ShapeNodeStyle ? node.style.fill : {}
// Retain a bit more space around nodes
layoutData.nodeMargins = new Insets(15)

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

In many cases the complete initialization of CircularLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> 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
  partitions: (node: INode): any =>
    node.style instanceof ShapeNodeStyle ? node.style.fill : {},
  // Retain a bit more space around nodes
  nodeMargins: new Insets(15),
})

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

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods