C

OrientationStage

OrientationStage is an ILayoutStage that changes the orientation of the layout.

Remarks

Layout Style

There are four orientations that can be used for a layout. These orientations can exist with or without mirroring at the x-axis or y-axis.

Changing the layout orientation is useful for layout styles that show a main direction.

TOP_TO_BOTTOM layout

BOTTOM_TO_TOP layout with mirroring

LEFT_TO_RIGHT layout

RIGHT_TO_LEFT layout

Concept

OrientationStage performs three basic steps.

  1. Preparation: The sizes and locations of nodes and edge bends as well as labels and LayoutPortCandidates are transformed to the TOP_TO_BOTTOM orientation.
  2. Delegation: The coreLayout is invoked and calculates the layout for orientation TOP_TO_BOTTOM.
  3. Completion: The result of the coreLayout is rotated and mirrored to fit the desired layout orientation.

Features

OrientationStage is used as an ILayoutStage wrapping an ILayoutAlgorithm. Then it will change the orientation of the result of the coreLayout.

Default Values of Properties

NameDefaultDescription
coreLayoutnull
edgeLabelPlacementOrientationStageEdgeLabelPlacement.CONSIDER
The orientation of labels is handled by this OrientationStage.
mirroredOrientationsMirroredOrientations.BOTTOM_TO_TOP
orientationLayoutOrientation.TOP_TO_BOTTOM

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new OrientationStage instance using the given optional coreLayout and layout orientation.

Parameters

coreLayout?: ILayoutAlgorithm
The core layout algorithm. The default value is null.
orientation?: LayoutOrientation
The layout orientation.

Properties

Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final

Property Value

the core layout routine

Default Value

The default value is: null
Gets or sets whether the position of the edge labels should be changed during orientation change.
The coreLayout should switch this off if it performs integrated edge labeling.
conversionfinal

Property Value

CONSIDER if the position of the edge labels is changed, IGNORE otherwise

Default Value

The orientation of labels is handled by this OrientationStage.
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.

By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false.

Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.

final
Gets or sets the mask that defines which orientations this OrientationStage shall mirror.

Setting a layout orientation can be seen as rotating the graph by 90, 180, or 270 degrees. Afterward, the graph can be mirrored at the x-axis (for horizontal layout orientations) or y-axis (for vertical layout orientations).

Which directions are mirrored can be defined by the given mask. It can combine several mirrored directions with a logical or-operation.

conversionfinal

Property Value

the mask that determines which layout orientations are mirrored

Throws

Exception ({ name: 'ArgumentError' })
if an unknown mask is specified

Default Value

The default value is: MirroredOrientations.BOTTOM_TO_TOP
Gets or sets the main direction of the layout.
conversionfinal

Property Value

of the valid orientation specifiers

Default Value

The default value is: LayoutOrientation.TOP_TO_BOTTOM

Methods

Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final

Parameters

graph: LayoutGraph
The graph to apply the layout to.
Prepares the graph for orientation change before calling the coreLayout and finishes the orientation change afterwards.
protected

Parameters

graph: LayoutGraph
the input graph