documentationfor yFiles for HTML 3.0.0.3

TemporaryGroupInsertionData<TNode,TEdge,TNodeLabel,TEdgeLabel>

Specifies custom data for the TemporaryGroupInsertionStage.

Inheritance Hierarchy

Remarks

The TemporaryGroupInsertionStage can be used for ungrouped graphs if nodes should be treated by layout algorithms as if they were actually grouped.

Examples

Using a RecursiveGroupLayout together with a TemporaryGroupInsertionStage
// define temporaryGroup1 to use an OrganicLayout
// with all nodes in nodeList belonging to temporaryGroup1
const groupNodeInsertionData = new TemporaryGroupInsertionData()
const temporaryGroup1 = groupNodeInsertionData.temporaryGroups.add(
  new TemporaryGroupDescriptor({
    recursiveGroupLayoutAlgorithm: new OrganicLayout(),
  }),
)
temporaryGroup1.items = nodeList
// wrap the core layout in a RecursiveGroupLayout and both in a TemporaryGroupInsertionStage
const layout = new TemporaryGroupInsertionStage(
  new RecursiveGroupLayout(hierarchicalLayout),
)
// combine the HierarchicalLayoutData and the TemporaryGroupNodeInsertionData
const layoutData = new CompositeLayoutData(
  hierarchicalLayoutData,
  groupNodeInsertionData,
)
// run the layout
await graphComponent.applyLayoutAnimated({
  layout,
  layoutData,
  animationDuration: '1s',
})
// do something after the Promise resolved

Type Parameters

TNode
TEdge
TNodeLabel
TEdgeLabel

Type Details

yFiles module
algorithms

Constructors

Properties

Methods