astraeus 0.5.0 → 0.6.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 +22 -0
- package/README.md +3 -3
- package/data/moons/jupiter.json +351 -115
- package/data/moons/neptune.json +54 -16
- package/data/moons/pluto.json +21 -5
- package/data/moons/saturn.json +882 -292
- package/data/moons/uranus.json +90 -28
- package/package.json +1 -1
- package/src/api/bodies.d.ts +6 -1
- package/src/api/bodies.js +15 -2
- package/src/api/data.d.ts +2 -1
- package/src/api/data.js +4 -13
- package/src/api/index.d.ts +1 -1
- package/src/api/index.js +1 -1
- package/src/api/index.node.js +1 -1
- package/src/api/scene.js +43 -19
- package/src/api/story.d.ts +4 -0
- package/src/api/story.js +10 -1
- package/src/app/AstraeusScene.js +3 -1
- package/src/app/LayeredRender.js +1 -0
- package/src/app/OrbitSetView.js +5 -0
- package/src/app/PathView.d.ts +3 -2
- package/src/app/PathView.js +5 -5
- package/src/app/SceneLabels.d.ts +8 -0
- package/src/app/SceneLabels.js +15 -1
- package/src/app/SkyView.js +2 -0
- package/src/app/sceneHooks.js +1 -1
- package/src/assets/bodies/jupiter.js +2 -0
- package/src/assets/bodies/listedMoons.d.ts +4 -0
- package/src/assets/bodies/listedMoons.js +7 -0
- package/src/assets/bodies/outerPlanetCatalogues.d.ts +1 -5
- package/src/assets/bodies/outerPlanetCatalogues.js +2 -6
- package/src/assets/bodies/outerPlanetRings.d.ts +5 -0
- package/src/assets/bodies/outerPlanetRings.js +6 -0
- package/src/assets/bodies/planetSystemMaps.js +6 -3
- package/src/assets/catalogue.d.ts +3 -0
- package/src/assets/catalogue.js +8 -0
- package/src/assets/compositions.js +2 -1
- package/src/assets/moonCatalogue.d.ts +3 -1
- package/src/assets/moonCatalogue.js +1 -0
- package/src/assets/visual.d.ts +1 -1
- package/src/core/bodies/io.js +1 -0
- package/src/core/bodies/jupiterMoons.d.ts +1 -1
- package/src/core/bodies/jupiterMoons.js +5 -4
- package/src/core/bodies/listedMoonBodies.d.ts +18 -0
- package/src/core/bodies/listedMoonBodies.js +36 -0
- package/src/core/bodies/listedMoons.d.ts +18 -0
- package/src/core/bodies/listedMoons.js +483 -0
- package/src/core/bodies/moon.d.ts +2 -0
- package/src/core/bodies/moon.js +4 -0
- package/src/core/bodies/moonSystem.d.ts +5 -2
- package/src/core/bodies/moonSystem.js +2 -1
- package/src/core/bodies/outerPlanetData.d.ts +0 -3
- package/src/core/bodies/outerPlanetData.js +1 -7
- package/src/core/bodies/outerPlanetRingData.d.ts +3 -0
- package/src/core/bodies/outerPlanetRingData.js +10 -0
- package/src/core/bodies/planetMoons.js +11 -10
- package/src/core/body.d.ts +4 -0
- package/src/core/events.d.ts +2 -0
- package/src/core/satelliteMeanElements.d.ts +2 -8
- package/src/core/satelliteMeanElements.js +2 -15
- package/src/core/siderealPeriod.d.ts +27 -0
- package/src/core/siderealPeriod.js +18 -0
- package/src/shell/AstraeusShell.js +6 -2
- package/src/shell/AstraeusShell.node.js +6 -2
- package/src/synthetic/syntheticJourneyScene.d.ts +2 -1
- package/src/synthetic/syntheticJourneyScene.js +21 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Versions follow [semantic versioning](https://semver.org). While the version starts with `0.`, the public API (the names exported from `astraeus`) may still change between minor versions; each change is listed here.
|
|
4
4
|
|
|
5
|
+
## 0.6.0 (2026-11-01)
|
|
6
|
+
|
|
7
|
+
First download of the packed example (`npm run measure:example`): 1,638,245 bytes raw, 468,717 bytes gzip (code and styles loaded on first open).
|
|
8
|
+
|
|
9
|
+
Every listed moon can be added by id (O-049, G-014), from a third finding sent back by the outside interplanetary probe app built on 0.5.1: Uranus's main moons had positions but no bodies.
|
|
10
|
+
|
|
11
|
+
- Every moon in the engine's moon lists (458 across Mars, Jupiter, Saturn, Uranus, Neptune and Pluto) now carries a sidereal orbit period from the JPL Planetary Satellite Mean Elements table (O-049 T-210, I-122), and a small generated lookup (`core/bodies/listedMoons`: id, label, mean radius, parent, period, data package, fit-set body) lets a later step add any listed moon by id without loading the full lists. Importing the lookup from the entry adds 17,716 bytes raw and 7,126 bytes gzip to the first download (`npm run measure:example`, measured with the lookup consulted from `addBody`); the full lists stay out of it.
|
|
12
|
+
- `scene.addBody(id)` takes every moon in the moon lists, not only the ready-made ones (O-049 T-211, I-122). One rule: the listed moon becomes a grey sphere at its JPL mean radius (the picture pack's picture when it holds one under the moon's id), positioned from its planet's fits in `astraeus-data-<planet>`, with `{ orbit: true }` drawing one lap of its JPL period about the planet; a moon without a period throws `no-orbit`, a missing package `missing-data`, a window outside its fit years `out-of-span`. The detailed moons (Io to Callisto, Saturn's seven, Triton, Charon, Phobos, Deimos) keep their own definitions. A moon is defined only when a scene adds it, so an unused moon costs nothing at run time. New `listedMoons(planet?)` lists every addable moon with the data package it needs (`requires`); the `unknown-body` message names the built-in ids and `listedMoons(planet)` rather than hundreds of ids. With the lookup used, the first download of the packed example is 1,638,245 bytes raw, 468,717 bytes gzip (+19,682 raw, +7,617 gzip on 0.5.1; re-measured after T-212 with `npm run build` and `node tools/measure-example.mjs`).
|
|
13
|
+
- Proof on the packed package (O-049 T-212, I-122): `npm run check:node-consumer` adds Miranda and Titania by id with `{ orbit: true }` and lists Uranus's moons; the made-up synthetic journey now passes Uranus on 24 January 1986 and adds its five main moons, checked by `npm run check:browser`. No change to the package's code or size.
|
|
14
|
+
|
|
15
|
+
## 0.5.1 (2026-10-31)
|
|
16
|
+
|
|
17
|
+
First download of the packed example (`npm run measure:example`): 1,618,563 bytes raw, 461,100 bytes gzip (code and styles loaded on first open).
|
|
18
|
+
|
|
19
|
+
Near planets stay visible and ringed planets show their rings (O-048, G-014), from a second round of findings sent back by the outside interplanetary probe app built on 0.5.0.
|
|
20
|
+
|
|
21
|
+
- A planet or moon near the camera now stays visible however far the camera has zoomed out (O-048 T-204, I-117). The renderer uses a logarithmic depth buffer, so a Sun-centred scene whose far plane reaches a 170 AU path no longer loses Saturn at 0.01 AU to depth precision. Every custom shader in the engine carries the log-depth chunks, and a test fails for one that does not.
|
|
22
|
+
- Jupiter, Saturn, Uranus and Neptune now carry their rings in their one catalogue definition (O-048 T-205, I-118), so a scene that adds the planet through the public API draws the rings with their NSSDC fact-sheet source; the ring bands and the ring look sliders are unchanged. The planets demo no longer attaches rings itself. First download of the packed example (`npm run measure:example`) grows from 1,608,313 to 1,617,005 bytes raw and from 457,901 to 460,652 bytes gzip (the ring data now ships with the engine).
|
|
23
|
+
- `addBody(moon, { orbit: true })` draws the orbit line of any catalogued moon, not only the Moon and Io (O-048 T-206, I-119). One rule: one lap of the period the moon's catalogue definition carries (`orbitPeriodDays`, read once from its mean-element record), drawn about its planet; the Moon and Io draw as before, and a moon with no period (Phobos, Deimos) throws `no-orbit`. First download grows by 786 bytes raw, 243 bytes gzip (1,617,005 to 1,617,791 raw; 460,652 to 460,895 gzip).
|
|
24
|
+
- `addEvents` takes an optional `object` (a body or trajectory id) per event (O-048 T-207, I-120): the timeline's Go to, Previous and Next seek to the event and frame that object as `camera.lookAt` does; an event without one seeks as before, and an `object` the scene lacks throws `bad-event` naming the event and the id. Only code already in the first download changed; size is not re-measured.
|
|
25
|
+
- Overlapping labels no longer flicker at fast playback (O-048 T-208, I-121). One rule for every label: a label hidden by an overlap needs 14 px more clearance than the plain 6 px gap before it shows again, so two labels crossing swap winner once per crossing; the selected object's label still always wins and labels switched off stay hidden. Layout only; no State change and no new files in the package.
|
|
26
|
+
|
|
5
27
|
## 0.5.0 (2026-10-31)
|
|
6
28
|
|
|
7
29
|
First download of the packed example (`npm run measure:example`): 1,608,131 bytes raw, 457,845 bytes gzip (code and styles loaded on first open).
|
package/README.md
CHANGED
|
@@ -76,13 +76,13 @@ The full reference, generated from the types and doc comments, is at <https://as
|
|
|
76
76
|
| Call | What it does |
|
|
77
77
|
|---|---|
|
|
78
78
|
| `new Scene()` | An empty scene. Every method below returns the scene, so calls chain. |
|
|
79
|
-
| `scene.addBody(body, { orbit?, enlarge?, showLabel?, labelReach?, description?, color?, knownLimitations? })` | Adds a catalogued body: a ready-made one (`sun`, `mercury`, `venus`, `earth`, `moon`, `mars`, `jupiter`, `saturn`, `uranus`, `neptune`, `pluto`, and the moons `io`, `europa`, `ganymede`, `callisto`, `mimas`, `enceladus`, `tethys`, `dione`, `rhea`, `titan`, `iapetus`, `triton`, `charon`, `phobos`, `deimos`) or its id. The first body added is the scene's centre. `{ orbit: true }` also draws its orbit line:
|
|
79
|
+
| `scene.addBody(body, { orbit?, enlarge?, showLabel?, labelReach?, description?, color?, knownLimitations? })` | Adds a catalogued body: a ready-made one (`sun`, `mercury`, `venus`, `earth`, `moon`, `mars`, `jupiter`, `saturn`, `uranus`, `neptune`, `pluto`, and the moons `io`, `europa`, `ganymede`, `callisto`, `mimas`, `enceladus`, `tethys`, `dione`, `rhea`, `titan`, `iapetus`, `triton`, `charon`, `phobos`, `deimos`) or its id; every moon in the moon lists is also taken by its id (`addBody("miranda")` with `astraeus-data-uranus` passed to `mount`) as a grey sphere at its mean radius, and `listedMoons(planet?)` names them with the data package each needs (`requires`). The first body added is the scene's centre. `{ orbit: true }` also draws its orbit line: any catalogued moon with a period in its data (every listed moon but those the list gives no period for, and `moon`, `io`, `europa`, `ganymede`, `callisto`, `mimas`, `enceladus`, `tethys`, `dione`, `rhea`, `titan`, `iapetus`, `triton`, `charon`) about its planet, one lap of that period (the planet must be in the scene; `phobos`, `deimos` and any moon with no period throw `no-orbit`), or, with `sun` in the scene, one turn round the Sun of any body that circles it (the planets, Earth's year, a body from `addBodyFromElements`), from the opening time: one full turn of the body's own positions where they cover a whole turn, else (Uranus and Neptune, whose turn outlasts the planet series) the two-body ellipse osculating at the opening time, which the info card says; anything else throws `no-orbit`. `camera.fitOrbit` follows the same rule. `enlarge` (a number of at least 1) draws the body that many times larger than life (in a Sun-centred scene the viewer then offers its "Solar system" scale, true distances with the named bodies enlarged, as the second scale in place of Readable); `showLabel: false` starts its label off; `labelReach` (a positive number, in the camera's distance units) shows its label only within that distance of the camera, in place of the scene's shared rule. A scene whose first body is the Sun sets no label reach, so labels stay when zoomed out, and it can hold a path (`addTrajectory`, drawn with `lineFixedTo: "sun"`). `color` (a hex colour such as `"#9fd8ff"`) sets the colour on its info card and label; `knownLimitations` (a list of non-empty texts) replaces the catalogue's limits shown with its provenance; a bad value throws `bad-body`. Jupiter, Saturn, Uranus and Neptune are drawn with their rings (bands at the NASA NSSDC ring fact sheet radii) whenever you add them; Mercury, Venus, Earth, Mars and Pluto have none. |
|
|
80
80
|
| `scene.addTrajectory({ id, label?, color?, center?, plane?, lineFixedTo?, labelReach?, samples, provenance?, provenanceSpans?, description?, knownLimitations?, anchors?, readouts? })` | A recorded path. Each sample is `{ time, positionKm, velocityKmS? }` measured from `center` (default: the scene's centre, its first body, so a Sun-first scene reads them from the Sun and an Earth-first one from Earth; Earth if no body is added) in equatorial J2000 (EQJ) axes; `plane: "ecliptic-j2000"` instead takes ecliptic J2000 vectors as JPL Horizons publishes them and rotates them to EQJ once on the way in (positions and velocities, from samples or a provider; a provider's `orientation` quaternion passes through unrotated, a known limit; any other `plane` throws `bad-trajectory`); `lineFixedTo` names the body the line is drawn against (default the scene centre): each sample is placed from that body at the sample's own time, then the line is carried to that body's place from the scene centre at the clock time, so `"sun"` fixes a probe's line to the Sun in any scene, Sun-centred ones included, and a body the scene does not hold throws `bad-trajectory`; `labelReach` (a positive number, in the camera's distance units) limits how far from the camera its name shows, in place of the scene's shared rule; a bad value throws `bad-trajectory`; `time` is ISO text, a `Date` or Unix milliseconds. Instead of `samples` you may give `provider` (an object with `stateAt(timeUtcMs)`) and `bounds: { start, end }`. `description` and `knownLimitations` (a list of sentences) go on its info card with `provenance`. `anchors: [{ id, time }]` draw labelled dots where the source published a point (the time must fall within the path). `readouts` are bars on the card, in order: `{ kind: "range", marker? }` (distance from the centre; `marker` names a body to mark), `{ kind: "speed" }`, `{ kind: "distance", to }` and `{ kind: "altitude", above }`; a named body must be in the scene. `provenanceSpans` (a list of `{ start, end, provenance }`, sorted, not overlapping, inside the path) gives each stretch its own provenance, shown with the path as time moves (as an activity's `provenance`); where no span covers the time, `provenance` (or the illustrative default) shows; a fault throws `bad-trajectory` naming the index. |
|
|
81
81
|
| `scene.addBodyFromElements(record, options?)` | Your own body that circles the Sun, from published orbit elements: `record` is `{ id, label, elements: { semiMajorAxisAu, eccentricity, inclinationDeg, ascendingNodeDeg, argumentOfPerihelionDeg, meanAnomalyDeg or perihelionJdTdb }, epoch: { jd, timeScale, ttMinusUtcSeconds? }, frame: "ecliptic-j2000", source: { name, url, solution, accessed }, radius?, accuracy: { classification, statement, validFromUtc, validToUtc, limitations }, marker?: { color, sizePx } }`. Drawn as a marker on unperturbed two-body motion about the Sun; the source, accuracy and limits show on its info card, with a live "Distance from Sun" row. `options` are `addBody`'s (`{ orbit: true }` draws its whole orbit from periapsis, smooth even for a sharp comet orbit). A bad record throws `bad-element` naming the field; a repeated id throws `duplicate-id`. |
|
|
82
82
|
| `scene.addGroup({ id, orbits, label?, center?, plane?, color?, dotSizePx?, referenceTime?, seed?, clump?, refillAfterMs?, refillSliceMs?, provenance?, description?, knownLimitations? })` | A list of orbits drawn as one group of dots: `orbits` is `[{ id, semiMajorAxisKm, eccentricity, inclinationDeg, raanDeg, argumentOfPeriapsisDeg, time? }]` (bound orbits, ids distinct), measured about `center` (default the scene's centre; it must be in the scene) in `plane` (`"ecliptic-j2000"` default, or `"EQJ"`). One colour (`color`, a hex colour), dot size (`dotSizePx`), menu item, info card, provenance and known limits. Where each dot sits along its orbit is a drawing choice, marked illustrative: an even spread shuffled by `seed`, fixed at `referenceTime` (default the opening time), then two-body motion. `clump: { near, fraction, widthDeg }` draws a share of the dots near a body's place along its orbit (a model; the body must be in the scene and not the centre; it may be one added with `addBodyFromElements` before the group). `refillAfterMs` is how often the dots are placed again; `refillSliceMs` (0 or more) is how much of a frame may go on computing the next fill ahead of time. The group's card shows "illustrative" as its source type, with the elements' own type in the accuracy sentence. The id joins the camera menu (`focus-<id>`, `follow-<id>`) and may be a panel's `object`. A mistake throws `bad-group`. |
|
|
83
83
|
| `scene.setTime(time)` | The moment the scene opens at. |
|
|
84
84
|
| `scene.setScale(trueScale \| readableScale \| solarSystemScale, { only? })` | The opening scale; the viewer can switch to the other unless `{ only: true }` offers that scale alone. `solarSystemScale` (true distances, enlarged bodies drawn larger) needs a Sun-centred scene with an enlarged body, else `bad-scale`; such a scene offers it second in place of `readableScale`. |
|
|
85
|
-
| `scene.addEvents(events, { provenance? })` | Timed events on the timeline: `[{ id, label, time, type?, provenance? }]`, ids unique. `provenance` says where the times come from; an event's own `provenance` wins over the batch's. A provenance `sourceType` is `ephemeris`, `observed`, `reconstructed`, `modelled` or `illustrative`; `modelled` is shown as "Modelled". Batch and per-event provenance are checked: a malformed one throws `bad-event`. May be called more than once. |
|
|
85
|
+
| `scene.addEvents(events, { provenance? })` | Timed events on the timeline: `[{ id, label, time, type?, provenance?, object? }]`, ids unique. `object` is the id of a body or trajectory in the scene the event is about: the timeline's Go to (and Previous/Next) seeks to the event and frames that object as `camera.lookAt` does (it is selected and Focus shows pressed); an event without one only seeks. An `object` the scene lacks throws `bad-event` naming the event and the id when the scene is built. `provenance` says where the times come from; an event's own `provenance` wins over the batch's. A provenance `sourceType` is `ephemeris`, `observed`, `reconstructed`, `modelled` or `illustrative`; `modelled` is shown as "Modelled". Batch and per-event provenance are checked: a malformed one throws `bad-event`. May be called more than once. |
|
|
86
86
|
| `scene.addStoryPanels({ pauseSeconds?, autoOpen?, panels })` | Story panels that open as playback reaches them: `{ id, at: { utc } \| { event } \| { anchor }, title, body, details?, badge, sources, object? }`. `badge` is `observed`, `modelled` or `illustrative`; `sources` is never empty. A mistake throws `bad-panels` naming the panel and field. |
|
|
87
87
|
| `scene.setTimeline({ start, end, rates?, rate?, loop?, pacing? })` | The timeline's span, the playback speeds offered (simulated seconds per real second) and the one it opens at. `{ none: true, at?, rate? }` draws no timeline bar: time is frozen at `at`, or runs on at `rate`. The speed menu shows exactly the `rates` you give (ascending), and no others; without `rates` it offers 1 minute, 1 hour and 1 day per second. `pacing` slows playback for encounters and speeds it up for cruise, see "Paced playback" below. With a timeline bar and no `loop`, playback stops on the timeline's end instead of running past it. |
|
|
88
88
|
| `scene.addActivity({ id, label, unit, start, end, samples, peak?, provenance?, type?, peakLabel? })` | A period of activity on the timeline: a rate curve `samples: [{ time, value }]` (at least two, sorted, inside `start` to `end`; straight lines between) that the timeline glows by, with an optional `peak` mark and `provenance: [{ start, end, provenance }]` for where each stretch comes from. A group's `readouts: [{ kind: "rate", activity? }]` shows the live rate (unavailable outside the period) against the peak on its card. Without `setTimeline` the timeline spans the activities. A repeated id or a bad curve, peak or source throws `bad-activity`; a rate readout with no activity is `bad-readout`. |
|
|
@@ -197,7 +197,7 @@ window.addEventListener("vite:preloadError", () => window.location.reload());
|
|
|
197
197
|
|
|
198
198
|
For tests, the package has a `node` export condition: Node and Vitest's Node environment import a copy of the package without the stylesheet import, so `new Scene()...toDefinition()` works with no `test.server.deps.inline` setting. The jsdom and happy-dom Vitest environments also take the `node` condition, so the viewer's CSS is not loaded there; this does not matter for tests that check scene definitions or behaviour. Bundlers do not use the `node` condition and load the normal build.
|
|
199
199
|
|
|
200
|
-
First download: the packed `examples/hello-scene` loads 1,
|
|
200
|
+
First download: the packed `examples/hello-scene` loads 1,638,245 bytes (468,717 gzip) of code and styles, measured at this commit on first open (`npm run measure:example`; pictures and data files are not counted).
|
|
201
201
|
|
|
202
202
|
## What `astraeus-data` adds
|
|
203
203
|
|