aitsuki85 downloadsApply one global Mermaid configuration and open diagrams in a draggable, zoomable viewer.
Mermaid Lens is an Obsidian plugin that applies one shared Mermaid configuration across your vault and opens diagrams in a dedicated pan-and-zoom viewer.
| Zoomed out | Zoomed in |
|---|---|
https://github.com/user-attachments/assets/056c7e1b-5d88-4508-99bb-ded31a615efd
Mermaid Lens requires Obsidian 1.12.0 or later.
Download main.js, manifest.json, and styles.css from GitHub Releases.
Place all three files in:
<Vault>/.obsidian/plugins/mermaid-lens/
Reload Obsidian, then enable Mermaid Lens under Settings → Community plugins.
The plugin uses Obsidian's standard Mermaid syntax:
```mermaid
sequenceDiagram
participant App as Mobile app
participant API as API server
App->>API: Request
API-->>App: Response
```
By default, click a Mermaid diagram to open it. You can change the trigger under Settings → Mermaid Lens to double-click or the expand button only.
Viewer controls:
| Input | Action |
|---|---|
| Drag with the primary mouse button | Pan |
| Mouse wheel | Zoom around the pointer |
+, =, or - |
Zoom in or out |
| Double-click | Fit the diagram to the viewer |
| Toolbar buttons | Zoom out, fit, or zoom in |
| Escape | Close the viewer |
| One- or two-finger touch gesture | Pan or pinch to zoom |
Open Settings → Mermaid Lens, edit Global Mermaid configuration, and select Apply and redraw. The value must be a JSON object accepted by Mermaid's initialize() API. For example:
{
"theme": "base",
"themeVariables": {
"primaryColor": "#EEF2FF",
"primaryBorderColor": "#6366F1",
"primaryTextColor": "#1E293B",
"lineColor": "#64748B"
},
"sequence": {
"actorMargin": 40,
"messageMargin": 30
}
}
See the Mermaid configuration reference for available fields. Changes remain a draft until you select Apply and redraw. Use Restore defaults to return to the bundled configuration.
See CONTRIBUTING.md for build, test, and acceptance-testing instructions.