Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Better Mermaid

jovenjoven1k downloads

Enhance Mermaid diagrams with click-to-zoom and custom CSS injection

Add to Obsidian
Better Mermaid screenshot
Better Mermaid screenshot
  • Overview
  • Scorecard
  • Updates7

An Obsidian plugin that enhances Mermaid diagram viewing experience with click-to-zoom, pan & zoom controls, and PNG export.

Features

  • Click to Zoom — Click any Mermaid diagram in reading mode to open it in a full-size modal
  • Pan & Zoom — Scroll to pan, Ctrl + scroll to zoom, drag to move around
  • Zoom Presets — Quick zoom levels: 20%, 50%, 75%, 100%
  • Export PNG — Download any diagram as a high-resolution PNG image (2x)
  • Custom CSS — Inject your own CSS to customize Mermaid diagram appearance
  • i18n — English and Chinese language support

Preview

Click a Mermaid diagram → opens a floating modal with frosted glass controls: image

Installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Copy them to your vault's .obsidian/plugins/obsidian-better-mermaid/ folder
  3. Enable the plugin in Obsidian Settings → Community Plugins

Manual Build

npm install
npm run build

Then copy main.js, manifest.json, and styles.css to the plugin folder.

Usage

Action Control
Open modal Click a Mermaid diagram in reading mode
Pan vertically Scroll wheel
Pan horizontally Shift + scroll wheel
Zoom Ctrl + scroll wheel
Pan freely Click and drag
Preset zoom Select from dropdown (20% / 50% / 75% / 100%)
Download PNG Click Download PNG button

Settings

Setting Description Default
Language UI language (English / 中文) English
Enable click to zoom Toggle the click-to-zoom feature on/off On
Enhance readability Thicken lines; dark mode: brighten lines & darken subgraphs (off = match reading view) On
Modal width Width of the modal (% of viewport) 80%
Modal height Height of the modal (% of viewport) 80%
Default zoom level Initial zoom when opening a diagram 100%
Custom CSS CSS rules injected into Obsidian (empty)

Each slider has a reset button to restore default values.

Custom CSS Example

.markdown-preview-view .mermaid svg,
.markdown-source-view .mermaid svg {
  max-width: 100% !important;
  height: auto !important;
}

/* 限制最大高度,避免纵向过长 */
.markdown-preview-view .mermaid,
.markdown-source-view .mermaid {
  max-height: 80vh; /* 可根据需要调整,如 70vh、90vh */
  overflow: auto;    /* 超出时显示滚动条 */
}

Troubleshooting

Cannot open the plugin's settings tab (the page is blank/unresponsive, console shows TypeError: e.display is not a function)

  • Cause: since v1.0.6 the settings tab uses the declarative settings API (getSettingDefinitions()), which requires Obsidian 1.13.0 or later. On older versions Obsidian still tries to render the tab through the legacy display() method, which is no longer implemented.
  • Fix: update Obsidian to 1.13.0 or newer — Settings → About → Check for updates. You can see your current version in Settings → About.
  • Note: manifest.json declares minAppVersion: 1.13.0, so installs from the community directory automatically block older Obsidian versions; only manually copied (sideloaded) plugins can end up running on an outdated Obsidian.

Compatibility

  • Minimum Obsidian version: 1.13.0 (required by the declarative settings API used for the settings tab)
  • Works on both desktop and mobile
  • Mobile: pinch to zoom, single-finger pan, double-tap to zoom, share-sheet / vault save for PNG export

License

MIT

HealthExcellent
ReviewSatisfactory
About
## 中文版 **v1.0.8 — 可读性增强开关 + 桌面端体验修复** ### 新功能 - **新增「增强图表可读性」设置**(默认开启,可在设置中关闭,切换即时生效): - 连线加粗至 2.5px(深色/浅色模式均生效) - 深色模式:连线与箭头提亮、subgraph 区块背景暗色化、区块标题提亮,大幅改善深色背景下的可读性 - 关闭后,弹窗配色与阅读视图完全一致(图表为阅读视图渲染结果的克隆) ### 修复 - **桌面端缩放塌陷**:缩放过程中(尤其回到 100% 时)图表突然变得特别小、弹窗高度时大时小——现已将弹窗高度固定为设置中的百分比,彻底消除该问题 - **设置页语言切换实时刷新**:切换语言后界面立即更新,无需重新打开设置页 ### 改进 - **滚轮直接缩放**:普通滚轮即可以鼠标位置为中心缩放(原先需要 Ctrl+滚轮) - Shift + 滚轮横向平移;按住左键拖拽自由平移(保留) - 触控板双指捏合缩放继续可用 > 要求 Obsidian ≥ 1.13.0(声明式设置 API)。 --- ## English **v1.0.8 — Readability enhancements toggle + desktop fixes** ### Features - **New "Enhance diagram readability" setting** (enabled by default, applies instantly): - Thicker connector lines (2.5px, both light & dark themes) - Dark mode: brightened lines & arrows, darkened subgraph backgrounds and brightened cluster titles for much better contrast - When disabled, the viewer matches reading-view colors exactly (the diagram is a clone of the rendered SVG) ### Fixes - **Desktop zoom coll
VisualizationExportCSS
Details
Current version
1.0.8
Last updated
3 days ago
Created
3 months ago
Updates
7 releases
Downloads
1k
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
jovenjoven
GitHubjoven-lynn
  1. Community
  2. Plugins
  3. Visualization
  4. Better Mermaid

Related plugins

Mermaid View

Handle Mermaid files as first-class citizens, rendering them fullscreen when opened.

Vault Graph

Your whole vault as one disc: notes packed into folder wedges on a fixed lattice, sized by links, with a growth heatmap, timeline, search and per-folder filters. Deterministic, not force-directed - the same vault always draws the same picture.

Markmind

Mind map, outline and PDF annotation tool. (Closed source)

Advanced Canvas

Supercharge your canvas experience. Create presentations, flowcharts and more.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

Breadcrumbs

Visualise the hierarchy of your vault using a breadcrumb trail or matrix view.

Custom Frames

Turn web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.

Maps

Adds a map layout to bases so you can display notes as an interactive map view.

Admonition

Admonition block-styled content.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.