Repository navigation
v0.2.0
Breaking: the code every language shares moves out of the Mermaid and Graphviz namespaces (drawing, layout, text, colours, models, rendering). Upgrading from 0.1 maps each old class to its new one.
Native PlantUML
- Every PlantUML diagram family is read and drawn natively, ported from PlantUML's MIT distribution (pinned to 1.2026.8,
tools/plantuml.lock): class and object, component, deployment and use case, state, sequence (a port of teoz), activity in the new and legacy syntaxes, mind map, WBS, JSON, YAML and HCL, Chen EER, EBNF and regex, board, packet, network, wire, Salt, timing, Gantt, git log, flow, files, chart, Creole and@startdot. - The preprocessor, the MIT libraries of the standard library (archimate, bootstrap, C4, domainstory), the 31 bundled themes, sprites, Open Iconic icons and PlantUML's Twemoji emoji run natively.
- Text is measured with the jar's own font metrics. Diagrams svek lays out go through a port of svek on the native dot engine, with PlantUML's limit finder, shapes and link marks, so drawings come out the jar's size.
- Whatever the native renderer does not draw is refused with a reason (
Source\Unsupported) and falls back to the PlantUML jar. A diagram the jar rejects is refused the same way. - Parity is checked against the jar: recorded fixtures graded by
PlantUmlParityTest(tools/record-plantuml-parity.php), and a weekly workflow against the jar itself.
Native Graphviz
- DOT is read natively: a lexer and parser for the whole language, and a model that follows
dot's rules for defaults, subgraphs, strict graphs and clusters. - A native dot layout engine (
Layout\Dot\DotEngine), written clean-room from Gansner et al.'s paper anddot's observed output, never from Graphviz's source. It covers network-simplex ranking with clusters and rank sets; ordering with flat edges, ports,orderingandgroup; network-simplex coordinates; Dobkin et al.'s spline routing; loops, labels and head and tail labels set asdotsets them. The Graphviz compatibility notes track how closely it followsdot. - Every other layout is native too: neato, fdp, sfdp, twopi, circo, osage, patchwork and nop.
- The native renderer draws HTML labels, records, images from allowed directories (
Viz'simageDirectories), gradients, thestriped,wedgedandradialstyles, colour lists,splinesincludingortho,concentrate,sameheadandsametail, compound edges,ratio,rotateandpad. Nothing needsdotinstalled.
Models and conversion
- Shared models for class, state, entity-relationship, sequence, use case and activity diagrams, alongside the graph. Mermaid reads into them and writes them, PlantUML writes them, and DOT draws them where they have a graph form.
- Conversion goes through
Source\ReaderandSource\Writercontracts gathered inSource\Languages, andConverter::write()sends each family directly or through its graph (conversion routes).
Rendering
Viztakes anengine(Render\Engine::Auto,NativeorCli). It draws every language native first, through aFallbackRenderer, and falls back to the command-line tool for what the native renderer refuses.Draw\NativeRendererdraws anyDraw\Pipelineto SVG, PNG or PDF. OneProcess\CommandRendererdrives mmdc,dotand the PlantUML jar.- A source that does not parse is refused as
The <language> source cannot be read: ….