mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-10-26 22:37:03 +00:00
568b113446
mermaid 12 changes the default layout engine. Read from the shipped
bundles rather than the release note -- mermaidAPI.getConfig() on each
version, with no initialize() call in front of it:
11.17.2 layout="dagre" look="classic" theme="default"
12.0.0 layout="elk" look="classic" theme="default"
So `layout` is the one that moved. `look` is a defensive pin of a value
that did NOT change, written down so a later default change cannot move
our diagrams silently, and `theme` stays 'dark' -- our own value, not a
default, left exactly as it was.
What the pin does and does not buy, measured in a real browser against
two servers (mermaid 11 at main's tip, mermaid 12 on this branch), same
item, same viewport:
flowchart 377.5x623 -> 426x737 (v12 pinned to dagre)
state 120.7x412 -> 152x412
sequence 706x389 -> 706x389 (byte-identical viewBox)
Node counts, edge counts, font size and reading order are identical in
every case. So the pin preserves the LAYOUT -- the graph is laid out the
same way by the same engine -- but mermaid 12 draws that layout LARGER
regardless of this setting. Stored diagrams do not re-flow; they do get
bigger, and no config setting available here changes that.
Without the pin, ELK lays the same graphs out differently again
(flowchart 416x737, state 152x452) and the build's 1.46 MB elk chunk,
which is otherwise never fetched, is downloaded on first render.
This is the site default, not a ceiling: a diagram carrying its own
`config: layout: elk` frontmatter still gets ELK.
Editor.svelte's dynamic import('mermaid') is the only mermaid call site
in the tree (`grep -rln mermaid web/src`).
Claude-Session: https://claude.ai/code/session_01BLg7wiBeSgXvAhWi23mT4Z