xiaozhuang04335k downloadsAdd zoom functionality to Mermaid diagrams. Use mouse wheel or touch gestures to zoom in and out.
An Obsidian plugin that adds zoom and pan functionality to Mermaid diagrams.
Once approved, install directly from Obsidian's community plugins browser.
your-vault/.obsidian/plugins/mermaid-zoom
| Action | Description |
|---|---|
| Zoom | Enable the Wheel zoom toggle on a diagram, then scroll the wheel over it |
| Pan | Click and drag to move the diagram |
| Resize | Drag an edge or corner of the diagram container |
| Fullscreen | Click the fullscreen button to open in modal view |
| Action | Description |
|---|---|
| Zoom | Pinch with two fingers |
| Pan | Drag with one finger |
Located in the bottom-right corner of each diagram:
+ - Zoom in- - Zoom out⟲ - Reset to fit⛶ - Toggle fullscreen# Install dependencies
npm install
# Development mode (watch for changes)
npm run dev
# Production build
npm run build
The plugin provides the following settings in Obsidian's plugin settings:
The plugin automatically detects all Mermaid diagrams rendered in Obsidian and wraps each one in a zoomable, resizable container. Each container can be resized by dragging its edges or corners. Zoom range is from 10% to 500%.
Wheel zoom is off by default in the inline view (so the page scrolls normally); enable it per diagram with the Wheel zoom toggle. In the fullscreen modal, wheel zoom is always active.
Original SVG dimensions are cached to ensure consistent scaling behavior when resetting or resizing.