Obsidian plugin for rendering infographic diagrams using @antv/infographic
Beyond rendering the built-in infographic templates, this plugin ships the interactions notes actually need:
| Capability | Details |
|---|---|
| Zoom & pan | Ctrl/Cmd+wheel zoom, drag to pan, double-click or the percentage label to reset — all inside the note, scrolling never hijacked |
| Fullscreen viewer | Big-canvas review with wheel zoom, pan and full-image export |
| Export & copy | One-click PNG/SVG from the export menu (no dialog); copy the source or the rendered image |
| Drag-resize | Edge handles resize the block and persist width=N / height=N back into the fence |
| Alignment | align=center fence parameter with a toolbar toggle |
| Themes & styles | Built-in themes (light / dark / hand-drawn — the list follows the library) plus rough / pattern / gradient stylize, applied to open notes live |
| Right-click menu | Every toolbar action also lives in a context menu (long-press on mobile) |
| Small-surface aware | The toolbar folds into a "more" menu on narrow blocks and sidebars — nothing overflows |
- Open Settings → Community plugins in Obsidian.
- Click Browse and search for "AntV Infographic".
- Click Install, then Enable.
If the plugin doesn't show up in search yet, it may still be under review — use one of the methods below in the meantime.
-
Download the following files from the latest release:
main.jsmanifest.jsonstyles.css
-
Create an
antv-infographic-plusfolder in your vault's.obsidian/plugins/directory (if it doesn't exist) -
Place the downloaded files in
.obsidian/plugins/antv-infographic-plus/ -
Enable the plugin in Obsidian settings
Useful for tracking beta builds before they reach the store:
- Make sure you have installed the BRAT plugin
- In BRAT settings, click the "Add a beta plugin" button and add this plugin's GitHub repository URL:
https://github.com/hcg1023/obsidian-infographic-plus - Version Selection
- Select "Latest version", or install a specific version as needed
- Click the Add Plugin button and BRAT will automatically download and install the latest version of the plugin
-
Clone the project to your Obsidian plugins directory:
cd ~/.obsidian/plugins git clone https://github.com/hcg1023/obsidian-infographic-plus.git cd obsidian-infographic-plus
-
Install dependencies and build:
npm install npm run build
-
Enable the plugin in Obsidian settings
In your Obsidian notes, use the infographic code block:
```infographic
infographic list-row-simple-horizontal-arrow
data
items
- label Step 1
desc Start
- label Step 2
desc In Progress
- label Step 3
desc Complete
``````infographic
infographic chart-bar-plain-text
data
title 年度营收增长
desc 展示近三年及本年目标营收对比(单位:亿元)
items
- label 2021年
value 120
desc 转型初期,稳步试水
icon lucide/sprout
- label 2022年
value 150
desc 平台优化,效率显著提升
icon lucide/zap
- label 2023年
value 190
desc 深化数智融合,全面增长
icon lucide/brain-circuit
- label 2024年
value 240
desc 拓展生态协同,冲击新高
icon lucide/trophy
theme light
palette antv
```The opening fence line accepts optional parameters:
```infographic width=600 align=center
```width=N— cap the rendering width atNpixels (minimum 200). When absent, the block is responsive and fills the available note width.height=N— fix the block height atNpixels (minimum 100). Can be used independently ofwidth=N, e.g.```infographic height=360. You can also drag the top/bottom edge handles to adjust the height; on release the fence line is rewritten withheight=N(same as width).align=center— center the block horizontally (default is left-aligned).
Both parameters are also editable interactively: drag the resize handles on the sides of a block to change its width, and use the toolbar center-align button. The change is persisted back into the fence line of your note.
UI strings follow the Obsidian language (English / Simplified Chinese).
The rendered infographic is interactive:
| Interaction | Behavior |
|---|---|
| Mouse wheel (fit state) | Scrolls the note as usual — the block stays out of the way |
Ctrl/Cmd + wheel |
Zoom in / out at any time |
| Wheel after zooming in | Keeps zooming (wheel is captured by the block) |
| Drag while zoomed | Pan the diagram |
| Double-click | Reset zoom to 100% (zoom only — block width unchanged) |
Toolbar + / − / fit buttons |
Zoom in, zoom out, or reset zoom; click the zoom percentage to reset zoom to 100% only; Fit to width also restores the block to the full note-column width by clearing the width=N / height=N parameters (session-only in reading mode) |
| Fullscreen viewer | Wheel always zooms; drag pans; export the full image or copy the source |
Open the fullscreen viewer via the toolbar maximize button. The infographic: Insert infographic template command inserts a ready-made template into the current note.
Hover over the rendered infographic (or tap it on mobile) to reveal the toolbar. Right-click (long-press on mobile) the block or the fullscreen viewer opens a context menu with the same actions, so everything stays reachable even when the toolbar is collapsed on narrow blocks:
- Copy source - Copy the infographic source code to the clipboard
- Copy image - Copy the infographic (PNG format) to clipboard for pasting into other applications
- Export PNG / SVG - Open the export dialog to download the infographic as a PNG image or an SVG vector file
- Node.js >= 16
- npm or yarn
# Install dependencies
npm install
# Development mode with hot reload
npm run dev
# Production build
npm run build
# Run linter
npm run lintobsidian-infographic-plus/
├── src/
│ ├── main.ts # Main plugin code
│ └── settings.ts # Plugin settings
├── main.js # Compiled plugin
├── manifest.json # Plugin manifest
├── styles.css # Plugin styles
└── package.json # Dependencies
This plugin uses @antv/infographic for rendering. The infographic content is passed directly to the Infographic instance.
| Setting | Default | Description |
|---|---|---|
| Theme | Auto | Infographic color theme. Auto follows Obsidian light/dark; the other options are the built-in themes reported by getThemes() (light / dark / hand-drawn, and whatever future versions add) |
| Stylize | None | Apply rough / pattern / gradient styling on top of the theme (themeConfig.stylize). Pattern is a dropdown of the library's built-ins; gradients pick two colors with native color pickers (multi-stop gradients via the block's JSON themeConfig). Blocks whose JSON carries its own themeConfig.stylize keep theirs |
| Drag to resize | on | Show drag handles on block edges to adjust width and height |
| In-note zoom | on | Ctrl/Cmd+wheel zoom, drag to pan, and zoom controls on the toolbar |
| Hover toolbar | on | Show the toolbar with copy, export and zoom actions when hovering a block. The right-click menu remains available even with this off |
| Center blocks by default | off | Center blocks horizontally unless overridden by the align= fence parameter |
- Dual syntax: JSON specs and the concise Infographic DSL both work in
infographiccode blocks - Responsive width — blocks fill the note width, or cap them with the
width=Nfence parameter align=centerfence parameter (and a toolbar toggle) for horizontal centering- Hover toolbar: copy source, copy image, export PNG/SVG, center-align, zoom controls
- Right-click context menu on blocks and in the fullscreen viewer, sharing the same actions as the toolbar
- Responsive toolbar: buttons collapse into a "more" menu on narrow blocks (container queries)
- In-note zoom & pan: Ctrl/Cmd+wheel to zoom, zoom buttons, drag to pan, double-click to reset
- Fullscreen viewer with wheel zoom, drag pan and full-image export
insert-templatecommand to scaffold a new infographic block- Error handling with friendly error placeholder cards
- Requires Obsidian 1.13+
This plugin incorporates code ported and modified from shuuul/obsidian-infographic (v0.2.0, Apache-2.0) — the dual-syntax parser, the MarkdownRenderChild renderer with resize handling, fence parameter parsing/persistence, and the export/source modals. Ported files carry an Apache-2.0 header notice; see LICENSE-APACHE-2.0. Changes: removed the PDF print-snapshot pipeline, reworked toolbar/zoom integration, added PanZoomController and the fullscreen viewer. The remainder of this plugin is MIT licensed.
MIT License
- Built with @antv/infographic
- Based on Obsidian Sample Plugin