astraeus 0.6.0 → 0.7.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 +16 -0
- package/README.md +31 -8
- package/package.json +1 -1
- package/src/api/AstraeusScene.d.ts +4 -2
- package/src/api/AstraeusScene.js +13 -10
- package/src/api/AstraeusScene.node.js +13 -10
- package/src/api/errors.d.ts +1 -1
- package/src/api/index.d.ts +1 -0
- package/src/api/mount.d.ts +5 -1
- package/src/api/mount.js +2 -0
- package/src/api/mount.node.js +2 -0
- package/src/api/pathProvenance.d.ts +15 -6
- package/src/api/pathProvenance.js +23 -11
- package/src/api/scene.d.ts +18 -1
- package/src/api/scene.js +88 -10
- package/src/api/sphereOfInfluence.d.ts +20 -0
- package/src/api/sphereOfInfluence.js +48 -0
- package/src/api/viewerLink.d.ts +7 -1
- package/src/api/viewerLink.js +13 -2
- package/src/api/views.d.ts +42 -0
- package/src/api/views.js +80 -0
- package/src/app/App.js +32 -5
- package/src/app/App.node.js +32 -5
- package/src/app/AstraeusScene.d.ts +3 -0
- package/src/app/CameraController.d.ts +6 -0
- package/src/app/CameraController.js +3 -1
- package/src/app/StoryMarkers.d.ts +4 -1
- package/src/app/StoryMarkers.js +3 -2
- package/src/app/TrackedBodyView.d.ts +1 -1
- package/src/app/TrackedBodyView.js +20 -11
- package/src/app/experienceDefinition.d.ts +3 -0
- package/src/app/mission.d.ts +15 -2
- package/src/app/mission.js +15 -0
- package/src/app/sceneCamera.d.ts +2 -0
- package/src/app/sceneCamera.js +14 -0
- package/src/app/sceneFrame.d.ts +2 -0
- package/src/app/sceneFrame.js +42 -6
- package/src/app/viewHiding.d.ts +13 -0
- package/src/app/viewHiding.js +37 -0
- package/src/app/viewerPort.d.ts +6 -0
- package/src/app/views.d.ts +31 -0
- package/src/app/views.js +2 -0
- package/src/shell/AstraeusShell.d.ts +12 -2
- package/src/shell/AstraeusShell.js +42 -4
- package/src/shell/AstraeusShell.node.js +42 -4
- package/src/shell/DisplaySwitches.d.ts +18 -1
- package/src/shell/DisplaySwitches.js +18 -5
- package/src/shell/TimelineBar.css +18 -0
- package/src/shell/TimelineBar.js +29 -4
- package/src/shell/TimelineBar.node.js +29 -4
- package/src/shell/TopBar.d.ts +4 -2
- package/src/shell/TopBar.js +3 -3
- package/src/shell/TopBar.node.js +3 -3
- package/src/shell/timelineModel.d.ts +13 -0
- package/src/shell/timelineModel.js +25 -0
- package/src/shell/viewCamera.d.ts +4 -0
- package/src/shell/viewCamera.js +13 -0
- package/src/synthetic/syntheticJourneyScene.js +11 -1
- package/src/synthetic/syntheticViewsDefinition.d.ts +6 -0
- package/src/synthetic/syntheticViewsDefinition.js +44 -0
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Scene } from "../api/scene.js";
|
|
7
7
|
import { callisto, dione, earth, enceladus, europa, ganymede, iapetus, io, jupiter, mimas, rhea, saturn, sun, tethys, titan, uranus } from "../api/bodies.js";
|
|
8
8
|
import { solarSystemScale } from "../core/scalePolicy.js";
|
|
9
|
+
const HOUR_MS = 3_600_000;
|
|
9
10
|
const DAY_MS = 86_400_000;
|
|
10
11
|
const YEAR_S = 31_557_600;
|
|
11
12
|
const AU_KM = 149_597_870.7;
|
|
@@ -50,7 +51,12 @@ export function buildSyntheticJourneyScene() {
|
|
|
50
51
|
label: "Made-up traveller",
|
|
51
52
|
samples,
|
|
52
53
|
center: "sun",
|
|
53
|
-
|
|
54
|
+
// O-050 T-217: the line is drawn against the Sun in the cruise and against Jupiter for the 20 days either side of its pass (one path, three stretches, one menu entry).
|
|
55
|
+
lineFixedTo: [
|
|
56
|
+
{ start: JOURNEY_LAUNCH_UTC_MS, end: JOURNEY_JUPITER_UTC_MS - 20 * DAY_MS, body: "sun" },
|
|
57
|
+
{ start: JOURNEY_JUPITER_UTC_MS - 20 * DAY_MS, end: JOURNEY_JUPITER_UTC_MS + 20 * DAY_MS, body: "jupiter" },
|
|
58
|
+
{ start: JOURNEY_JUPITER_UTC_MS + 20 * DAY_MS, end: JOURNEY_END_UTC_MS, body: "sun" },
|
|
59
|
+
],
|
|
54
60
|
provenance: made("whole journey", "None claimed.", "illustrative"),
|
|
55
61
|
provenanceSpans: [
|
|
56
62
|
{ start: JOURNEY_LAUNCH_UTC_MS, end: JOURNEY_URANUS_UTC_MS + 90 * DAY_MS, provenance: made("planet passes", "None claimed. Straight legs between two planets' places.", "reconstructed") },
|
|
@@ -62,6 +68,10 @@ export function buildSyntheticJourneyScene() {
|
|
|
62
68
|
});
|
|
63
69
|
scene.addEvents([
|
|
64
70
|
{ id: "traveller-jupiter", label: "Made-up pass of Jupiter", time: JOURNEY_JUPITER_UTC_MS, type: "encounter", object: "jupiter" },
|
|
71
|
+
// Three moon passes within nine hours of the Jupiter pass: close markers on the timeline, gathered under one numbered mark that lists each (I-126).
|
|
72
|
+
{ id: "traveller-io", label: "Made-up pass of Io", time: JOURNEY_JUPITER_UTC_MS - 3 * HOUR_MS, type: "encounter", object: "io" },
|
|
73
|
+
{ id: "traveller-europa", label: "Made-up pass of Europa", time: JOURNEY_JUPITER_UTC_MS + 2 * HOUR_MS, type: "encounter", object: "europa" },
|
|
74
|
+
{ id: "traveller-ganymede", label: "Made-up pass of Ganymede", time: JOURNEY_JUPITER_UTC_MS + 6 * HOUR_MS, type: "encounter", object: "ganymede" },
|
|
65
75
|
{ id: "traveller-saturn", label: "Made-up pass of Saturn", time: JOURNEY_SATURN_UTC_MS, type: "encounter", object: "saturn" },
|
|
66
76
|
{ id: "traveller-uranus", label: "Made-up pass of Uranus", time: JOURNEY_URANUS_UTC_MS, type: "encounter", object: "uranus" },
|
|
67
77
|
], { provenance: { sourceType: "illustrative", sources: ["Made up"], accuracy: "None claimed.", notes: "Not real passes." } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExperienceDefinition } from "../app/experienceDefinition.js";
|
|
2
|
+
import { ViewerLink } from "../api/viewerLink.js";
|
|
3
|
+
export declare const VIEWS_START_UTC_MS: number;
|
|
4
|
+
export declare const syntheticViewsDefinition: ExperienceDefinition;
|
|
5
|
+
/** The host link a host page gets from `mount`, for the dev page: kept on `window.astraeusHost` so a browser check can call `setView` and read what the viewer tells a host. */
|
|
6
|
+
export declare function createViewsHost(): ViewerLink;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Scene } from "../api/scene.js";
|
|
2
|
+
import { ViewerLink } from "../api/viewerLink.js";
|
|
3
|
+
import { earth } from "../api/bodies.js";
|
|
4
|
+
import { trueScale } from "../core/scalePolicy.js";
|
|
5
|
+
export const VIEWS_START_UTC_MS = Date.parse("2026-01-01T00:00:00Z");
|
|
6
|
+
const HOUR_MS = 3_600_000;
|
|
7
|
+
const SPAN_H = 24;
|
|
8
|
+
const madeUp = { sourceType: "illustrative", sources: ["Made up for the views test; not a real spacecraft"], accuracy: "None claimed.", notes: "A circle about Earth, not a real flight." };
|
|
9
|
+
/** A circle about Earth in the plane tilted `tiltDeg` about x, one lap in `lapH` hours, a sample every 5 minutes over the whole timeline. */
|
|
10
|
+
function circle(radiusKm, lapH, tiltDeg) {
|
|
11
|
+
const tilt = (tiltDeg * Math.PI) / 180;
|
|
12
|
+
return Array.from({ length: SPAN_H * 12 + 1 }, (_, i) => {
|
|
13
|
+
const angle = (2 * Math.PI * i) / (lapH * 12);
|
|
14
|
+
const y = radiusKm * Math.sin(angle);
|
|
15
|
+
return { time: VIEWS_START_UTC_MS + i * 300_000, positionKm: [radiusKm * Math.cos(angle), y * Math.cos(tilt), y * Math.sin(tilt)] };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const panel = (id, title, hour) => ({ id, at: { utc: new Date(VIEWS_START_UTC_MS + hour * HOUR_MS).toISOString() }, title, body: ["A made-up line."], badge: "illustrative", sources: ["Made up for the views test"] });
|
|
19
|
+
const scene = new Scene()
|
|
20
|
+
.addBody(earth, { description: "The planet both made-up probes circle; shown in every view." })
|
|
21
|
+
.addTrajectory({ id: "probe-a", label: "Probe A", samples: circle(40_000, 6, 0), provenance: madeUp, description: "A made-up probe on a flat circle.", knownLimitations: ["Made up; not a real spacecraft."] })
|
|
22
|
+
.addTrajectory({ id: "probe-b", label: "Probe B", samples: circle(70_000, 9, 35), provenance: madeUp, description: "A made-up probe on a tilted circle.", knownLimitations: ["Made up; not a real spacecraft."] })
|
|
23
|
+
.addEvents([
|
|
24
|
+
{ id: "event-a", label: "Probe A event", time: VIEWS_START_UTC_MS + 3 * HOUR_MS },
|
|
25
|
+
{ id: "event-b", label: "Probe B event", time: VIEWS_START_UTC_MS + 9 * HOUR_MS },
|
|
26
|
+
{ id: "event-shared", label: "Shared event", time: VIEWS_START_UTC_MS + 21 * HOUR_MS },
|
|
27
|
+
], { provenance: madeUp })
|
|
28
|
+
.addStoryPanels({ panels: [panel("panel-a", "About probe A", 10), panel("panel-b", "About probe B", 15), panel("panel-shared", "About both", 20)] })
|
|
29
|
+
.setViews([
|
|
30
|
+
{ id: "a", label: "Probe A", paths: ["probe-a"], events: ["event-a"], panels: ["panel-a"], camera: "stay" },
|
|
31
|
+
{ id: "b", label: "Probe B", paths: ["probe-b"], events: ["event-b"], panels: ["panel-b"], camera: { follow: "probe-b" } },
|
|
32
|
+
{ id: "both", label: "Both", paths: ["probe-a", "probe-b"], events: ["event-a", "event-b"], panels: ["panel-a", "panel-b"], camera: { focus: "probe-a" } },
|
|
33
|
+
], { place: "top-bar" })
|
|
34
|
+
.setTimeline({ start: VIEWS_START_UTC_MS, end: VIEWS_START_UTC_MS + SPAN_H * HOUR_MS, rates: [60, 600, 3600], rate: 600 })
|
|
35
|
+
.setScale(trueScale, { only: true })
|
|
36
|
+
.setTime(VIEWS_START_UTC_MS);
|
|
37
|
+
scene.camera.follow("probe-a", { distance: 14 });
|
|
38
|
+
export const syntheticViewsDefinition = scene.toDefinition();
|
|
39
|
+
/** The host link a host page gets from `mount`, for the dev page: kept on `window.astraeusHost` so a browser check can call `setView` and read what the viewer tells a host. */
|
|
40
|
+
export function createViewsHost() {
|
|
41
|
+
const link = new ViewerLink();
|
|
42
|
+
window.astraeusHost = link;
|
|
43
|
+
return link;
|
|
44
|
+
}
|