OLanO6 downloadsPreview .drawio diagrams inline as read-only SVGs, with zoom, pan, and multi-page support.
Drawio Preview renders .drawio diagrams inside Obsidian — both as inline embeds and as the file view — without opening an embedded editor. Diagrams are drawn as SVG by a bundled drawio viewer, and on desktop a click opens an interactive viewer where you can zoom, pan, go fullscreen, or hand the file to your local drawio app for editing.
![[Diagram.drawio]] and .drawio files render immediately. Editing stays in your desktop drawio app — the viewer's Edit button opens the file with your system's default application.![[Diagram.drawio]] fits the pane width, ![[Diagram.drawio|400]] pins a width, ![[Diagram.drawio|400x300]] pins width and height. Diagrams scale proportionally inside the box.‹ / › controls, and the pin button writes the current page into the link so the note remembers it.Esc leaves fullscreen..drawio file — at the attachment folder, next to the current note, or in a folder you pin in the settings.main.js, manifest.json and styles.css from the latest release.<your-vault>/.obsidian/plugins/drawio-preview/ and put the three files in it.![[Diagram.drawio]]
![[Diagram.drawio|400]]
![[Diagram.drawio|400x300]]
![[Diagram.drawio#p1]]
The size syntax is the same one Obsidian uses for images, so it behaves the way you already expect. Editing the number in the link resizes the preview immediately.
Click a preview to activate it. A toolbar appears in the top-right corner:
| Button | Action |
|---|---|
+ / − |
Zoom in / out (desktop) |
| Fit | Return to the fitted view |
| Edit | Open the file in your default application (desktop) |
| Fullscreen | Expand the preview to the whole screen (desktop) |
× |
Leave fullscreen |
While zoomed, drag the diagram to pan. Click outside the preview to deactivate it.
Use ‹ and › to flip pages. The pin button writes the page you are looking at into the embed's link as a #pN anchor (#p1 is the first page, #p2 the second, and so on), so the note keeps showing that page after a reload.
Use the command Drawio Preview: New diagram, the ribbon icon, or New drawio diagram in a folder's context menu. Where the file lands is controlled by the New diagram location setting.
| Setting | Description | Default |
|---|---|---|
| New diagram location | Where diagrams created by the command are saved: follow Obsidian's attachment folder, the folder of the current note, or a folder specified below. | Follow attachment folder |
| Folder specified below | Only editable when the location is set to a specified folder. Supports folder autocomplete; created automatically if missing. | — |
| Diagram preview appearance | When following the theme is on, the preview matches Obsidian's light/dark theme and the dropdown is disabled. Otherwise the dropdown picks light, dark, or transparent. | Follow theme with light |
| Cached preview files | Maximum number of cached SVGs. The oldest files are removed first. Only cache files are deleted, never your diagrams. | 20 (range 10–30) |
Drawio Preview is designed to work fully offline:
main.js; nothing is downloaded at runtime..drawio file with its default application.<your-vault>/.obsidian/plugins/drawio-preview/cache/. It holds rendered SVG files only, is capped by the setting above, and can be deleted at any time — the plugin simply regenerates it.Why is the first open slow? The first time a diagram is shown, the plugin loads the bundled drawio viewer (roughly 2.7 MB) and renders the diagram. The result is cached, so the same page opens almost instantly afterwards. A different page or an edited file needs one new render.
The Edit button does nothing.
It hands the file to your operating system, so a .drawio file needs an associated application. Install the drawio desktop app (or point the file type at the web app) and try again.
Where does the cache live, and can I clear it?
<your-vault>/.obsidian/plugins/drawio-preview/cache/. Delete the folder whenever you like; it is rebuilt on demand. The number of files kept is controlled by the Cached preview files setting.
licenses/drawio/.Bug reports and pull requests are welcome — please open an issue first for anything larger than a fix, so we can agree on the approach.
When reporting a problem, include your Obsidian version, the plugin version, and whether the diagram is an embed or a .drawio file view. A minimal .drawio file that reproduces the issue helps more than a screenshot.