documentationfor yFiles for HTML 3.0.0.3

OrthogonalLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the OrthogonalLayout.

Inheritance Hierarchy

Examples

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

Creating an instance of OrthogonalLayoutData
const layoutData = new OrthogonalLayoutData()
layoutData.sourceGroupIds = (edge: IEdge) => edge.sourceNode
layoutData.edgeOrientation = (edge) =>
  graphComponent.selection.edges.includes(edge) ? 1 : 0
graphComponent.graph.applyLayout(new OrthogonalLayout(), layoutData)

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

Using an object initializer for easy creation of OrthogonalLayoutData
const layoutData = new OrthogonalLayoutData({
  sourceGroupIds: (edge: IEdge): any => edge.sourceNode,
  edgeOrientation: (edge) =>
    graphComponent.selection.edges.includes(edge) ? 1 : 0,
})

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

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods