Owen Mermaid

approved

by Owen lee

Zoom, visually edit, and export Mermaid SVG diagrams in Obsidian. - This plugin has not been manually reviewed by Obsidian staff.

325 downloadsUpdated 11d agoMIT

Owen Kit

Owen Mermaid

[!NOTE] Language: Owen Mermaid follows Obsidian by default: Korean uses Korean, while every other locale uses English. Override it from Settings → Owen Mermaid → Interface → Language.

Owen Mermaid is an Obsidian plugin for viewing and editing Mermaid SVG images inside your notes.

  • Detects Mermaid SVG diagrams and adds an inline glass toolbar.
  • Adds a Mermaid SVG right-click menu for zoom view, editing, PNG download, and JPG download.
  • Provides a full-screen pan and zoom viewer.
  • Includes a flowchart-focused visual editor for creating shapes, dragging nodes, editing text, creating/editing/deleting connectors, and writing changes back to the original Mermaid code block.
  • Supports PNG/JPG download settings for save location, output folder, filename template, quality, background, and scale.
  • Exports all rendered Mermaid SVG diagrams in the active note to a vault folder with an optional Markdown batch report.
  • Provides a settings screen with section headers like the screenshot design.
  • Supports mouse drag-and-drop Mermaid editing directly on the canvas, similar to working in Visio.
  • Applies a liquid glass design tone inspired by Owen Graphite and Owen Editor.

Screenshots

Owen Mermaid menu

Owen Mermaid zoom viewer

Owen Mermaid visual editor

Owen Mermaid visual editor 1

Owen Mermaid visual editor 2

Owen Mermaid visual editor 3

Owen Mermaid visual editor 4

Owen Mermaid visual editor 5

Owen Mermaid visual editor 6

Features

When adding new functionality, add a new row to this table so the current feature surface stays easy to scan.

AreaFeatureNotes
Rendered diagramsInline glass toolbarAdds zoom, edit, and image download controls to rendered Mermaid SVG blocks.
Rendered diagramsContext menu actionsRight-click a rendered Mermaid SVG to open zoom, edit, PNG download, or JPG download actions.
Zoom viewerFull-screen pan and zoomOpens rendered Mermaid SVGs in a large viewer with zoom controls, reset, and drag panning.
Visual editorFlowchart editingCreates, edits, drags, resizes, duplicates, and deletes common flowchart nodes.
Visual editorBasic state and sequence editingParses and edits basic stateDiagram and sequenceDiagram participants, states, and messages.
Visual editorDrag-and-drop creationSupports clicking or dragging shape tools onto the canvas.
Visual editorLong canvas panningScrolls oversized diagrams by dragging the editor background horizontally or vertically.
Visual editorFitted node labelsWraps, scales, and truncates long or explicit multi-line labels to keep text inside node bounds.
Visual editorConnector editingCreates, reconnects, reverses, styles, deletes, and labels connectors and free lines.
Visual editorConnector route modesSupports curve, straight, and elbow connector routes stored in Owen Mermaid metadata.
Visual editorDraggable connector labelsAllows connector and free-line labels to be repositioned visually and preserved in metadata.
Visual editorSelf connectorsAdds self-loop connectors from the node context menu.
Visual editorMulti-select nodesSupports modifier-click node selection, group movement, group deletion, and selection-aware inspector controls.
Visual editorAlignment and distributionAligns selected nodes left/center/right/top/middle/bottom and distributes selected nodes horizontally or vertically.
Visual editorView navigationProvides editor zoom, reset, fit-to-screen, center-selection, and a minimap navigator.
Visual editorSnap controlsSupports snap on/off and configurable 10/20/40 grid spacing.
Visual editorUndo and redoTracks editor changes across drag, resize, text, source, layout, connector, and group operations.
Visual editorSource preview and editingShows Mermaid source, supports explicit source editing, and applies source changes back into the visual model.
Visual editorUnsaved-change protectionPrompts before closing the editor when unapplied visual/source changes exist.
Visual editorSource diff previewShows a compact Mermaid source diff before applying changes.
Visual editorPreserved unsupported linesDisplays preserved unsupported Mermaid lines such as styles, classes, click handlers, link styles, and subgraph blocks.
Mermaid sourceLayout metadataPersists node size/position, free lines, connector routes, and label offsets in %% owen-mermaid metadata.
Mermaid sourceExact block targetingRe-resolves the clicked Mermaid fence and rejects ambiguous stale matches instead of editing another diagram.
ExportSingle image downloadDownloads rendered Mermaid SVGs as PNG or JPG with configured scale, background, and quality.
ExportBatch exportExports every rendered Mermaid SVG in the active note to a vault folder.
ExportBatch reportsOptionally writes a Markdown report for all batch exports or failures only.
SettingsExport configurationConfigures format, output folder, filename template, scale, quality, and background.
UILiquid glass designUses an Owen Graphite inspired liquid glass style for toolbars, settings, viewer, and editor surfaces.

Usage

  1. Create a Mermaid code block in an Obsidian note.
  2. View the note in Reading view or Live Preview.
  3. Hover a rendered Mermaid diagram to use the inline buttons.
  4. Right-click the Mermaid SVG to open zoom, edit, or download actions.
  5. Run Export Mermaid diagrams in active note from the command palette to batch-export every rendered Mermaid SVG in the current note.

The visual editor currently targets common flowchart/graph Mermaid syntax: nodes, basic shapes, labels, and connectors. It also handles basic stateDiagram and sequenceDiagram structures. Mermaid init directives are preserved before the regenerated header, and unsupported lines or subgraph blocks are preserved in the generated output section when possible.

Mermaid Compatibility

Owen Mermaid keeps Mermaid source editable first and visual editing focused. Use this matrix to decide what should round-trip visually, what is preserved as source, and what may need direct source editing.

Syntax areaVisual editingSource preservationNotes
flowchart / graph headersYesYesSupports TD, LR, BT, and RL; unsupported or missing headers fall back to the configured editor direction.
Flowchart nodesYesYesSupports rectangle, rounded, stadium, diamond, and circle shapes with common quoted or unquoted labels.
Flowchart connectorsYesYesSupports line, arrow, dotted, thick, labels, self connectors, and Owen Mermaid route/label metadata.
Flowchart stylesPartialYesstyle and linkStyle colors are parsed for editable items; classDef, class, and click lines are preserved.
SubgraphsNoYesSubgraph blocks are preserved as source and are not expanded into editable canvas items.
Mermaid init directivesNoYes%%{init: ...}%% lines stay before the regenerated diagram header.
stateDiagram / stateDiagram-v2BasicYesSupports named states, start/end markers, basic transitions, labels, and Owen Mermaid color classes.
sequenceDiagramBasicYesSupports participants, actors, aliases, and basic ->, -->, ->>, and -->> messages.
Owen layout metadataYesYes%% owen-mermaid metadata stores visual positions, sizes, routes, label offsets, colors, and free lines.
Other Mermaid featuresSource onlyBest effortUnsupported lines remain in the source preview/preserved section when the parser can safely keep them.

Keyboard shortcuts inside the editor:

  • Ctrl/Cmd + Z: undo the last editor change.
  • Ctrl/Cmd + Y or Ctrl/Cmd + Shift + Z: redo the last undone change.
  • Enter: edit the selected node, connector, or free line text.
  • Delete/Backspace: delete the selected item.
  • Arrow keys: move the selected node or free line.
  • Shift + arrow keys: move by the grid snap size.
  • Shift/Ctrl/Cmd + click: add or remove nodes from the current multi-selection.
  • Escape: cancel the active placement or connector tool.

Batch export notes:

  • Batch export uses the configured image format, filename template, output folder, scale, background, and quality.
  • Files are written to the vault output folder and automatically receive a numeric suffix instead of overwriting existing files.
  • The batch report setting controls whether a Markdown report is written never, only on failures, or every time.

Development

npm install
npm run dev
npm run build
npm test

Release validation:

npm run release:check

Optional Obsidian smoke test:

Obsidian --remote-debugging-port=9222
npm run test:obsidian

The smoke test connects to the running Obsidian app over CDP, confirms that Owen Mermaid is enabled, checks command registration, creates a temporary Mermaid note, verifies the rendered SVG toolbar, opens the visual editor, and then removes the temporary note. Set OWEN_MERMAID_SMOKE_SKIP_UI=1 to run only the command-registration checks.

Manual install for testing:

<vault>/.obsidian/plugins/owen-mermaid/

Copy main.js, manifest.json, and styles.css into that folder, reload Obsidian, and enable Owen Mermaid from Community plugins.

Release Files

Community release assets should include:

  • manifest.json
  • main.js
  • styles.css

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.