Skip to content

Scene Documents

idadwind edited this page Sep 21, 2026 · 1 revision

Scene documents

A SceneDocument contains:

  • version: 1: required format version.
  • spaces: named coordinate spaces, each with an objects array.
  • parameters: optional named numeric values shared across spaces.
  • events: optional animation tracks.
  • duration: optional explicit timeline length in seconds.
  • theme: optional document-level colors; a space can override these.

The first space is initially active. The default duration is the latest event endpoint. Set an explicit duration when geometry uses t without animation events.

Coordinates

Space Native coordinates View
axis1d [x] Number line
plane2d [x, y] Cartesian plane
polar2d [radius, angle] Polar plane
space3d [x, y, z] 3D scene

Angles use radians. Geometry is converted to Cartesian coordinates for transforms and rendering. A FunctionGraph describes Cartesian y = f(x) and a PolarGraph describes r = f(theta). Primitive lengths and radii are Cartesian distances.

Space settings include axes, ticks, grid, camera and theme. axes can be a boolean or axis-name array. Camera settings include center, scale, and, for 3D, position and projection (perspective or orthographic).

Appearance

An object's style supports color, opacity, fillOpacity, strokeWidth, pointSize and fontSize. Use six-digit hex colors such as #58a6ff; opacity values are between zero and one.

Document/space themes support background, foreground, axes, grid and an objectColors palette. Explicit object colors take precedence over the palette. The older builder API has a different theme shape; do not pass its theme options unchanged into scene documents.


Wiki home · Quick start

Clone this wiki locally