Expand description
§Saorsa Canvas WASM Application
This crate provides the WASM bindings for the Saorsa Canvas, enabling the canvas to run in web browsers.
§Usage
Build for WASM:
wasm-pack build --target web canvas-appThen import in JavaScript:
import init, { CanvasApp } from './pkg/canvas_app.js';
await init();
const app = new CanvasApp('main-canvas');
function render() {
app.render();
requestAnimationFrame(render);
}
render();Structs§
- Canvas
App - The main canvas application for WASM.
Functions§
- create_
chart_ element - Create a chart element JSON with sample data.
- create_
chart_ with_ data - Create a chart element JSON with custom data.
- create_
image_ element - Create an image element JSON.
- create_
text_ element - Create a text element JSON.
- create_
video_ element - Create a video element JSON.
- init_
wasm - Initialize the WASM module.