Skip to content

Writing Diagrams

Vivek Sarin edited this page Nov 20, 2026 · 2 revisions

Writing diagrams

FlowMotion reads a subset of the text styles used by Mermaid and PlantUML. It is not a full implementation of either language. Each diagram starts with a header line that tells FlowMotion the diagram type. For the list of types, see Diagram types.

For finer control over layout and the order of events, use the YAML format instead.

For complex diagrams generated by people or coding tools, start with the authoring reference and cookbook. Use storyboard YAML for scene presentation, or event YAML for dependency scheduling. Do not mix YAML fields into a text DSL definition.

Start a diagram

Place the text inside a flowmotion code block in your note:

```flowmotion
flowchart TB
  A --> B
```

Use one of these header lines:

Header Diagram type
flowchart LR, flowchart TB, or graph TD Flowchart
sequenceDiagram Sequence diagram
@startuml PlantUML diagrams, such as activity and component diagrams

Example

flowchart TB
  user((User)) -->|request| gw{Gateway}
  subgraph platform [Platform]
    gw -->|ok| api[API Service]
    api --> db[(Orders DB)]
  end
  classDef hot fill:#fdeaea,stroke:#d13b3b
  class api hot
  %% @duration db 700

When you play this diagram, each arrow shows a moving packet. Each node acts as a processing step. A node with several inputs waits until all of them arrive.

Shapes

Shape Syntax
Box [box]
Rounded (round)
Pill ([pill])
Circle ((circle))
Diamond (decision) {diamond}
Hexagon {{hexagon}}
Subroutine [[subroutine]]
Database (cylinder) [(cylinder)]
Slanted [/slant/]

Lines and arrows

Syntax Meaning
--> Arrow
--- Line, without an arrow
-.-> Dotted arrow
==> Thick arrow
<--> Arrow in both directions
--x Line ending in a cross
--o Line ending in a circle

Labels on arrows

Use any of these forms:

  • A -->|text| B
  • A -- text --> B
  • A --> B : text

Shortcuts

  • A & B --> C connects two nodes to one.
  • A --> B --> C chains two arrows in one line.

Groups

Group related nodes with subgraph id [Title]. End each group with end. Groups can be nested inside other groups.

Colours and styles

  • classDef name fill:#hex,stroke:#hex defines a style.
  • class node name applies a style to a node.
  • node:::name applies a style to a single node inside its definition.
  • style and linkStyle set the look of one node or one arrow.

Colours are written as hexadecimal codes, such as #2f6fed.

Links

In a flowchart, you can make a node open a link when it is clicked, and show a tooltip when the mouse rests on it:

click A href "https://example.com" "Tooltip text"

The link must start with http://, https://, or obsidian://. FlowMotion ignores links of any other kind.

Timing and playback comments

Lines that begin with %% are comments. Other tools ignore them, and FlowMotion uses them to control playback. For example, %% @duration db 700 makes the node db take 700 milliseconds. See Playback and timing for the full list.

Clone this wiki locally