documentationfor yFiles for HTML 3.0.0.3

TreeReductionStage

The TreeReductionStage temporarily reduces general graphs to trees.

Inheritance Hierarchy
LayoutStageBase
TreeReductionStage
Implemented Interfaces

Remarks

Layout Style

This stage prepares a non-tree graph such that it can be processed by a tree layout algorithm.

The non-tree edges are marked

Concept

This ILayoutStage works in three steps:

  1. Remove some edges to get a tree or forest from the graph
  2. Invoke the coreLayout which supports tree graph handling
  3. Reinsert all previously removed edges
  4. Optionally route these edges using the non-tree edge router and place their labels using the non-tree edge labeling algorithm.

Features

The routing of the temporarily hidden non-tree edges can be customized by specifying an edge routing algorithm for those edges. Similarly, the placement of edge labels of non-tree edges can be delegated to a custom edge labeling algorithm. As default, both custom algorithms are not specified and, thus, non-tree edges are not routed and edge labels not placed.

This stage is also able to handle multi-parent structures, i.e., structures of multiple nodes that share the same predecessors as well as the same successors. More precisely, if the specified coreLayout supports multi-parent structures (see allowMultiParent) and option allowMultiParent is enabled, this stage does not hide such structures, i.e., the multi-parent structures are passed to the coreLayout.

Non-tree edges can also be bundled together such that their common parts are to some degree merged into a bundled part. The edge bundling can be specified by means of property edgeBundling.

Default Values of Properties

allowMultiParentfalseThe reduced graph is a normal tree.
nonTreeEdgeLabelingnullEdge labels of non-tree edges are not placed.
nonTreeEdgeRouternullNon-tree edges are not routed.

Type Details

yFiles module
algorithms
To get the non-tree edges computed internally, property nonTreeEdgesResult on the TreeReductionStageData<TNode,TEdge,TNodeLabel,TEdgeLabel> can be queried (the data must be passed to the layout execution).
If there are edges between group nodes, the TreeLayout may throw an ArgumentError-Exception. Such exceptions can be prevented by temporarily removing those edges.

Constructors

Properties

Methods

Constants