Skip to content
Ferrigura

Ferrigura / Diagrams

Diagram types

ferrigura renders all 33 diagram types of Mermaid 12.2.0. Each type has a page here that describes how its text is parsed, how it is laid out and drawn, which settings it reads, and where it differs from Mermaid. The table below is the index: every type with the keywords that start it, its page, the layout engine that places its parts, and how far it is checked against the reference (0014).

A diagram type is a module inside the crates, not a crate of its own (ARCHITECTURE.md). Flowchart, class, state, ER and requirement share the unified renderer, and swimlanes, agentflow, use case, mindmap and block build on it; the other types have a renderer of their own. The layout engines are those of 0012. What porting taught across several types is in LEARNINGS.md.

Coverage

TypeKeywordsLayoutSpecsDifferential parseLayout dataGeometry
flowchartflowchart, flowchart-elk, graphELK Layered1060 / 1091 (31 ignored)783 inputs, no difference781 inputs, no difference298 of 298 within tolerance (54 not compared)
swimlanesswimlane-betaSwimlane layout (ferrigura-swimlane)33 / 33216 inputs, no difference—38 of 38 within tolerance (9 not compared)
classclassDiagram, classDiagram-v2ELK Layered243 / 250 (7 ignored)329 inputs, no difference328 inputs, no difference180 of 180 within tolerance (67 not compared)
statestateDiagram, stateDiagram-v2ELK Layered120 / 124 (4 ignored)390 inputs, no difference389 inputs, no difference140 of 140 within tolerance (5 not compared)
ererDiagramELK Layered657 / 660 (3 ignored)752 inputs, no difference751 inputs, no difference159 of 159 within tolerance (47 not compared)
requirementrequirementDiagramELK Layered53 / 53266 inputs, no difference266 inputs, no difference146 of 146 within tolerance (26 not compared)
blockblock, block-betaOwn, on the unified shapes40 / 41 (1 ignored)265 inputs, no difference—58 of 58 within tolerance
mindmapmindmapcose-bilkent; tidy tree28 / 28255 inputs, no difference—57 of 57 within tolerance
sequencesequenceDiagramOwn212 / 216 (4 ignored)447 inputs, no difference—193 of 193 within tolerance
ganttganttOwn, on d3's time scale80 / 82 (2 ignored)125 inputs, no difference—52 of 52 within tolerance
timelinetimelineOwn42 / 4283 inputs, no difference—30 of 30 within tolerance
journeyjourneyOwn16 / 16131 inputs, no difference—18 of 18 within tolerance
gitgraphgitGraphOwn98 / 107 (9 ignored)299 inputs, no difference—135 of 135 within tolerance
piepieOwn, on d3's arcs27 / 29 (2 ignored)107 inputs, no difference—24 of 24 within tolerance
infoinfoOwn6 / 618 inputs, no difference—2 of 2 within tolerance
xychartxychart, xychart-betaOwn65 / 65207 inputs, no difference—47 of 47 within tolerance
quadrantquadrantChartOwn28 / 29 (1 ignored)340 inputs, no difference—30 of 30 within tolerance
sankeysankey, sankey-betaOwn, on d3-sankey55 / 55178 inputs, no difference—48 of 48 within tolerance (3 not compared)
packetpacket, packet-betaOwn59 / 59115 inputs, no difference—29 of 29 within tolerance
treemaptreemap, treemap-betaOwn, on d3-hierarchy's treemap45 / 45211 inputs, no difference—114 of 114 within tolerance
radarradar-betaOwn84 / 84208 inputs, no difference—26 of 26 within tolerance
kanbankanbanOwn64 / 64356 inputs, no difference355 inputs, no difference30 of 30 within tolerance
architecturearchitecture, architecture-betafcose97 / 102 (5 ignored)281 inputs, no difference—46 of 46 within tolerance
c4C4Context, C4Container, C4Component, C4Dynamic, C4DeploymentOwn171 / 171177 inputs, no difference—32 of 32 within tolerance
ishikawaishikawa, ishikawa-betaOwn40 / 4081 inputs, no difference—28 of 28 within tolerance (1 not compared)
eventmodelingeventmodelingOwn41 / 42 (1 ignored)220 inputs, no difference—39 of 39 within tolerance
cynefincynefin-betaOwn86 / 86125 inputs, no difference—23 of 23 within tolerance
wardleywardley-betaOwn77 / 77222 inputs, no difference—22 of 22 within tolerance
vennvenn-betaVenn layout (ferrigura-venn)63 / 63277 inputs, no difference—32 of 32 within tolerance (3 not compared)
tree-viewtreeView-betaOwn220 / 221 (1 ignored)176 inputs, no difference—32 of 32 within tolerance
railroadrailroad-beta, railroad-ebnf-beta, railroad-abnf-beta, railroad-peg-betaOwn149 / 149418 inputs, no difference—42 of 42 within tolerance
agentflowagentflow-betaELK Layered232 / 296 (64 ignored)287 inputs, no difference—51 of 51 within tolerance (2 not compared)
usecaseusecase-betaELK Layered244 / 247 (3 ignored)291 inputs, no difference—31 of 31 within tolerance (1 not compared)

Reading the coverage

Each column is one of the checks of 0015, run against the reference. Specs counts the tests ported from Mermaid's own spec files for the type, passing over all, with the ignored ones named: an ignored spec carries #[ignore = "port: <reason>"], for example because it tests what ferrigura leaves out on purpose (0005). Differential parse is the number of inputs, the fixtures, the probes, the string literals of Mermaid's specs, the diagrams of its documentation and the cases of the harness, whose canonical models agree with the reference's, or which both sides reject; an input that differs only through a named exception is counted as agreeing, and the run fails on any other difference (0014). Layout data compares getData() field by field for the types on the unified renderer that have such a run. Geometry is the number of fixtures and probes, drawn by both sides in Chromium, whose boxes, positions, edge points and texts agree within 0.05 px, out of those both sides draw; "not compared" are the ones a rule of the harness leaves out, each with its reason: look: handDrawn, scripts that no bundled face covers, and inputs on which the reference itself fails. A dash means the type has no run of that kind, because it does not use the unified renderer; the layout engines have corpora of their own (LEARNINGS.md). For flowchart, the geometry run also checks that the graph given to ELK equals the reference's in all 298 fixtures. The cells of Specs, Differential parse, Layout data and Geometry are rewritten by pnpm -C tools/port port:status, which counts the specs with cargo test and reads the summaries of the last differential and geometry runs; a cell whose summary the checkout lacks keeps what it says. CI runs all the checks on every change.