astraeus 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +92 -11
- package/data/ephemerides/planets/planets.json +1 -1
- package/package.json +1 -1
- package/src/api/AstraeusScene.d.ts +9 -1
- package/src/api/AstraeusScene.js +26 -4
- package/src/api/AstraeusScene.node.js +26 -4
- package/src/api/activity.d.ts +1 -1
- package/src/api/activity.js +1 -1
- package/src/api/bodies.d.ts +2 -0
- package/src/api/bodies.js +2 -0
- package/src/api/data.js +11 -1
- package/src/api/errors.d.ts +1 -1
- package/src/api/index.d.ts +3 -2
- package/src/api/index.js +1 -1
- package/src/api/index.node.js +1 -1
- package/src/api/mount.d.ts +16 -0
- package/src/api/mount.js +13 -1
- package/src/api/mount.node.js +13 -1
- package/src/api/pathProvenance.d.ts +10 -0
- package/src/api/pathProvenance.js +34 -0
- package/src/api/scene.d.ts +26 -5
- package/src/api/scene.js +197 -44
- package/src/api/story.d.ts +41 -1
- package/src/api/story.js +63 -1
- package/src/api/sunOrbit.d.ts +3 -3
- package/src/api/sunOrbit.js +92 -24
- package/src/api/viewerLink.d.ts +40 -0
- package/src/api/viewerLink.js +86 -0
- package/src/app/App.d.ts +4 -1
- package/src/app/App.js +42 -6
- package/src/app/App.node.js +42 -6
- package/src/app/AstraeusScene.d.ts +7 -0
- package/src/app/BodySetView.js +3 -2
- package/src/app/KeplerPoints.d.ts +1 -1
- package/src/app/KeplerPoints.js +3 -2
- package/src/app/PointsView.js +3 -2
- package/src/app/SceneLabels.d.ts +2 -0
- package/src/app/SceneLabels.js +5 -1
- package/src/app/TrackedBodyView.d.ts +9 -3
- package/src/app/TrackedBodyView.js +54 -14
- package/src/app/bodyDraw.js +3 -2
- package/src/app/dotMaterial.d.ts +11 -0
- package/src/app/dotMaterial.js +38 -0
- package/src/app/experienceDefinition.d.ts +12 -0
- package/src/app/mission.d.ts +3 -1
- package/src/app/mission.js +1 -1
- package/src/app/openClock.d.ts +1 -1
- package/src/app/openClock.js +3 -0
- package/src/app/pathRules.d.ts +7 -3
- package/src/app/pathRules.js +9 -5
- package/src/app/sceneContentsHooks.js +2 -1
- package/src/app/sceneDebug.d.ts +4 -2
- package/src/app/sceneFrame.d.ts +2 -2
- package/src/app/sceneFrame.js +7 -2
- package/src/app/sceneFraming.d.ts +1 -1
- package/src/app/sceneFraming.js +9 -3
- package/src/app/viewerPort.d.ts +33 -0
- package/src/app/viewerPort.js +1 -0
- package/src/core/bodies/io.js +1 -1
- package/src/core/bodies/jupiterMoons.d.ts +1 -1
- package/src/core/bodies/jupiterMoons.js +6 -6
- package/src/core/bodies/moonSystem.d.ts +15 -1
- package/src/core/bodies/moonSystem.js +58 -7
- package/src/core/bodies/outerPlanets.js +1 -1
- package/src/core/bodies/planetMoons.js +10 -10
- package/src/core/chebyshevEphemeris.d.ts +7 -1
- package/src/core/chebyshevEphemeris.js +24 -7
- package/src/core/clock.d.ts +8 -0
- package/src/core/clock.js +14 -0
- package/src/core/pacing.d.ts +24 -0
- package/src/core/pacing.js +35 -0
- package/src/core/planetModels.d.ts +4 -1
- package/src/core/planetModels.js +6 -1
- package/src/core/planetSeries.d.ts +3 -0
- package/src/core/planetSeries.js +8 -1
- package/src/core/scalePolicy.d.ts +2 -0
- package/src/core/scalePolicy.js +2 -0
- package/src/core/timeWindow.d.ts +2 -0
- package/src/core/timeWindow.js +4 -3
- package/src/shell/AstraeusShell.d.ts +6 -2
- package/src/shell/AstraeusShell.js +3 -3
- package/src/shell/AstraeusShell.node.js +3 -3
- package/src/shell/TimelineBar.d.ts +4 -2
- package/src/shell/TimelineBar.js +15 -6
- package/src/shell/TimelineBar.node.js +15 -6
- package/src/shell/experience.d.ts +3 -1
- package/src/shell/infoModel.js +5 -4
- package/src/shell/timelineModel.d.ts +2 -3
- package/src/shell/timelineModel.js +3 -11
- package/src/synthetic/syntheticJourneyScene.d.ts +9 -0
- package/src/synthetic/syntheticJourneyScene.js +75 -0
- package/src/synthetic/syntheticProbeDefinition.d.ts +5 -0
- package/src/synthetic/syntheticProbeDefinition.js +38 -0
|
@@ -9,7 +9,9 @@ interface Props {
|
|
|
9
9
|
readonly experience: ExperienceConfig;
|
|
10
10
|
readonly snapshot: ClockSnapshot;
|
|
11
11
|
readonly onTogglePlayback: () => void;
|
|
12
|
-
readonly onRateChange: (rate: number) => void;
|
|
12
|
+
readonly onRateChange: (rate: number | "auto") => void;
|
|
13
|
+
/** Present only for a scene with pacing: true while pacing sets the speed. The menu then gains an Auto choice, selected while it is. */
|
|
14
|
+
readonly paceAuto?: boolean | undefined;
|
|
13
15
|
readonly onSeek: (timeUtcMs: number) => void;
|
|
14
16
|
/** Story panels drawn as markers on the track; pressing one seeks to it and opens it. */
|
|
15
17
|
readonly panels?: readonly StoryPanel[];
|
|
@@ -32,7 +34,7 @@ interface Props {
|
|
|
32
34
|
readonly swipeThresholdPx: number;
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
export declare function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, onSeek, panels, openPanelId, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook, drawer }: Props): import("react").JSX.Element;
|
|
37
|
+
export declare function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels, openPanelId, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook, drawer }: Props): import("react").JSX.Element;
|
|
36
38
|
interface ExpandedProps {
|
|
37
39
|
readonly experience: ExperienceConfig;
|
|
38
40
|
readonly snapshot: ClockSnapshot;
|
package/src/shell/TimelineBar.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
|
-
import { eventContextAt, eventPositionPercent, formatUtcTimestamp, formatWindowRate, navigationStops, windowContextAt, timePositionPercent,
|
|
3
|
+
import { eventContextAt, eventPositionPercent, formatUtcTimestamp, formatWindowRate, navigationStops, windowContextAt, timePositionPercent, speedsOf, TIMELINE_STEP_MS, clampToBounds, formatRateCompact, formatRate } from "./timelineModel.js";
|
|
4
4
|
import { activityAt, DEFAULT_TIMELINE_GLOW, glowDescription, glowGradient, glowProfile, glowTooltip } from "./timelineGlow.js";
|
|
5
5
|
import { Label } from "./Label.js";
|
|
6
6
|
import { useDrawerSwipe } from "./useDrawerSwipe.js";
|
|
7
7
|
import "./TimelineBar.css";
|
|
8
|
+
/** The Auto choice of the speed menu: just "Auto", or with the speed pacing is running at now. */
|
|
9
|
+
function autoLabel(showRate, rate) {
|
|
10
|
+
return showRate ? `Auto — ${formatRate(Math.round(rate * 10) / 10)}` : "Auto";
|
|
11
|
+
}
|
|
12
|
+
/** The speed menu: the scene's speeds, preceded by Auto in a scene with pacing (selected while pacing sets the speed). On a phone it shows each rate in a few characters; the speed slider in the drawer says it in words. */
|
|
13
|
+
function SpeedMenu({ speeds, rate, paceAuto, compact, onRateChange }) {
|
|
14
|
+
return (_jsxs("label", { className: "timeline-speed", children: [_jsx("span", { children: "Playback rate" }), _jsxs("select", { "aria-label": "Playback speed", title: "Playback speed", value: paceAuto === true ? "auto" : rate, onChange: (event) => onRateChange(event.target.value === "auto" ? "auto" : Number(event.target.value)), children: [paceAuto !== undefined && _jsx("option", { value: "auto", children: autoLabel(paceAuto && !compact, rate) }), speeds.map((speed) => _jsx("option", { value: speed.rate, children: compact ? formatRateCompact(speed.rate) : speed.label }, speed.rate))] })] }));
|
|
15
|
+
}
|
|
8
16
|
/** The seek slider's spoken value: the time, with the activity window and its rate when one is running. */
|
|
9
17
|
function seekValueText(timeUtcMs, activityNow) {
|
|
10
18
|
if (activityNow === null || activityNow.window.rate === undefined)
|
|
11
19
|
return formatUtcTimestamp(timeUtcMs);
|
|
12
20
|
return `${formatUtcTimestamp(timeUtcMs)}, ${activityNow.window.label}: ${formatWindowRate(activityNow.rate, activityNow.window.rate.unit)}`;
|
|
13
21
|
}
|
|
14
|
-
export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, onSeek, panels = [], openPanelId = null, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook = DEFAULT_TIMELINE_GLOW, drawer }) {
|
|
22
|
+
export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels = [], openPanelId = null, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook = DEFAULT_TIMELINE_GLOW, drawer }) {
|
|
15
23
|
const windows = experience.windows ?? [];
|
|
16
24
|
const profile = useMemo(() => glowProfile(windows, experience.window), [windows, experience.window]);
|
|
17
25
|
const gradients = useMemo(() => ({ ahead: glowGradient(profile, glowLook, "ahead"), played: glowGradient(profile, glowLook, "played") }), [profile, glowLook]);
|
|
@@ -36,7 +44,7 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
|
|
|
36
44
|
onWindowSeek(stop.window, stop.timeUtcMs);
|
|
37
45
|
};
|
|
38
46
|
const stopLabel = (direction, stop) => windows.length === 0 || stop === null ? `${direction} event` : `${direction}: ${stop.label}`;
|
|
39
|
-
const speeds =
|
|
47
|
+
const speeds = speedsOf(experience.rates);
|
|
40
48
|
const timestamp = formatUtcTimestamp(snapshot.timeUtcMs);
|
|
41
49
|
const handle = useDrawerSwipe({
|
|
42
50
|
thresholdPx: drawer?.swipeThresholdPx ?? 0,
|
|
@@ -44,6 +52,7 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
|
|
|
44
52
|
onSwipe: (direction) => drawer?.onOpenChange(direction === "up"),
|
|
45
53
|
});
|
|
46
54
|
const speedIndex = Math.max(0, speeds.findIndex((speed) => speed.rate === snapshot.rate));
|
|
55
|
+
const speedText = paceAuto === true ? autoLabel(true, snapshot.rate) : speeds[speedIndex]?.label;
|
|
47
56
|
const scrubber = (_jsxs("div", { className: "timeline-scrubber", children: [_jsxs("div", { className: "timeline-track", title: profile === null ? undefined : hoverTitle ?? description, onPointerMove: moveOnTrack, onPointerLeave: () => setHoverTitle(null), children: [_jsxs("div", { className: "timeline-glow", ...(description === "" ? { "aria-hidden": true } : { role: "img", "aria-label": description }), style: {
|
|
48
57
|
"--glow-ahead": gradients.ahead,
|
|
49
58
|
"--glow-played": gradients.played,
|
|
@@ -54,9 +63,9 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
|
|
|
54
63
|
onWindowSeek(window, window.peakUtcMs); onWindowInfo(window); } }, `peak-${window.id}`)))] }), _jsx("input", { type: "range", "aria-label": "Seek timeline", "aria-valuetext": valueText, min: experience.window.startUtcMs, max: experience.window.endUtcMs, step: TIMELINE_STEP_MS, value: clampToBounds(snapshot.timeUtcMs, experience.window), onChange: (event) => onSeek(Number(event.target.value)) })] }), _jsxs("div", { className: "timeline-bounds", "aria-hidden": "true", children: [_jsx("time", { dateTime: formatUtcTimestamp(experience.window.startUtcMs), children: formatUtcTimestamp(experience.window.startUtcMs).slice(0, 10) }), _jsx("time", { dateTime: formatUtcTimestamp(experience.window.endUtcMs), children: formatUtcTimestamp(experience.window.endUtcMs).slice(0, 10) })] })] }));
|
|
55
64
|
return (_jsxs("section", { className: "timeline-bar", "aria-label": "Timeline controls", "data-drawer-open": drawer?.open, children: [drawer !== undefined && (_jsx("button", { type: "button", className: "drawer-handle drawer-handle-top ui-bare", "aria-label": "Timeline drawer", "aria-expanded": drawer.open, "aria-controls": "timeline-drawer", ...handle, children: _jsx("span", {}) })), _jsxs("div", { className: "timeline-main-row", children: [_jsxs("div", { className: "timeline-transport", children: [_jsx("button", { type: "button", className: "timeline-play ui-icon ui-accent", title: snapshot.playing ? "Pause" : "Play", onClick: onTogglePlayback, "aria-label": snapshot.playing ? "Pause playback" : "Play playback", children: snapshot.playing ? _jsx(Symbol, { path: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }) : _jsx(Symbol, { path: "M7 5v14l12-7z" }) }), _jsx("button", { type: "button", className: "timeline-previous ui-icon ui-ghost", "aria-label": stopLabel("Previous", navigation.previous), title: stopLabel("Previous", navigation.previous), disabled: navigation.previous === null, onClick: () => { if (navigation.previous !== null)
|
|
56
65
|
goToStop(navigation.previous); }, children: _jsx(Symbol, { path: "M6 5h2v14H6zM19 5v14L9 12z" }) }), _jsx("button", { type: "button", className: "timeline-next ui-icon ui-ghost", "aria-label": stopLabel("Next", navigation.next), title: stopLabel("Next", navigation.next), disabled: navigation.next === null, onClick: () => { if (navigation.next !== null)
|
|
57
|
-
goToStop(navigation.next); }, children: _jsx(Symbol, { path: "M16 5h2v14h-2zM5 5v14l10-7z" }) })] }), _jsxs("time", { className: "timeline-time", dateTime: timestamp, "aria-label": timestamp, children: [_jsx("span", { className: "timeline-time-full", children: timestamp }), _jsx("span", { className: "timeline-time-short", "aria-hidden": "true", children: timestamp.slice(0, 16).replace("T", " ") })] }),
|
|
58
|
-
drawer.onOpenChange(false); }, children: _jsxs("div", { className: "timeline-drawer-body", children: [_jsxs("div", { className: "timeline-speed-slider", children: [_jsx("span", { "aria-hidden": "true", children: "Playback speed" }), _jsx("input", { type: "range", "aria-label": "Speed slider", "aria-valuetext":
|
|
59
|
-
onRateChange(next.rate); } }), _jsx("output", { children:
|
|
66
|
+
goToStop(navigation.next); }, children: _jsx(Symbol, { path: "M16 5h2v14h-2zM5 5v14l10-7z" }) })] }), _jsxs("time", { className: "timeline-time", dateTime: timestamp, "aria-label": timestamp, children: [_jsx("span", { className: "timeline-time-full", children: timestamp }), _jsx("span", { className: "timeline-time-short", "aria-hidden": "true", children: timestamp.slice(0, 16).replace("T", " ") })] }), _jsx(SpeedMenu, { speeds: speeds, rate: snapshot.rate, paceAuto: paceAuto, compact: drawer !== undefined, onRateChange: onRateChange }), scrubber, drawer === undefined && (_jsxs("details", { className: "timeline-event-list", children: [_jsxs("summary", { className: "ui-button", title: "Events: what just happened, what is next, and the full list", children: ["Events ", _jsxs("span", { children: ["(", experience.events.length, ")"] })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo })] }))] }), drawer !== undefined && (_jsx("div", { id: "timeline-drawer", className: "timeline-drawer", role: "region", "aria-label": "Timeline details", "data-open": drawer.open, onClick: (event) => { const closer = event.target.closest("[data-closes-drawer]"); if (closer !== null && closer.tagName !== "SELECT")
|
|
67
|
+
drawer.onOpenChange(false); }, children: _jsxs("div", { className: "timeline-drawer-body", children: [_jsxs("div", { className: "timeline-speed-slider", children: [_jsx("span", { "aria-hidden": "true", children: "Playback speed" }), _jsx("input", { type: "range", "aria-label": "Speed slider", "aria-valuetext": speedText, min: 0, max: speeds.length - 1, step: 1, value: speedIndex, onChange: (event) => { const next = speeds[Number(event.target.value)]; if (next !== undefined)
|
|
68
|
+
onRateChange(next.rate); } }), _jsx("output", { children: speedText })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo })] }) }))] }));
|
|
60
69
|
}
|
|
61
70
|
/** A 24x24 filled symbol; the button around it carries the accessible name and tooltip. */
|
|
62
71
|
function Symbol({ path }) {
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
|
-
import { eventContextAt, eventPositionPercent, formatUtcTimestamp, formatWindowRate, navigationStops, windowContextAt, timePositionPercent,
|
|
3
|
+
import { eventContextAt, eventPositionPercent, formatUtcTimestamp, formatWindowRate, navigationStops, windowContextAt, timePositionPercent, speedsOf, TIMELINE_STEP_MS, clampToBounds, formatRateCompact, formatRate } from "./timelineModel.js";
|
|
4
4
|
import { activityAt, DEFAULT_TIMELINE_GLOW, glowDescription, glowGradient, glowProfile, glowTooltip } from "./timelineGlow.js";
|
|
5
5
|
import { Label } from "./Label.js";
|
|
6
6
|
import { useDrawerSwipe } from "./useDrawerSwipe.js";
|
|
7
|
+
/** The Auto choice of the speed menu: just "Auto", or with the speed pacing is running at now. */
|
|
8
|
+
function autoLabel(showRate, rate) {
|
|
9
|
+
return showRate ? `Auto — ${formatRate(Math.round(rate * 10) / 10)}` : "Auto";
|
|
10
|
+
}
|
|
11
|
+
/** The speed menu: the scene's speeds, preceded by Auto in a scene with pacing (selected while pacing sets the speed). On a phone it shows each rate in a few characters; the speed slider in the drawer says it in words. */
|
|
12
|
+
function SpeedMenu({ speeds, rate, paceAuto, compact, onRateChange }) {
|
|
13
|
+
return (_jsxs("label", { className: "timeline-speed", children: [_jsx("span", { children: "Playback rate" }), _jsxs("select", { "aria-label": "Playback speed", title: "Playback speed", value: paceAuto === true ? "auto" : rate, onChange: (event) => onRateChange(event.target.value === "auto" ? "auto" : Number(event.target.value)), children: [paceAuto !== undefined && _jsx("option", { value: "auto", children: autoLabel(paceAuto && !compact, rate) }), speeds.map((speed) => _jsx("option", { value: speed.rate, children: compact ? formatRateCompact(speed.rate) : speed.label }, speed.rate))] })] }));
|
|
14
|
+
}
|
|
7
15
|
/** The seek slider's spoken value: the time, with the activity window and its rate when one is running. */
|
|
8
16
|
function seekValueText(timeUtcMs, activityNow) {
|
|
9
17
|
if (activityNow === null || activityNow.window.rate === undefined)
|
|
10
18
|
return formatUtcTimestamp(timeUtcMs);
|
|
11
19
|
return `${formatUtcTimestamp(timeUtcMs)}, ${activityNow.window.label}: ${formatWindowRate(activityNow.rate, activityNow.window.rate.unit)}`;
|
|
12
20
|
}
|
|
13
|
-
export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, onSeek, panels = [], openPanelId = null, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook = DEFAULT_TIMELINE_GLOW, drawer }) {
|
|
21
|
+
export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels = [], openPanelId = null, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook = DEFAULT_TIMELINE_GLOW, drawer }) {
|
|
14
22
|
const windows = experience.windows ?? [];
|
|
15
23
|
const profile = useMemo(() => glowProfile(windows, experience.window), [windows, experience.window]);
|
|
16
24
|
const gradients = useMemo(() => ({ ahead: glowGradient(profile, glowLook, "ahead"), played: glowGradient(profile, glowLook, "played") }), [profile, glowLook]);
|
|
@@ -35,7 +43,7 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
|
|
|
35
43
|
onWindowSeek(stop.window, stop.timeUtcMs);
|
|
36
44
|
};
|
|
37
45
|
const stopLabel = (direction, stop) => windows.length === 0 || stop === null ? `${direction} event` : `${direction}: ${stop.label}`;
|
|
38
|
-
const speeds =
|
|
46
|
+
const speeds = speedsOf(experience.rates);
|
|
39
47
|
const timestamp = formatUtcTimestamp(snapshot.timeUtcMs);
|
|
40
48
|
const handle = useDrawerSwipe({
|
|
41
49
|
thresholdPx: drawer?.swipeThresholdPx ?? 0,
|
|
@@ -43,6 +51,7 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
|
|
|
43
51
|
onSwipe: (direction) => drawer?.onOpenChange(direction === "up"),
|
|
44
52
|
});
|
|
45
53
|
const speedIndex = Math.max(0, speeds.findIndex((speed) => speed.rate === snapshot.rate));
|
|
54
|
+
const speedText = paceAuto === true ? autoLabel(true, snapshot.rate) : speeds[speedIndex]?.label;
|
|
46
55
|
const scrubber = (_jsxs("div", { className: "timeline-scrubber", children: [_jsxs("div", { className: "timeline-track", title: profile === null ? undefined : hoverTitle ?? description, onPointerMove: moveOnTrack, onPointerLeave: () => setHoverTitle(null), children: [_jsxs("div", { className: "timeline-glow", ...(description === "" ? { "aria-hidden": true } : { role: "img", "aria-label": description }), style: {
|
|
47
56
|
"--glow-ahead": gradients.ahead,
|
|
48
57
|
"--glow-played": gradients.played,
|
|
@@ -53,9 +62,9 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
|
|
|
53
62
|
onWindowSeek(window, window.peakUtcMs); onWindowInfo(window); } }, `peak-${window.id}`)))] }), _jsx("input", { type: "range", "aria-label": "Seek timeline", "aria-valuetext": valueText, min: experience.window.startUtcMs, max: experience.window.endUtcMs, step: TIMELINE_STEP_MS, value: clampToBounds(snapshot.timeUtcMs, experience.window), onChange: (event) => onSeek(Number(event.target.value)) })] }), _jsxs("div", { className: "timeline-bounds", "aria-hidden": "true", children: [_jsx("time", { dateTime: formatUtcTimestamp(experience.window.startUtcMs), children: formatUtcTimestamp(experience.window.startUtcMs).slice(0, 10) }), _jsx("time", { dateTime: formatUtcTimestamp(experience.window.endUtcMs), children: formatUtcTimestamp(experience.window.endUtcMs).slice(0, 10) })] })] }));
|
|
54
63
|
return (_jsxs("section", { className: "timeline-bar", "aria-label": "Timeline controls", "data-drawer-open": drawer?.open, children: [drawer !== undefined && (_jsx("button", { type: "button", className: "drawer-handle drawer-handle-top ui-bare", "aria-label": "Timeline drawer", "aria-expanded": drawer.open, "aria-controls": "timeline-drawer", ...handle, children: _jsx("span", {}) })), _jsxs("div", { className: "timeline-main-row", children: [_jsxs("div", { className: "timeline-transport", children: [_jsx("button", { type: "button", className: "timeline-play ui-icon ui-accent", title: snapshot.playing ? "Pause" : "Play", onClick: onTogglePlayback, "aria-label": snapshot.playing ? "Pause playback" : "Play playback", children: snapshot.playing ? _jsx(Symbol, { path: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }) : _jsx(Symbol, { path: "M7 5v14l12-7z" }) }), _jsx("button", { type: "button", className: "timeline-previous ui-icon ui-ghost", "aria-label": stopLabel("Previous", navigation.previous), title: stopLabel("Previous", navigation.previous), disabled: navigation.previous === null, onClick: () => { if (navigation.previous !== null)
|
|
55
64
|
goToStop(navigation.previous); }, children: _jsx(Symbol, { path: "M6 5h2v14H6zM19 5v14L9 12z" }) }), _jsx("button", { type: "button", className: "timeline-next ui-icon ui-ghost", "aria-label": stopLabel("Next", navigation.next), title: stopLabel("Next", navigation.next), disabled: navigation.next === null, onClick: () => { if (navigation.next !== null)
|
|
56
|
-
goToStop(navigation.next); }, children: _jsx(Symbol, { path: "M16 5h2v14h-2zM5 5v14l10-7z" }) })] }), _jsxs("time", { className: "timeline-time", dateTime: timestamp, "aria-label": timestamp, children: [_jsx("span", { className: "timeline-time-full", children: timestamp }), _jsx("span", { className: "timeline-time-short", "aria-hidden": "true", children: timestamp.slice(0, 16).replace("T", " ") })] }),
|
|
57
|
-
drawer.onOpenChange(false); }, children: _jsxs("div", { className: "timeline-drawer-body", children: [_jsxs("div", { className: "timeline-speed-slider", children: [_jsx("span", { "aria-hidden": "true", children: "Playback speed" }), _jsx("input", { type: "range", "aria-label": "Speed slider", "aria-valuetext":
|
|
58
|
-
onRateChange(next.rate); } }), _jsx("output", { children:
|
|
65
|
+
goToStop(navigation.next); }, children: _jsx(Symbol, { path: "M16 5h2v14h-2zM5 5v14l10-7z" }) })] }), _jsxs("time", { className: "timeline-time", dateTime: timestamp, "aria-label": timestamp, children: [_jsx("span", { className: "timeline-time-full", children: timestamp }), _jsx("span", { className: "timeline-time-short", "aria-hidden": "true", children: timestamp.slice(0, 16).replace("T", " ") })] }), _jsx(SpeedMenu, { speeds: speeds, rate: snapshot.rate, paceAuto: paceAuto, compact: drawer !== undefined, onRateChange: onRateChange }), scrubber, drawer === undefined && (_jsxs("details", { className: "timeline-event-list", children: [_jsxs("summary", { className: "ui-button", title: "Events: what just happened, what is next, and the full list", children: ["Events ", _jsxs("span", { children: ["(", experience.events.length, ")"] })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo })] }))] }), drawer !== undefined && (_jsx("div", { id: "timeline-drawer", className: "timeline-drawer", role: "region", "aria-label": "Timeline details", "data-open": drawer.open, onClick: (event) => { const closer = event.target.closest("[data-closes-drawer]"); if (closer !== null && closer.tagName !== "SELECT")
|
|
66
|
+
drawer.onOpenChange(false); }, children: _jsxs("div", { className: "timeline-drawer-body", children: [_jsxs("div", { className: "timeline-speed-slider", children: [_jsx("span", { "aria-hidden": "true", children: "Playback speed" }), _jsx("input", { type: "range", "aria-label": "Speed slider", "aria-valuetext": speedText, min: 0, max: speeds.length - 1, step: 1, value: speedIndex, onChange: (event) => { const next = speeds[Number(event.target.value)]; if (next !== undefined)
|
|
67
|
+
onRateChange(next.rate); } }), _jsx("output", { children: speedText })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo })] }) }))] }));
|
|
59
68
|
}
|
|
60
69
|
/** A 24x24 filled symbol; the button around it carries the accessible name and tooltip. */
|
|
61
70
|
function Symbol({ path }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TimelineEvent } from "../core/events.js";
|
|
2
2
|
import type { Provenance } from "../core/provenance.js";
|
|
3
|
-
import type { TimelineWindow } from "../core/timeWindow.js";
|
|
3
|
+
import type { TimelineWindow, WindowProvenanceSpan } from "../core/timeWindow.js";
|
|
4
4
|
import type { TimeBounds } from "../core/trajectory.js";
|
|
5
5
|
import type { BodyFeatureSet } from "./bodyFeatures.js";
|
|
6
6
|
import type { MoonFamilyList } from "./moonFamilies.js";
|
|
@@ -31,6 +31,8 @@ export interface ExperienceObject {
|
|
|
31
31
|
readonly description?: string;
|
|
32
32
|
/** Where this object's data comes from. Anything reconstructed or illustrative must carry one. */
|
|
33
33
|
readonly provenance?: Provenance;
|
|
34
|
+
/** Provenance by time: while a span covers the clock its provenance shows in place of `provenance`. */
|
|
35
|
+
readonly provenanceSpans?: readonly WindowProvenanceSpan[];
|
|
34
36
|
/** Labelled values for the info panel (a moon's family, size, discovery and sources). */
|
|
35
37
|
readonly facts?: readonly {
|
|
36
38
|
readonly label: string;
|
package/src/shell/infoModel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { provenanceAt, rateAt } from "../core/timeWindow.js";
|
|
1
|
+
import { provenanceAt, rateAt, spanProvenanceAt } from "../core/timeWindow.js";
|
|
2
2
|
import { findFeature } from "./bodyFeatures.js";
|
|
3
3
|
import { formatUtcTimestamp, formatWindowRate } from "./timelineModel.js";
|
|
4
4
|
/** The badge text for each provenance status. The status is always written, never shown by colour alone. */
|
|
@@ -22,7 +22,7 @@ export function infoView(experience, target, timeUtcMs) {
|
|
|
22
22
|
if (target.kind === "feature")
|
|
23
23
|
return featureInfo(experience, target);
|
|
24
24
|
if (target.kind === "object")
|
|
25
|
-
return objectInfo(experience, target);
|
|
25
|
+
return objectInfo(experience, target, timeUtcMs);
|
|
26
26
|
return eventInfo(experience, target);
|
|
27
27
|
}
|
|
28
28
|
function windowInfo(experience, target, timeUtcMs) {
|
|
@@ -56,16 +56,17 @@ function featureInfo(experience, target) {
|
|
|
56
56
|
provenance: provenanceView(set.provenance, set.knownLimitations),
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function objectInfo(experience, target) {
|
|
59
|
+
function objectInfo(experience, target, timeUtcMs) {
|
|
60
60
|
const object = experience.objects.find((candidate) => candidate.id === target.id);
|
|
61
61
|
if (object === undefined)
|
|
62
62
|
return null;
|
|
63
|
+
const source = (timeUtcMs === undefined || object.provenanceSpans === undefined ? null : spanProvenanceAt(object.provenanceSpans, timeUtcMs)) ?? object.provenance;
|
|
63
64
|
return {
|
|
64
65
|
target,
|
|
65
66
|
title: object.label,
|
|
66
67
|
...(object.description === undefined ? {} : { description: object.description }),
|
|
67
68
|
...(object.facts === undefined ? {} : { facts: object.facts }),
|
|
68
|
-
provenance:
|
|
69
|
+
provenance: source === undefined ? null : provenanceView(source, object.knownLimitations),
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
72
|
function eventInfo(experience, target) {
|
|
@@ -5,15 +5,14 @@ export interface PlaybackSpeed {
|
|
|
5
5
|
readonly label: string;
|
|
6
6
|
readonly rate: number;
|
|
7
7
|
}
|
|
8
|
-
export declare const DEFAULT_PLAYBACK_SPEEDS: readonly PlaybackSpeed[];
|
|
9
8
|
export declare const TIMELINE_STEP_MS = 60000;
|
|
10
9
|
export declare function formatRate(rate: number): string;
|
|
11
10
|
/** A rate in a few characters for a narrow picker: simulated time per real second ("1 h/s"), or the plain rate when no whole unit fits. */
|
|
12
11
|
export declare function formatRateCompact(rate: number): string;
|
|
13
12
|
/** Every rate explains how much simulated time passes during one real second. */
|
|
14
13
|
export declare function describePlaybackRate(rate: number): string;
|
|
15
|
-
/**
|
|
16
|
-
export declare function
|
|
14
|
+
/** The speeds the timeline offers: exactly the experience's rates (no speed is added), ascending, each once. */
|
|
15
|
+
export declare function speedsOf(rates: readonly number[]): readonly PlaybackSpeed[];
|
|
17
16
|
export interface EventContext {
|
|
18
17
|
/** Most recent event at or before the current time. */
|
|
19
18
|
readonly current: TimelineEvent | null;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { rateAt } from "../core/timeWindow.js";
|
|
2
|
-
export const DEFAULT_PLAYBACK_SPEEDS = [
|
|
3
|
-
{ label: describePlaybackRate(1), rate: 1 },
|
|
4
|
-
{ label: describePlaybackRate(3_600), rate: 3_600 },
|
|
5
|
-
{ label: describePlaybackRate(86_400), rate: 86_400 },
|
|
6
|
-
{ label: describePlaybackRate(604_800), rate: 604_800 },
|
|
7
|
-
];
|
|
8
2
|
export const TIMELINE_STEP_MS = 60_000;
|
|
9
3
|
export function formatRate(rate) {
|
|
10
4
|
return `${rate.toLocaleString("en-US")}×`;
|
|
@@ -41,11 +35,9 @@ export function describePlaybackRate(rate) {
|
|
|
41
35
|
return `${formatRate(rate)} — real time`;
|
|
42
36
|
return `${formatRate(rate)} — ${formatSimulatedDuration(rate)} per real second`;
|
|
43
37
|
}
|
|
44
|
-
/**
|
|
45
|
-
export function
|
|
46
|
-
|
|
47
|
-
.map((rate) => ({ label: describePlaybackRate(rate), rate }));
|
|
48
|
-
return [...base, ...extra].sort((a, b) => a.rate - b.rate);
|
|
38
|
+
/** The speeds the timeline offers: exactly the experience's rates (no speed is added), ascending, each once. */
|
|
39
|
+
export function speedsOf(rates) {
|
|
40
|
+
return [...new Set(rates)].sort((a, b) => a - b).map((rate) => ({ label: describePlaybackRate(rate), rate }));
|
|
49
41
|
}
|
|
50
42
|
/** Finds the story event just reached and the next event without changing the event model. */
|
|
51
43
|
export function eventContextAt(events, timeUtcMs) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Scene } from "../api/scene.js";
|
|
2
|
+
export declare const JOURNEY_LAUNCH_UTC_MS: number;
|
|
3
|
+
export declare const JOURNEY_JUPITER_UTC_MS: number;
|
|
4
|
+
export declare const JOURNEY_SATURN_UTC_MS: number;
|
|
5
|
+
export declare const JOURNEY_END_UTC_MS: number;
|
|
6
|
+
/** The distance the journey ends at, AU (I-114). */
|
|
7
|
+
export declare const JOURNEY_END_AU = 170;
|
|
8
|
+
/** The made-up journey as a Scene. Needs the planet series loaded (it reads Earth, Jupiter and Saturn from the Sun). */
|
|
9
|
+
export declare function buildSyntheticJourneyScene(): Scene;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// O-047 T-203: a made-up probe journey from 1977 out to 170 AU, built only through the public Scene API (ARCH-01: no real mission, name or data).
|
|
2
|
+
// It leaves Earth's place on 5 September 1977, passes Jupiter on 5 March 1979 and Saturn on 12 November 1980, then flies straight out to 170 AU by 1 January 2026.
|
|
3
|
+
// In one scene it proves: moons at historical dates (the data packages are handed to `toDefinition`), Saturn's orbit line, paced playback, provenance that changes along the path,
|
|
4
|
+
// the opening selection and a camera that zooms out to the whole path (I-114). The planets' places come from the planet series, so the series must be loaded before this builds (the site does).
|
|
5
|
+
import { Scene } from "../api/scene.js";
|
|
6
|
+
import { callisto, dione, earth, enceladus, europa, ganymede, iapetus, io, jupiter, mimas, rhea, saturn, sun, tethys, titan } from "../api/bodies.js";
|
|
7
|
+
import { solarSystemScale } from "../core/scalePolicy.js";
|
|
8
|
+
const DAY_MS = 86_400_000;
|
|
9
|
+
const YEAR_S = 31_557_600;
|
|
10
|
+
const AU_KM = 149_597_870.7;
|
|
11
|
+
export const JOURNEY_LAUNCH_UTC_MS = Date.UTC(1977, 8, 5);
|
|
12
|
+
export const JOURNEY_JUPITER_UTC_MS = Date.UTC(1979, 2, 5);
|
|
13
|
+
export const JOURNEY_SATURN_UTC_MS = Date.UTC(1980, 10, 12);
|
|
14
|
+
export const JOURNEY_END_UTC_MS = Date.UTC(2026, 0, 1);
|
|
15
|
+
/** The distance the journey ends at, AU (I-114). */
|
|
16
|
+
export const JOURNEY_END_AU = 170;
|
|
17
|
+
/** How far past each giant planet the made-up probe passes, km (outward from the Sun). */
|
|
18
|
+
const PASS_KM = 1_500_000;
|
|
19
|
+
const length = (a) => Math.hypot(a[0], a[1], a[2]);
|
|
20
|
+
const mix = (a, b, f) => [a[0] + (b[0] - a[0]) * f, a[1] + (b[1] - a[1]) * f, a[2] + (b[2] - a[2]) * f];
|
|
21
|
+
const scaled = (a, k) => [a[0] * k, a[1] * k, a[2] * k];
|
|
22
|
+
const made = (stretch, accuracy, sourceType) => ({ sourceType, sources: [`Made up for the journey test (${stretch}); not a real spacecraft`], accuracy, notes: "Exists to prove a long recorded path, moons at their dates and paced playback." });
|
|
23
|
+
/** The made-up journey as a Scene. Needs the planet series loaded (it reads Earth, Jupiter and Saturn from the Sun). */
|
|
24
|
+
export function buildSyntheticJourneyScene() {
|
|
25
|
+
const scene = new Scene().addBody(sun).addBody(earth, { enlarge: 60, orbit: true }).addBody(jupiter, { orbit: true }).addBody(io, { orbit: true }).addBody(europa).addBody(ganymede).addBody(callisto)
|
|
26
|
+
.addBody(saturn, { orbit: true }).addBody(mimas).addBody(enceladus).addBody(tethys).addBody(dione).addBody(rhea).addBody(titan).addBody(iapetus).setTime(JOURNEY_LAUNCH_UTC_MS);
|
|
27
|
+
const place = (id, time) => [...scene.stateOf(id, time).positionKm];
|
|
28
|
+
const pass = (id, time) => { const p = place(id, time); return scaled(p, 1 + PASS_KM / length(p)); };
|
|
29
|
+
const launch = place("earth", JOURNEY_LAUNCH_UTC_MS);
|
|
30
|
+
const atJupiter = pass("jupiter", JOURNEY_JUPITER_UTC_MS);
|
|
31
|
+
const atSaturn = pass("saturn", JOURNEY_SATURN_UTC_MS);
|
|
32
|
+
const out = scaled(atSaturn, (JOURNEY_END_AU * AU_KM) / length(atSaturn));
|
|
33
|
+
const leg = (from, to, t0, t1, stepMs) => {
|
|
34
|
+
const n = Math.max(1, Math.round((t1 - t0) / stepMs));
|
|
35
|
+
return Array.from({ length: n }, (_, i) => ({ time: Math.round(t0 + ((t1 - t0) * i) / n), positionKm: mix(from, to, i / n) }));
|
|
36
|
+
};
|
|
37
|
+
const samples = [
|
|
38
|
+
...leg(launch, atJupiter, JOURNEY_LAUNCH_UTC_MS, JOURNEY_JUPITER_UTC_MS, 15 * DAY_MS),
|
|
39
|
+
...leg(atJupiter, atSaturn, JOURNEY_JUPITER_UTC_MS, JOURNEY_SATURN_UTC_MS, 15 * DAY_MS),
|
|
40
|
+
...leg(atSaturn, out, JOURNEY_SATURN_UTC_MS, JOURNEY_END_UTC_MS, 365.25 * DAY_MS),
|
|
41
|
+
{ time: JOURNEY_END_UTC_MS, positionKm: out },
|
|
42
|
+
];
|
|
43
|
+
scene.addTrajectory({
|
|
44
|
+
id: "traveller",
|
|
45
|
+
label: "Made-up traveller",
|
|
46
|
+
samples,
|
|
47
|
+
center: "sun",
|
|
48
|
+
lineFixedTo: "sun",
|
|
49
|
+
provenance: made("whole journey", "None claimed.", "illustrative"),
|
|
50
|
+
provenanceSpans: [
|
|
51
|
+
{ start: JOURNEY_LAUNCH_UTC_MS, end: JOURNEY_SATURN_UTC_MS + 90 * DAY_MS, provenance: made("planet passes", "None claimed. Straight legs between two planets' places.", "reconstructed") },
|
|
52
|
+
{ start: JOURNEY_SATURN_UTC_MS + 90 * DAY_MS, end: JOURNEY_END_UTC_MS, provenance: made("outbound cruise", "None claimed. A straight line out to 170 AU.", "illustrative") },
|
|
53
|
+
],
|
|
54
|
+
description: "An invented probe that leaves Earth in 1977, passes Jupiter in 1979 and Saturn in 1980, then flies straight out to 170 AU by 2026.",
|
|
55
|
+
knownLimitations: ["Made up; not a real spacecraft.", "Straight legs: it ignores gravity and does not follow any real trajectory."],
|
|
56
|
+
anchors: [{ id: "traveller-jupiter", time: JOURNEY_JUPITER_UTC_MS }, { id: "traveller-saturn", time: JOURNEY_SATURN_UTC_MS }],
|
|
57
|
+
});
|
|
58
|
+
scene.addEvents([
|
|
59
|
+
{ id: "traveller-jupiter", label: "Made-up pass of Jupiter", time: JOURNEY_JUPITER_UTC_MS, type: "encounter" },
|
|
60
|
+
{ id: "traveller-saturn", label: "Made-up pass of Saturn", time: JOURNEY_SATURN_UTC_MS, type: "encounter" },
|
|
61
|
+
], { provenance: { sourceType: "illustrative", sources: ["Made up"], accuracy: "None claimed.", notes: "Not real passes." } });
|
|
62
|
+
scene.setTimeline({
|
|
63
|
+
start: JOURNEY_LAUNCH_UTC_MS,
|
|
64
|
+
end: JOURNEY_END_UTC_MS,
|
|
65
|
+
rates: [DAY_MS / 1000, 30 * DAY_MS / 1000, YEAR_S],
|
|
66
|
+
rate: 30 * DAY_MS / 1000,
|
|
67
|
+
pacing: [
|
|
68
|
+
{ near: { type: "encounter", within: 30 * DAY_MS / 1000 }, rate: DAY_MS / 1000 },
|
|
69
|
+
{ from: JOURNEY_SATURN_UTC_MS + 120 * DAY_MS, to: JOURNEY_END_UTC_MS, rate: YEAR_S },
|
|
70
|
+
],
|
|
71
|
+
});
|
|
72
|
+
scene.setScale(solarSystemScale);
|
|
73
|
+
scene.camera.follow("traveller", { distance: 20_000 });
|
|
74
|
+
return scene;
|
|
75
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ExperienceDefinition } from "../app/experienceDefinition.js";
|
|
2
|
+
export declare const PROBE_START_UTC_MS: number;
|
|
3
|
+
/** The moment the made-up probe is at Earth. */
|
|
4
|
+
export declare const PROBE_FLYBY_UTC_MS: number;
|
|
5
|
+
export declare const syntheticProbeDefinition: ExperienceDefinition;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { earth, mars, sun, venus } from "../api/bodies.js";
|
|
2
|
+
import { Scene } from "../api/scene.js";
|
|
3
|
+
import { solarSystemScale } from "../core/scalePolicy.js";
|
|
4
|
+
import { createOrbTwoBodyAdapter } from "../core/twoBodyAdapter.js";
|
|
5
|
+
export const PROBE_START_UTC_MS = Date.parse("2026-01-01T00:00:00Z");
|
|
6
|
+
const DAY_MS = 86_400_000;
|
|
7
|
+
/** The moment the made-up probe is at Earth. */
|
|
8
|
+
export const PROBE_FLYBY_UTC_MS = PROBE_START_UTC_MS + 200 * DAY_MS;
|
|
9
|
+
/** The engine's own ecliptic-to-equator rotation (row-major 3x3); its transpose turns equator vectors back to the ecliptic (STYLE-07: no second obliquity constant). */
|
|
10
|
+
const ECLIPTIC_TO_EQJ = createOrbTwoBodyAdapter().eclipticJ2000ToEqjMatrix();
|
|
11
|
+
const scene = new Scene().addBody(sun).addBody(venus, { enlarge: 60, orbit: true }).addBody(earth, { enlarge: 60, orbit: true }).addBody(mars, { enlarge: 60, orbit: true }).setTime(PROBE_START_UTC_MS);
|
|
12
|
+
/** A planet's place from the Sun at `timeUtcMs`, turned from the equator frame the scene answers in to the ecliptic frame the path is given in (km). */
|
|
13
|
+
function eclipticPlace(id, timeUtcMs) {
|
|
14
|
+
const [x, y, z] = scene.stateOf(id, timeUtcMs).positionKm;
|
|
15
|
+
const m = ECLIPTIC_TO_EQJ;
|
|
16
|
+
return [m[0] * x + m[3] * y + m[6] * z, m[1] * x + m[4] * y + m[7] * z, m[2] * x + m[5] * y + m[8] * z];
|
|
17
|
+
}
|
|
18
|
+
// A straight leg from a point 0.6 of the way from the Sun to Earth's place at the start, to Earth's place at the flyby, ten samples, then on along the same line for five more.
|
|
19
|
+
const from = eclipticPlace("earth", PROBE_START_UTC_MS).map((v) => v * 0.6);
|
|
20
|
+
const to = eclipticPlace("earth", PROBE_FLYBY_UTC_MS);
|
|
21
|
+
const samples = Array.from({ length: 16 }, (_, i) => ({ time: PROBE_START_UTC_MS + i * 20 * DAY_MS, positionKm: from.map((v, k) => v + ((to[k] - v) * i) / 10) }));
|
|
22
|
+
scene.addTrajectory({
|
|
23
|
+
id: "probe",
|
|
24
|
+
label: "Made-up probe",
|
|
25
|
+
samples,
|
|
26
|
+
center: "sun",
|
|
27
|
+
plane: "ecliptic-j2000",
|
|
28
|
+
lineFixedTo: "sun",
|
|
29
|
+
provenance: { sourceType: "illustrative", sources: ["Made up for the Sun-centred path test; not a real spacecraft"], accuracy: "None claimed. A straight line ending at Earth's place on day 200.", notes: "Exists to prove a recorded path can be drawn fixed to the Sun beside enlarged planets." },
|
|
30
|
+
description: "An invented probe that starts inside Earth's orbit and is at Earth on day 200.",
|
|
31
|
+
knownLimitations: ["Made up; not a real spacecraft.", "A straight line: it ignores the Sun's gravity."],
|
|
32
|
+
anchors: [{ id: "probe-flyby", time: PROBE_FLYBY_UTC_MS }],
|
|
33
|
+
});
|
|
34
|
+
scene.addEvents([{ id: "probe-flyby", label: "Made-up flyby of Earth", time: PROBE_FLYBY_UTC_MS }], { provenance: { sourceType: "illustrative", sources: ["Made up"], accuracy: "None claimed.", notes: "Not a real flyby." } });
|
|
35
|
+
scene.setScale(solarSystemScale);
|
|
36
|
+
scene.camera.follow("probe", { distance: 70_000 });
|
|
37
|
+
scene.camera.fitOrbit(mars);
|
|
38
|
+
export const syntheticProbeDefinition = scene.toDefinition();
|