- I
- I
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.
Concept
OrientationStage performs three basic steps.
- Preparation: The sizes and locations of nodes and edge bends as well as labels and LayoutPortCandidates are transformed to the TOP_TO_BOTTOM orientation.
- Delegation: The coreLayout is invoked and calculates the layout for orientation TOP_TO_BOTTOM.
- 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
| Name | Default | Description |
|---|---|---|
| coreLayout | null | |
| edgeLabelPlacement | OrientationStageEdgeLabelPlacement.CONSIDER | The orientation of labels is handled by this OrientationStage. |
| mirroredOrientations | MirroredOrientations.BOTTOM_TO_TOP | |
| orientation | LayoutOrientation.TOP_TO_BOTTOM |
See Also
Developer's Guide
Members
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.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets or sets whether the position of the edge labels should be changed during orientation change.
Property Value
Default Value
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.
Defined in
LayoutStageBase.enabledGets 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.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if an unknown mask is specified
Default Value
Gets or sets the main direction of the layout.
Property Value
Default Value
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.