Skip to main content

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:

Loading the editor…
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​

DirectionAPI
Mermaid β†’ sceneimportMermaid(text)
Graphviz (dot) β†’ sceneimportDot(text)
drawio β†’ sceneimportDrawio(xml)
Excalidraw β†’ sceneimportExcalidraw(json)
JSON Canvas (Obsidian) β†’ sceneimportJsonCanvas(json)
scene β†’ MermaidexportMermaid(scene)
scene ⇄ JSONserializeScene / 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.