Documentation
¶
Rendered for js/wasm
Overview ¶
Command prismwasm is the WebAssembly entry point for the Prism visualization library. It compiles to `bin/prism.wasm` and exposes the six-stage pipeline (spec → validate → plan → compile → encode → render) as `js.Func` methods on the `globalThis.prism` object.
JS callers marshal everything across the bridge as JSON strings:
const sceneJSON = prism.execute(specJSON, datasetsJSON); const svgString = prism.render(sceneJSON, "light"); const ok = prism.validate(specJSON);
Every exported function returns either a string (success) or an `{ok:false, error:{Code, Message, Fixups, SeeAlso, Context}}` envelope identical to the Twirp/MCP error shape. Boundary errors (missing argument, bad JSON) come back with code `PRISM_WASM_001`.
Click to show internal directories.
Click to hide internal directories.