Build a Canvas repaint plan
Lower a Graphics scene to versioned Canvas 2D commands.
Inspect a repaint plan
The Canvas target returns deterministic rix.canvas-plan@1 JSON. It is a sequence of drawing commands, not a replacement for .Graphics; a browser host can repaint it into any CanvasRenderingContext2D.
The plan preserves the scene dimensions and reports unsupported nodes through diagnostics. Use .Out("diagram.canvas.json", scene) to save it with the CLI.
- Browser: complete plan generation and optional host painting.
- CLI: no external tools.
- Options:
pixelRatio,viewport,selection, and portableassets.
Preserve interaction semantics
The serialized plan includes hit-test bounds and an accessibility text/object tree. A browser uses the exported host helpers for pointer inversion, hit testing, loading declared images, and repainting only the listed dirty regions.
Repaint without rebuilding semantics
For animation or reactive views, retain the semantic Graphic and generate a fresh plan only when its inputs change. A browser may then replay the commands against the same canvas; repainting does not parse RiX or mutate the Graphic.
Plan creation and painting are linear in the emitted command count. Hosts should reuse the canvas element and its context; the Phase 1 executor deliberately has no hidden scene cache or event state.