Skip to content

Rings

A flywheel, a PDCA loop or a release cycle is a cycle, and the loop is the point of the diagram. Laid out in layers, a cycle becomes a column with one long edge running back to the top. Merlion draws two kinds of cycle as a ring instead, from plain Mermaid with no new syntax:

  • a subgraph whose nodes, 3 to 16 of them, are joined by exactly one directed cycle;
  • a group of 3 to 16 connected nodes outside every subgraph that is exactly one cycle.
A ring outside any subgraph Flowchart, left to right. 3 nodes, 3 edges. Build → Measure Measure → Learn Learn → Build Build Measure Learn
A ring outside any subgraph
Diagram source
flowchart LR
accTitle: A ring outside any subgraph
build[Build] --> measure[Measure] --> learn[Learn] --> build

The members sit on a circle in cycle order, starting at the top with the first one declared, and each cycle edge follows the circle. Edge labels sit on their arcs. Shapes, roles, classDef colours and title + detail labels work as they do anywhere else in a flowchart.

A labelled ring in a subgraph, with edges in and out Flowchart, top to bottom. 6 nodes, 6 edges. Customer request → Plan PDCA: Plan → Do [ship] PDCA: Do → Check [observe] PDCA: Check → Act [decide] PDCA: Act → Plan [repeat]; → Quarterly report PDCA ship observe decide repeat Plan Do Check Act Customer request Quarterly report
A labelled ring in a subgraph, with edges in and out
Diagram source
flowchart TB
accTitle: A labelled ring in a subgraph, with edges in and out
customer[Customer request] --> plan
subgraph cycle[PDCA]
plan[Plan] -->|ship| do[Do] -->|observe| check[Check] -->|decide| act[Act] -->|repeat| plan
end
act --> report[Quarterly report]

Everything outside a ring is laid out by the layered engine, with the ring taking the room of one large node. The ring is then turned, and mirrored where that helps, so the members with links out face the nodes they link to. A link runs straight between the two nodes when it crosses nothing; otherwise it follows the engine’s route to the ring and goes round the ring’s edge to its member, never through the middle. Two linked flywheels face each other:

Two flywheels sharing a catalog Flowchart, top to bottom. 13 nodes, 15 edges. Supply flywheel: 1 Recruit sellers sellers onboarded → 2 More listings listings per seller Supply flywheel: 2 More listings listings per seller → 3 Wider selection categories covered Supply flywheel: 3 Wider selection categories covered → 4 Lower prices median price change Supply flywheel: 4 Lower prices median price change → 5 Faster delivery days to doorstep Supply flywheel: 5 Faster delivery days to doorstep → 6 Seller revenue revenue per seller; → Shared catalog listings and reviews [listings] Supply flywheel: 6 Seller revenue revenue per seller → 1 Recruit sellers sellers onboarded Demand flywheel: 1 New buyers signups by source → 2 First order converted in 7 days Demand flywheel: 2 First order converted in 7 days → 3 Repeat orders orders per buyer Demand flywheel: 3 Repeat orders orders per buyer → 4 Reviews reviews per order Demand flywheel: 4 Reviews reviews per order → 5 Referrals invites accepted Demand flywheel: 5 Referrals invites accepted → 6 Retention active after 90 days; → 4 Lower prices median price change [price feedback] Demand flywheel: 6 Retention active after 90 days → 1 New buyers signups by source Shared catalog listings and reviews → 1 New buyers signups by source [search results] Supply flywheel 1 Recruit sellerssellers onboarded 2 More listingslistings per seller 3 Wider selectioncategories covered 4 Lower pricesmedian price change 5 Faster deliverydays to doorstep 6 Seller revenuerevenue per seller Demand flywheel 1 New buyerssignups by source 2 First orderconverted in 7 days 3 Repeat ordersorders per buyer 4 Reviewsreviews per order 5 Referralsinvites accepted 6 Retentionactive after 90 days listings search results price feedback Shared cataloglistings and reviews
Two flywheels sharing a catalog
Diagram source
flowchart LR
accTitle: Two flywheels sharing a catalog
subgraph supply["Supply flywheel"]
s1["**1 Recruit sellers**<br/>sellers onboarded"] --> s2["**2 More listings**<br/>listings per seller"]
s2 --> s3["**3 Wider selection**<br/>categories covered"] --> s4["**4 Lower prices**<br/>median price change"]
s4 --> s5["**5 Faster delivery**<br/>days to doorstep"] --> s6["**6 Seller revenue**<br/>revenue per seller"] --> s1
end
subgraph demand["Demand flywheel"]
d1["**1 New buyers**<br/>signups by source"] --> d2["**2 First order**<br/>converted in 7 days"]
d2 --> d3["**3 Repeat orders**<br/>orders per buyer"] --> d4["**4 Reviews**<br/>reviews per order"]
d4 --> d5["**5 Referrals**<br/>invites accepted"] --> d6["**6 Retention**<br/>active after 90 days"] --> d1
end
catalog[("**Shared catalog**<br/>listings and reviews")]
s5 -->|listings| catalog
catalog -->|search results| d1
d5 -.->|price feedback| s4

Two rings side by side need the width for both plus the edge labels between them. In a narrower container, automatic orientation stacks them instead; pass a wider width, or shorten the labels on the links, to keep them side by side.

A cycle stays in layers when any of these holds:

  • a chord, a self-loop or a second edge between two members, so the edges are no longer one cycle;
  • an invisible ~~~ edge among the members;
  • a subgraph nested inside the ring’s subgraph;
  • fewer than 3 or more than 16 members;
  • a group outside every subgraph that touches a subgraph node.

State diagrams always lay their cycles out in layers.

A direction statement inside a subgraph keeps that subgraph in layers:

flowchart LR
subgraph retry[Retry loop]
direction TB
send[Send] --> wait[Wait] --> check{Delivered?} --> send
end

To turn rings off for a whole diagram, set merlion.rings in front matter or an %%{init}%% directive. Mermaid ignores the key, so the source still renders there:

---
config:
merlion:
rings: false
---
flowchart LR
build[Build] --> measure[Measure] --> learn[Learn] --> build

The exact rules (slot angles, radius, clearances, routing tests and fuel) are in layout.md § Rings.