@chamuka-labs/engine
v0.3.1
Published
Embeddable Chamuka DrawIt engine — Rust-WASM diagramming core with full interactivity.
Readme
@chamuka-labs/engine
Embeddable Chamuka DrawIt engine — a Rust-WASM diagramming core with a minimal host API. Use this package to embed the Chamuka canvas in Storybook, docs sites, a CMS, the VSCode extension webview, or any other host that can run modern ESM + WebAssembly.
Install
npm install @chamuka-labs/engine
# or
pnpm add @chamuka-labs/engineQuickstart
import { createEngine } from '@chamuka-labs/engine';
const engine = await createEngine();
engine.loadDocument(myChamukaDoc);
const renderer = await engine.renderInto(
document.getElementById('canvas')!
);
engine.onEvent((e) => console.log(e));
// later…
renderer.resize(1024, 768);
renderer.dispose();API
createEngine(options?)— async factory; resolves to anEngine.Engine.loadDocument(json)— load a parsed.chamukadocument.Engine.toJSON()— serialize the current document.Engine.renderInto(target, options?)— async; mounts a PixiJS renderer intotargetand resolves with aRendereronce WebGL is ready.Engine.onEvent(listener)— subscribe to engine events. Returns anUnsubscribefunction.Engine.dispose()— release resources (including every renderer it handed out). Safe to call twice.
Stability
This is a 0.x release — the public surface may change between minor versions. We will freeze the contract at 1.0.
Status
0.2.0 wires the PixiJS renderer; the canvas now actually paints. See
docs/embed-sdk.md for the full host guide. Production-ready target
remains Q4 per the strategic plan.
