Data conversion
Text formats convert into scenes (and back), so external data renders as an editable diagram. This editor's content came from the Mermaid string below β live, on this page:
import { importMermaid } from "@oh-just-another/importers";
const scene = importMermaid(
"graph LR; A[Order placed] --> B{In stock?}; B -->|yes| C[Ship]; B -->|no| D[Backorder]; D --> C",
);
editor.loadScene(scene);
The conversion matrixβ
| Direction | API |
|---|---|
| Mermaid β scene | importMermaid(text) |
| Graphviz (dot) β scene | importDot(text) |
| drawio β scene | importDrawio(xml) |
| Excalidraw β scene | importExcalidraw(json) |
| JSON Canvas (Obsidian) β scene | importJsonCanvas(json) |
| scene β Mermaid | exportMermaid(scene) |
| scene β JSON | serializeScene / parseScene (versioned, with migrations) |
All importers are pure functions in @oh-just-another/importers β they run in the browser, in Node, and inside agents. Combine with headless rendering to turn any of these formats into SVG/PNG on a server.