Test fixtures
Every file in crates/merlion-render/tests/fixtures/flowcharts/, the inputs of the core’s snapshot tests. Fixtures with deliberate mistakes (llm-repairs, llm-typographic, llm-unquoted-labels) render through the parser’s repairs.
Ci pipeline
Section titled “Ci pipeline”Diagram source
flowchart LR push([git push]) --> lint[Lint] push --> test[Unit tests] push --> build[Build] lint & test & build --> gate{All green?} gate -->|yes| deploy_staging[Deploy to staging] gate -->|no| notify[Notify author] deploy_staging --> e2e[E2E suite] e2e --> approve{Manual approval} approve -->|approved| prod[(Production)] approve -. rejected .-> notifyData pipeline
Section titled “Data pipeline”Diagram source
flowchart LR subgraph ingest [Ingest] src1[Web events] --> q[[Queue]] src2[Mobile events] --> q end subgraph process [Process] q --> parse[Parse] --> enrich[Enrich] --> dedupe[Deduplicate] end subgraph store [Store] lake[(Data lake)] wh[(Warehouse)] end dedupe --> lake lake --> etl[Nightly ETL] --> wh wh --> bi[/BI dashboards/]Decision tree
Section titled “Decision tree”Diagram source
flowchart TD start((Start)) --> q1{Is it raining?} q1 -->|Yes| q2{Do you have an umbrella?} q1 -->|No| walk[Walk] q2 -->|Yes| walk q2 -->|No| q3{Is it far?} q3 -->|Yes| bus[Take the bus] q3 -->|No| run[Run] walk & bus & run --> done(((Arrive)))Edge gallery
Section titled “Edge gallery”Diagram source
flowchart LR a1 --> b1 a2 --- b2 a3 -.-> b3 a4 ==> b4 a5 --o b5 a6 --x b6 a7 <--> b7 a8 o--o b8 a9 x--x b9 a10 ~~~ b10 a11 ----> b11 a12 -- label --> b12 a13 == thick label ==> b13 a14 -. dotted label .-> b14Git branching
Section titled “Git branching”Diagram source
flowchart LR main[main] --> feat[feature/login] main --> fix[hotfix/crash] feat --> pr1{{PR review}} fix --> pr2{{PR review}} pr1 -->|squash| main pr2 -->|merge| main main --> tag>v1.2.0]Github actions matrix
Section titled “Github actions matrix”Diagram source
flowchart TB trigger[pull_request] --> setup[Checkout and cache] subgraph matrix [Test matrix] direction LR linux[ubuntu-latest] mac[macos-latest] win[windows-latest] end setup --> linux & mac & win linux & mac & win --> report[Upload coverage] report --> status{{Required checks}} status ==> merge([Merge])Llm repairs
Section titled “Llm repairs”Diagram source
```mermaidflowchart TD A[“User Request”] --> B{Valid input: yes?} B -->|Yes| C[Process (async)] B -->|No| D[Return error] C --> end subgraph Workers C --> E[(Queue)] E --> F```Llm typographic
Section titled “Llm typographic”Diagram source
flowchart TD start[“Begin”] --> check{“Ready?”} check -->|“Yes”| go[‘Go’] check -->|“No”| wait[Wait] wait --> checkLlm unquoted labels
Section titled “Llm unquoted labels”Diagram source
graph LR Client[Client (browser)] --> API[API: v2] API --> Cache{Cache hit?} Cache -->|yes| Resp[Return cached] Cache -->|no| DB[(Database [primary])] DB --> RespLogin flow
Section titled “Login flow”Diagram source
flowchart TD accTitle: Login flow accDescr: How a user signs in with a password or a magic link. open[Open app] --> signed{Session valid?} signed -->|yes| home[Home] signed -->|no| choose{Method} choose -->|password| pw[Enter password] choose -->|magic link| email[Enter email] email --> inbox[Check inbox] --> link[Click link] pw --> verify{Correct?} verify -->|no| pw verify -->|yes| home link --> home click home href "https://example.com/home" _blankMarkdown labels
Section titled “Markdown labels”Diagram source
flowchart LR a["`**Bold** start`"] --> b["`Line one line two`"] b --> c["Entity #quot;quoted#quot; and #35;hash"] c --> d["Break<br/>here"]Microservices
Section titled “Microservices”Diagram source
flowchart LR user((User)) --> cdn[CDN] cdn --> gw[API gateway] subgraph edge [Edge] cdn gw end subgraph services [Services] direction TB auth[Auth service] orders[Order service] payments[Payment service] inventory[Inventory service] end subgraph data [Data] pg[(PostgreSQL)] redis[(Redis)] kafka[[Kafka]] end gw --> auth & orders orders --> payments orders --> inventory orders --> kafka payments --> pg inventory --> pg auth --> redis kafka -.-> inventoryMl training
Section titled “Ml training”Diagram source
flowchart TB subgraph prep [Data preparation] raw[(Raw data)] --> clean[Clean] --> split{Split} split --> train_set[Train set] split --> val_set[Validation set] end subgraph train [Training] train_set --> model[Model] --> loss[Loss] --> opt[Optimizer] opt -. update weights .-> model end val_set --> eval[Evaluate] model --> eval eval --> better{Better than baseline?} better -->|yes| registry[(Model registry)] better -->|no| tune[Tune hyperparameters] --> modelNested architecture
Section titled “Nested architecture”Diagram source
flowchart TB subgraph cloud [Cloud account] subgraph vpc [VPC] subgraph public [Public subnet] alb[Load balancer] nat[NAT gateway] end subgraph private [Private subnet] subgraph cluster [Kubernetes cluster] api[API pods] worker[Worker pods] end db[(Primary DB)] replica[(Read replica)] end end s3[(Object storage)] end internet((Internet)) --> alb alb --> api api --> db worker --> db db -. replication .-> replica api --> s3 worker --> nat --> internetOncall escalation
Section titled “Oncall escalation”Diagram source
flowchart TD alert[/PagerDuty alert/] --> ack{Acked in 5 min?} ack -->|yes| triage[Triage] ack -->|no| secondary[Page secondary] secondary --> ack2{Acked in 10 min?} ack2 -->|no| manager[Page manager] ack2 -->|yes| triage triage --> sev{Severity} sev -->|SEV1| war[Open war room] sev -->|SEV2| ticket[File ticket] sev -->|SEV3| backlog[Backlog] war --> postmortem[[Postmortem]]Release train
Section titled “Release train”Diagram source
---title: Release trainconfig: flowchart: curve: stepAfter---flowchart LR freeze[Code freeze] --> rc1[RC 1] rc1 --> qa{QA pass?} qa -->|no| fix[Fix blockers] --> rc1 qa -->|yes| tag[Tag release] tag --> notes[/Release notes/] tag --> publish[[Publish packages]] publish --> announce>Announce]Semicolons and comments
Section titled “Semicolons and comments”Diagram source
%% Compact style used in many READMEsgraph TD; A-->B; A-->C; B-->D; %% inline comment C-->D;Shapes gallery
Section titled “Shapes gallery”Diagram source
flowchart LR r[Rectangle] --> ro(Rounded) --> st([Stadium]) --> sub[[Subroutine]] sub --> cy[(Cylinder)] --> ci((Circle)) --> dc(((Double))) dc --> as>Asymmetric] --> rh{Rhombus} --> hx{{Hexagon}} hx --> pl[/Lean right/] --> pa[\Lean left\] --> tr[/Trapezoid\] --> ta[\Inverted/] ta --> n1@{ shape: doc, label: "Document" } n1 --> n2@{ shape: cyl, label: "Database" }State machine like
Section titled “State machine like”Diagram source
flowchart LR idle((Idle)) -->|start| running[Running] running -->|pause| paused[Paused] paused -->|resume| running running -->|finish| done(((Done))) running -->|error| failed[Failed] failed -->|retry| running paused -->|cancel| cancelled[Cancelled]Styled classes
Section titled “Styled classes”Diagram source
flowchart TD classDef ok fill:#e6ffed,stroke:#22863a,stroke-width:2px classDef warn fill:#fff5b1,stroke:#b08800 classDef bad fill:#ffeef0,stroke:#cb2431,color:#86181d,font-weight:bold a[Healthy]:::ok --> b[Degraded]:::warn b --> c[Down]:::bad c --> d[Recovered] class d ok style a stroke-dasharray: 5 5 linkStyle default stroke:#6a737d linkStyle 1 stroke:#cb2431,stroke-width:3pxTheme directive
Section titled “Theme directive”Diagram source
%%{init: {'theme': 'forest', 'flowchart': {'curve': 'basis'}}}%%flowchart LR a[Draft] --> b[Review] --> c[Publish] b -->|changes requested| aTroubleshooting
Section titled “Troubleshooting”Diagram source
graph TD A[Service is down] --> B{Can you ping the host?} B -- No --> C[Check network] B -- Yes --> D{Is the process running?} D -- No --> E[Restart service] D -- Yes --> F{Errors in logs?} F -- Yes --> G[Open incident] F -- No --> H[Check load balancer] C --> I[Escalate to infra] E --> J{Recovered?} J -- Yes --> K([Close ticket]) J -- No --> GTwo tier labels
Section titled “Two tier labels”Diagram source
flowchart LR cron["**cron trigger**<br/>every minute<br/>idempotent run key"] subgraph wf["durable workflow"] lease["**lease**<br/>one run per window<br/>90 s TTL"] due["**due set**<br/>scan schedules<br/>next_at ≤ now"] budget["**budget**<br/>250 push slots<br/>per-tenant caps"] enqueue["**enqueue**<br/>batches of 100<br/>dedupe by job id"] wait["**wait**<br/>sleep until acked<br/>or 30 s timeout"] finalize["**finalize**<br/>record outcomes<br/>advance next_at"] release["**release**<br/>drop the lease"] lease --> due --> budget --> enqueue --> wait --> finalize --> release end q[("**push queue**<br/>at-least-once<br/>visibility 60 s")] subgraph consumers["consumers"] c1["**sender A**<br/>APNs"] c2["**sender B**<br/>FCM"] c3["**sender C**<br/>web push"] end dlq[("**dead letters**<br/>after 5 attempts<br/>kept 14 days")] cron --> lease enqueue -->|batch| q q --> c1 & c2 & c3 c1 & c2 & c3 -.->|ack| wait q -->|max retries| dlq