documentationfor yFiles for HTML 2.6

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 core layout algorithm 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 core layout algorithm supports multi-parent structures (see multiParentAllowed) and option multiParentAllowed is enabled, this stage does not hide such structures, i.e., the multi-parent structures are passed to the core layout algorithm.

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 method edgeBundling.

Default Values of Properties

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

Type Details

yfiles module
layout-tree
yfiles-umd modules
layout-orthogonal-compact, layout-orthogonal, layout-tree, layout
Legacy UMD name
yfiles.tree.TreeReductionStage

See Also

To get the non-tree edges computed internally, a IDataAcceptor can be registered with the specified non-tree selection key. The algorithm will mark the non-tree edges.
If there are edges between group nodes, the ClassicTreeLayout may throw a InvalidGraphStructureError-Exception. Such exceptions can be prevented by temporarily removing those edges.

Constructors

Properties

Methods

Constants