prismwasm

command
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 21 Imported by: 0

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`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL