Testing all planned Mermaid diagram types against Royal Tonal tokens. Architecture diagram (new), flowchart (existing standard), and 2x2 quadrant chart. Each renders via Mermaid JS with custom themeVariables.
The architecture diagram that was previously hand-authored SVG, now as Mermaid flowchart. Uses classDef for three-tier node treatment: owned (royal-4 fill, royal-8 stroke), highlighted (royal-5 fill, royal-9 stroke, 2px), external (transparent fill, royal-7 dashed).
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#1E2346",
"primaryBorderColor": "#3B5BDB",
"primaryTextColor": "#E6E2D9",
"lineColor": "#3B5BDB",
"secondaryColor": "#121428",
"tertiaryColor": "#181B36",
"fontFamily": "Geist, -apple-system, system-ui, sans-serif",
"fontSize": "13px",
"clusterBkg": "transparent",
"clusterBorder": "#252C58",
"edgeLabelBackground": "#121428"
}
}}%%
flowchart TD
browser["Browser\n(React SPA)"]
subgraph worker ["CLOUDFLARE WORKER"]
direction LR
auth["Auth"]
tasks["Tasks"]
reviews["Reviews"]
sms["SMS"]
notify["Notify"]
end
db[("D1\n(SQLite)")]
gateway["Vendor Gateway\nkillswitch → budget → dedup → send"]
cron(["Cron Trigger"])
google["Google OAuth"]
twilio["Twilio"]
haiku["Claude Haiku"]
browser --> worker
cron --> notify
auth & tasks & reviews & sms & notify --> db
sms --> gateway
notify --> gateway
auth -.-> google
gateway -.-> twilio
gateway -.-> haiku
classDef owned fill:#1E2346,stroke:#3B5BDB,stroke-width:1.5px,color:#E6E2D9,rx:8,ry:8
classDef highlighted fill:#252C58,stroke:#4D6DE8,stroke-width:2px,color:#E6E2D9,rx:8,ry:8
classDef external fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9,rx:8,ry:8
classDef trigger fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
class browser,auth,tasks,reviews,sms,notify,db owned
class gateway highlighted
class google,twilio,haiku external
class cron trigger
classDef handles the three-tier node treatment cleanly[(text)]([text])-.->) for external calls\n for sub-labels (same font size)stroke-dasharray on nodes may need escaping in some renderersThe existing standard from portfolio-imagery-standards.md. Simple left-to-right data flow. This is the baseline Mermaid diagram type that was already planned.
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#1E2346",
"primaryBorderColor": "#3B5BDB",
"primaryTextColor": "#E6E2D9",
"lineColor": "#3B5BDB",
"secondaryColor": "#121428",
"tertiaryColor": "#181B36",
"fontFamily": "Geist, -apple-system, system-ui, sans-serif",
"fontSize": "13px",
"edgeLabelBackground": "#121428"
}
}}%%
flowchart LR
A["Browse recipes"] --> B["Pick 3 meals"]
B --> C["Consolidate"]
C --> D{"Optional\ngarnishes?"}
D -->|yes| E["Include"]
D -->|no| F["Skip"]
E --> G["Review trolley"]
F --> G
G --> H["Checkout"]
classDef default fill:#1E2346,stroke:#3B5BDB,stroke-width:1.5px,color:#E6E2D9,rx:8,ry:8
The quadrantChart diagram type for simple 2x2 matrices. Example: prioritisation matrix for Planner V1 features. Limited theming — Mermaid quadrant charts have their own colour variables.
%%{init: {
"theme": "base",
"themeVariables": {
"quadrant1Fill": "#252C58",
"quadrant2Fill": "#1E2346",
"quadrant3Fill": "#181B36",
"quadrant4Fill": "#1E2346",
"quadrant1TextFill": "#D5DCFA",
"quadrant2TextFill": "#A5B4FF",
"quadrant3TextFill": "#A5B4FF",
"quadrant4TextFill": "#A5B4FF",
"quadrantPointFill": "#4D6DE8",
"quadrantPointTextFill": "#E6E2D9",
"quadrantXAxisTextFill": "#A5B4FF",
"quadrantYAxisTextFill": "#A5B4FF",
"quadrantTitleFill": "#D5DCFA",
"quadrantInternalBorderStrokeFill": "#364280",
"quadrantExternalBorderStrokeFill": "#364280",
"fontFamily": "Geist, -apple-system, system-ui, sans-serif",
"fontSize": "13px"
}
}}%%
quadrantChart
title Planner V1 Feature Prioritisation
x-axis Low effort --> High effort
y-axis Low impact --> High impact
quadrant-1 Ship first
quadrant-2 Plan carefully
quadrant-3 Deprioritise
quadrant-4 Quick wins
SMS reminders: [0.7, 0.9]
Weekly review: [0.5, 0.8]
Vendor Gateway: [0.8, 0.95]
Google OAuth: [0.6, 0.7]
Budget caps: [0.3, 0.85]
Task CRUD: [0.2, 0.6]
Dark mode: [0.15, 0.2]
Export CSV: [0.4, 0.3]
quadrant* variables, not the standard node variablesThe architecture diagram rendered inside containers at desktop (720px) and mobile (390px) widths, simulating the case study body column. Tests whether Mermaid's auto-layout handles narrow containers gracefully.
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#1E2346",
"primaryBorderColor": "#3B5BDB",
"primaryTextColor": "#E6E2D9",
"lineColor": "#3B5BDB",
"secondaryColor": "#121428",
"tertiaryColor": "#181B36",
"fontFamily": "Geist, -apple-system, system-ui, sans-serif",
"fontSize": "13px",
"clusterBkg": "transparent",
"clusterBorder": "#252C58",
"edgeLabelBackground": "#121428"
}
}}%%
flowchart TD
browser["Browser (React SPA)"]
subgraph worker ["CLOUDFLARE WORKER"]
direction LR
auth["Auth"]
tasks["Tasks"]
reviews["Reviews"]
sms["SMS"]
notify["Notify"]
end
db[("D1 (SQLite)")]
gateway["Vendor Gateway\nkillswitch → budget → dedup → send"]
cron(["Cron Trigger"])
google["Google OAuth"]
twilio["Twilio"]
haiku["Claude Haiku"]
browser --> worker
cron --> notify
auth & tasks & reviews & sms & notify --> db
sms --> gateway
notify --> gateway
auth -.-> google
gateway -.-> twilio
gateway -.-> haiku
classDef owned fill:#1E2346,stroke:#3B5BDB,stroke-width:1.5px,color:#E6E2D9
classDef highlighted fill:#252C58,stroke:#4D6DE8,stroke-width:2px,color:#E6E2D9
classDef external fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
classDef trigger fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
class browser,auth,tasks,reviews,sms,notify,db owned
class gateway highlighted
class google,twilio,haiku external
class cron trigger
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#1E2346",
"primaryBorderColor": "#3B5BDB",
"primaryTextColor": "#E6E2D9",
"lineColor": "#3B5BDB",
"secondaryColor": "#121428",
"tertiaryColor": "#181B36",
"fontFamily": "Geist, -apple-system, system-ui, sans-serif",
"fontSize": "12px",
"clusterBkg": "transparent",
"clusterBorder": "#252C58",
"edgeLabelBackground": "#121428"
}
}}%%
flowchart TD
browser["Browser (React SPA)"]
subgraph worker ["CLOUDFLARE WORKER"]
direction LR
auth["Auth"]
tasks["Tasks"]
reviews["Reviews"]
sms["SMS"]
notify["Notify"]
end
db[("D1 (SQLite)")]
gateway["Vendor Gateway\nkillswitch → budget → dedup → send"]
cron(["Cron Trigger"])
google["Google OAuth"]
twilio["Twilio"]
haiku["Claude Haiku"]
browser --> worker
cron --> notify
auth & tasks & reviews & sms & notify --> db
sms --> gateway
notify --> gateway
auth -.-> google
gateway -.-> twilio
gateway -.-> haiku
classDef owned fill:#1E2346,stroke:#3B5BDB,stroke-width:1.5px,color:#E6E2D9
classDef highlighted fill:#252C58,stroke:#4D6DE8,stroke-width:2px,color:#E6E2D9
classDef external fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
classDef trigger fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
class browser,auth,tasks,reviews,sms,notify,db owned
class gateway highlighted
class google,twilio,haiku external
class cron trigger
The same Planner V1 architecture rendered via Mermaid (auto-layout) and via the hand-authored SVG from the v2 explorer. For evaluating whether the auto-layout is good enough.
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#1E2346",
"primaryBorderColor": "#3B5BDB",
"primaryTextColor": "#E6E2D9",
"lineColor": "#3B5BDB",
"secondaryColor": "#121428",
"tertiaryColor": "#181B36",
"fontFamily": "Geist, -apple-system, system-ui, sans-serif",
"fontSize": "13px",
"clusterBkg": "transparent",
"clusterBorder": "#252C58",
"edgeLabelBackground": "#121428"
}
}}%%
flowchart TD
browser["Browser (React SPA)"]
subgraph worker ["CLOUDFLARE WORKER"]
direction LR
auth["Auth"]
tasks["Tasks"]
reviews["Reviews"]
sms["SMS"]
notify["Notify"]
end
db[("D1 (SQLite)")]
gateway["Vendor Gateway\nkillswitch → budget → dedup → send"]
cron(["Cron Trigger"])
google["Google OAuth"]
twilio["Twilio"]
haiku["Claude Haiku"]
browser --> worker
cron --> notify
auth & tasks & reviews & sms & notify --> db
sms --> gateway
notify --> gateway
auth -.-> google
gateway -.-> twilio
gateway -.-> haiku
classDef owned fill:#1E2346,stroke:#3B5BDB,stroke-width:1.5px,color:#E6E2D9
classDef highlighted fill:#252C58,stroke:#4D6DE8,stroke-width:2px,color:#E6E2D9
classDef external fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
classDef trigger fill:none,stroke:#364280,stroke-width:1.5px,stroke-dasharray:6 4,color:#E6E2D9
class browser,auth,tasks,reviews,sms,notify,db owned
class gateway highlighted
class google,twilio,haiku external
class cron trigger