A Mermaid editor that keeps your diagrams and exports PNGs that actually have labels
Mermaid is the nicest way I know to keep a diagram next to the code it describes: it is plain text, it diffs, and GitHub renders it in a README. The annoying part is everything around it — drafting a diagram somewhere you can see it, keeping more than one around, and getting an image out for a slide or a ticket. The Mermaid Editor on Omikuji Tools is a browser page for exactly that.
Type on the left, see it on the right
Write Mermaid code in the editor and the preview redraws as you type (it waits a moment after your last keystroke, so a half-finished line does not flicker errors at you). Flowcharts, sequence diagrams, ER diagrams, Gantt charts — whatever Mermaid itself supports. When the syntax is wrong, the preview shows Mermaid's own error message instead of a blank box.
The preview behaves like a map: scroll the wheel to zoom around the cursor, double-click to zoom in, drag to pan, and one button fits the whole diagram back into view. For a wide diagram you can hide the editor panel and give the preview the full width.
More than one diagram
The sidebar is a file list. Each diagram gets a title and is saved in your browser's local storage, so you can keep the architecture overview, the login sequence and the migration Gantt chart side by side and come back to them later. Nothing is sent to a server; the page only needs the network to load in the first place.
Export: SVG, or PNG with or without a background
The download menu saves an SVG, a PNG with a transparent background, or a PNG on white. You can also copy the SVG, or the Mermaid code itself, to the clipboard. Files are named after the diagram's title.
Two details I cared about. PNGs are drawn at twice the diagram's size, capped at 8192 pixels on the long side, so they stay sharp on a slide without becoming enormous. And flowchart labels are rendered as plain SVG text rather than embedded HTML — converting an SVG with HTML labels to a PNG can silently drop the text in some browsers, and a flowchart of empty boxes is not much use.
Pasting diagrams from elsewhere
A lot of Mermaid gets copied from a wiki or a colleague's README. The editor runs Mermaid in its strict security mode, which sanitizes the output and blocks things like javascript: links in click handlers — the sensible default when the code came from somewhere else.
One caveat the page states itself: some beta diagram types, such as sankey-beta, may fail to parse non-ASCII characters. If you hit an error there, try ASCII labels.
If the diagram belongs in a longer document, Markdown Preview handles the prose: GitHub-flavoured Markdown with a live preview, auto-saved in the browser, and exported to PDF.
👉 Mermaid Editor — free, no sign-up, diagrams stay in your browser.
Comments
Post a Comment