@johnmorrisdotca/wakusei-planets 0.32.0 → 0.34.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/NOTICE.md +15 -1
- package/README.md +11 -5
- package/dist/bodies/all.d.ts +1 -0
- package/dist/bodies/all.js +1 -0
- package/dist/bodies/minor.d.ts +1 -0
- package/dist/bodies/minor.js +16 -0
- package/dist/data/minor.d.ts +3 -0
- package/dist/data/minor.js +7 -0
- package/dist/data/tables.d.ts +4 -2
- package/dist/data/tables.js +1 -1
- package/dist/element.d.ts +10 -1
- package/dist/element.js +36 -6
- package/dist/embed.d.ts +1 -1
- package/dist/embed.js +3 -3
- package/dist/ephemeris.d.ts +7 -7
- package/dist/ephemeris.js +36 -13
- package/dist/facts.d.ts +28 -4
- package/dist/facts.js +24 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/nearest.js +6 -4
- package/dist/scene/body.d.ts +13 -2
- package/dist/scene/body.js +35 -0
- package/dist/scene/name-label.d.ts +116 -0
- package/dist/scene/name-label.js +232 -0
- package/dist/scene/painter.d.ts +29 -0
- package/dist/scene/painter.js +36 -0
- package/dist/scene/textures.d.ts +2 -2
- package/dist/space/arrows.d.ts +29 -3
- package/dist/space/arrows.js +38 -6
- package/dist/space/bodies.d.ts +6 -6
- package/dist/space/bodies.js +6 -6
- package/dist/space/element.d.ts +20 -0
- package/dist/space/element.js +44 -4
- package/dist/space/frame.d.ts +28 -3
- package/dist/space/frame.js +40 -4
- package/dist/space/index.d.ts +2 -2
- package/dist/space/index.js +2 -2
- package/dist/space/scale.d.ts +4 -4
- package/dist/space/scale.js +8 -2
- package/dist/space/scene.d.ts +17 -3
- package/dist/space/scene.js +36 -17
- package/dist/stops.d.ts +1 -1
- package/dist/stops.js +4 -1
- package/dist/tables/all.d.ts +1 -0
- package/dist/tables/all.js +1 -0
- package/dist/tables/lazy.d.ts +5 -0
- package/dist/tables/lazy.js +12 -0
- package/dist/tables/minor.d.ts +1 -0
- package/dist/tables/minor.js +317 -0
- package/dist/textures/vesta-1024.webp +0 -0
- package/dist/textures/vesta-512.webp +0 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.34.0] - 2026-11-11
|
|
6
|
+
|
|
7
|
+
- **The body's name written on its globe** (MODULES-923). `body-label="painted"` on `<wakusei-body>` and `<wakusei-space>` writes each body's name on its own surface in the shaded looks, large and in capitals, lying on the globe and turning with it as a film lays a title over the thing it names, with the surface showing through. Off by default. The family's standard attributes beside it: `body-label-strength` (0 to 1), `body-label-repeat` (`once`, `both` so one is always in view, `around`), `body-label-latitude` (the equator, or a band near a pole), `body-label-facing` (the name keeps facing the reader while the body turns under it), `body-label-font` and `body-label-fallback-font`; and one property, `bodyLabel`, taking the same as an object or `null`. The looks are `painted`, `etched`, `outline` and `burned`. The default when on is John's pick: Michroma, painted, half strength, once, on the equator, turning with the body. The text is the body's name in the element's `lang` (`EARTH`, `地球`; Japanese in the fallback font). A body drawn smaller than 24 CSS pixels in radius carries no name, so the small moons and the whole solar system stay plain; the Sun's is drawn on its disc, fully lit; the name is lit as the body is, so it is dark on the night side. The drawing is kazoku-ui 0.37's `body-label` (the one drawing for the family, so chikyu-earth's Earth can carry the same), fitted to the bodies' own frame and lit through the painter's own light (the scenes have no three.js lights). Through the painter: `label` in `PaintContext`, `setLabel` and `label` on a `Painting`, `PaintLabel`; `readNameLabel` and `nameLabelText` from `/painter`. Michroma (SIL OFL 1.1) is fetched once from kazoku-ui's copy the first time a name is written in it; a page's own font fetches nothing. A page that hands over a subset of three.js adds `CanvasTexture`, `SRGBColorSpace` and `NormalBlending` for the name to be drawn. Both demo pages have a "Name on the body" row kept in the address (`bl`, `blr`, `bll`, `bls`, `blf`); `stats.label` and `stats.bodyLabels` say what is drawn. Guide "A name on the body" in English and Japanese; `e2e/body-label.demo.ts` and a freeze case. kazoku-ui 0.37.
|
|
8
|
+
|
|
9
|
+
## [0.33.0] - 2026-11-11
|
|
10
|
+
|
|
11
|
+
- **CI installs Playwright's browsers in bounded, cached steps** (KAZOKU-UI-100). A slow package mirror held `playwright install --with-deps` for the whole job limit on 2026-11-09 and 2026-11-10, so no test ran and the failure read as a test failure. `.github/actions/playwright` (the family's, kazoku-ui's copy is canonical) caches the browsers by Playwright's version, then installs the system libraries in a step of their own: two tries, each cut off after 7 minutes, and a failure that says it is the runner's package mirror and that nothing was run. Free: GitHub-hosted Linux runners and the cache.
|
|
12
|
+
- **`pnpm docs:check` reads a guide's front matter as strict YAML** (KAZOKU-UI-102). A title or description holding a colon and a space without quotes passed the old line reader while GitHub showed "Error in user YAML" above the page. `scripts/docs-site.mjs` (the family's, version `2026-11-10-strict-front-matter`) now fails with the file, the line and a plain sentence on an unquoted colon, an unquoted " #", a value that starts with a YAML character (`[ { & * ! | > % @` or a backtick), a tab, an indented continuation, a key twice and an unclosed quote.
|
|
13
|
+
- **Two arrows on each orbit, with a setting for the count** (MODULES-909, John: "too many arrows ... we probably only need 2 or max 4"). `ARROWS_PER_ORBIT` is now 2 (it was 6) and an orbit carries at most 4 (`MAX_ARROWS_PER_ORBIT`). `<wakusei-space>` has the attribute and property `arrows` for the count: 2 by default, 0 for none, anything else a whole number from 0 to 4 (`arrowCount` reads it); `arrowSites(line, count)` takes the same. The Moon's line has them too.
|
|
14
|
+
- **The far orbits are smooth curves** (MODULES-909). Sedna's, Eris's, Gonggong's and Haumea's lines (and Halley's, Pholus's and Chiron's) are cut at equal steps of the eccentric anomaly, not of time: cut in time, 96 points left the sharp turn near the Sun as one long straight stroke with corners. And `kepler` solved long orbits (e from 0.8, Sedna's 0.86) wrongly for a negative mean anomaly, which scattered half of Sedna's line far from the ellipse: it starts from a place on the right side of the orbit now.
|
|
15
|
+
|
|
16
|
+
- **Vesta, Pallas, Chiron, Pholus and Halley's comet are bodies** (MODULES-553). `MINOR_IDS` (and the type `MinorId`) name them and `BodyFacts.kind` has three new values, `asteroid`, `centaur` and `comet`; `BODY_IDS` is 52 long (it was 47). Each has its size, its shape where one is published (Vesta 569 x 554 x 453 km, Pallas 568 x 532 x 448, Halley 14.9 x 8.2), pole, rotation, colour, a line drawing and a shaded look, and a name in Japanese (ベスタ, パラス, ケイロン, ポルス, ハレー彗星); the numbers are JPL's Small-Body Database's and NOTICE.md gives each source and says which poles are estimated (Chiron's, Pholus's and Halley's are along the orbit's pole; Halley is drawn still). Vesta's painted look is Dawn's own photomap (public domain, 2.05 MB of pictures now ship, the budget is 2.1). The other four have never been imaged beyond a point of light (Halley's nucleus was photographed by Giotto, whose pictures' terms keep them out), so they are drawn from their numbers.
|
|
17
|
+
- **Their positions are tables fitted to JPL Horizons, within 1 arc-second** (MODULES-553). `@johnmorrisdotca/wakusei-planets/tables/minor` (new; also in `/tables`) holds Vesta and Pallas for 1900 to 2100 and Chiron, Pholus and Halley for 1800 to 2200, made by `scripts/make-minor-data.py`, about 48 kB gzipped. A comet moves fast near the Sun, so a table can now have segments of unequal length: `FittedTable.edges` says where each starts (Halley's are 43 days long at its perihelion and 16 years at its aphelion). Measured on 12 dates (`test/data/horizons-minor.json`, one Horizons request a date) the worst is 0.53 arc-seconds. `heliocentric`, `heliocentricModel` and `meanSunAu` take a `MinorId`; outside the table's years a body is a plain ellipse from Horizons' osculating elements (Halley's, from 1968, are 31 degrees off by 2026: `<wakusei-space>` loads the table itself, and `<wakusei-body>` fetches it when a minor body has a date). `nearest`, `within`, `closestApproach` and `conjunctions` include them, with `kind: "asteroid" | "centaur" | "comet"`, and `JOURNEY_STOPS` has a row for each (Vesta's and Pallas's GM from the Small-Body Database).
|
|
18
|
+
- **The space view offers them** (MODULES-553). `frameAt` has `minors` (`SPACE_MINORS`, `SpaceMinor`), `SPACE_BODIES` is the twenty-four bodies it places, the hopper goes Mars, Vesta, Ceres, Pallas, Jupiter and Saturn, Chiron, Halley, Uranus, Pholus, Neptune (by the size of their orbits), `findBody` reads their names in either language, and `bodyKindOf` says what they are. A small body has an orbit line (`planetOrbit` cuts a long ellipse at equal steps of the eccentric anomaly, so Halley's turn round the Sun is smooth), a name and a ring, and is drawn once it is half a pixel across (at true scale none of them is; the compressed scale gives each 0.2 Earth radii). The demo's picker has a "Small bodies" kind, and the body page and the embed builder a "Small bodies" row.
|
|
19
|
+
- **The test of the Horizons fixture's dates.** Horizons gives every time of a list the correction between terrestrial and universal time of the *first* date of the list, so `test/data/horizons.json` (a list from 1800 or 1900) puts a date in 2026 about a minute off. That is invisible for the slow bodies it holds and 0.6 arc-seconds for Vesta, so the minor bodies' reference is a file of its own with one request a date (`python3 -I scripts/fetch-horizons-reference.py minors`).
|
|
20
|
+
|
|
5
21
|
## [0.32.0] - 2026-11-10
|
|
6
22
|
|
|
7
23
|
- **The data door: `@johnmorrisdotca/wakusei-planets/door`** (MODULES-831, step 2; the shapes are kazoku-ui's `templates/data-door.ts`, copied unchanged to `src/data-door.ts`). One way to hand the package outside data and to say whose data is on the screen. `BodyMapSource` is a `TileSource` for the colour or the height of a body's map (the family's `MapPlace` and `ImageTile`; the keys end in `level/column/row` on the package's 512 pixel pyramid, and `mapKeys` names them), and `tilesSource(base)` is the package's own folder of tiles as a source, which is what the `tiles` attribute means; the attribute stays. `SmallBody` (name, `a`, `e`, `i`, `node`, `peri`, `M0`, `epoch`, `H`) and `SmallBodySource` are a record source of small bodies, read once, at most 200,000, with the records that cannot be drawn left out and counted; `smallBodyAt` says where one is on a date. `<wakusei-body>` and `<wakusei-space>` take `sources`, `addSource` (checked at once, returns its `remove()`), `removeSource`, `enableSource` and `data="own"`, and have `credits()` and the event `wakusei-creditschange`; `creditLine` writes the credit line with the licence beside each source, "non-commercial" or "share-alike" included, in English and Japanese. Off aborts a source's loads, frees its tiles and records, and drops its credit. The tiles of every body in a view share one 48 MB budget (`TILE_BUDGET_BYTES`), six loads at a time per source, and nothing is sent at rest. `OWN_SOURCES` (the pictures, the tiles and the orbit series) and `ownCredit` write the package's own credits from `NOTICE.md`, and a test holds that none is non-commercial or share-alike. A window of tiles that could not be made is no longer tried again after 30 seconds: it is tried again when the view changes. Every attribute and function is as it was; `createPainter` takes an optional `book`.
|
package/NOTICE.md
CHANGED
|
@@ -31,6 +31,15 @@ Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna (Pluto is with
|
|
|
31
31
|
|
|
32
32
|
The tests compare the Galilean moons and four planets with astronomy-engine (MIT, https://github.com/cosinekitty/astronomy), a development dependency that is never shipped.
|
|
33
33
|
|
|
34
|
+
## The minor bodies
|
|
35
|
+
|
|
36
|
+
Vesta, Pallas, Chiron, Pholus and Halley's comet (`MINOR_IDS`). Values read on 2026-11-10 from JPL's Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api) and Horizons (https://ssd.jpl.nasa.gov/api/horizons.api); both are NASA/JPL, not subject to copyright in the United States (credit: NASA/JPL-Caltech).
|
|
37
|
+
|
|
38
|
+
- **Where they are**: JPL Horizons, fitted as Chebyshev tables from the solar system's barycentre (`scripts/make-minor-data.py`, `src/tables/minor.ts`) like the dwarf planets, with the Sun's swing about the barycentre worked out from the planets' masses: Vesta and Pallas 1900 to 2100, Chiron, Pholus and Halley 1800 to 2200, each within 1 arc-second of Horizons on the samples left out of each fit (0.6 at the worst on the 12 dates of `test/data/horizons.json`, one request a date). Halley's segments are of unequal length (43 days near the Sun, 16 years far from it). Halley is Horizons' record 90000030, the solution of the 1986 apparition (observations 1835 to 1994): a comet's orbit past that arc is a prediction, and its non-gravitational forces are in the solution. Outside the tables' years each runs on Horizons' osculating elements (Vesta 2020-01-01, Pallas 2017-04-27, Chiron 2017-06-12, Pholus 2010-06-22, Halley 1968-01-20; `src/data/minor.ts`) as a plain ellipse: a few degrees off a century from the epoch, and Pallas, a planet's pull on an orbit tipped 35 degrees, most.
|
|
39
|
+
- **Sizes and spin**, as the Small-Body Database gives them: Vesta, 569.24 x 554.48 x 452.66 km, pole RA 309.0611 and Dec 42.2324, rotation 5.3421276 h, GM 17.2882844 km^3/s^2, Park et al. 2025, Nature Astronomy (DOI 10.1038/s41550-025-02533-7); its prime meridian at J2000 (285.39 degrees, the Claudia system of Dawn's maps) is the IAU's, Archinal et al. 2018, Celestial Mechanics and Dynamical Astronomy 130:22. Pallas, 568 x 532 x 448 km, Marsset et al. 2020, Nature Astronomy 4:569; pole from Carry et al. 2010, Icarus 205:460 (ecliptic longitude 30, latitude -16, which is RA 33, Dec -3), rotation 7.8132214 h; GM 13.63 km^3/s^2, Vernazza et al. 2021, A&A 654:A56. Chiron, a diameter of 166 km (an occultation, listed by the Small-Body Database as "Dunham occultation list: Duham 1998"), rotation 5.918 h, Warner et al. 2009 (the Lightcurve Database). Pholus, a diameter of 190 km, Earth, Moon, and Planets 89:117 (2002), rotation 9.98 h, Lightcurve Database. Halley's nucleus, 14.9 x 8.2 km, Keller et al. 1987, A&A 187:807 (the Giotto flyby), radius 5.5 km (the Small-Body Database). Colours from the published albedos and spectral types (Vesta, V-type, albedo 0.42; Pallas, B-type, 0.155; Chiron, Cb, 0.15; Pholus, very red, 0.044; Halley, 0.04).
|
|
40
|
+
- **Vesta's picture** is Dawn's own: the global photomap on Wikimedia Commons (public domain; table above). The other four have never been imaged as more than a few pixels, except Halley, whose nucleus Giotto photographed in 1986 (ESA; those pictures' terms keep them out of this package): their shaded looks and line drawings are generic craters on the numbers' shape, which this paragraph says.
|
|
41
|
+
- **Estimated, not measured** (the pictures say so only here): Chiron's and Pholus's poles are not measured, so each is drawn with its spin axis along its orbit's pole (RA 258.793, Dec 72.317 for Chiron; RA 334.495, Dec 66.246 for Pholus). Halley's nucleus tumbles (about 2.2 days, a period this package does not model): it is drawn still, its axis along its orbit's pole. Vesta's and Pallas's features on the line look (Vesta's Rheasilvia basin at the south pole, and two bands for its equatorial troughs) are Dawn's; the craters are generic.
|
|
42
|
+
|
|
34
43
|
## The spacecraft
|
|
35
44
|
|
|
36
45
|
Voyager 1 and 2, New Horizons, Pioneer 10 and 11, Cassini, Galileo, Juno, Parker Solar Probe and the James Webb Space Telescope. Values read on 2026-11-08. NASA content is not subject to copyright in the United States; credit: NASA/JPL-Caltech. This package is not endorsed by NASA and uses none of its insignia.
|
|
@@ -93,6 +102,7 @@ Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equir
|
|
|
93
102
|
| `enceladus-*.webp` | Enceladus | [Enceladus Color Map.jpg](https://commons.wikimedia.org/wiki/File:Enceladus_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18435), turned half way round the same way as Rhea's (the source does not say where it is centred; the fractured trailing terrain is put at 90 degrees east); the colours are false-colour (the blue of the tiger stripes is ultraviolet) and are turned most of the way to grey |
|
|
94
103
|
| `mimas-*.webp` | Mimas | [Map of Mimas 2010-02 PIA12780.jpg](https://commons.wikimedia.org/wiki/File:Map_of_Mimas_2010-02_PIA12780.jpg) | Public domain | NASA/JPL/Space Science Institute | Cassini ISS map of February 2010 (PIA12780), cropped inside its frame and labels; Herschel is at 110 degrees west as its own scale says |
|
|
95
104
|
| `ceres-*.webp` | Ceres | [PIA20354-Ceres-DwarfPlanet-MercatorMap-HAMO-20160322-0DegreeLongitude.jpg](https://commons.wikimedia.org/wiki/File:PIA20354-Ceres-DwarfPlanet-MercatorMap-HAMO-20160322-0DegreeLongitude.jpg) | Public domain | NASA/JPL-Caltech/UCLA/MPS/DLR/IDA | Dawn's colourised global map of Ceres (PIA20354, 140 m a pixel), longitude 0 in the middle as the file says (Occator's bright spots fall at 239 degrees east); the green and yellow high latitudes, where Dawn's colour coverage is incomplete (the map says so), are made the surface's own grey keeping their detail, and the last rows with no data repeat the nearest real ones; the colour is turned most of the way to grey |
|
|
105
|
+
| `vesta-*.webp` | Vesta | [Vesta map for GeoHack.png](https://commons.wikimedia.org/wiki/File:Vesta_map_for_GeoHack.png) | Public domain | NASA/JPL-Caltech/UCLA/MPS/DLR/IDA (as the file page gives it; hosted by the USGS Astrogeology Science Center's Gazetteer of Planetary Nomenclature) | Dawn Framing Camera global photomap of Vesta (grey, 3561 x 1781, north up), whose left edge is 330 degrees east (the file says so), turned a twelfth of the way round so longitude 0 is in the middle; the grey is given a faint warmth. Rheasilvia, the great basin at the south pole, shows at the bottom |
|
|
96
106
|
| `tethys-*.webp` | Tethys | [Tethys Color Map.jpg](https://commons.wikimedia.org/wiki/File:Tethys_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18439, Paul Schenk), turned half way round so longitude 0 is in the middle (the source does not say where it is centred; Odysseus, at 129 degrees west, falls at 131 degrees west and the dark trailing side at 90 degrees east); the colours are enhanced (ultraviolet to infrared) and are turned about half way to grey |
|
|
97
107
|
| `dione-*.webp` | Dione | [Dione Color Map.jpg](https://commons.wikimedia.org/wiki/File:Dione_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18434), turned half way round the same way as Tethys's (the source does not say where it is centred; the dark trailing side with its wispy fractures is put at 90 degrees east); the colours are enhanced and are turned about half way to grey |
|
|
98
108
|
| `iapetus-*.webp` | Iapetus | [Iapetus Color Map.jpg](https://commons.wikimedia.org/wiki/File:Iapetus_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18436), turned half way round the same way (the source does not say where it is centred; the dark leading side, Cassini Regio, is put at 270 degrees east, 90 degrees west); the colours are enhanced and are turned a third of the way to grey |
|
|
@@ -100,7 +110,7 @@ Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equir
|
|
|
100
110
|
| `charon-*.webp` | Charon | [Charon map iau1803c.jpg](https://commons.wikimedia.org/wiki/File:Charon_map_iau1803c.jpg) | Public domain | NASA/Johns Hopkins University Applied Physics Laboratory/Southwest Research Institute (via the IAU) | New Horizons global map of Charon (iau1803c, no labels or grid), as it is, with longitude 0 in the middle (the source does not say; the sharp hemisphere New Horizons saw best is the one that faces Pluto, which is longitude 0); the south, in the polar night New Horizons never saw, is continued from the last real rows and fades to the mean grey |
|
|
101
111
|
| `saturn-ring-2048.webp` | Saturn's rings | [Saturn's rings in visible light and radio.jpg](https://commons.wikimedia.org/wiki/File:Saturn's_rings_in_visible_light_and_radio.jpg) | Public domain | NASA / JPL / Space Science Institute | Cassini's natural-colour mosaic of the lit rings (PIA07874, from PIA06175), read along one radius into a strip of 2048 colours and opacities from 74,794 to 137,035 km. The radii are fitted to five edges the picture shows (the B ring's inner edge, the two edges of the Cassini Division, the Encke gap and the A ring's outer edge), each within 300 km. The opacity is taken from the brightness, and the colour balance is moved to match the Saturn portrait above; the F ring and the D ring are not in the picture |
|
|
102
112
|
|
|
103
|
-
The package does not ship the 2048 pixel widths: `TEXTURE_FAR_BASE` fetches them from this repository by jsDelivr's GitHub address when a view is zoomed in. The 512 and 1024 pixel widths of every picture, and the ring strip, are
|
|
113
|
+
The package does not ship the 2048 pixel widths: `TEXTURE_FAR_BASE` fetches them from this repository by jsDelivr's GitHub address when a view is zoomed in. The 512 and 1024 pixel widths of every picture, and the ring strip, are 2.05 MB in the package (the nine of 0.2.0 were 0.53 MB; Ceres adds 0.13 MB, Tethys, Dione, Iapetus, Triton and Charon 0.45 MB, and Vesta 0.08 MB). Where a source does not say where its map is centred, its row says what the picture was matched to.
|
|
104
114
|
|
|
105
115
|
## Finer map tiles
|
|
106
116
|
|
|
@@ -132,6 +142,10 @@ Not tiled, because no finer public-domain map was found that this package can us
|
|
|
132
142
|
|
|
133
143
|
The generic detail of a close zoom (docs/guides/close-zoom.md) is noise made in the shader. It is no data and takes nothing from any source.
|
|
134
144
|
|
|
145
|
+
## The font of a name on a body
|
|
146
|
+
|
|
147
|
+
A body's name written on its globe (`body-label`) is drawn in Michroma, by Vernon Adams, "Copyright 2011 The Michroma Project Authors (https://github.com/googlefonts/Michroma-font)", under the SIL Open Font License, Version 1.1, with no Reserved Font Name. The licence was read on 2026-11-11: it allows the font to be used, bundled, embedded and redistributed with software, as long as the copyright notice and the licence go with it and the font is not sold by itself. This package bundles no font: the file ships unchanged in `@johnmorrisdotca/kazoku-ui` (`dist/body-label/fonts/Michroma-Regular.ttf`, with `OFL.txt` beside it) and is fetched from there only when a page writes a name in it. A page that names its own font fetches nothing.
|
|
148
|
+
|
|
135
149
|
## The data door
|
|
136
150
|
|
|
137
151
|
- **The package's own credits (`OWN_SOURCES` in `@johnmorrisdotca/wakusei-planets/door`, MODULES-831, written 2026-11-10)**: three rows, written from the entries of this file and read nowhere else. `wakusei-pictures` is the surface pictures (Surface pictures above: NASA, USGS and JPL maps that are public domain, and Solar System Scope's and Nestaeric's maps, CC BY 4.0; its licence name is the stricter, "CC BY 4.0", read 2026-11-02). `wakusei-tiles` is the finer map tiles (Finer map tiles above: public domain, read 2026-11-09). `wakusei-orbits` is the series and tables the positions come from (The numbers above: IMCCE's VSOP87B and ELP2000-82B, which "carry no licence text" and are published for use with the credit, and JPL Horizons, NASA/JPL-Caltech, read 2026-11-07; its licence name says "Published for use with credit"). A test holds that none of the three is marked non-commercial or share-alike.
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Wakusei Planets runs in the browser of a phone, a tablet or a computer: nothing
|
|
|
19
19
|
|
|
20
20
|
<p align="center"><img alt="The demo on a desk: Saturn in the painted look, turning in the big view, with the page's links to the portrait builder, the colouring sheets, the space view, the star page and the size line-up above it, and the choice of body and its moons below" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-desk.webp" width="620"> <img alt="The same page on a phone: the same links in rows, and Saturn in the painted look below them" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-phone.webp" width="200"></p>
|
|
21
21
|
|
|
22
|
-
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
22
|
+
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.34.0/docs/images/lineup-desk.png" width="640"></p>
|
|
23
23
|
|
|
24
24
|
## Who it is for
|
|
25
25
|
|
|
@@ -96,7 +96,7 @@ A bundled app imports it: `import "@johnmorrisdotca/wakusei-planets/element"` (a
|
|
|
96
96
|
|
|
97
97
|
## Features
|
|
98
98
|
|
|
99
|
-
- The Sun, the eight planets, Pluto, eight more dwarf planets and 29 moons, each with its real size, flattening, axial tilt, pole and rotation as data.
|
|
99
|
+
- The Sun, the eight planets, Pluto, eight more dwarf planets, five minor bodies (the asteroids Vesta and Pallas, the centaurs Chiron and Pholus and Halley's comet) and 29 moons, each with its real size, flattening, axial tilt, pole and rotation as data.
|
|
100
100
|
- Three looks: a clean `line` drawing (an SVG string), a shaded `realistic` sphere worked out in a shader, and a `painted` surface map from public-domain imagery.
|
|
101
101
|
- The sky for any date and time: a body's pole, rotation, phase and ring opening as the Earth sees it, and a planet's moons where they are then.
|
|
102
102
|
- One WebGL context for the page, nothing drawn at rest, at most thirty frames a second, and everything freed when an element leaves.
|
|
@@ -126,7 +126,7 @@ Import the element once in client code, and the entry point of each body you dra
|
|
|
126
126
|
| `realistic` | A shaded sphere drawn from the body's real colours and features, lit from the Sun's side, with the rings casting shadows. No pictures: the surface is worked out in a shader. | `three`, the body's entry point |
|
|
127
127
|
| `painted` | A real surface map from public-domain NASA, USGS and JPL imagery. Small pictures first (1.31 MB for all of them in the package), a sharper one fetched when you zoom in, and finer map tiles for the part in view when you zoom right up, in a body, a portrait or the space view (Mars, the Moon, the Earth and ten moons: [close zoom](docs/guides/close-zoom.md)). | `three`, the body's entry point |
|
|
128
128
|
|
|
129
|
-
Every body has its real size relative to the others (`scale-to="jupiter"`), its axial tilt and its rotation. The Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto are drawn, and so are the eight other dwarf planets (Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna; Haumea and Quaoar as the long shapes they are, and Ceres with a painted map from Dawn) and 29 moons (the Moon, Phobos and Deimos, the four Galilean moons, Saturn's seven larger moons, Uranus's five, Proteus, Triton and Nereid, Charon, Nix and Hydra, and Vanth, Hiʻiaka, Namaka and Dysnomia, the moons of the dwarf planets whose orbits are published with a date). The Earth is drawn like the rest in the realistic and painted looks (NASA's Blue Marble), and its line look is [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth)'s own globe: `import "@johnmorrisdotca/wakusei-planets/earth"` (it needs `@johnmorrisdotca/chikyu-earth` 0.10.0 or later installed). The painted looks cover the Sun, the planets from Mercury to Earth and Pluto, Ceres, the Moon, the four Galilean moons, Saturn's Mimas, Enceladus, Tethys, Dione, Rhea, Titan and Iapetus, Triton and Charon, and Saturn's rings are Cassini's own picture of them.
|
|
129
|
+
Every body has its real size relative to the others (`scale-to="jupiter"`), its axial tilt and its rotation. The Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto are drawn, and so are the eight other dwarf planets (Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna; Haumea and Quaoar as the long shapes they are, and Ceres with a painted map from Dawn) five minor bodies (Vesta, with Dawn's own map, Pallas, Chiron, Pholus and Halley's comet, each its own shape, size and spin as the Small-Body Database has them) and 29 moons (the Moon, Phobos and Deimos, the four Galilean moons, Saturn's seven larger moons, Uranus's five, Proteus, Triton and Nereid, Charon, Nix and Hydra, and Vanth, Hiʻiaka, Namaka and Dysnomia, the moons of the dwarf planets whose orbits are published with a date). The Earth is drawn like the rest in the realistic and painted looks (NASA's Blue Marble), and its line look is [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth)'s own globe: `import "@johnmorrisdotca/wakusei-planets/earth"` (it needs `@johnmorrisdotca/chikyu-earth` 0.10.0 or later installed). The painted looks cover the Sun, the planets from Mercury to Earth and Pluto, Ceres, the Moon, the four Galilean moons, Saturn's Mimas, Enceladus, Tethys, Dione, Rhea, Titan and Iapetus, Triton and Charon, and Saturn's rings are Cassini's own picture of them.
|
|
130
130
|
|
|
131
131
|
## A star from its numbers
|
|
132
132
|
|
|
@@ -151,6 +151,10 @@ const text = lineupText(largest, "en");
|
|
|
151
151
|
console.log(`${text.name}: ${text.radius}, ${text.km}, ${text.source}`);
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
## A name on the body
|
|
155
|
+
|
|
156
|
+
`body-label="painted"` writes the body's name on its own globe, large and in capitals, lying on the surface and turning with it, as a film lays a title over the thing it names: on `<wakusei-body>` and on every body of `<wakusei-space>`, in the page's language, in Michroma by default or a font of yours. Four looks (`painted`, `etched`, `outline`, `burned`), once or on both sides, at the equator or near a pole, turning with the body or always facing you; nothing on a body too small on the screen. [A name on the body](docs/guides/name-on-the-body.md) has the attributes.
|
|
157
|
+
|
|
154
158
|
## Two packages: this one and chikyu-earth
|
|
155
159
|
|
|
156
160
|
This package is the Sun, the planets, the dwarf planets and the moons, and where they are. [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth) is the Earth in detail: its countries, day and night, places and satellites. Each works alone; install both and the Earth's line look becomes chikyu-earth's globe with the countries. The dependency runs one way: this package may use chikyu-earth, never the reverse. [Why two packages](docs/guides/two-packages.md) has the rule, a table of what lives where and how to use them together.
|
|
@@ -372,7 +376,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
|
|
|
372
376
|
|
|
373
377
|
## The portrait builder
|
|
374
378
|
|
|
375
|
-
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
379
|
+
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.34.0/docs/images/portrait-family.png" width="640"></p>
|
|
376
380
|
|
|
377
381
|
[The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
|
|
378
382
|
|
|
@@ -455,6 +459,7 @@ Each guide has a Japanese twin in [docs/guides/ja](docs/guides/ja/getting-starte
|
|
|
455
459
|
| [Put it in your page](docs/guides/put-it-in-your-page.md) | Set up a body and copy the code |
|
|
456
460
|
| [The portrait builder](docs/guides/portrait-builder.md) | Many bodies in one picture |
|
|
457
461
|
| [Looks and bodies](docs/guides/looks-and-bodies.md) | The looks and each body's entry point |
|
|
462
|
+
| [A name on the body](docs/guides/name-on-the-body.md) | The body's name written on its globe: looks, how many, where, facing you, the font |
|
|
458
463
|
| [Why two packages](docs/guides/two-packages.md) | This package and chikyu-earth: which to install, alone or together |
|
|
459
464
|
| [Moons and time](docs/guides/moons-and-time.md) | The sky on a date, time that runs fast |
|
|
460
465
|
| [The space view](docs/guides/space-view.md) | The Earth, Moon, Sun and planets in their places; two scales; time both ways |
|
|
@@ -493,6 +498,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
493
498
|
- **The planets** (Mercury to Neptune, VSOP87B cut to 995 of its 35,080 terms) are within 5 arc-seconds of Horizons on 60 dates from 1800 to 2200, Mars the worst at 4.8, and the tests hold each to 6 or less; the series is good for the years 1750 to 2250 and slowly worse beyond. Pluto's table is within 0.2.
|
|
494
499
|
- **The Moon** (ELP2000-82B cut to its 540 largest terms) is within 4.7 arc-seconds on the same 60 dates, held to 5.8.
|
|
495
500
|
- **The moons** are less exact: Jupiter's four big moons are within 0.15 degree and Saturn's seven inner ones within 2.1, Uranus's Miranda within 3 and Neptune's Nereid within 6.3; one degree on a moon's orbit is about the width of the moon on a screen. [Accuracy](docs/guides/accuracy.md) has each moon's number.
|
|
501
|
+
- **The minor bodies** (Vesta, Pallas, Chiron, Pholus, Halley) are within an arc-second of Horizons in the years their tables cover (Vesta and Pallas 1900 to 2100, the others 1800 to 2200; 0.5 at the worst on the dates checked); outside them they are plain ellipses from Horizons' elements of one epoch, a few degrees off a century away (and Halley's 31 degrees off in 2026 without its table: the space view loads it).
|
|
496
502
|
- **The dwarf planets** are within 0.2 arc-seconds of Horizons in the years their tables cover (1800 to 2200, Ceres 1900 to 2100); outside them the positions are plain ellipses, good for a few years either side of June 2026. Their moons other than Pluto's are not checked against Horizons, and a dwarf planet's pole is estimated where it is not measured (NOTICE.md says which).
|
|
497
503
|
- **The spacecraft** follow Horizons' own record, within 1,000 km near a planet and elsewhere a millionth of the distance from the Sun; a path after today is Horizons' prediction, not a fact.
|
|
498
504
|
- **Star sizes** in the line-up are each from a refereed paper, with the paper's error; WOH G64's and Stephenson 2-18's are estimated (from the spectrum and the brightness, and from a dust-shell fit) and not measured, and UY Scuti's distance is not a parallax. A star's surface (cells, spots, glow) is drawn for looks and says so.
|
|
@@ -507,7 +513,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
507
513
|
|
|
508
514
|
If this package helps a paper, a talk or a class, please cite it as software. GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA; in plain text:
|
|
509
515
|
|
|
510
|
-
> Morris, J. (2026). *Wakusei Planets* (version 0.
|
|
516
|
+
> Morris, J. (2026). *Wakusei Planets* (version 0.34.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
|
|
511
517
|
|
|
512
518
|
Cite the version you used (`npm ls @johnmorrisdotca/wakusei-planets`), and cite the sources of the numbers you use as well: [NOTICE.md](NOTICE.md) names each one, with the paper or the page it was read from (the IAU working group's report for sizes and poles, VSOP87B, ELP2000-82B, L1.2 and TASS1.7 for positions, and NASA's JPL Horizons for the fits and the spacecraft).
|
|
513
519
|
|
package/dist/bodies/all.d.ts
CHANGED
package/dist/bodies/all.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { rock } from "../scene/recipes.js";
|
|
3
|
+
// The minor bodies, drawn from their numbers: a rock of the body's colour with craters. Vesta has Dawn's own map as its painted look; the others have never been seen as more than a few pixels
|
|
4
|
+
// (Halley's nucleus was photographed by the Giotto probe in 1986, a picture whose terms keep it out of this package), so their craters and patches are made up.
|
|
5
|
+
registerLook({
|
|
6
|
+
id: "vesta",
|
|
7
|
+
surface: rock({ dark: "#7d776d", light: "#bdb6aa", craters: 1.5, contrast: 0.9, seed: 81, patches: 3 }),
|
|
8
|
+
relief: 0.8,
|
|
9
|
+
ambient: 0.02,
|
|
10
|
+
painted: { map: "vesta", widths: [512, 1024, 2048], far: 2048 },
|
|
11
|
+
mapped: true,
|
|
12
|
+
});
|
|
13
|
+
registerLook({ id: "pallas", surface: rock({ dark: "#5e6064", light: "#92949a", craters: 1.2, contrast: 0.8, seed: 83, patches: 2.6 }), relief: 0.7, ambient: 0.02 });
|
|
14
|
+
registerLook({ id: "chiron", surface: rock({ dark: "#6f7073", light: "#a5a6a9", craters: 0.9, contrast: 0.7, seed: 85, patches: 2.4 }), relief: 0.6, ambient: 0.02 });
|
|
15
|
+
registerLook({ id: "pholus", surface: rock({ dark: "#6b3524", light: "#a85c42", craters: 0.9, contrast: 0.7, seed: 87, patches: 2.6 }), relief: 0.6, ambient: 0.02 });
|
|
16
|
+
registerLook({ id: "halley", surface: rock({ dark: "#25221f", light: "#4a4541", craters: 0.8, contrast: 0.9, seed: 89, patches: 3.2 }), relief: 0.9, ambient: 0.02 });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const MINOR_ELEMENTS = {
|
|
2
|
+
vesta: { epoch: 1577836800000, a: 2.361908654291772, e: 0.08857261385730482, i: 7.14181494423702, node: 103.8092892453337, w: 150.8357762126256, m: 163.3754032354997, n: 0.271524753 },
|
|
3
|
+
pallas: { epoch: 1493251200000, a: 2.773023116113918, e: 0.2306545322740501, i: 34.83970334384021, node: 173.0883296888898, w: 309.9974922427895, m: 263.9040941962388, n: 0.21343903 },
|
|
4
|
+
chiron: { epoch: 1497225600000, a: 13.64597936638133, e: 0.3824171374703196, i: 6.94959060447848, node: 209.2011323125998, w: 339.6529896907077, m: 151.975605480683, n: 0.019552262 },
|
|
5
|
+
pholus: { epoch: 1277164800000, a: 20.30484241567553, e: 0.5718479422462566, i: 24.66709981611229, node: 119.4098618882261, w: 354.7063272595453, m: 73.88199769909997, n: 0.010772206 },
|
|
6
|
+
halley: { epoch: -61516800000, a: 17.92863504856929, e: 0.9679359956953212, i: 162.1905300439129, node: 59.09894720612437, w: 112.2414314637764, m: 274.3823371364693, n: 0.012983244 },
|
|
7
|
+
};
|
package/dist/data/tables.d.ts
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
export interface FittedTable {
|
|
3
3
|
/** Milliseconds since 1970, in terrestrial time, at the start of the first segment. */
|
|
4
4
|
start: number;
|
|
5
|
-
/** The length of a segment in milliseconds. */
|
|
5
|
+
/** The length of a segment in milliseconds (the mean length, for a table with `edges`). */
|
|
6
6
|
segment: number;
|
|
7
|
+
/** Where each segment starts, in milliseconds from `start`, and where the last ends: one more than there are segments. Left out, every segment is `segment` long; a body that moves fast in one part of its orbit and slowly in another (a comet) has segments of unequal length. */
|
|
8
|
+
edges?: readonly number[];
|
|
7
9
|
/** The error on samples held back from the fit, in arc-seconds. */
|
|
8
10
|
worst: number;
|
|
9
11
|
/** By segment, then x, y, z, then the Chebyshev coefficients, in au. */
|
|
10
12
|
segments: readonly (readonly (readonly number[])[])[];
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
|
-
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres` and `/tables/
|
|
15
|
+
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres`, `/tables/dwarfs` and `/tables/minor` call this as they load.
|
|
14
16
|
*
|
|
15
17
|
* @param id - The body's name.
|
|
16
18
|
* @param table - Its Chebyshev segments, as `scripts/make-dwarf-data.py` writes them.
|
package/dist/data/tables.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const KEY = Symbol.for("johnmorrisdotca.wakusei-planets.tables");
|
|
4
4
|
const tables = (globalThis[KEY] ??= new Map());
|
|
5
5
|
/**
|
|
6
|
-
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres` and `/tables/
|
|
6
|
+
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres`, `/tables/dwarfs` and `/tables/minor` call this as they load.
|
|
7
7
|
*
|
|
8
8
|
* @param id - The body's name.
|
|
9
9
|
* @param table - Its Chebyshev segments, as `scripts/make-dwarf-data.py` writes them.
|
package/dist/element.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import type { Credit, DataSource } from "./data-door.ts";
|
|
|
7
7
|
import { type DoorHost } from "./door/host.ts";
|
|
8
8
|
export { TEXTURE_BASE, TEXTURE_FAR_BASE, TILES_BASE } from "./scene/textures.ts";
|
|
9
9
|
import type { DetailStats } from "./scene/detail.ts";
|
|
10
|
-
import { type ThreeParts } from "./scene/body.ts";
|
|
10
|
+
import { type BodyScene, type ThreeParts } from "./scene/body.ts";
|
|
11
|
+
import { type NameLabelOptions } from "./scene/name-label.ts";
|
|
11
12
|
import { setThreeLoader } from "./scene/shared.ts";
|
|
12
13
|
export { setThreeLoader };
|
|
13
14
|
/**
|
|
@@ -33,6 +34,7 @@ export type WakuseiState = "line" | "loading" | "still" | "live" | "lost" | "una
|
|
|
33
34
|
* `controls="none"` turns them off, and `live="off"` (a still, a thumbnail) starts without them (`controls` with no value brings them back). `zoom-min` and `zoom-max` set the range (0.1 to 50 for the line drawing; for the shaded looks 0.1 up to where the body's detail runs out, 8 at least and 1000 at most: see the close zoom guide); a `<kazoku-view-controls for="...">` takes over and reads it.
|
|
34
35
|
* Close up, `tiles` is where the finer map tiles are (a folder address; `off` for none; by default the demo site's, unless `texture-base` names your own pictures): a window of them is laid over the painted map for the part in view and let go when it is not, and the zoom range of a body with tiles grows with them.
|
|
35
36
|
* Whatever moves the view, `setView` sends a `wakusei-view` event with its `yaw`, `tilt`, `roll`, `zoom`, `panX` and `panY`.
|
|
37
|
+
* `body-label` writes the body's name on its globe in the shaded looks (`painted`, `etched`, `outline` or `burned`; absent for none), with `body-label-strength`, `-repeat`, `-latitude`, `-facing`, `-font` and `-fallback-font` beside it, and the `bodyLabel` property takes the same as an object: see the guide "A name on the body".
|
|
36
38
|
* A dated picture (a `time`, or `moons`) has a clock: `rate` is the simulated seconds for each real second, and `rate="0"` holds it, drawing nothing. While it runs (`rate` not 0), `wakusei-timechange` carries
|
|
37
39
|
* `detail: { time, running: true }` (`time` is the moment shown in milliseconds since 1970; four times a second, once a second at real time; only while the tab is shown, whether or not the picture is on screen), and once with
|
|
38
40
|
* `running: false` when the clock is held: a page writes the date into its date box from it. The `time` property reads the moment shown, and `undefined` for a portrait with no date.
|
|
@@ -83,6 +85,12 @@ export declare class WakuseiBody extends HTMLElement {
|
|
|
83
85
|
set star(numbers: StarNumbers | string | null | undefined);
|
|
84
86
|
get star(): StarNumbers | undefined;
|
|
85
87
|
get look(): Look;
|
|
88
|
+
/**
|
|
89
|
+
* The name written on the body's globe in the shaded looks, as an object (`{ look: "painted", strength: 0.5, repeat: "once", latitude: 0, facing: false, font: "Michroma", fallbackFont: "" }`), or `null` for none.
|
|
90
|
+
* Set, it takes the place of the `body-label` attributes; set to `undefined` the attributes are read again. The text is the body's own name in the element's `lang`, in capitals in English.
|
|
91
|
+
*/
|
|
92
|
+
get bodyLabel(): NameLabelOptions | null;
|
|
93
|
+
set bodyLabel(value: NameLabelOptions | null | undefined);
|
|
86
94
|
/** What the element is doing now. */
|
|
87
95
|
get state(): WakuseiState;
|
|
88
96
|
/** Numbers for a test or a status line: the state, the texture width in use and the renderer's own counts. */
|
|
@@ -93,6 +101,7 @@ export declare class WakuseiBody extends HTMLElement {
|
|
|
93
101
|
renderer: SharedRenderer<ThreeParts>["stats"] | undefined;
|
|
94
102
|
tiles: DetailStats | undefined;
|
|
95
103
|
zoomMax: number | undefined;
|
|
104
|
+
label: BodyScene["label"] | null;
|
|
96
105
|
};
|
|
97
106
|
connectedCallback(): void;
|
|
98
107
|
disconnectedCallback(): void;
|
package/dist/element.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { carryControls } from "@johnmorrisdotca/kazoku-ui/view-controls";
|
|
2
2
|
import "./tables/ceres.js";
|
|
3
3
|
import "./tables/dwarfs.js";
|
|
4
|
-
import { loadMoonTheory } from "./tables/lazy.js";
|
|
4
|
+
import { loadMinorTables, loadMoonTheory } from "./tables/lazy.js";
|
|
5
5
|
import { orbitPath } from "./ephemeris.js";
|
|
6
|
-
import { BODIES } from "./facts.js";
|
|
6
|
+
import { BODIES, MINOR_IDS } from "./facts.js";
|
|
7
7
|
import { extentOf, ROOM } from "./scene/extent.js";
|
|
8
8
|
import { createGate, frameCap } from "./gate.js";
|
|
9
9
|
import { lineSvg } from "./line.js";
|
|
@@ -17,6 +17,7 @@ import { ownCredit } from "./door/own.js";
|
|
|
17
17
|
export { TEXTURE_BASE, TEXTURE_FAR_BASE, TILES_BASE } from "./scene/textures.js";
|
|
18
18
|
import { mapWidthOf, ringWidthOf, zoomLimit } from "./scene/reach.js";
|
|
19
19
|
import { createBodyItem } from "./scene/body.js";
|
|
20
|
+
import { NAME_LABEL_ATTRIBUTES, nameLabelKey, nameLabelText, readNameLabel } from "./scene/name-label.js";
|
|
20
21
|
import { delegates, onRegister } from "./scene/store.js";
|
|
21
22
|
import { setThreeLoader, takeRenderer } from "./scene/shared.js";
|
|
22
23
|
import { turn as turnVec } from "./vec.js";
|
|
@@ -78,6 +79,7 @@ const TEMPLATE = `<style>
|
|
|
78
79
|
* `controls="none"` turns them off, and `live="off"` (a still, a thumbnail) starts without them (`controls` with no value brings them back). `zoom-min` and `zoom-max` set the range (0.1 to 50 for the line drawing; for the shaded looks 0.1 up to where the body's detail runs out, 8 at least and 1000 at most: see the close zoom guide); a `<kazoku-view-controls for="...">` takes over and reads it.
|
|
79
80
|
* Close up, `tiles` is where the finer map tiles are (a folder address; `off` for none; by default the demo site's, unless `texture-base` names your own pictures): a window of them is laid over the painted map for the part in view and let go when it is not, and the zoom range of a body with tiles grows with them.
|
|
80
81
|
* Whatever moves the view, `setView` sends a `wakusei-view` event with its `yaw`, `tilt`, `roll`, `zoom`, `panX` and `panY`.
|
|
82
|
+
* `body-label` writes the body's name on its globe in the shaded looks (`painted`, `etched`, `outline` or `burned`; absent for none), with `body-label-strength`, `-repeat`, `-latitude`, `-facing`, `-font` and `-fallback-font` beside it, and the `bodyLabel` property takes the same as an object: see the guide "A name on the body".
|
|
81
83
|
* A dated picture (a `time`, or `moons`) has a clock: `rate` is the simulated seconds for each real second, and `rate="0"` holds it, drawing nothing. While it runs (`rate` not 0), `wakusei-timechange` carries
|
|
82
84
|
* `detail: { time, running: true }` (`time` is the moment shown in milliseconds since 1970; four times a second, once a second at real time; only while the tab is shown, whether or not the picture is on screen), and once with
|
|
83
85
|
* `running: false` when the clock is held: a page writes the date into its date box from it. The `time` property reads the moment shown, and `undefined` for a portrait with no date.
|
|
@@ -94,7 +96,7 @@ const TEMPLATE = `<style>
|
|
|
94
96
|
* ```
|
|
95
97
|
*/
|
|
96
98
|
export class WakuseiBody extends HTMLElement {
|
|
97
|
-
static observedAttributes = ["body", "star", "quality", ...STAR_ATTRS, "look", "size", "time", "tilt", "pitch", "phase", "meridian", "turn", "rate", "moons", "range", "scale-to", "span-km", "fit", "live", "texture-base", "texture-far-base", "tiles", "data", "lang", "labels"];
|
|
99
|
+
static observedAttributes = ["body", "star", "quality", ...STAR_ATTRS, "look", "size", "time", "tilt", "pitch", "phase", "meridian", "turn", "rate", "moons", "range", "scale-to", "span-km", "fit", "live", "texture-base", "texture-far-base", "tiles", "data", "lang", "labels", ...NAME_LABEL_ATTRIBUTES];
|
|
98
100
|
#stage;
|
|
99
101
|
#state = "line";
|
|
100
102
|
#renderer;
|
|
@@ -135,6 +137,7 @@ export class WakuseiBody extends HTMLElement {
|
|
|
135
137
|
#limitKey = "";
|
|
136
138
|
#tileLevels;
|
|
137
139
|
#tiles;
|
|
140
|
+
#bodyLabel;
|
|
138
141
|
#door = createDoorHost(this, {
|
|
139
142
|
own: () => {
|
|
140
143
|
// the body's own pictures and, where a window of the package's own tiles is on it, those
|
|
@@ -241,13 +244,25 @@ export class WakuseiBody extends HTMLElement {
|
|
|
241
244
|
get look() {
|
|
242
245
|
return readLook(this.getAttribute("look"));
|
|
243
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* The name written on the body's globe in the shaded looks, as an object (`{ look: "painted", strength: 0.5, repeat: "once", latitude: 0, facing: false, font: "Michroma", fallbackFont: "" }`), or `null` for none.
|
|
249
|
+
* Set, it takes the place of the `body-label` attributes; set to `undefined` the attributes are read again. The text is the body's own name in the element's `lang`, in capitals in English.
|
|
250
|
+
*/
|
|
251
|
+
get bodyLabel() {
|
|
252
|
+
return this.#bodyLabel !== undefined ? this.#bodyLabel : readNameLabel(this);
|
|
253
|
+
}
|
|
254
|
+
set bodyLabel(value) {
|
|
255
|
+
this.#bodyLabel = value;
|
|
256
|
+
this.#lastAnchors = -1;
|
|
257
|
+
this.#queue();
|
|
258
|
+
}
|
|
244
259
|
/** What the element is doing now. */
|
|
245
260
|
get state() {
|
|
246
261
|
return this.#state;
|
|
247
262
|
}
|
|
248
263
|
/** Numbers for a test or a status line: the state, the texture width in use and the renderer's own counts. */
|
|
249
264
|
get stats() {
|
|
250
|
-
return { state: this.#state, textureWidth: this.#textureWidth, anchors: this.#live.anchors, renderer: this.#renderer?.stats, tiles: this.#view?.scene?.detail ?? this.#tiles, zoomMax: this.#hands?.controller.limits.zoomMax };
|
|
265
|
+
return { state: this.#state, textureWidth: this.#textureWidth, anchors: this.#live.anchors, renderer: this.#renderer?.stats, tiles: this.#view?.scene?.detail ?? this.#tiles, zoomMax: this.#hands?.controller.limits.zoomMax, label: this.#view?.scene?.label ?? null };
|
|
251
266
|
}
|
|
252
267
|
connectedCallback() {
|
|
253
268
|
const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
@@ -509,7 +524,13 @@ export class WakuseiBody extends HTMLElement {
|
|
|
509
524
|
const r = this.#request();
|
|
510
525
|
const extent = this.#extent(r.moons);
|
|
511
526
|
const moons = r.moons ? this.#moonsOf(frame, extent, tiltBy, roll) : undefined;
|
|
512
|
-
|
|
527
|
+
const label = this.#labelNow();
|
|
528
|
+
return { pose, extent, sky: frame.time !== undefined, zoom: this.#zoom, panX: clampPan(this.#panX, extent, this.#zoom), panY: clampPan(this.#panY, extent, this.#zoom), moons, label };
|
|
529
|
+
}
|
|
530
|
+
/** The name on the globe the attributes or the property ask for, with its text in the element's language. */
|
|
531
|
+
#labelNow() {
|
|
532
|
+
const options = this.bodyLabel;
|
|
533
|
+
return options === null ? null : { ...options, text: nameLabelText(this.#facts().name, this.getAttribute("lang") === "ja" ? "ja" : "en") };
|
|
513
534
|
}
|
|
514
535
|
/** Body radii from the middle of the picture to its edge at zoom 1, for the attributes now. */
|
|
515
536
|
#extent(moons) {
|
|
@@ -606,6 +627,15 @@ export class WakuseiBody extends HTMLElement {
|
|
|
606
627
|
const request = this.#request();
|
|
607
628
|
if (request.moons)
|
|
608
629
|
this.#wantTheory(request.id);
|
|
630
|
+
// a minor body with a date is placed from its fitted table, fetched the first time one is asked for
|
|
631
|
+
if (request.start !== undefined && MINOR_IDS.includes(request.id)) {
|
|
632
|
+
void loadMinorTables().then((loaded) => {
|
|
633
|
+
if (!loaded)
|
|
634
|
+
return;
|
|
635
|
+
this.#live = createLive();
|
|
636
|
+
this.#queue(true);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
609
639
|
const frame = this.#live.at(request, performance.now());
|
|
610
640
|
if (frame.anchors !== this.#lastAnchors) {
|
|
611
641
|
this.#lastAnchors = frame.anchors;
|
|
@@ -724,7 +754,7 @@ export class WakuseiBody extends HTMLElement {
|
|
|
724
754
|
}
|
|
725
755
|
#key(state) {
|
|
726
756
|
const moons = (state.moons ?? []).map((m) => `${m.id}:${m.x.toFixed(1)},${m.y.toFixed(1)}`).join(";");
|
|
727
|
-
return `${this.#star()?.key ?? this.body}|${this.look}|${vectorKey(state.pose.pole)}|${vectorKey(state.pose.meridian)}|${vectorKey(state.pose.light)}|${state.extent.toFixed(2)}|${state.zoom.toFixed(2)}|${state.panX.toFixed(2)},${state.panY.toFixed(2)}|${moons}`;
|
|
757
|
+
return `${this.#star()?.key ?? this.body}|${this.look}|${vectorKey(state.pose.pole)}|${vectorKey(state.pose.meridian)}|${vectorKey(state.pose.light)}|${state.extent.toFixed(2)}|${state.zoom.toFixed(2)}|${state.panX.toFixed(2)},${state.panY.toFixed(2)}|${moons}|${state.label ? nameLabelKey(state.label.text, state.label) : ""}`;
|
|
728
758
|
}
|
|
729
759
|
// Replacing a view keeps the renderer lease; leaving 3D gives it back.
|
|
730
760
|
#disposeView(releaseRenderer = false) {
|
package/dist/embed.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export interface EmbedSettings {
|
|
|
68
68
|
/** The package's address on the CDN, with its version. */
|
|
69
69
|
cdn?: string;
|
|
70
70
|
}
|
|
71
|
-
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
71
|
+
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `minor` for Vesta, Pallas, Chiron, Pholus and Halley, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
72
72
|
export declare function entryOf(id: BodyId): string;
|
|
73
73
|
/**
|
|
74
74
|
* The text that puts a body in a page, for one way of making the page. Each way is built, parsed or run by the package's tests: the plain HTML one with a script tag from jsDelivr, an ES module, a React component,
|
package/dist/embed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The text to put a body in a page, for each way a page is made: a script tag from a CDN, an ES module, React, Vue, Angular, Svelte, or an iframe of `embed.html`. The demo's "Put it in your page"
|
|
2
2
|
// section shows these as the reader changes a choice, and the tests build or parse every one. Pure: no DOM.
|
|
3
3
|
import { embedSnippet } from "@johnmorrisdotca/kazoku-ui/embed-panel";
|
|
4
|
-
import { BODIES, DWARF_IDS } from "./facts.js";
|
|
4
|
+
import { BODIES, DWARF_IDS, MINOR_IDS } from "./facts.js";
|
|
5
5
|
import { decodeScene } from "./portrait/model.js";
|
|
6
6
|
import { VERSION } from "./version.js";
|
|
7
7
|
/**
|
|
@@ -18,11 +18,11 @@ export const EMBED_KINDS = ["html", "module", "react", "vue", "angular", "svelte
|
|
|
18
18
|
const SITE = "https://johnmorrisdotca.github.io/wakusei-planets/";
|
|
19
19
|
const CDN = `https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@${VERSION}`;
|
|
20
20
|
const PACKAGE = "@johnmorrisdotca/wakusei-planets";
|
|
21
|
-
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
21
|
+
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `minor` for Vesta, Pallas, Chiron, Pholus and Halley, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
22
22
|
export function entryOf(id) {
|
|
23
23
|
const parent = BODIES[id].parent;
|
|
24
24
|
if (parent === undefined)
|
|
25
|
-
return DWARF_IDS.includes(id) ? "dwarfs" : id;
|
|
25
|
+
return DWARF_IDS.includes(id) ? "dwarfs" : MINOR_IDS.includes(id) ? "minor" : id;
|
|
26
26
|
return DWARF_IDS.includes(parent) ? "moons-dwarf" : `moons-${parent}`;
|
|
27
27
|
}
|
|
28
28
|
/** A star's numbers as the attributes that carry them, in the order they are written: the same names are the iframe's address keys. */
|
package/dist/ephemeris.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { moonGeocentric } from "./theory.ts";
|
|
2
2
|
export { moonGeocentric };
|
|
3
|
-
import { type BodyId, type HostId, type MoonId } from "./facts.ts";
|
|
3
|
+
import { type BodyId, type HostId, type MinorId, type MoonId } from "./facts.ts";
|
|
4
4
|
import { type Vec3 } from "./vec.ts";
|
|
5
5
|
/** Solve Kepler's equation for the eccentric anomaly, all in radians. */
|
|
6
6
|
export declare function kepler(meanAnomaly: number, e: number): number;
|
|
7
7
|
/**
|
|
8
8
|
* A planet's or dwarf planet's position in the Sun's frame (J2000 ecliptic, astronomical units) at a time: Mercury to Neptune from the VSOP87B series, and Pluto and the other dwarf planets from tables fitted to Horizons (each within a few arc-seconds or better, see the accuracy guide; outside a table's years a dwarf planet falls back to the osculating elements of one epoch from JPL's Small-Body Database).
|
|
9
|
-
* @param planet - The planet's
|
|
9
|
+
* @param planet - The planet's, dwarf planet's or minor body's name.
|
|
10
10
|
* @param ms - The instant, in milliseconds since 1970 (UTC).
|
|
11
11
|
* @returns The position as x, y, z in au.
|
|
12
12
|
*
|
|
@@ -18,7 +18,7 @@ export declare function kepler(meanAnomaly: number, e: number): number;
|
|
|
18
18
|
* console.log(Math.hypot(x, y, z).toFixed(3));
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare function heliocentric(planet: HostId, ms: number): Vec3;
|
|
21
|
+
export declare function heliocentric(planet: HostId | MinorId, ms: number): Vec3;
|
|
22
22
|
/**
|
|
23
23
|
* The theory that `heliocentric(planet, ms)` answers with, given the tables loaded now: VSOP87B for Mercury to Neptune, a fitted Chebyshev table where one covers the moment, else
|
|
24
24
|
* osculating elements (a dwarf planet) or JPL's approximate elements (Pluto outside its table). `worstArcseconds` is the fitted table's measured worst on samples held back from
|
|
@@ -35,13 +35,13 @@ export declare function heliocentric(planet: HostId, ms: number): Vec3;
|
|
|
35
35
|
* console.log(heliocentricModel("pluto", Date.UTC(2026, 0, 1)));
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export declare function heliocentricModel(planet: HostId, ms: number): {
|
|
38
|
+
export declare function heliocentricModel(planet: HostId | MinorId, ms: number): {
|
|
39
39
|
theory: "vsop87b" | "chebyshev" | "osculating-elements" | "approximate-elements";
|
|
40
40
|
worstArcseconds: number | null;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
* Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's semi-major axis at the epoch of its elements.
|
|
44
|
-
* @param id - A planet or a
|
|
43
|
+
* Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's or minor body's semi-major axis at the epoch of its elements.
|
|
44
|
+
* @param id - A planet, a dwarf planet or a minor body.
|
|
45
45
|
* @returns The semi-major axis in au.
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
@@ -51,7 +51,7 @@ export declare function heliocentricModel(planet: HostId, ms: number): {
|
|
|
51
51
|
* console.log(meanSunAu("earth").toFixed(3));
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
export declare function meanSunAu(id: HostId): number;
|
|
54
|
+
export declare function meanSunAu(id: HostId | MinorId): number;
|
|
55
55
|
/** The north pole of a body as a J2000 ecliptic unit vector. */
|
|
56
56
|
export declare function poleOf(id: BodyId): Vec3;
|
|
57
57
|
/** The prime meridian's direction (J2000 ecliptic unit vector) when it has turned to `w` degrees. */
|