documentationfor yFiles for HTML 2.6

MultiStageLayout

An abstract base class for layout algorithms that provides services to simplify and decompose the input graph before it is passed to the core layout algorithm itself.

Remarks

Subclasses of this layout algorithm have to provide implementations for the abstract method applyLayoutCore. It invokes the actual layout routine of this layout algorithm.

Concept

This class provides a configurable pipeline that contains ILayoutStages that add preprocessing steps and/or postprocessing steps to the layout algorithm. MultiStageLayout provides some predefined ILayoutStages, that simplify the input graph for the layout algorithm and complement the result. It is also possible to add custom ILayoutStages which are executed before or after the predefined ones.

Each ILayoutStage in the pipeline wraps its successor. When the layout pipeline is processed, the preprocessing code of the preceding ILayoutStage is executed before the code in the current ILayoutStage while the postprocessing code is executed afterwards.

The pipeline of predefined ILayoutStages of MultiStageLayout (when all are activated) causes the following sequence of steps:

  1. Hides the group nodes.
  2. Hides all except for the induced subgraph.
  3. Decomposes the graph into its connected components. Performs steps 4-12 on each component.
  4. Prepares for label placement.
  5. Prepares the layout for an orientation change.
  6. Hides self-loops.
  7. Hides parallel edges.
  8. Invokes the layout algorithm on the simplified graph.
  9. Un-hides and routes parallel edges.
  10. Un-hides and routes self-loops.
  11. Completes orientation change of the layout.
  12. Assigns label positions.
  13. Arranges the connected components of the graph.
  14. Un-hides non-induced subgraph.
  15. Un-hides the group nodes.

In order to take effect, a stage that is not already activated by default needs to be activated using the corresponding method, e.g., hideGroupsStageEnabled. Vice versa, a stage can also be deactivated, if necessary.

Default Values of Properties

componentLayoutEnabledtrueThe stage that arranges connected graph components is activated.
hideGroupsStageEnabledtrueThe stage responsible for hiding group nodes is activated.
labelingEnabledfalseThe stage responsible for label placement is deactivated.
layoutOrientationTOP_TO_BOTTOM
orientationLayoutEnabledtrueThe orientation is activated.
parallelEdgeRouterEnabledtrueThe stage that routes parallel edges is activated.
selfLoopRouterEnabledtrueThe stage that routes self-loops is activated.
subgraphLayoutEnabledfalseThe stage that constrains the input graph to a subgraph is deactivated.

Type Details

yfiles module
layout-core
yfiles-umd modules
All layout modules, view-layout-bridge
Legacy UMD name
yfiles.layout.MultiStageLayout

See Also

Constructors

Properties

Methods