@oh-just-another/diagram-vue
| Install | |
|---|---|
npm install @oh-just-another/diagram-vue |
|
| Latest Version: | 0.3.17 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Sep 30, 2026 |
| Links: | GitHub · npm |
@oh-just-another/diagram-vue
Vue 3 wrapper for the diagram editor — a thin <Diagram> component over the framework-neutral <oja-diagram> custom element. The editor (canvas, WASM text shaping, workers, React internals) is bundled inside the custom element; this package just maps Vue props / events to it.
Install
pnpm add @oh-just-another/diagram-vue vue
vue is a peer dependency.
Usage
<script setup lang="ts">
import { ref } from "vue";
import { Diagram } from "@oh-just-another/diagram-vue";
import type { Scene } from "@oh-just-another/scene";
const scene = ref<Scene>();
const diagram = ref<InstanceType<typeof Diagram>>();
function save() {
scene.value = diagram.value?.getScene();
}
</script>
<template>
<Diagram
ref="diagram"
:scene="scene"
theme="system"
grid
snap
@scenechange="scene = $event"
@ready="({ editor }) => console.log('editor ready', editor)"
/>
</template>
The component fills its parent — give the parent (or the component) a height.
Props
| Prop | Type | Notes |
|---|---|---|
scene |
Scene |
Initial / current scene. |
theme |
"dark" | "light" | "system" |
Defaults to following the OS. |
renderer |
"canvas2d" | "webgl2" | "offscreen" |
Backend; auto-detected when omitted. |
grid |
boolean |
Show the background grid. |
snap |
boolean |
Snap dragged shapes to the grid. |
Events
@ready ({ editor }), @scenechange (Scene), @selectionchange (ElementId[]), @themechange ("dark" | "light" | "system").
Imperative API
Through a template ref: getScene, loadScene, undo, redo, zoomToFit, getActiveTool, setActiveTool, getSelection, setSelection.
Dev
pnpm --filter @oh-just-another/diagram-vue dev # example harness
Related Packages
Headless node-based board engine for spatial editors, diagramming tools, and whi...
The Vue editor for dumbshow: ComposerApp and its panes over @dumbshow/core — mou...
Process/execution diagram editor component with input/output params and script a...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.3.17 | ^3.4.0 | MIT | |
| 0.3.16 | ^3.4.0 | MIT | |
| 0.3.15 | ^3.4.0 | MIT | |
| 0.3.14 | ^3.4.0 | MIT | |
| 0.3.13 | ^3.4.0 | MIT | |
| 0.3.12 | ^3.4.0 | MIT | |
| 0.3.11 | ^3.4.0 | MIT | |
| 0.3.10 | ^3.4.0 | MIT | |
| 0.3.9 | ^3.4.0 | MIT | |
| 0.3.8 | ^3.4.0 | MIT | |
| 0.3.7 | ^3.4.0 | MIT | |
| 0.3.6 | ^3.4.0 | MIT | |
| 0.3.5 | ^3.4.0 | MIT | |
| 0.3.4 | ^3.4.0 | MIT | |
| 0.3.3 | ^3.4.0 | MIT | |
| 0.3.2 | ^3.4.0 | MIT | |
| 0.3.1 | ^3.4.0 | MIT | |
| 0.3.0 | ^3.4.0 | MIT | |
| 0.2.0 | ^3.4.0 | MIT |