paddy14 downloadsPan, zoom, fit, and fullscreen for Mermaid diagrams, with Ctrl/Cmd+wheel zoom and touch gestures. Works with any theme. Ordinary wheel still scrolls the page.
An Obsidian plugin for working with Mermaid diagrams. Reading: every rendered diagram becomes a small stage with pan, zoom, fit, reset, and a lightweight fullscreen overlay. Writing: a picker inserts a ready-made template for any diagram type in one click.
It works with any theme and needs no companion plugin. The chrome is drawn with Obsidian's own colour and radius variables, so it follows the active theme; the diagram itself keeps whatever look the theme gives Mermaid.
Mermaid Kit continues Lumen Stage, which is no longer developed. The two wrap the same diagrams, so disable Lumen Stage before enabling Mermaid Kit.
Obsidian draws Mermaid diagrams with Mermaid's stock light palette and, in a dark theme, inverts the picture. Mermaid Kit instead gives Mermaid a palette built from the colors your theme is showing: background, text, borders, the accent color, and Obsidian's eight named hues for series such as pie slices and Git branches. Diagrams use the interface font and look at home in any theme, light or dark, across every diagram type.
Insert Mermaid diagram opens a picker with one card per diagram type: flowchart, sequence, class, state, entity relationship, Gantt, pie, mindmap, timeline, Git graph, user journey, quadrant, XY chart, Sankey, block, architecture, kanban, requirement, C4, packet, radar, and treemap.
Enter takes the first match, a click inserts```mermaid block. With the cursor inside an open ```mermaid block, only the diagram body is filled inInline, in the note:
Ctrl / Cmd + wheel, or a trackpad pinch, zooms toward the pointer+ / - zoom, 0 resets, 1 shows 100%, arrow keys pan, F opens fullscreenThe More actions menu, inline and in the overlay:
The two source items appear only when the diagram can be traced back to its block with certainty; a diagram inside an embedded note offers the copies but not the edit.
In the overlay:
Ctrl / Cmd + wheel or pinch zoomsF fits, 0 resets, 1 shows 100%Esc, the close button, or the dimmed backdrop closes itOn touch screens, two fingers pinch-zoom and pan. A diagram that fits its stage vertically lets the page scroll through it.
Reset shows the diagram at its natural size, shrunk to the column when it is wider. Fit shows the whole diagram as large as the canvas allows: the overlay frame, or inline the column and 72% of the window height. The button for the view already on screen is dimmed.
Labels, tooltips, and the overlay hint follow Obsidian's language: English, Simplified Chinese, and Traditional Chinese.
Commands: Open first Mermaid diagram fullscreen opens the diagram on screen in the active note. Insert Mermaid diagram opens the template picker.
The chrome is a silent 36px header band with icon buttons that recede until the pointer or the keyboard reaches the stage. The diagram keeps a 12px margin from the frame. There is no drafting grid and no floating instrument toolbar.
This plugin is not on the community list yet. Install it locally:
<vault>/.obsidian/plugins/mermaid-kit/, or symlink it there while developing.npm install and npm run build if main.js is missing.Reload the plugin after a rebuild. Obsidian reads manifest.json, main.js, and styles.css from that folder.
Requires Node.js 20 or later.
npm install
npm run build
npm run check
npm run build typechecks, then bundles src/ into main.js with esbuildnpm run check typechecks and validates manifest, versions, and CSS token rulesnpm test runs the unit tests for the parts that do not need the app: insertion, source extraction, pan and fit geometry, and the template listnpm run dev watches src/ and rebuilds with an inline sourcemapEdit TypeScript under src/. Do not hand-edit main.js. After a build, reload the plugin in Obsidian.
Mermaid Kit is available under the MIT License.