pub enum NodeShape {
Show 16 variants
Rectangle,
Rounded,
Diamond,
Circle,
Stadium,
Subroutine,
Cylinder,
Hexagon,
Asymmetric,
Parallelogram,
Trapezoid,
ParallelogramBackslash,
TrapezoidInverted,
DoubleCircle,
Bar(BarOrientation),
Note,
}Expand description
The visual shape used to render a node.
Variants§
Rectangle
Square corners: ┌──┐ │ │ └──┘
Rounded
Rounded corners: ╭──╮ │ │ ╰──╯
Diamond
Diamond / decision box rendered with / and \ corners.
Circle
Circle rendered as a rounded box with parenthesis markers.
Stadium
Stadium / pill: rounded box with ( / ) markers at vertical midpoints.
Mermaid syntax: ([label])
Subroutine
Subroutine: rectangle with an extra inner vertical bar on each side.
Mermaid syntax: [[label]]
Cylinder
Cylinder (database): rectangle with arc markers at top and bottom centres.
Mermaid syntax: [(label)]
Hexagon
Hexagon: rectangle with < / > markers at vertical midpoints of left/right edges.
Mermaid syntax: {{label}}
Asymmetric
Asymmetric flag: rectangle with a ⟩ marker at the right vertical midpoint.
Mermaid syntax: >label]
Parallelogram
Parallelogram (lean-right): rectangle with / markers at top-left / bottom-right corners.
Mermaid syntax: [/label/]
Trapezoid
Trapezoid (wider top): rectangle with / at top-left and \ at top-right corners.
Mermaid syntax: [/label\]
ParallelogramBackslash
Parallelogram leaning left (backslash variant): rectangle with \ markers at
top-left and bottom-right corners.
Mermaid syntax: [\label\]
TrapezoidInverted
Inverted trapezoid (wider bottom): rectangle with \ at top-left and / at
top-right corners, indicating a narrower top.
Mermaid syntax: [\label/]
DoubleCircle
Double circle: two concentric rounded boxes, one cell inside the other.
Mermaid syntax: (((label)))
Bar(BarOrientation)
UML synchronisation bar — a single line used as a fork (one incoming, many outgoing) or join (many incoming, one outgoing) point in parallel-flow state machines.
The orientation is perpendicular to the flow direction (so edges fan in/out across its long axis):
- In LR/RL flow:
BarOrientation::Vertical— a column of┃glyphs. - In TD/BT flow:
BarOrientation::Horizontal— a row of━glyphs.
Fork and join are visually identical (only the semantic role
differs); both use this single shape variant. The renderer
skips drawing the node label for Bar(_) shapes — bars are
connection points, not labelled states.
Mermaid syntax: state X <<fork>> / state X <<join>>
(and the [[…]] alternative spellings).
Note
State-diagram note (Mermaid note left|right|over of …).
Synthesised at parse time as a regular Node with this
shape and connected to its anchor via an EdgeStyle::Dotted
/ EdgeEndpoint::None edge. Renders as a small rounded box
— the dotted connector visually distinguishes it from regular
rounded states without needing a separate dashed-border
primitive (a future variant could add one).