layout.setPositions
setPositions(positions: object[]): voidSet the world-space positions of multiple nodes directly, bypassing layout computation.
Useful for restoring a previously saved layout or driving positions from
an external algorithm. Recorded in history as "SetPositions" (undoable).
Does not emit "layout:start" / "layout:end" events.
positions | object[] | Array of { id, x, y, z? } descriptors (z defaults to 0). |
Returns: void
Example
api.layout.setPositions([
{ id: "s1", x: 0, y: 0 },
{ id: "s2", x: 100, y: 50, z: 10 },
]);
- Set positions — programmatic placement
- Audio-reactive nodes — spectrum as a texture, not as uniforms
- Media components — video, images and audio with no shader
- Image mosaic — N image URLs, one draw call
- Sci-fi HUD — holographic dossier panels and reticles, two draw calls
- Broadcast monitors — a few nodes play video, the rest don't
- Node dossiers — a whole record as the node