xiaozhuang04331k 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 | Hover over a Mermaid diagram and scroll the mouse wheel |
| Pan | Click and drag to move the diagram |
| 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 automatically detects all Mermaid diagrams rendered in Obsidian and wraps each one in a zoomable container. Zoom range is configurable from 10% to 500%.
Original SVG dimensions are cached to ensure consistent scaling behavior when resetting or resizing.