pub enum Direction {
TopDown,
LeftRight,
BottomTop,
RightLeft,
}Expand description
Flow direction of a layout, in mermaid vocabulary: TD / LR / BT / RL.
Directions are transposes of one canonical computation: the layered
pass lays ranks along the flow axis and orders nodes along the
cross axis, then maps (cross, flow) into screen (x, y). Node cards
never rotate — a w x h card stays w x h in every direction.
This is a closed vocabulary by design (four flows exist), so the enum is deliberately exhaustive per ADR-0003 §3.
Variants§
TopDown
Rank 0 at the top, flow downward (mermaid TD/TB). The default.
LeftRight
Rank 0 at the left, flow rightward (mermaid LR).
BottomTop
Rank 0 at the bottom, flow upward (mermaid BT).
RightLeft
Rank 0 at the right, flow leftward (mermaid RL).
Implementations§
Source§impl Direction
impl Direction
Sourcepub const fn is_vertical(self) -> bool
pub const fn is_vertical(self) -> bool
True when the flow axis is vertical (TD / BT).
Sourcepub const fn is_reversed(self) -> bool
pub const fn is_reversed(self) -> bool
True when rank 0 sits at the far end of its axis (BT / RL), i.e. the canonical picture is mirrored along the flow axis.