oh-just-another/diagram
An open-source diagram editor library. The name is honest: yet another diagramming tool nobody asked for — Excalidraw exists, tldraw exists, drawio will outlive us all. I built mine anyway, to understand how these things work from the inside.
The public API is one React component:
1import {Editor} from "@oh-just-another/editor";
2import "@oh-just-another/react-ui/styles.css";
3
4export default function Diagram() {
5 return <Editor style={{position: "fixed", inset: 0}}/>;
6}
Five lines on the surface. Underneath: 26 published npm packages in a monorepo, organized into nine layers with one-way dependencies (enforced by dependency-cruiser, not just declared in the README), 63K lines of code plus 270 test files.
What’s inside:
- Three rendering backends — Canvas2D, WebGL2 (MSDF text, Loop-Blinn curves), and offscreen — with automatic fallback.
- Server-side export — the core layers are DOM-free, so a scene renders to PNG or SVG right in Node via resvg, no headless browser.
- Real collaboration — Yjs CRDT under the hood: peer cursors, branches, three-way merge. Works over WebSocket and between tabs via BroadcastChannel.
- Invertible-patch history — every patch stores both
beforeandafter, so undo is a symmetric swap. - Rust → wasm for the heavy parts: text shaping, MSDF glyph rasterization, Bézier flattening, stroke-to-fill.
- Own parsers for Mermaid, Graphviz, and drawio formats — no
mermaidorxmldomin the dependency tree, each parser tested against ReDoS.
Pre-1.0, the API still moves. MIT license, no watermark, no paid gate.
GitHub · The honest write-up · Internals
This page will change and grow as development goes on.