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

D2 File Preview

jeongsoljeongsol44 downloads

Edit D2 source files and automatically render SVG previews in Obsidian.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates4

D2 File Preview lets you edit .d2 files in Obsidian and automatically renders sibling SVG previews.

Rendering runs locally and offline through the bundled D2.js/WebAssembly engine. A separate D2 executable is not required.

Platform support

  • Windows, macOS, and Linux are supported.
  • Android is supported and has been verified on a Samsung SM-T875N running Android 13 with Obsidian 1.13.8. The physical-device check passed simple render, edit/save refresh, vault-local relative import, and cold-start worker initialization.
  • iOS/iPadOS is not tested on a physical device yet, although installation is enabled. Please treat iOS/iPadOS support as unverified and report any worker, rendering, or preview issues.

Usage

  1. Run Create new D2 file from the Command Palette to create an empty Untitled.d2 file, or open an existing .d2 file.
  2. Edit the D2 source.
  3. After one second without additional edits, the plugin creates or overwrites a sibling .svg file with the same base name.
  4. After the first successful render, the SVG opens in a preview. Later successful renders reuse and refresh that preview.

If rendering fails, the plugin shows a short notice and writes details to the developer console. The last successfully generated SVG remains unchanged, and rendering is retried after the next source edit.

Imports

D2 imports between .d2 files inside the current vault are supported, including relative imports. Imports outside the current vault are not supported.

To let D2 resolve imports itself, the plugin supplies the vault's .d2 files to the bundled renderer for each render. Very large vaults containing many D2 files may therefore take longer to render.

Upgrading from 1.0.x

The plugin no longer uses a system D2 executable. The former D2 executable path setting has been removed; any previously saved value is ignored.

MVP scope

The plugin does not include a dedicated D2 editor, render-options UI, manual Render command, ribbon/context-menu actions, or automatic SVG cleanup after D2 rename/delete operations.

License

MIT. See THIRD_PARTY_NOTICES.md for the bundled D2.js dependency.

HealthExcellent
ReviewSatisfactory
About
Edit .d2 files and automatically render sibling SVG previews using the local D2 CLI (launched as an external process). Auto-render occurs after one second of idle edits, opens the first successful SVG in a split view, and refreshes previews on subsequent renders; desktop-only (Windows, macOS, Linux).
DrawingImagesIntegrations
Details
Current version
1.1.0
Last updated
2 weeks ago
Created
3 weeks ago
Updates
4 releases
Downloads
44
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
jeongsoljeongsol
GitHubsoljeong
  1. Community
  2. Plugins
  3. Drawing
  4. D2 File Preview

Related plugins

Ink

Handwriting and drawing directly between paragraphs using a digital pen, stylus, or Apple pencil.

TTRPG Tools - Maps

A toolbox for interactive fantasy maps.

Image auto upload

Upload images from your clipboard by PicGo.

BRAT

Easily install a beta version of a plugin for testing.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

LanguageTool Integration

Advanced grammar and spell checking, powered by LanguageTool.

Self-hosted LiveSync

Sync vaults securely to self-hosted servers or WEBRTC.

Fast Note Sync

Real-time sync of your vaults across server, mobile, and web; shareable with anyone; supports REST and MCP integrations to build your personal AI knowledge base.

Custom Frames

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

Local REST API with MCP

Unlock your automation needs by interacting with your notes over a secure REST API.