feat: trajectory3d.js, a 3-D path with a time marker (zero-build)
What
mountTrajectory3D(host, options) draws a path through three dimensions on a plain 2-D canvas, with a marker at the current time and the last trail seconds drawn heavier. It returns {update, setTime, show, resetView, destroy}. Zero-build, no dependencies, same shape as cellfield.js (a mount* function plus a .d.ts).
trajectory3d.js+trajectory3d.d.tsat the repo rootpackage.json: shipped infiles, new entry point./trajectory3d.jsdev_check.py:check_trajectory3d();scripts/api_surface.pytracks the export and the handle methods, so a later rename forces a breaking bump- Story: Science / 3-D views / Path with a time marker (zero-build, synthetic)
- Docs:
INTEGRATION.md§ 5 (and the allow-list line in § 1), a row inREADME.md
Versioning
Additive, so a patch. A new entry point and nothing existing changes. The React Trajectory3D (the hodogram on Scene3D) is a separate view and is untouched; no React wrapper was added for this module, to avoid a name collision.
Public-repo rule
- Method: a 3-D state-space path / phase portrait with a playhead. Standard.
- Data: the story integrates the Lorenz system (Lorenz 1963) in the story itself. Synthetic, and labelled so.
- Findings: none shown or stated.
Differences from the private copy it was ported from
- Axes are right-handed and positive pitch looks down, as in
src/science/space(the original was left-handed, seen from below). Paths appear mirrored relative to the original. - On a drag the near side follows the pointer (direction reversed).
- A two-finger touch pinch zooms. Before, only Ctrl/Cmd-scroll did.
- Arrow keys turn and
+/-zoom when the canvas has focus. - Redraws on a theme change; falls back to
--chart-1/--chart-4on the React theme.
Checked
python3 dev_check.py: 429/429npx tsc -p .: cleanpython3 scripts/api_surface.py --removed v0.5.16: nothing removed- In a browser: a zero-build page on
design.cssand the Storybook story, light and dark, and at 375 px (no sideways scroll). Turn, pinch, Ctrl-scroll zoom, keyboard, reset, destroy and live theme switch work; a plain scroll is left to the page. Pinch was tested with synthetic pointer events, not on a real phone.
Note for consumers
The canvas takes every touch that starts on it (touch-action: none), so a page needs scroll room beside or below it on a phone. Documented in INTEGRATION.md.
🤖 Generated with Claude Code