Blog
About

© 2026 Uzair Tariq

← Back to blog

Mermaid Test Post 1,2,3

August 29, 2026

Mermaid stress test 1 — flow and structure

Flowcharts and the layout-heavy diagrams. This part is where wide drawings, deep nesting and long labels get tested: if the column overflows or a node's text spills its box, it shows up here first.

Flowchart — every direction

Left to right.

flowchart LR
  A[Cron fires] --> B{Credentials present?}
  B -->|yes| C[Fetch upstream]
  B -->|no| D[Report fetch_failed]
  C --> E[(Firestore)]
  E --> F[ISR page]

Drawing

Top to bottom.

flowchart TB
  Start([Request]) --> Auth{Session cookie?}
  Auth -->|absent| Login[/Login page/]
  Auth -->|present| Verify[Verify with admin SDK]
  Verify --> Ok[Panel]
  Verify --> Stale[Fall through to the form]

Drawing

Right to left, and bottom to top.

flowchart RL
  Reader --> Page --> Cache --> Origin

Drawing
flowchart BT
  Storage --> Document --> Card --> Feed

Drawing

Flowchart — every node shape

flowchart LR
  rect[Rectangle]
  round(Rounded)
  stadium([Stadium])
  subroutine[[Subroutine]]
  cylinder[(Database)]
  circle((Circle))
  asymmetric>Asymmetric]
  rhombus{Rhombus}
  hexagon{{Hexagon}}
  parallelogram[/Parallelogram/]
  parallelogram_alt[\Parallelogram alt\]
  trapezoid[/Trapezoid\]
  trapezoid_alt[\Trapezoid alt/]
  doublecircle(((Double circle)))
  rect --> round --> stadium --> subroutine
  cylinder --> circle --> asymmetric --> rhombus
  hexagon --> parallelogram --> parallelogram_alt --> trapezoid
  trapezoid_alt --> doublecircle

Drawing

Flowchart — every link style

flowchart LR
  A --> B
  B --- C
  C -.-> D
  D ==> E
  E -- text --- F
  F -. dotted text .-> G
  G == thick text ==> H
  H --o I
  I --x J
  J <--> K

Drawing

Flowchart — subgraphs, nested

flowchart TB
  subgraph site[The site]
    direction LR
    subgraph public[Public routes]
      home[Home] --> blog[Blog index] --> post[A post]
    end
    subgraph admin[Admin]
      direction TB
      login[Login] --> panel[Panel]
    end
  end
  subgraph jobs[Cron jobs]
    activity[activity sync]
    screen[screen sync]
  end
  jobs --> store[(Firestore)]
  store --> site
  post -.reads.-> store

Drawing

Flowchart — styling directives

Class definitions, per-node style, and link styling all in one drawing.

flowchart LR
  classDef hot fill:#ff8a65,stroke:#bf360c,color:#111111
  classDef cool fill:#4dd0e1,stroke:#00697c,color:#111111
  A[Hot path]:::hot --> B[Cool path]:::cool
  B --> C[Plain]
  style C fill:#c5e1a5,stroke:#33691e,color:#111111
  linkStyle 0 stroke:#ff8a65,stroke-width:3px

Drawing

Flowchart — a wide one

Fifty nodes across, to see what horizontal scrolling does inside a post.

flowchart LR
  n1 --> n2 --> n3 --> n4 --> n5 --> n6 --> n7 --> n8 --> n9 --> n10
  n10 --> n11 --> n12 --> n13 --> n14 --> n15 --> n16 --> n17 --> n18
  n18 --> n19 --> n20 --> n21 --> n22 --> n23 --> n24 --> n25 --> n26
  n26 --> n27 --> n28 --> n29 --> n30 --> n31 --> n32 --> n33 --> n34
  n34 --> n35 --> n36 --> n37 --> n38 --> n39 --> n40 --> n41 --> n42
  n42 --> n43 --> n44 --> n45 --> n46 --> n47 --> n48 --> n49 --> n50

Drawing

Flowchart — a dense one

Twelve nodes, everything connected to everything nearby. Layout engine under load.

flowchart TB
  a1 --> b1 & b2 & b3
  b1 --> c1 & c2
  b2 --> c2 & c3
  b3 --> c3 & c4
  c1 --> d1
  c2 --> d1 & d2
  c3 --> d2 & d3
  c4 --> d3
  d1 & d2 & d3 --> e1

Drawing

Legacy graph keyword

Still supported, still parsed by the same renderer.

graph LR
  old[graph keyword] --> new[flowchart keyword]

Drawing

Block diagram

block-beta
  columns 3
  Reader:3
  Edge Cache Origin
  space:3
  Firestore:3
Drawing

Architecture diagram

architecture-beta
  group site(cloud)[Portfolio]
  group jobs(cloud)[Scheduled work]

  service web(server)[Next js] in site
  service db(database)[Firestore] in site
  service files(disk)[Storage] in site
  service cron(server)[cron job org] in jobs
  service runner(server)[GitHub Actions] in jobs

  web:R -- L:db
  web:B -- T:files
  cron:R -- L:runner

Drawing

Swimlane diagram

swimlane-beta
  subgraph Reader
    r1[Opens a post]
  end
  subgraph Site
    s1[Serves cached HTML]
    s2[Revalidates]
  end
  subgraph Cron
    c1[Syncs upstream]
  end
  r1 --> s1
  c1 --> s2

Drawing

Mermaid stress test 2 — behaviour over time

Sequence, state and class diagrams. These are the ones with the most chrome — notes, activation bars, loop frames, dividers — so they are where a theme that only got the node fills right starts to show gaps.

Sequence — the full vocabulary

Autonumber, activation, every message arrow, and a note on each side.

sequenceDiagram
  autonumber
  actor Reader
  participant Site
  participant Store as Firestore
  participant Trakt

  Reader->>Site: GET /screen
  activate Site
  Site->>Store: read screen/data
  Store-->>Site: document
  deactivate Site
  Site-->>Reader: cached HTML

  Note right of Trakt: the cron asks, never the page
  Trakt-)Site: scrobble webhook
  Site--)Trakt: ack
  Site-xStore: failed write
  Note over Reader,Site: a reader never waits on upstream

Drawing

Sequence — control flow blocks

sequenceDiagram
  participant Cron
  participant API
  participant Store

  Cron->>API: sync
  alt credentials present
    API->>Store: upsert cards
  else credentials missing
    API-->>Cron: fetch_failed
  end

  opt heatmaps enabled
    API->>Store: union days
  end

  loop every page until the watermark
    API->>API: walk history
  end

  par fetch GitHub
    API->>API: events
  and fetch Trakt
    API->>API: history
  end

  critical hold the watermark
    API->>Store: stamp lastSyncedAt
  option write fails
    API-->>Cron: report incomplete
  end

  break nothing new
    API-->>Cron: no-op
  end

Drawing

Sequence — boxes and a long conversation

sequenceDiagram
  box Reader side
    actor Person
    participant Browser
  end
  box Server side
    participant Route
    participant Admin as Admin SDK
  end

  Person->>Browser: click Sign in
  Browser->>Route: redirect to Google
  Route-->>Browser: 302
  Browser->>Route: return leg with code
  Route->>Admin: verify id token
  Admin-->>Route: claims
  Route-->>Browser: session cookie and marker
  Browser-->>Person: panel

Drawing

State — v2, with everything

stateDiagram-v2
  [*] --> Planning
  Planning --> Active: work starts
  Active --> Halted: blocked
  Halted --> Active: unblocked
  Active --> Done: last milestone ships
  Done --> [*]

  state Active {
    [*] --> Building
    Building --> Reviewing
    Reviewing --> Building: changes requested
    Reviewing --> [*]: approved
  }

  note right of Halted
    A halted project keeps its
    roadmap; nothing is deleted.
  end note

Drawing

State — forks, joins and choices

stateDiagram-v2
  state fork_state <<fork>>
  state join_state <<join>>
  state choice_state <<choice>>

  [*] --> fork_state
  fork_state --> FetchGitHub
  fork_state --> FetchTrakt
  FetchGitHub --> join_state
  FetchTrakt --> join_state
  join_state --> choice_state
  choice_state --> Stamp: both complete
  choice_state --> Hold: either failed
  Stamp --> [*]
  Hold --> [*]

Drawing

State — directions and concurrency

stateDiagram-v2
  direction LR
  [*] --> Idle
  Idle --> Syncing
  state Syncing {
    direction TB
    Reading --> Writing
    --
    Staging --> Committing
  }
  Syncing --> Idle

Drawing

Legacy state syntax

stateDiagram
  [*] --> Draft
  Draft --> Published
  Published --> [*]

Drawing

Class — the full vocabulary

Generics, visibility markers, static and abstract members, annotations.

classDiagram
  class Project {
    +String slug
    +String title
    +String status
    -Milestone[] roadmap
    #String repo
    +ship(String id) Milestone
    +progress()* float
    +count()$ int
  }

  class Milestone {
    <<interface>>
    +String id
    +String state
    +Date shippedAt
  }

  class Series~T~ {
    +String id
    +T[] entries
    +adopt(T entry) void
  }

  class Archived {
    <<abstract>>
  }

  Project "1" o-- "0..*" Milestone : roadmap
  Archived <|-- Project
  Project ..> Milestone : creates
  note for Project "Ordering is band, then updatedAt, then title."

Drawing

Class — namespaces and relation types

classDiagram
  namespace storage {
    class Document
    class Collection
  }
  namespace domain {
    class Card
    class Feed
  }
  Collection "1" *-- "many" Document
  Document <|.. Card
  Card o-- Feed
  Feed <--> Document : reads

Drawing

Mermaid stress test 3 — data and charts

Everything that draws a quantity. This part is the real test of the categorical ramp: eight tokens, cycled, against charts that ask for more series than that.

Pie — five slices

pie showData
  title Where the time goes
  "Blog" : 35
  "Projects" : 25
  "Anime" : 20
  "Games" : 12
  "Books" : 8

Drawing

Pie — twelve slices

Past the eighth the ramp wraps, so slice 9 repeats slice 1. Worth looking at whether that reads as a mistake.

pie
  title Twelve ways to spend an evening
  "Reading" : 12
  "Writing" : 11
  "Anime" : 10
  "Films" : 9
  "Series" : 8
  "Games" : 7
  "Code" : 6
  "Music" : 5
  "Walking" : 4
  "Cooking" : 3
  "Admin" : 2
  "Sleep" : 1

Drawing

Pie — one slice, and a lopsided one

pie
  title Everything
  "All of it" : 100

Drawing
pie showData
  title A rounding test
  "Dominant" : 997
  "Sliver" : 2
  "Speck" : 1

Drawing

XY chart — bar and line together

xychart-beta
  title "Posts per month"
  x-axis [jan, feb, mar, apr, may, jun, jul, aug]
  y-axis "Count" 0 --> 12
  bar [3, 6, 4, 8, 5, 9, 2, 7]
  line [3, 6, 4, 8, 5, 9, 2, 7]

Drawing

XY chart — a wide domain

xychart-beta
  title "Reads by page"
  x-axis [home, blog, projects, anime, music, steam, screen, books, about]
  y-axis "Thousands" 0 --> 40
  bar [38, 31, 22, 18, 15, 12, 9, 6, 4]

Drawing
xychart-beta
  title "Twenty days"
  x-axis "Day" 1 --> 20
  y-axis "Events" 0 --> 50
  line [2, 8, 14, 9, 22, 31, 18, 27, 40, 12, 6, 19, 33, 44, 21, 15, 7, 29, 36, 11]

Drawing

Sankey

sankey-beta
Blog,Readers,35
Projects,Readers,25
Anime,Readers,20
Books,Readers,10
Readers,Subscribers,22
Readers,Bounced,68

Drawing

Sankey — many flows

sankey-beta
Search,Landing,120
Social,Landing,80
Direct,Landing,60
Newsletter,Landing,40
Landing,Blog,140
Landing,Projects,90
Landing,Life,70
Blog,Subscribed,40
Projects,Contacted,25
Life,Left,120

Drawing

Radar

radar-beta
  axis speed, safety, cost, reach, polish, effort
  curve now{4, 3, 5, 2, 4, 3}
  curve target{5, 5, 3, 4, 5, 2}
  max 5

Drawing

Radar — a single curve, many axes

radar-beta
  axis a["Correctness"], b["Speed"], c["Cost"], d["Legibility"], e["Coverage"], f["Docs"], g["Tests"], h["Polish"]
  curve current{5, 3, 4, 2, 5, 3, 4, 3}
  max 5

Drawing

Treemap

treemap-beta
"Site"
  "Blog"
    "Posts": 35
    "Books": 12
  "Life"
    "Anime": 20
    "Steam": 15
    "Screen": 10
  "Build"
    "Projects": 25
    "Activity": 8

Drawing

Quadrant

quadrantChart
  title Reach and engagement
  x-axis Low Reach --> High Reach
  y-axis Low Engagement --> High Engagement
  quadrant-1 Expand
  quadrant-2 Promote
  quadrant-3 Re-evaluate
  quadrant-4 Improve
  Anime: [0.3, 0.6]
  Blog: [0.45, 0.23]
  Projects: [0.57, 0.69]
  Books: [0.78, 0.34]
  Music: [0.12, 0.88]
  Steam: [0.9, 0.15]

Drawing

Venn

venn-beta
set A ["Reads the blog"]
set B ["Reads the projects"]
union A,B

Drawing

Venn — three sets

venn-beta
set A ["Anime"]
set B ["Films"]
set C ["Series"]
union A,B
union B,C
union A,C
union A,B,C

Drawing