Repository navigation
Objects and Expressions
Every object has an id and a type. IDs are unique within a space. References use spaceName.objectId, even when referring to an object in the same space.
Common object families include:
- Geometry: Point, Line, Arrow, Polygon, Circle, Rectangle, Arc and Bezier.
- Graphs: FunctionGraph, ParametricCurve, PolarGraph and ImplicitFunction.
- Relationships: PointOnCurve, Tangent, Angle and bounds helpers.
- Fields: ArrowVectorField, StreamLines and TracedPath.
- 3D: Sphere, Cube, Surface, Polyhedron and convex hulls.
- Labels/layouts: Text, MathTex, DecimalNumber, matrices, charts and graphs.
- Images: ImageMobject and ImageSequence.
- Composition: Group and PictureInPicture.
Use the exported supportedObjects list for the current inventory; the object reference defines each type’s fields.
Numeric fields can accept safe mathematical expression strings where their type is Scalar. Expressions support declared parameters, t, arithmetic, constants such as pi, and supported mathematical functions. Write multiplication explicitly: 2 * sin(x). Geometry supplies local variables such as x for a FunctionGraph and u, v for a Surface.
Expressions are parsed mathematical expressions, not JavaScript. Function callbacks and arbitrary property access are unsupported.
An object's scalar expressions can read a Point or PointOnCurve from another space:
{
"id": "connection",
"type": "Line",
"from": [0, 0],
"to": ["controls.handle.x", "controls.handle.y"]
}Here controls.handle must be a declared point. Its coordinates remain available when its space is hidden. These references follow dragging and seeking and use transformed Cartesian coordinates before camera projection. They connect mathematical coordinates, not screen positions between viewports. Destination coordinates still follow the destination space's native convention.
Missing references and dependency cycles are validation errors. These component references apply to object expressions, not event expressions.
Graph domain fields are optional. The Canvas player re-samples fully revealed
FunctionGraph objects over the visible window, respecting any explicit domain.
It refines curves to screen-space error with a bounded sampling budget, breaks
unresolved discontinuities, and caches samples until the view or object changes.
Nonlinear space maps use the same bounded source-coverage estimate as the grid;
arbitrary non-invertible maps cannot guarantee complete coverage.
Deterministic document evaluation, curve-dependent objects, 3D rendering, and
partially revealed Create/Uncreate animations retain the base samples:
FunctionGraph uses [-10, 10], PolarGraph uses [0, 2*pi], and
ParametricCurve uses [0, 1] when the domain is omitted. Explicit domains
also define that base interval. Natural mathematical domains are not inferred;
use explicit bounds for functions such as sqrt(x) whose base samples would
otherwise be invalid.
Canvas wheel zoom has no fixed pixels-per-unit cap. It stops before viewport bounds overflow or coordinate rounding exceeds a fraction of a screen pixel. Grid spacing follows the scale, with bounded iteration even at extreme values. Zoom easing remains on demand; expensive redraws use the existing direct-zoom fallback. This does not change the Three.js orbit camera or its clipping planes.
- Installation and development
- Browser quick start
- Scene documents
- Objects and expressions
- Document field reference
- Complete object reference
- Animation
- All animations and events
- Interaction and multiple views
- Browser player API
- Headless evaluation and validation
- Integration and lifecycle
- Features and limitations
- Publishing Webnim
- Troubleshooting
- Reference files