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
Scroll sideways for more columns.
| Type | Keywords | Layout | Specs | Differential parse | Layout data | Geometry |
|---|---|---|---|---|---|---|
| flowchart | flowchart, flowchart-elk, graph | ELK Layered | 1060 / 1091 (31 ignored) | 783 inputs, no difference | 781 inputs, no difference | 298 of 298 within tolerance (54 not compared) |
| swimlanes | swimlane-beta | Swimlane layout (ferrigura-swimlane) | 33 / 33 | 216 inputs, no difference | — | 38 of 38 within tolerance (9 not compared) |
| class | classDiagram, classDiagram-v2 | ELK Layered | 243 / 250 (7 ignored) | 329 inputs, no difference | 328 inputs, no difference | 180 of 180 within tolerance (67 not compared) |
| state | stateDiagram, stateDiagram-v2 | ELK Layered | 120 / 124 (4 ignored) | 390 inputs, no difference | 389 inputs, no difference | 140 of 140 within tolerance (5 not compared) |
| er | erDiagram | ELK Layered | 657 / 660 (3 ignored) | 752 inputs, no difference | 751 inputs, no difference | 159 of 159 within tolerance (47 not compared) |
| requirement | requirementDiagram | ELK Layered | 53 / 53 | 266 inputs, no difference | 266 inputs, no difference | 146 of 146 within tolerance (26 not compared) |
| block | block, block-beta | Own, on the unified shapes | 40 / 41 (1 ignored) | 265 inputs, no difference | — | 58 of 58 within tolerance |
| mindmap | mindmap | cose-bilkent; tidy tree | 28 / 28 | 255 inputs, no difference | — | 57 of 57 within tolerance |
| sequence | sequenceDiagram | Own | 212 / 216 (4 ignored) | 447 inputs, no difference | — | 193 of 193 within tolerance |
| gantt | gantt | Own, on d3's time scale | 80 / 82 (2 ignored) | 125 inputs, no difference | — | 52 of 52 within tolerance |
| timeline | timeline | Own | 42 / 42 | 83 inputs, no difference | — | 30 of 30 within tolerance |
| journey | journey | Own | 16 / 16 | 131 inputs, no difference | — | 18 of 18 within tolerance |
| gitgraph | gitGraph | Own | 98 / 107 (9 ignored) | 299 inputs, no difference | — | 135 of 135 within tolerance |
| pie | pie | Own, on d3's arcs | 27 / 29 (2 ignored) | 107 inputs, no difference | — | 24 of 24 within tolerance |
| info | info | Own | 6 / 6 | 18 inputs, no difference | — | 2 of 2 within tolerance |
| xychart | xychart, xychart-beta | Own | 65 / 65 | 207 inputs, no difference | — | 47 of 47 within tolerance |
| quadrant | quadrantChart | Own | 28 / 29 (1 ignored) | 340 inputs, no difference | — | 30 of 30 within tolerance |
| sankey | sankey, sankey-beta | Own, on d3-sankey | 55 / 55 | 178 inputs, no difference | — | 48 of 48 within tolerance (3 not compared) |
| packet | packet, packet-beta | Own | 59 / 59 | 115 inputs, no difference | — | 29 of 29 within tolerance |
| treemap | treemap, treemap-beta | Own, on d3-hierarchy's treemap | 45 / 45 | 211 inputs, no difference | — | 114 of 114 within tolerance |
| radar | radar-beta | Own | 84 / 84 | 208 inputs, no difference | — | 26 of 26 within tolerance |
| kanban | kanban | Own | 64 / 64 | 356 inputs, no difference | 355 inputs, no difference | 30 of 30 within tolerance |
| architecture | architecture, architecture-beta | fcose | 97 / 102 (5 ignored) | 281 inputs, no difference | — | 46 of 46 within tolerance |
| c4 | C4Context, C4Container, C4Component, C4Dynamic, C4Deployment | Own | 171 / 171 | 177 inputs, no difference | — | 32 of 32 within tolerance |
| ishikawa | ishikawa, ishikawa-beta | Own | 40 / 40 | 81 inputs, no difference | — | 28 of 28 within tolerance (1 not compared) |
| eventmodeling | eventmodeling | Own | 41 / 42 (1 ignored) | 220 inputs, no difference | — | 39 of 39 within tolerance |
| cynefin | cynefin-beta | Own | 86 / 86 | 125 inputs, no difference | — | 23 of 23 within tolerance |
| wardley | wardley-beta | Own | 77 / 77 | 222 inputs, no difference | — | 22 of 22 within tolerance |
| venn | venn-beta | Venn layout (ferrigura-venn) | 63 / 63 | 277 inputs, no difference | — | 32 of 32 within tolerance (3 not compared) |
| tree-view | treeView-beta | Own | 220 / 221 (1 ignored) | 176 inputs, no difference | — | 32 of 32 within tolerance |
| railroad | railroad-beta, railroad-ebnf-beta, railroad-abnf-beta, railroad-peg-beta | Own | 149 / 149 | 418 inputs, no difference | — | 42 of 42 within tolerance |
| agentflow | agentflow-beta | ELK Layered | 232 / 296 (64 ignored) | 287 inputs, no difference | — | 51 of 51 within tolerance (2 not compared) |
| usecase | usecase-beta | ELK Layered | 244 / 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.