Install EASEL.js
EASEL.js is published as the @xsyetopz/easel package. Use the package
manager already used by your application:
bun add @xsyetopz/easelnpm install @xsyetopz/easelThe package is also available through JSR:
bunx jsr add @xsyetopz/easelImport the library as an ES module. In a browser build, provide a Canvas2D element to the renderer or let it create one for you.
import * as EASEL from "@xsyetopz/easel";
const canvas = document.querySelector("canvas");if (!(canvas instanceof HTMLCanvasElement)) { throw new Error("A canvas element is required.");}
const renderer = new EASEL.Renderer({ canvas, width: 640, height: 360,});The renderer writes ImageData to Canvas2D. A browser that does not provide a
2D context cannot display a scene, but the scene graph and API modules remain
usable for non-rendering work.