Import JSON into the Canvas
You can load a JSON document directly into the canvas to rebuild a scene.
- Call
editor.loadData({ objects })with the JSON payload. - Ensure each object has
id,type,transform, and visibility fields. - Optional: include a
variablesblock to import theme tokens (collections, variables, activeModes).
For server-side previews, use the Node renderer:
- Run
agent/render-demo.tswith the JSON input and output PNG. - The renderer uses
@designful/editor-nodeso it works without a browser.
You can also render on demand with the local API:
POST /api/render-json- Sends a JSON payload with
objects(and optionalcanvas). - Returns a PNG buffer.
Tip: Keep the JSON in source control so the preview image can be regenerated when the data changes.