Mermaid Zoom

by xiaozhuang0433
5
4
3
2
1
Score: 49/100

Description

Category: Data Visualization

The Mermaid Zoom plugin adds zoom, pan and resize controls to Mermaid diagrams with separate handling for inline and fullscreen views. It wraps each rendered diagram in a resizable container, supports click and drag panning, pinch to zoom on mobile and quick controls for zooming in, zooming out, reset and fullscreen. Wheel zoom is opt in for each inline diagram so page scrolling still works normally, while fullscreen mode keeps wheel zoom active. The plugin also shows the current zoom level, lets you set a default zoom percentage from 50% to 300% for newly rendered diagrams and caches original SVG dimensions so reset and resize behaviour stays consistent. Zoom range runs from 10% to 500%.

Reviews

No reviews yet.

Stats

25
stars
6,655
downloads
4
forks
74
days
61
days
61
days
5
total PRs
0
open PRs
0
closed PRs
5
merged PRs
7
total issues
1
open issues
6
closed issues
78
commits

Latest Version

2 months ago

Changelog

Fixed

Wrong diagram heights in long notes

With many Mermaid diagrams in one note, diagrams further down could end up with the wrong container height. Root cause: the plugin used to re-parent each rendered diagram into its own container and measure it once at wrap time — a measurement that raced against Mermaid's asynchronous rendering and was then baked in forever.

The fix removes the takeover entirely. Inline diagrams are now rendered and sized 100% natively by Obsidian — the plugin never measures, never sets heights, so this class of bug is gone by construction.

Highlights

Native inline rendering, decoration only

The plugin now leaves every inline diagram untouched except for three decorative touches:

  • Alignment setting (left / center / right) — applies to open notes immediately, and diagrams coming back into view while scrolling catch up automatically
  • Container border toggle
  • A subtle fullscreen button at the diagram's bottom-right corner (kept clear of Obsidian's code-block action icons at the top-right)

Everything interactive — zoom, pan, pinch, the control bar, PNG export, keyboard shortcuts — still lives in the fullscreen viewer, unchanged from 1.4.5.

Removed settings (behavior change)

  • Default zoom level — inline diagrams always render at native size now; use the fullscreen view for zooming
  • Max container height — native rendering decides the height

Leftover values in data.json are ignored harmlessly.

Full changelog: https://github.com/xiaozhuang0433/mermaid-zoom/compare/1.4.5...1.5.0


中文说明

修复:长笔记中图表高度错误

单篇笔记图表较多时,靠后的图可能出现错误的容器高度。根因是插件过去把每张图搬进自制容器并"包裹时测一次、终身使用",与 Mermaid 的异步渲染存在竞态。本次修复是彻底移除接管逻辑——内联图表完全由 Obsidian 原生渲染和决定尺寸,插件零测量、不设高度,该类 bug 从构造上消失。

内联只做装饰

  • 对齐方式设置(左/中/右):对已打开笔记立即生效,滚动中重新进入画面的图也会自动跟上
  • 容器边框开关
  • 每张图右下角一个低调的全屏按钮(避开右上角的官方代码块操作图标)

所有交互(缩放、拖拽、捏合、控件条、导出 PNG、键盘快捷键)仍在全屏查看器中,与 1.4.5 一致。

移除的设置(行为变更)

  • 默认缩放级别:内联始终原生尺寸,需要缩放请进全屏
  • 最大容器高度:高度交给原生渲染

data.json 中的残留值会被自动忽略,无需处理。

完整变更: https://github.com/xiaozhuang0433/mermaid-zoom/compare/1.4.5...1.5.0

README file from

Github

Mermaid Zoom

English | 简体中文

An Obsidian plugin that adds zoom and pan functionality to Mermaid diagrams.

Version License

Features

  • Mouse Wheel Zoom - Opt-in wheel zoom via a per-diagram toggle (off by default, so the page still scrolls normally)
  • Drag to Pan - Click and drag to move around your diagrams
  • Touch Gestures - Pinch to zoom and drag to pan on mobile devices
  • Control Buttons - Quick access to zoom in, zoom out, and reset buttons
  • Scale Indicator - Real-time display of current zoom level
  • Fullscreen Mode - Open diagrams in a modal for better viewing
  • Resizable Containers - Drag the edges or corners of any diagram to resize its container

Installation

Obsidian Plugin Market (Coming Soon)

Once approved, install directly from Obsidian's community plugins browser.

Manual Installation

  1. Download the latest release from GitHub Releases
  2. Extract to your vault's plugins directory:
    your-vault/.obsidian/plugins/mermaid-zoom
    
  3. Enable the plugin in Obsidian:
    • Settings → Community Plugins
    • Find "Mermaid Zoom" and enable it

Usage

Mouse Controls

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

Touch Controls (Mobile)

Action Description
Zoom Pinch with two fingers
Pan Drag with one finger

Control Buttons

Located in the bottom-right corner of each diagram:

  • Wheel zoom toggle - Enable wheel-to-zoom for this diagram (off by default)
  • + - Zoom in
  • - - Zoom out
  • ↔ - Fit to width (scale the diagram so its full width fits the note column)
  • ⟲ - Reset to fit
  • ⛶ - Toggle fullscreen

Development

# Install dependencies
npm install

# Development mode (watch for changes)
npm run dev

# Production build
npm run build

Settings

The plugin provides the following settings in Obsidian's plugin settings:

  • Default zoom level — Initial zoom percentage when a diagram is rendered (50–300%, default 100%). Set it higher (e.g., 150%) if you prefer diagrams to appear larger without zooming in manually each time. Note: changes only apply to newly rendered diagrams; reload the note to see the effect.

How It Works

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.

License

MIT © Wang Xiao Zhuang

Support

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Diagrams.Net
4 years ago by Jens M Gleditsch
This repository contains a plugin for Obsidian for inserting and editing diagrams.net (previously draw.io) diagrams.
TikZJax
4 years ago by artisticat1
Render LaTeX and TikZ diagrams in your notes
D2
4 years ago by Terrastruct
The official D2 plugin for Obsidian. D2 is a modern diagram scripting language thats turns text to diagrams.
Mermaid Tools
4 years ago by dartungar
Tools for improved Mermaid.js experience in Obsidian.md
Adamantine Pick
4 years ago by Urist McMiner
Embeddable Pikchr(https://pikchr.org) diagrams renderer plugin for Obsidian(https://obsidian.md)
Mermaid Themes
3 years ago by jvsteiner
mermaid themes for obsidian
Full Screen Toggle
3 years ago by Donkey Pacific
Fullscreen toggle plugin across all platforms for Obsidian.
Mehrmaid
3 years ago by huterguier
Rendering Obsidian Markdown inside Mermaid diagrams.
Fullscreen Focus Mode
6 years ago by Razum
Zoom
5 years ago by Viacheslav Slinko
Kroki
5 years ago by Greg Zuro
WaveDrom
5 years ago by Alex Stewart
Image Toolkit
5 years ago by sissilab
An Obsidian plugin for viewing an image.
Diagrams
5 years ago by Sam Greenhalgh
Draw.io plugin for obsidian.md
Reset Font Size
5 years ago by luckman212
Plugin for Obsidian that adds shortcuts for resetting the font size (zoom level).
Nomnoml Diagram
5 years ago by Daeik Kim
Obsidian Plugin for nomnoml diagram
Mousewheel Image zoom
5 years ago by Nico Jeske
An Obsidian plugin that enables you to increase/decrease the size of an image by holding down a configurable key (defaults to left alt), hovering over an image in preview mode and scrolling.
Pintora
2 years ago by Amias Lee
Create Pintora diagrams directly in the Obsidian.
Mermaid Popup
2 years ago by ChenPengyuan
Image Tools
2 years ago by Andrey Serov
MoreDraw
2 years ago by webceoboy2011
mordraw.com for obsidian plugin
Pixel Perfect Image
2 years ago by Johan Sanneblad
Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.
Sankey
2 years ago by Finn Romaneessen
An Obsidian plugin to create sankey diagrams
Flowcharts
2 years ago by land0r
Flowchart Plugin for Obsidian – Create and customize flowcharts seamlessly within your Obsidian vault. Powered by Flowchart.js and designed for productivity
Media Viewer
2 years ago by Devon22
View and manage media files within your notes.
Export Graph View
2 years ago by Sean McGhee
Plugin to export your vault's graph view.
GoBoard
9 months ago by Dmitry I. Sokolov
Obsidian plugin for rendering Go game diagrams from markdown code blocks
Status Bar Clock
9 months ago by Marty Ballard
Status Bar Clock for Obsidian
Mermaid Icons
8 months ago by toshs
Obsidian plugin enabling the use of icons in Mermaid diagrams.
Graphic Organizer
7 months ago by Nick Le Guillou - Superhuman Curiosity
draw.io
4 months ago by somesanity
A plugin for Obsidian that integrates the draw.io editor into Obsidian.
Excalidraw Extras
4 months ago by zsviczian
Companion Obsidian.md plugin hosting extra add-on optional features for the main Excalidraw-Obsidian plugin
Wechat Converter
4 months ago by davidlam-oss
Obsidian 公众号排版、飞书云同步与多平台(小红书、知乎等)发布插件。Markdown 转微信文章 / Feishu docs / 知乎、小红书、今日头条等草稿,支持数学公式、本地图片、GIF 和 Mermaid。
Typewriter Mode
3 months ago by davisriedel
Typewriter Mode is a plugin that adds typewriter scrolling (current line stays at a fixed position on the screen), a highlight for the current line, dimming of unfocused paragraphs and more to Obsidian.
Tabsdown
3 months ago by grafanakibana
Create accessible, theme-native tabbed blocks for Markdown-renderable content in Obsidian.
Inline TikZ
2 months ago by Lachlan Harris
Render seamless Tikz, CircuiTikz & other PGFPlots LaTeX diagrams directly in your notes.