@johnmorrisdotca/wakusei-planets 0.15.0 → 0.17.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.0 - 2026-11-06
4
+
5
+ Photo maps on the realistic look, and every body turns.
6
+
7
+ - The documentation site's browser test is the family's current copy, so the skip-link check reaches the link with Tab on Mac WebKit (MODULES-411).
8
+ - Painted maps of Venus, Saturn, Neptune and the Sun are Solar System Scope's equirectangular maps, CC BY 4.0 (MODULES-509). Mercury is the natural grey 8K map (Shady Tex and Solar System Scope, CC BY 4.0), resized to 512, 1024 and 2048; the enhanced-colour map and its smeared poles are gone, and the normal map is not used. Mars stays on the Viking mosaic, graded toward a butterscotch ochre (MODULES-509): the craters and the ice caps are the mosaic's, and the seasonal frost in Hellas is toned to the basin and feathered so the patch has no hard edge. Both polar caps stay white. Solar System Scope's map and Shady Tex's 4K were compared; the 4K is the warmer colour and the mosaic is the detail, so the mosaic was graded rather than replaced. The painter's relief comes from the colour, so a separate normal map is not used. Jupiter and Uranus use Nestaeric's band maps, CC BY 4.0, which have east-west detail. Saturn's poles, including the north hexagon, are reprojected from Nestaeric's caps, also CC BY 4.0. The Earth stays on Blue Marble and the Moon on the LRO map until each has been compared. Sizes in the repository are 512, 1024 and 2048. The 8K originals stay out of the repository.
9
+ - `realistic` draws the photo maps, and `painted` is the same maps, kept as an attribute for an older page (MODULES-509). The demo shows one button for it, Realistic. `illustrated` is the shaded drawing that `realistic` used to be, and it is not a default. Its Japanese name on the picture is イラスト, which means "illustration".
10
+ - A portrait with no `turn` turns at 12 degrees a second, backwards for a body that turns backwards (Venus, Uranus). A picture with a date keeps that orientation and adds the same turn, and that turn keeps going instead of jumping back each second. `turn="0"` is the only stop. Reduced motion keeps a quarter of the turn (MODULES-509). `e2e/turn-all.demo.ts` photographs every body twice, two seconds apart, with no date and with a date, and the pictures differ.
11
+ - The Earth is drawn from the side opposite the Moon, so the Earth and the Moon show the same phase (MODULES-509).
12
+ - A portrait's true sizes keep the real ratio. A small body beside the Sun is no longer lifted to a minimum, which had made the Earth too big next to Jupiter.
13
+ - A surface picture that arrives after its body has gone is dropped, so switching bodies does not keep the old pictures. A thumbnail with `live="off"` stays still unless it is given a turn.
14
+ - Neptune's colour stays Solar System Scope after a comparison with Nestaeric's band map (MODULES-509): both have the dark spot, and Solar System Scope has more of the bands. The black hole is not part of this.
15
+ - Jupiter and Neptune have rings, drawn by the same code as Saturn and Uranus (MODULES-509). Jupiter's are the halo, the main ring from 122,800 to 129,200 km and the gossamer rings out to 226,000 km. Neptune's are Galle, Le Verrier, the Lassell sheet and Adams. Adams's arcs are that radius; a strip has no longitude.
16
+ - Saturn's rings are drawn as two halves. The half toward the camera is painted over the disc, and the far half is hidden behind it, so the near arc crosses in front and the far arc goes behind. The shadow on the rings stays.
17
+
18
+ ## 0.16.0 - 2026-11-05
19
+
20
+ Every body as a journey stop (MODULES-401), for journey planners such as uchusen-rockets' journey mode.
21
+
22
+ - **`JOURNEY_STOPS`**: every body as one row, with its radius, its mean distance from the Sun, its gravitational parameter, its mass and its escape speed, and `stopPlaceAu` for where it is on a date. A body whose pages print no mass has those fields empty.
23
+
3
24
  ## 0.15.0 - 2026-11-04
4
25
 
5
26
  The family's embed panel on the code builder and the portrait builder (MODULES-380).
package/NOTICE.md CHANGED
@@ -10,6 +10,7 @@ No picture is used by the line and shaded looks: they are drawn from numbers.
10
10
  - **Planet positions**: JPL Solar System Dynamics, "Keplerian Elements for Approximate Positions of the Major Planets", Table 1, 1800 AD to 2050 AD (https://ssd.jpl.nasa.gov/planets/approx_pos.html, read 2026-11-02; Pluto from the same page's earlier edition). NASA/JPL content is not subject to copyright in the United States; credit: NASA/JPL-Caltech.
11
11
  - **Moons' orbits**: JPL Solar System Dynamics, "Planetary Satellite Mean Elements" (https://ssd.jpl.nasa.gov/sats/elem/, read 2026-11-02), made into `src/data/orbits.ts` by `scripts/make-moon-data.py`. Credit: NASA/JPL-Caltech; the elements are from R. A. Jacobson and colleagues' ephemerides cited on that page.
12
12
  - **The Moon's position**: the largest terms of the series in Jean Meeus, "Astronomical Algorithms" (2nd edition), chapter 47, written out here as numbers; the mean arguments are the standard ones.
13
+ - **Mass and escape speed** (`JOURNEY_STOPS`): JPL "Planetary Satellite Physical Parameters" (https://ssd.jpl.nasa.gov/sats/phys_par/, read 2026-11-04) for the GM of the Earth, Mars through Pluto and the moons on that page; NASA's Sun, Mercury and Venus fact sheets (https://nssdc.gsfc.nasa.gov/planetary/factsheet/, read 2026-11-04) for those three GM values and the Sun's escape speed; JPL "Planetary Physical Parameters" (https://ssd.jpl.nasa.gov/planets/phys_par.html, read 2026-11-04) for the planets' escape speeds and for the masses of Ceres, Eris, Makemake and Haumea, turned into GM with the CODATA 2018 G that page names. A moon's escape speed is computed from its GM and the radius already in this package. Nereid, Orcus, Quaoar, Gonggong, Sedna, Vanth, Hiʻiaka, Namaka and Dysnomia are left blank: those pages do not print a mass.
13
14
 
14
15
  ## The dwarf planets
15
16
 
@@ -32,24 +33,26 @@ The painted looks' pictures in `textures/` (the 512 and 1024 pixel widths are al
32
33
 
33
34
  NASA says its content "generally are not subject to copyright in the United States" and asks for acknowledgement (https://www.nasa.gov/nasa-brand-center/images-and-media/); USGS and JPL maps are works of the United States government. This package is not endorsed by NASA, the USGS or any mission, and uses none of their insignia or logotypes.
34
35
 
36
+ Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equirectangular maps (https://www.solarsystemscope.com/textures/), CC BY 4.0. Mercury is the natural grey 8K map, credited to Shady Tex (https://sketchfab.com/3d-models/mercury-realistic-8k-215f364627054d25ae03bcd72afda714) and to Solar System Scope, also CC BY 4.0. Jupiter and Uranus use Nestaeric's band maps, and Saturn's poles, including the north-polar hexagon, are reprojected from Nestaeric's Saturn (https://sketchfab.com/3d-models/saturn-c09a1970148c43ad99db134a9d6d00b5), also CC BY 4.0. The originals are kept outside this repository. The code of this package stays MIT.
37
+
35
38
  | Pictures | Body | Source file | Licence | Credit | What was done |
36
39
  |---|---|---|---|---|---|
37
- | `mercury-*.webp` | Mercury | [Mercury MESSENGER MDIS Basemap EnhancedColor Mosaic Global 32ppd.jpg](https://commons.wikimedia.org/wiki/File:Mercury_MESSENGER_MDIS_Basemap_EnhancedColor_Mosaic_Global_32ppd.jpg) | Public domain | Johns Hopkins Applied Physics Laboratory, Applied Coherent Technology Corporation | MESSENGER MDIS enhanced-colour global mosaic (USGS Astrogeology map), colour turned most of the way to grey and brightened; the polar rows with no data repeat the nearest real ones |
38
- | `venus-*.webp` | Venus | [Cylindrical Map of Venus.jpg](https://commons.wikimedia.org/wiki/File:Cylindrical_Map_of_Venus.jpg) | Public domain | NASA / Jet Propulsion Laboratory | Magellan radar global map in the orange tone of the Venera pictures (a colour for the radar's brightness, not a photograph of the surface under the clouds), turned so Maxwell Montes is at 3 degrees east |
39
- | `mars-*.webp` | Mars | [Mars Viking MDIM21 ClrMosaic 1km.jpg](https://commons.wikimedia.org/wiki/File:Mars_Viking_MDIM21_ClrMosaic_1km.jpg) | Public domain | NASA / Jet Propulsion Lab / USGS | Viking Orbiter MDIM 2.1 colour mosaic (USGS Astrogeology), as it is |
40
- | `jupiter-*.webp` | Jupiter | [Jupiter Cylindrical Map - Dec 2000 PIA07782.jpg](https://commons.wikimedia.org/wiki/File:Jupiter_Cylindrical_Map_-_Dec_2000_PIA07782.jpg) | Public domain | NASA/JPL/Space Science Institute | Cassini cylindrical map of December 2000 (PIA07782), as it is; the poles are the map's own |
41
- | `saturn-*.webp` | Saturn | [Saturn during Equinox.jpg](https://commons.wikimedia.org/wiki/File:Saturn_during_Equinox.jpg) | Public domain | NASA / JPL / Space Science Institute | made from Cassini's natural-colour portrait of 2009 (PIA11141): the visible hemisphere turned back onto the sphere, the limb darkening taken off, and each latitude's colour kept all the way round (a photograph has no longitudes to map), the ring shadow and the ring crossing the disc taken out |
42
- | `uranus-*.webp` | Uranus | [Uranus as seen by NASA's Voyager 2.tif](https://commons.wikimedia.org/wiki/File:Uranus_as_seen_by_NASA%27s_Voyager_2.tif) | Public domain | NASA | made from Voyager 2's portrait (PIA18182): one colour for the whole planet, a little brighter toward the south pole, because that photograph has no features to map |
43
- | `neptune-*.webp` | Neptune | [Neptune Full (original).jpg](https://commons.wikimedia.org/wiki/File:Neptune_Full_(original).jpg) | Public domain | NASA/JPL | made from Voyager 2's full-disk view (PIA01492): the bands of each latitude all the way round, and the Great Dark Spot with its bright companion clouds put back where the photograph shows them |
40
+ | `mercury-*.webp` | Mercury | [Mercury Realistic 8K](https://sketchfab.com/3d-models/mercury-realistic-8k-215f364627054d25ae03bcd72afda714) by Shady Tex, the same map as [8k_mercury](https://www.solarsystemscope.com/textures/) | CC BY 4.0 | Shady Tex and Solar System Scope | Natural grey, resized to 512, 1024 and 2048. The normal map is not used |
41
+ | `venus-*.webp` | Venus | [2k_venus_surface.jpg](https://www.solarsystemscope.com/textures/) | CC BY 4.0 | Solar System Scope | Equirectangular surface map, resized to 512, 1024 and 2048 |
42
+ | `mars-*.webp` | Mars | [Mars Viking MDIM21 ClrMosaic 1km.jpg](https://commons.wikimedia.org/wiki/File:Mars_Viking_MDIM21_ClrMosaic_1km.jpg) | Public domain | NASA / Jet Propulsion Lab / USGS | Viking Orbiter MDIM 2.1 colour mosaic, graded toward a butterscotch ochre. The frost in Hellas is toned to the basin. The polar ice stays |
43
+ | `jupiter-*.webp` | Jupiter | [Jupiter](https://sketchfab.com/3d-models/jupiter-6380860bdb4247b98b30643615c3afab) by Nestaeric | CC BY 4.0 | This work is based on "Jupiter" (https://sketchfab.com/3d-models/jupiter-6380860bdb4247b98b30643615c3afab) by Nestaeric (https://sketchfab.com/Nestaeric) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/) | The band half of the texture, with the Great Red Spot and turbulent detail, resized to 512, 1024 and 2048 |
44
+ | `saturn-*.webp` | Saturn | [2k_saturn.jpg](https://www.solarsystemscope.com/textures/) and [Nestaeric's Saturn](https://sketchfab.com/3d-models/saturn-c09a1970148c43ad99db134a9d6d00b5) | CC BY 4.0 | Solar System Scope; pole caps by Nestaeric | The bands are Solar System Scope's map. The last 20 degrees at each pole are reprojected from Nestaeric's caps, and the north cap has the hexagon. The band map itself has little east-west detail |
45
+ | `uranus-*.webp` | Uranus | [Uranus](https://sketchfab.com/3d-models/uranus-0009a69dbace44608c0bd09af9ba20db) by NestaEric | CC BY 4.0 | This work is based on "Uranus" (https://sketchfab.com/3d-models/uranus-0009a69dbace44608c0bd09af9ba20db) by NestaEric (https://sketchfab.com/Nestaeric) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/) | The band half of the texture, which has a bright spot, resized to 512, 1024 and 2048 |
46
+ | `neptune-*.webp` | Neptune | [2k_neptune.jpg](https://www.solarsystemscope.com/textures/) | CC BY 4.0 | Solar System Scope | Equirectangular map, resized to 512, 1024 and 2048 |
44
47
  | `pluto-*.webp` | Pluto | [Pluto color mapmosaic.jpg](https://commons.wikimedia.org/wiki/File:Pluto_color_mapmosaic.jpg) | Public domain | NASA / Johns Hopkins University Applied Physics Laboratory / Southwest Research Institute | New Horizons global colour map, turned so Sputnik Planitia is at 178 degrees east; the south, in the polar night New Horizons never saw, fades into a dark brown |
45
- | `sun-*.webp` | Sun | [SDO 20240810 000000 4096 HMIIC (HMI).jpg](https://commons.wikimedia.org/wiki/File:SDO_20240810_000000_4096_HMIIC_(HMI).jpg) | Public domain | Courtesy of NASA/SDO and the AIA, EVE, and HMI science teams. | SDO's HMI continuum picture of 10 August 2024: the visible hemisphere turned back onto the sphere, limb darkening taken off, and its sunspots and granulation kept on a flat orange, repeated on the far side |
46
- | `moon-*.webp` | The Moon | [CGI Moon Kit - Lroc color poles.tif](https://commons.wikimedia.org/wiki/File:CGI_Moon_Kit_-_Lroc_color_poles.tif) | Public domain | NASA's Scientific Visualization Studio (Ernie Wright, Noah Petro); Lunar Reconnaissance Orbiter Camera | LRO WAC colour map from the SVS Moon Kit (4720), as it is, longitude 0 in the middle |
48
+ | `sun-*.webp` | Sun | [2k_sun.jpg](https://www.solarsystemscope.com/textures/) | CC BY 4.0 | Solar System Scope | Equirectangular map, resized to 512, 1024 and 2048 |
49
+ | `moon-*.webp` | The Moon | [CGI Moon Kit - Lroc color poles.tif](https://commons.wikimedia.org/wiki/File:CGI_Moon_Kit_-_Lroc_color_poles.tif) | Public domain | NASA's Scientific Visualization Studio (Ernie Wright, Noah Petro); Lunar Reconnaissance Orbiter Camera | LRO WAC colour map from the SVS Moon Kit (4720), kept until it has been compared with Solar System Scope beside a photograph |
47
50
  | `io-*.webp` | Io | [Io from Galileo and Voyager missions.jpg](https://commons.wikimedia.org/wiki/File:Io_from_Galileo_and_Voyager_missions.jpg) | Public domain | NASA / JPL (Galileo SSI and Voyager images); the file page names no author | Galileo and Voyager colour map between 57 degrees north and south, turned so Pele is at 105 degrees east; the poles it does not reach fade from the map's edge into its mean colour |
48
51
  | `europa-*.webp` | Europa | [Europa Voyager GalileoSSI global mosaic.jpg](https://commons.wikimedia.org/wiki/File:Europa_Voyager_GalileoSSI_global_mosaic.jpg) | Public domain | U.S. Geological Survey / Planetary Data System / Tammy Becker | USGS Voyager and Galileo grey-scale mosaic, longitude 0 in the middle (the source does not say; the Pwyll crater and the dark trailing side fall at 90 degrees east, the bright leading side at 90 degrees west); the unmapped rim of the south fades to its mean grey. The source is 1024 pixels wide, so there is no 2048 picture |
49
52
  | `ganymede-*.webp` | Ganymede | [Ganymede equatorial.jpg](https://commons.wikimedia.org/wiki/File:Ganymede_equatorial.jpg) | Public domain | USGS | USGS Voyager and Galileo colour mosaic (I-2762), the Mercator sheet for 57 degrees north and south, redrawn as an equirectangular map with longitude 0 in the middle (the source does not say; Galileo Regio falls at 140 degrees west); the poles are not on that sheet and fade from its edge into its mean colour |
50
53
  | `callisto-*.webp` | Callisto | [Callisto equatorial.jpg](https://commons.wikimedia.org/wiki/File:Callisto_equatorial.jpg) | Public domain | USGS | USGS Voyager and Galileo mosaic (I-2770), the Mercator sheet for 57 degrees north and south, redrawn as an equirectangular map with longitude 0 in the middle (the source does not say; Valhalla falls at 56 degrees west); the poles fade from its edge into its mean grey |
51
54
  | `titan-*.webp` | Titan | [Titan map April 2011 full.png](https://commons.wikimedia.org/wiki/File:Titan_map_April_2011_full.png) | Public domain | NASA / JPL / Space Science Institute | Cassini ISS 938 nm map (PIA14908), turned so longitude 0 is in the middle (the original is centred on 180). Titan's surface cannot be seen in visible light under its haze, so the picture is a colour for the infrared brightness, with its contrast turned down: it is not a photograph, as with Venus |
52
- | `earth-*.webp` | Earth | [Blue Marble: Next Generation with topography and bathymetry, September 2004](https://visibleearth.nasa.gov/images/73801) (Visible Earth 73801) | Public domain (NASA) | NASA Earth Observatory (Reto Stockli) | Resized from the 2048 pixel picture chikyu-earth already makes from the 5400 x 2700 original; the realistic and the painted looks both draw it, because an honest shaded Earth cannot be worked out from numbers |
55
+ | `earth-*.webp` | Earth | [Blue Marble: Next Generation with topography and bathymetry, September 2004](https://visibleearth.nasa.gov/images/73801) (Visible Earth 73801) | Public domain (NASA) | NASA Earth Observatory (Reto Stockli) | Kept until it has been compared with Solar System Scope beside a photograph |
53
56
  | `rhea-*.webp` | Rhea | [Rhea Color Map.jpg](https://commons.wikimedia.org/wiki/File:Rhea_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18438), turned half way round so longitude 0 is in the middle (the source does not say where it is centred; the dark trailing side is put at 90 degrees east); the colours are false-colour (infrared, green, ultraviolet) and are turned about half way to grey |
54
57
  | `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 |
55
58
  | `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 |
package/README.md CHANGED
@@ -13,9 +13,9 @@ A clean line drawing, a shaded realistic drawing, or a painted surface map, with
13
13
 
14
14
  <p align="center"><a href="https://johnmorrisdotca.github.io/wakusei-planets/"><strong>Open the demo →</strong></a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/embed.html">Embed page</a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/docs/">Docs</a></p>
15
15
 
16
- <p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.15.0/docs/images/hero-desk.png" width="640"></p>
16
+ <p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.17.0/docs/images/hero-desk.png" width="640"></p>
17
17
 
18
- <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.15.0/docs/images/lineup-desk.png" width="640"></p>
18
+ <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.17.0/docs/images/lineup-desk.png" width="640"></p>
19
19
 
20
20
  ## One minute
21
21
 
@@ -154,7 +154,7 @@ Vue, Svelte and Angular components, the Vite and webpack setups and an `<iframe>
154
154
 
155
155
  ## Light by design
156
156
 
157
- A page full of bodies stays light: one WebGL context for the page through kazoku-ui's shared renderer (the body in focus is live, the others are pictures), nothing drawn while nothing changes, at most thirty frames a second while it moves, a canvas held to 4096 pixels a side and six million pixels, everything freed when an element leaves, no drawing out of sight or in a hidden tab, no movement for a reader who prefers reduced motion, and a lost WebGL context coming back by itself. The tests count draws, animation frames, contexts and GPU objects at rest and over many changes (`pnpm test:freeze`, and a soak with `pnpm test:soak`).
157
+ A page full of bodies stays light: one WebGL context for the page through kazoku-ui's shared renderer (the body in focus is live, the others are pictures), nothing drawn while nothing changes, at most thirty frames a second while it moves, a canvas held to 4096 pixels a side and six million pixels, everything freed when an element leaves, no drawing out of sight or in a hidden tab, a slower turn for a reader who prefers reduced motion (`turn="0"` is the only stop), and a lost WebGL context coming back by itself. The tests count draws, animation frames, contexts and GPU objects at rest and over many changes (`pnpm test:freeze`, and a soak with `pnpm test:soak`).
158
158
 
159
159
  ## The element
160
160
 
@@ -273,7 +273,7 @@ A body that turns by itself and a moving sky, in HTML:
273
273
 
274
274
  ## The portrait builder
275
275
 
276
- <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.15.0/docs/images/portrait-family.png" width="640"></p>
276
+ <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.17.0/docs/images/portrait-family.png" width="640"></p>
277
277
 
278
278
  [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.
279
279
 
@@ -335,15 +335,16 @@ BODIES.pluto.kind; // "dwarf-planet"
335
335
  ```
336
336
 
337
337
  - A fact with no source is left out, never guessed. Moon positions are JPL's mean elements and are accurate to a few degrees on the orbit, about the size of the moon on screen.
338
- - The shaded `realistic` look works out a surface from the body's real colours and features in a shader: it is a likeness, not a map. The `painted` look is a real map where one exists; the Sun, Saturn, Uranus and Neptune have no global map, so theirs are made from one photograph each, as `NOTICE.md` says.
338
+ - `realistic` and `painted` are the photo maps (`painted` is the same maps, so an older page still works). `illustrated` is the shaded drawing from the numbers, and it is not a default. Venus, Saturn, Neptune and the Sun use Solar System Scope's maps (CC BY 4.0). Mercury uses the natural grey 8K map (Shady Tex and Solar System Scope, CC BY 4.0). Mars stays on the Viking mosaic, graded toward a butterscotch ochre, with the frost in Hellas toned to the basin and the polar ice left. Jupiter and Uranus use Nestaeric's maps (CC BY 4.0), and Saturn's poles use Nestaeric's caps (CC BY 4.0). The Earth and the Moon stay on their NASA maps until those have been compared. The rest are the public-domain maps in `NOTICE.md`.
339
339
  - A shaded look needs WebGL. Without it the line drawing is drawn.
340
- - Saturn and Uranus have their rings drawn.
340
+ - Jupiter, Saturn, Uranus and Neptune have their rings drawn.
341
+ - A portrait with no `turn` turns at 12 degrees a second, backwards when the body turns backwards. A picture with a date keeps that orientation and adds the same turn. `turn="0"` stays still.
341
342
  - Pictures for the painted look are 1.31 MB in the package at 512 and 1024 pixels; a sharper picture is fetched when you zoom in.
342
343
 
343
344
  ## Accessibility
344
345
 
345
346
  - Every `<wakusei-body>` is an image with an accessible name from its body and look, such as "Saturn, line drawing", or the Japanese name with `lang="ja"`.
346
- - A reader who prefers reduced motion gets no turning and no moving sky.
347
+ - A reader who prefers reduced motion gets a quarter of the turn. `turn="0"` is the only stop.
347
348
  - A body can be turned, tipped, zoomed and panned with the keyboard, and the view controls are at least 48 pixels.
348
349
  - Names and labels are in English and Japanese (`lang="ja"`).
349
350
 
@@ -414,7 +415,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). The rules that matter most: draw from pu
414
415
 
415
416
  ## Licence
416
417
 
417
- MIT: see [LICENSE](LICENSE). The pictures are public-domain NASA, USGS and JPL imagery, each file credited in [NOTICE.md](NOTICE.md).
418
+ MIT: see [LICENSE](LICENSE). The code is MIT. Some pictures are CC BY 4.0 (Solar System Scope, and Nestaeric for Jupiter, Uranus and Saturn's poles) and the rest are public-domain NASA, USGS and JPL imagery. Each file is credited in [NOTICE.md](NOTICE.md).
418
419
 
419
420
  ## The name
420
421
 
package/dist/element.d.ts CHANGED
@@ -25,7 +25,7 @@ export type WakuseiState = "line" | "loading" | "still" | "live" | "lost" | "una
25
25
  * console.log(TEXTURE_BASE);
26
26
  * ```
27
27
  */
28
- export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.15.0/dist/textures/";
28
+ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.17.0/dist/textures/";
29
29
  /**
30
30
  * Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
31
31
  * never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
@@ -37,12 +37,12 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
37
37
  * console.log(TEXTURE_FAR_BASE);
38
38
  * ```
39
39
  */
40
- export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.15.0/textures/";
40
+ export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.17.0/textures/";
41
41
  /**
42
42
  * The `<wakusei-body>` custom element: a body of the solar system, drawn in a look.
43
43
  *
44
44
  * Attributes: `body` (a name, such as `jupiter`), `look` (`line`, `realistic` or `painted`), `size` (pixels across), `time` (`now` or an ISO date: the body as the Earth sees it then; leave it out for a portrait),
45
- * `tilt`, `pitch`, `phase` and `meridian` (a portrait's pose, degrees), `turn` (a portrait turns this many degrees a second), `rate` (simulated seconds for each real second), `moons` (draw the planet's moons on their orbits),
45
+ * `tilt`, `pitch`, `phase` and `meridian` (a portrait's pose, degrees), `turn` (a portrait turns this many degrees a second; left out, 12 a second, backwards when the body is, and a date keeps its orientation and adds this turn; `live="off"` stays still unless this is set; `0` stays still; reduced motion keeps a quarter of it), `rate` (simulated seconds for each real second), `moons` (draw the planet's moons on their orbits),
46
46
  * `range` (planet radii the moons picture reaches), `scale-to` (draw to scale with another body), `span-km` (draw to scale: the half-width of the picture in kilometres, the same in every picture of a lineup), `live` (`always`, `hover` or `off`: when it takes the page's one WebGL context), `texture-base` (where the surface pictures are) and `lang` (`en` or `ja`).
47
47
  *
48
48
  * @example
package/dist/element.js CHANGED
@@ -2,7 +2,7 @@ import { orbitPath, nearMoons } from "./ephemeris.js";
2
2
  import { BODIES, ringReach } from "./facts.js";
3
3
  import { createGate, frameCap } from "./gate.js";
4
4
  import { lineSvg } from "./line.js";
5
- import { createLive } from "./live.js";
5
+ import { createLive, defaultTurn, REDUCED_TURN } from "./live.js";
6
6
  import { VERSION } from "./version.js";
7
7
  import { createBodyItem } from "./scene/body.js";
8
8
  import { delegates, onRegister } from "./scene/store.js";
@@ -38,7 +38,7 @@ const num = (value, fallback) => {
38
38
  const n = Number(value);
39
39
  return Number.isFinite(n) ? n : fallback;
40
40
  };
41
- const readLook = (value) => (value === "realistic" || value === "painted" ? value : "line");
41
+ const readLook = (value) => (value === "realistic" || value === "painted" || value === "illustrated" ? value : "line");
42
42
  const readTime = (value) => {
43
43
  if (value === null || value === "")
44
44
  return undefined;
@@ -82,7 +82,7 @@ const TEMPLATE = `<style>
82
82
  * The `<wakusei-body>` custom element: a body of the solar system, drawn in a look.
83
83
  *
84
84
  * Attributes: `body` (a name, such as `jupiter`), `look` (`line`, `realistic` or `painted`), `size` (pixels across), `time` (`now` or an ISO date: the body as the Earth sees it then; leave it out for a portrait),
85
- * `tilt`, `pitch`, `phase` and `meridian` (a portrait's pose, degrees), `turn` (a portrait turns this many degrees a second), `rate` (simulated seconds for each real second), `moons` (draw the planet's moons on their orbits),
85
+ * `tilt`, `pitch`, `phase` and `meridian` (a portrait's pose, degrees), `turn` (a portrait turns this many degrees a second; left out, 12 a second, backwards when the body is, and a date keeps its orientation and adds this turn; `live="off"` stays still unless this is set; `0` stays still; reduced motion keeps a quarter of it), `rate` (simulated seconds for each real second), `moons` (draw the planet's moons on their orbits),
86
86
  * `range` (planet radii the moons picture reaches), `scale-to` (draw to scale with another body), `span-km` (draw to scale: the half-width of the picture in kilometres, the same in every picture of a lineup), `live` (`always`, `hover` or `off`: when it takes the page's one WebGL context), `texture-base` (where the surface pictures are) and `lang` (`en` or `ja`).
87
87
  *
88
88
  * @example
@@ -279,13 +279,14 @@ export class WakuseiBody extends HTMLElement {
279
279
  ...(this.hasAttribute("phase") ? { phase: num(this.getAttribute("phase"), 0) } : {}),
280
280
  ...(this.hasAttribute("meridian") ? { spin: num(this.getAttribute("meridian"), 0) } : {}),
281
281
  },
282
- turn: num(this.getAttribute("turn"), 0),
282
+ turn: (this.hasAttribute("turn") ? num(this.getAttribute("turn"), 0) : this.getAttribute("live") === "off" ? 0 : defaultTurn(this.body)) * (this.#reduce ? REDUCED_TURN : 1),
283
283
  };
284
284
  }
285
285
  /** The picture moves on its own: a turn, or time running faster than the clock. */
286
286
  get #moving() {
287
287
  const r = this.#request();
288
- return !this.#reduce && (r.turn !== 0 || ((this.#start !== undefined || r.moons) && r.rate !== 1));
288
+ const turning = r.turn !== 0 || ((this.#start !== undefined || r.moons) && r.rate !== 1);
289
+ return this.#reduce ? r.turn !== 0 : turning;
289
290
  }
290
291
  // --- the state of the scene --------------------------------------------------------------------------------------------------------------------
291
292
  #sceneOf(frame) {
@@ -437,7 +438,7 @@ export class WakuseiBody extends HTMLElement {
437
438
  #label() {
438
439
  const f = BODIES[this.body];
439
440
  const ja = this.getAttribute("lang") === "ja";
440
- const looks = { line: ja ? "線画" : "line drawing", realistic: ja ? "リアルな絵" : "realistic drawing", painted: ja ? "表面の地図" : "painted surface" };
441
+ const looks = { line: ja ? "線画" : "line drawing", realistic: ja ? "表面の地図" : "painted surface", painted: ja ? "表面の地図" : "painted surface", illustrated: ja ? "イラスト" : "illustrated drawing" };
441
442
  return ja ? `${f.name.ja}の${looks[this.look]}` : `${f.name.en}, ${looks[this.look]}`;
442
443
  }
443
444
  #drawLine() {
@@ -490,7 +491,7 @@ export class WakuseiBody extends HTMLElement {
490
491
  };
491
492
  const item = createBodyItem({
492
493
  id: this.body,
493
- look: this.look === "painted" ? "painted" : "realistic",
494
+ look: this.look === "illustrated" ? "realistic" : "painted",
494
495
  key: this.#viewKey,
495
496
  state: () => this.#sceneState ?? state,
496
497
  textureBase: base,
package/dist/embed.d.ts CHANGED
@@ -115,7 +115,7 @@ export interface PortraitEmbed {
115
115
  */
116
116
  export declare function portraitCode(options: PortraitEmbed, kind?: EmbedKind, settings?: EmbedSettings): string;
117
117
  /**
118
- * The credits that travel with a picture of a body: the line and shaded looks are drawn from numbers, the painted look uses public-domain pictures.
118
+ * The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and `realistic` and `painted` use the surface maps.
119
119
  *
120
120
  * @param options - The choices, so only what is used is named.
121
121
  * @returns A short line of credit to put near the picture.
package/dist/embed.js CHANGED
@@ -106,7 +106,7 @@ export function portraitCode(options, kind = "html", settings = {}) {
106
106
  return snippet(kind, { tag: "wakusei-portrait", element: "portrait", entries, attrs, name: "portrait", iframe: { src: `${site}embed.html?${new URLSearchParams({ scene: options.scene }).toString()}`, title: "Wakusei Planets portrait", width, height: Math.round(width / scene.aspect) } }, cdn);
107
107
  }
108
108
  /**
109
- * The credits that travel with a picture of a body: the line and shaded looks are drawn from numbers, the painted look uses public-domain pictures.
109
+ * The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and `realistic` and `painted` use the surface maps.
110
110
  *
111
111
  * @param options - The choices, so only what is used is named.
112
112
  * @returns A short line of credit to put near the picture.
@@ -120,7 +120,8 @@ export function portraitCode(options, kind = "html", settings = {}) {
120
120
  */
121
121
  export function embedCredit(options) {
122
122
  const base = "Wakusei Planets by John Morris (MIT). Sizes, tilt and rotation: IAU and NASA fact sheets.";
123
- const painted = (options.look ?? "realistic") === "painted" ? " Surface pictures: NASA, USGS and JPL imagery in the public domain (details in the package's NOTICE.md)." : "";
123
+ const photos = options.look !== "line" && options.look !== "illustrated";
124
+ const painted = photos ? " Surface pictures: NASA, USGS and JPL imagery in the public domain (details in the package's NOTICE.md)." : "";
124
125
  const earth = options.body === "earth" ? " Earth: NASA Earth Observatory, Blue Marble." : "";
125
126
  return `${base}${painted}${earth}`;
126
127
  }
@@ -17,6 +17,19 @@ export declare function kepler(meanAnomaly: number, e: number): number;
17
17
  * ```
18
18
  */
19
19
  export declare function heliocentric(planet: HostId, ms: number): Vec3;
20
+ /**
21
+ * 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.
22
+ * @param id - A planet or a dwarf planet.
23
+ * @returns The semi-major axis in au.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { meanSunAu } from "@johnmorrisdotca/wakusei-planets";
28
+ *
29
+ * console.log(meanSunAu("earth").toFixed(3));
30
+ * ```
31
+ */
32
+ export declare function meanSunAu(id: HostId): number;
20
33
  /**
21
34
  * The Moon's position from the Earth's centre (J2000 ecliptic, kilometres), from the largest terms of Meeus's lunar series.
22
35
  * @param ms - The instant, in milliseconds since 1970.
package/dist/ephemeris.js CHANGED
@@ -95,6 +95,22 @@ export function heliocentric(planet, ms) {
95
95
  const si = Math.sin(I);
96
96
  return [(cw * cn - sw * sn * ci) * x + (-sw * cn - cw * sn * ci) * y, (cw * sn + sw * cn * ci) * x + (-sw * sn + cw * cn * ci) * y, sw * si * x + cw * si * y];
97
97
  }
98
+ /**
99
+ * 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.
100
+ * @param id - A planet or a dwarf planet.
101
+ * @returns The semi-major axis in au.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * import { meanSunAu } from "@johnmorrisdotca/wakusei-planets";
106
+ *
107
+ * console.log(meanSunAu("earth").toFixed(3));
108
+ * ```
109
+ */
110
+ export function meanSunAu(id) {
111
+ const dwarf = DWARF_ELEMENTS[id];
112
+ return dwarf !== undefined ? dwarf.a : ELEMENTS[id][0];
113
+ }
98
114
  /**
99
115
  * The Moon's position from the Earth's centre (J2000 ecliptic, kilometres), from the largest terms of Meeus's lunar series.
100
116
  * @param ms - The instant, in milliseconds since 1970.
@@ -159,8 +175,8 @@ function geometry(id, ms) {
159
175
  return { earth, target: g, sunFrom: scale(earth, -1), emit: ms - length(g) * LIGHT_SECONDS_PER_AU * 1000, distanceAu: length(g) };
160
176
  }
161
177
  if (id === "earth") {
162
- // The Earth is seen from the Moon: the viewer is a Moon's distance away, looking back.
163
- const g = scale(moonGeocentric(ms), -1 / AU_KM);
178
+ // The same side of the pair as the Moon is seen from: a Moon's distance out, opposite the Moon, so the Earth and the Moon show the same phase.
179
+ const g = scale(moonGeocentric(ms), 1 / AU_KM);
164
180
  return { earth, target: g, sunFrom: scale(earth, -1), emit: ms - length(g) * LIGHT_SECONDS_PER_AU * 1000, distanceAu: length(g) };
165
181
  }
166
182
  const facts = BODIES[id];
package/dist/facts.d.ts CHANGED
@@ -103,17 +103,17 @@ export type MoonId = (typeof MOONS_OF)[keyof typeof MOONS_OF][number];
103
103
  */
104
104
  export type BodyId = "sun" | PlanetId | DwarfId | MoonId;
105
105
  /**
106
- * How a body is drawn: `line` (an outline drawing), `realistic` (shaded, from the numbers) or `painted` (a real surface map).
106
+ * How a body is drawn: `line` (an outline drawing), `realistic` and `painted` (a real surface map; `painted` is the same maps), or `illustrated` (shaded from the numbers, not a default).
107
107
  *
108
108
  * @example
109
109
  * ```ts
110
110
  * import { type Look } from "@johnmorrisdotca/wakusei-planets";
111
111
  *
112
- * const looks: Look[] = ["line", "realistic", "painted"];
112
+ * const looks: Look[] = ["line", "realistic", "painted", "illustrated"];
113
113
  * console.log(looks.length);
114
114
  * ```
115
115
  */
116
- export type Look = "line" | "realistic" | "painted";
116
+ export type Look = "line" | "realistic" | "painted" | "illustrated";
117
117
  /**
118
118
  * One band of a ring system, in kilometres from the planet's centre: how much light it stops (`alpha`, 0 to 1) and how bright it is (`tone`, 0 dark, 1 bright).
119
119
  *
package/dist/facts.js CHANGED
@@ -69,6 +69,20 @@ const SATURN_RINGS = [
69
69
  { from: 133610, to: 136775, alpha: 0.5, tone: 0.65 },
70
70
  { from: 140100, to: 140260, alpha: 0.35, tone: 0.8 },
71
71
  ];
72
+ // Jupiter: the halo inside the main ring, the main ring, and the gossamer rings out to about 226,000 km (NASA). Dark; the main ring is the one that shows.
73
+ const JUPITER_RINGS = [
74
+ { from: 92000, to: 122500, alpha: 0.04, tone: 0.25 },
75
+ { from: 122800, to: 129200, alpha: 0.4, tone: 0.55 },
76
+ { from: 129200, to: 181350, alpha: 0.06, tone: 0.3 },
77
+ { from: 181350, to: 226000, alpha: 0.04, tone: 0.25 },
78
+ ];
79
+ // Neptune: Galle, Le Verrier, the Lassell sheet and Adams. Adams's arcs sit on that radius; a strip has no longitude, so they are the same band.
80
+ const NEPTUNE_RINGS = [
81
+ { from: 40900, to: 42900, alpha: 0.1, tone: 0.3 },
82
+ { from: 53150, to: 53300, alpha: 0.45, tone: 0.5 },
83
+ { from: 53300, to: 57200, alpha: 0.05, tone: 0.25 },
84
+ { from: 62890, to: 62980, alpha: 0.55, tone: 0.6 },
85
+ ];
72
86
  const URANUS_RINGS = [
73
87
  { from: 41800, to: 41880, alpha: 0.3, tone: 0.2 },
74
88
  { from: 42200, to: 42270, alpha: 0.3, tone: 0.2 },
@@ -125,6 +139,7 @@ export const BODIES = {
125
139
  }),
126
140
  jupiter: f("jupiter", "planet", "Jupiter", "木星", 71492, 0.06487, 3.13, 268.056595, 64.495303, 284.95, 870.536, 9.925, "#d9b48a", {
127
141
  showLon: -48,
142
+ rings: JUPITER_RINGS,
128
143
  features: [...bandsAt([62, 48, 35, 22, 8, -8, -22, -34, -48, -62]), { kind: "oval", lon: 20, lat: -22, rx: 12, ry: 6 }, { kind: "oval", lon: -70, lat: -33, rx: 3, ry: 2 }],
129
144
  }),
130
145
  saturn: f("saturn", "planet", "Saturn", "土星", 60268, 0.09796, 26.73, 40.589, 83.537, 38.9, 810.7939024, 10.656, "#e4d09c", {
@@ -134,6 +149,7 @@ export const BODIES = {
134
149
  uranus: f("uranus", "planet", "Uranus", "天王星", 25559, 0.02293, 97.77, 257.311, -15.175, 203.81, -501.1600928, -17.24, "#a9e0e5", { rings: URANUS_RINGS, features: bandsAt([62, 38, 14, -14, -38]) }),
135
150
  neptune: f("neptune", "planet", "Neptune", "海王星", 24764, 0.01708, 28.32, 299.36, 43.46, 249.978, 541.1397757, 16.11, "#4a6ee0", {
136
151
  showLon: -30,
152
+ rings: NEPTUNE_RINGS,
137
153
  features: [...bandsAt([58, 34, 10, -14, -38, -60]), { kind: "oval", lon: -20, lat: -22, rx: 12, ry: 6 }, { kind: "oval", lon: 45, lat: -42, rx: 5, ry: 2.5 }],
138
154
  }),
139
155
  pluto: f("pluto", "dwarf-planet", "Pluto", "冥王星", 1188.3, 0, 122.53, 132.993, -6.163, 302.695, 56.3625225, -153.2935, "#c9a98a", {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { BODIES, BODY_IDS, DWARF_IDS, MOONS_OF, PLANET_IDS, ringReach, type BodyFacts, type BodyId, type DwarfId, type Feature, type HostId, type Look, type MoonId, type PlanetId, type RingBand } from "./facts.ts";
2
- export { apparent, moonGeocentric, heliocentric, orbitPath, system, type Apparent, type MoonPlace, type Pose, type System } from "./ephemeris.ts";
2
+ export { apparent, heliocentric, meanSunAu, moonGeocentric, orbitPath, system, type Apparent, type MoonPlace, type Pose, type System } from "./ephemeris.ts";
3
+ export { JOURNEY_STOPS, journeyStop, stopPlaceAu, type JourneyStop } from "./stops.ts";
3
4
  export { drawnTilt, portrait, type PortraitOptions } from "./pose.ts";
4
5
  export { lineSvg, mix, type LineOptions } from "./line.ts";
5
6
  export { ringStrip, type RingStrip } from "./scene/rings.ts";
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { BODIES, BODY_IDS, DWARF_IDS, MOONS_OF, PLANET_IDS, ringReach } from "./facts.js";
2
- export { apparent, moonGeocentric, heliocentric, orbitPath, system } from "./ephemeris.js";
2
+ export { apparent, heliocentric, meanSunAu, moonGeocentric, orbitPath, system } from "./ephemeris.js";
3
+ export { JOURNEY_STOPS, journeyStop, stopPlaceAu } from "./stops.js";
3
4
  export { drawnTilt, portrait } from "./pose.js";
4
5
  export { lineSvg, mix } from "./line.js";
5
6
  export { ringStrip } from "./scene/rings.js";
package/dist/live.d.ts CHANGED
@@ -33,6 +33,12 @@ export interface LiveFrame {
33
33
  /** How many full workings-out have been made so far. */
34
34
  anchors: number;
35
35
  }
36
+ /** Degrees a second a portrait turns when the page does not set `turn`. Slow enough to watch. */
37
+ export declare const DEFAULT_TURN = 12;
38
+ /** The share of that turn kept when the reader prefers reduced motion. `turn="0"` is the only stop. */
39
+ export declare const REDUCED_TURN = 0.25;
40
+ /** The portrait turn when none is set: `DEFAULT_TURN` degrees a second, and backwards when the body turns backwards. `turn="0"` stays still. */
41
+ export declare function defaultTurn(id: BodyId): number;
36
42
  /** The degrees a second a body's own turn advances its prime meridian (a moon that keeps one face to its planet turns once a trip). */
37
43
  export declare function turnRate(id: BodyId): number;
38
44
  /** A live picture's maths: ask `at(request, now)` as often as you like; it works out the sky about once a second. */
package/dist/live.js CHANGED
@@ -6,6 +6,14 @@ import { BODIES, MOONS_OF } from "./facts.js";
6
6
  import { portrait } from "./pose.js";
7
7
  import { turn, unit, cross } from "./vec.js";
8
8
  const ANCHOR_MS = 1000;
9
+ /** Degrees a second a portrait turns when the page does not set `turn`. Slow enough to watch. */
10
+ export const DEFAULT_TURN = 12;
11
+ /** The share of that turn kept when the reader prefers reduced motion. `turn="0"` is the only stop. */
12
+ export const REDUCED_TURN = 0.25;
13
+ /** The portrait turn when none is set: `DEFAULT_TURN` degrees a second, and backwards when the body turns backwards. `turn="0"` stays still. */
14
+ export function defaultTurn(id) {
15
+ return (BODIES[id].rotationHours < 0 ? -1 : 1) * DEFAULT_TURN;
16
+ }
9
17
  /** The degrees a second a body's own turn advances its prime meridian (a moon that keeps one face to its planet turns once a trip). */
10
18
  export function turnRate(id) {
11
19
  const f = BODIES[id];
@@ -48,8 +56,11 @@ export function createLive() {
48
56
  if (r.turn !== 0)
49
57
  pose = { ...pose, meridian: turn(pose.meridian, pose.pole, r.turn * seconds) };
50
58
  }
51
- else if (seconds !== 0) {
52
- pose = { ...pose, meridian: turn(pose.meridian, pose.pole, turnRate(r.id) * seconds) };
59
+ else {
60
+ // The date's own spin is already in the anchor, so only the bit since then is added. The portrait turn is from the start of the clock: folding it into the one-second window made a dated picture jump back every second.
61
+ const spin = turnRate(r.id) * seconds + r.turn * ((now - r.startedAt) / 1000);
62
+ if (spin !== 0)
63
+ pose = { ...pose, meridian: turn(pose.meridian, pose.pole, spin) };
53
64
  }
54
65
  const moons = a.place.map((m, i) => {
55
66
  const rate = Math.abs(ORBITS[m.id]?.sid ?? 0) / 86400;
@@ -4,6 +4,7 @@ import { setThreeLoader, takeRenderer } from "../scene/shared.js";
4
4
  import { TEXTURE_BASE, TEXTURE_FAR_BASE } from "../element.js";
5
5
  import { backgroundCss, drawShapes, lineScene, paintBackground, shapesOf, shapesSvg, starfield } from "./overlay.js";
6
6
  import { decodeScene, defaultPortrait, encodeScene, fromScreen, hitTest, resolve, toScreen } from "./model.js";
7
+ import { REDUCED_TURN } from "../live.js";
7
8
  import { poseOf } from "./pose.js";
8
9
  import { createPortraitItem } from "./scene3d.js";
9
10
  export { setThreeLoader };
@@ -231,7 +232,7 @@ export class WakuseiPortrait extends HTMLElement {
231
232
  const text = this.getAttribute("scene");
232
233
  const p = text === null ? defaultPortrait() : decodeScene(text);
233
234
  const look = this.getAttribute("look");
234
- if (look === "line" || look === "realistic" || look === "painted")
235
+ if (look === "line" || look === "realistic" || look === "painted" || look === "illustrated")
235
236
  p.look = look;
236
237
  this.#portrait = p;
237
238
  }
@@ -248,14 +249,17 @@ export class WakuseiPortrait extends HTMLElement {
248
249
  return Number.isFinite(ms) ? ms : undefined;
249
250
  }
250
251
  get #turning() {
251
- return !this.#reduce && this.#portrait.items.some((i) => i.turn !== 0);
252
+ return this.#portrait.items.some((i) => i.turn !== 0);
252
253
  }
253
254
  #seconds() {
254
- return this.#turning ? (performance.now() - this.#startedAt) / 1000 : 0;
255
+ if (!this.#turning)
256
+ return 0;
257
+ const elapsed = (performance.now() - this.#startedAt) / 1000;
258
+ return this.#reduce ? elapsed * REDUCED_TURN : elapsed;
255
259
  }
256
260
  #draw() {
257
261
  const p = this.#portrait;
258
- return { placed: this.#resolved.placed, camera: this.#resolved.camera, light: p.light, look: p.look === "painted" ? "painted" : "realistic", ms: this.#date(), seconds: this.#seconds(), shadows: p.shadows };
262
+ return { placed: this.#resolved.placed, camera: this.#resolved.camera, light: p.light, look: p.look === "illustrated" ? "realistic" : "painted", ms: this.#date(), seconds: this.#seconds(), shadows: p.shadows };
259
263
  }
260
264
  #changed() {
261
265
  if (!this.isConnected)
@@ -445,7 +445,8 @@ export function rescale(p, mode) {
445
445
  const base = sizesFor([largest.body], mode)[0];
446
446
  const sizes = sizesFor(p.items.map((i) => i.body), mode);
447
447
  out.items.forEach((item, i) => {
448
- item.r = Math.max(0.004, (sizes[i] / base) * largest.r);
448
+ const scaled = (sizes[i] / base) * largest.r;
449
+ item.r = mode === "true" ? scaled : Math.max(0.004, scaled);
449
450
  });
450
451
  return out;
451
452
  }
@@ -556,7 +557,7 @@ export function createHistory(initial, limit = 100) {
556
557
  };
557
558
  }
558
559
  // --- the address --------------------------------------------------------------------------------------------------------------------------------------
559
- const LOOKS = ["line", "realistic", "painted"];
560
+ const LOOKS = ["line", "realistic", "painted", "illustrated"];
560
561
  const BACKGROUNDS = ["black", "stars", "gradient", "transparent"];
561
562
  const ARRANGES = ["row", "arc", "grid", "orbit"];
562
563
  const num = (value, fallback) => {
@@ -85,9 +85,9 @@ export function createBodyItem(options) {
85
85
  const ringInner = photo !== undefined && photoTexture !== undefined ? photo.from / facts.radiusKm : (table?.inner ?? 1);
86
86
  const ringOuter = photo !== undefined && photoTexture !== undefined ? photo.to / facts.radiusKm : (table?.outer ?? 2);
87
87
  const ringKey = photoTexture !== undefined ? `${options.id}:p` : options.id;
88
- let ringMesh;
88
+ // Two halves. The near one is drawn over the disc; the far one is tested against it, so it goes behind.
89
+ let ringHalves;
89
90
  let ringTexture;
90
- let ringMaterial;
91
91
  if (table !== null && look.emissive !== true) {
92
92
  ringTexture = assets.acquire(`wk:ringtex:${ringKey}`, () => {
93
93
  if (photoTexture !== undefined) {
@@ -107,18 +107,25 @@ export function createBodyItem(options) {
107
107
  }, (t) => t.dispose());
108
108
  if (photoTexture !== undefined && ringTexture !== photoTexture)
109
109
  photoTexture.dispose();
110
- const ringGeometry = assets.acquire(`wk:ring:${ringKey}`, () => new T.RingGeometry(ringInner, ringOuter, 256, 1), (g) => g.dispose());
111
- ringMaterial = assets.acquire(`wk:ringmat:${ringKey}`, () => new T.ShaderMaterial({
110
+ const ringMaterial = (key, depthTest) => assets.acquire(`wk:ringmat:${ringKey}:${key}`, () => new T.ShaderMaterial({
112
111
  vertexShader: RING_VERTEX,
113
112
  fragmentShader: RING_FRAGMENT,
114
113
  side: T.DoubleSide,
115
114
  transparent: true,
116
115
  depthWrite: false,
116
+ depthTest,
117
117
  uniforms: { uRingTex: { value: ringTexture }, uRingR: { value: new T.Vector2(ringInner, ringOuter) }, uLight: { value: new T.Vector3(0, 0, 1) }, uRingN: { value: new T.Vector3(0, 1, 0) } },
118
118
  }), (m) => m.dispose());
119
- ringMesh = new T.Mesh(ringGeometry, ringMaterial);
120
- ringMesh.frustumCulled = false;
121
- scene.add(ringMesh);
119
+ // 0..pi is the +Y half. The basis maps local +Y onto +east.
120
+ const half = (key, start, depthTest) => {
121
+ const geometry = assets.acquire(`wk:ring:${ringKey}:${key}`, () => new T.RingGeometry(ringInner, ringOuter, 128, 1, start, Math.PI), (g) => g.dispose());
122
+ const material = ringMaterial(key, depthTest);
123
+ const piece = new T.Mesh(geometry, material);
124
+ piece.frustumCulled = false;
125
+ scene.add(piece);
126
+ return { mesh: piece, material };
127
+ };
128
+ ringHalves = [half("e", 0, false), half("w", Math.PI, true)];
122
129
  }
123
130
  // the glow of a star
124
131
  let glow;
@@ -139,25 +146,33 @@ export function createBodyItem(options) {
139
146
  let viewHeight = height;
140
147
  // the picture
141
148
  let textureWidth = 0;
142
- let texture;
143
149
  let loading = false;
144
150
  let failed = false;
151
+ let gone = false;
145
152
  const tried = new Set();
146
153
  let latest = options.state();
147
154
  const loadTexture = (w) => {
148
155
  const far = look.painted.far !== undefined && w >= look.painted.far;
149
156
  return loadImage(`${far ? options.farBase() : options.textureBase()}${look.painted.map}-${w}.webp`);
150
157
  };
158
+ const drop = (t) => {
159
+ t.dispose();
160
+ t.image = null;
161
+ };
151
162
  const use = (t, w) => {
163
+ if (gone) {
164
+ drop(t);
165
+ return;
166
+ }
152
167
  t.anisotropy = 4;
153
168
  t.wrapS = T.RepeatWrapping;
154
169
  t.colorSpace = T.NoColorSpace;
155
- const previous = texture;
156
- texture = t;
170
+ const shared = assets.acquire(`wk:map:${options.id}:${w}`, () => t, (tex) => drop(tex));
171
+ if (shared !== t)
172
+ drop(t);
157
173
  textureWidth = w;
158
- paintedMaterial.uniforms.uMap.value = t;
174
+ paintedMaterial.uniforms.uMap.value = shared;
159
175
  mesh.material = paintedMaterial;
160
- previous?.dispose();
161
176
  options.report?.({ painted: true, width: w });
162
177
  };
163
178
  const fail = () => {
@@ -187,8 +202,21 @@ export function createBodyItem(options) {
187
202
  const scaleY = ax ? ax[2] / mean : 1 - facts.flattening;
188
203
  const scaleZ = ax ? ax[0] / mean : 1;
189
204
  setBasis(T, mesh, east, pole, meridian, scaleX, scaleY, scaleZ);
190
- if (ringMesh !== undefined)
191
- setBasis(T, ringMesh, meridian, east, pole);
205
+ if (ringHalves !== undefined) {
206
+ const [near, far] = ringHalves;
207
+ // The camera sits on +Z. The ring's near direction is +Z laid onto the ring plane, and that half is drawn over the disc.
208
+ const zx = meridian[2];
209
+ const zy = east[2];
210
+ const span = Math.hypot(zx, zy) || 1;
211
+ const toward = [(meridian[0] * zx + east[0] * zy) / span, (meridian[1] * zx + east[1] * zy) / span, (meridian[2] * zx + east[2] * zy) / span];
212
+ const across = cross(toward, pole);
213
+ setBasis(T, near.mesh, across, toward, pole);
214
+ setBasis(T, far.mesh, [-across[0], -across[1], -across[2]], [-toward[0], -toward[1], -toward[2]], pole);
215
+ near.mesh.renderOrder = 2;
216
+ far.mesh.renderOrder = 1;
217
+ near.material.depthTest = false;
218
+ far.material.depthTest = true;
219
+ }
192
220
  };
193
221
  const frame = (state) => {
194
222
  const aspect = viewWidth / Math.max(1, viewHeight);
@@ -268,11 +296,13 @@ export function createBodyItem(options) {
268
296
  orient(state);
269
297
  frame(state);
270
298
  place(state);
271
- if (ringMaterial !== undefined) {
299
+ if (ringHalves !== undefined) {
272
300
  const light = v3(T, state.pose.light);
273
301
  const pole = v3(T, state.pose.pole);
274
- ringMaterial.uniforms.uLight.value.copy(light);
275
- ringMaterial.uniforms.uRingN.value.copy(pole);
302
+ for (const piece of ringHalves) {
303
+ piece.material.uniforms.uLight.value.copy(light);
304
+ piece.material.uniforms.uRingN.value.copy(pole);
305
+ }
276
306
  for (const mat of [shader, paintedMaterial]) {
277
307
  if (mat === undefined)
278
308
  continue;
@@ -304,6 +334,10 @@ export function createBodyItem(options) {
304
334
  loading = true;
305
335
  void loadTexture(next).then((t) => {
306
336
  loading = false;
337
+ if (gone) {
338
+ drop(t);
339
+ return;
340
+ }
307
341
  use(t, next);
308
342
  options.redraw();
309
343
  }, () => {
@@ -334,8 +368,7 @@ export function createBodyItem(options) {
334
368
  return false;
335
369
  },
336
370
  dispose() {
337
- texture?.dispose();
338
- texture = undefined;
371
+ gone = true;
339
372
  for (const o of orbitLines.values())
340
373
  o.line.geometry.dispose();
341
374
  orbitMaterial.dispose();
@@ -1,6 +1,8 @@
1
1
  const PALETTE = {
2
2
  saturn: [[104, 86, 66], [243, 230, 200]],
3
+ jupiter: [[92, 78, 62], [186, 164, 132]],
3
4
  uranus: [[58, 62, 66], [150, 158, 162]],
5
+ neptune: [[48, 56, 70], [140, 156, 176]],
4
6
  };
5
7
  const hash = (n) => {
6
8
  const s = Math.sin(n * 127.1 + 311.7) * 43758.5453;
@@ -0,0 +1,72 @@
1
+ import { type BodyFacts, type BodyId, type HostId } from "./facts.ts";
2
+ import { type Vec3 } from "./vec.ts";
3
+ /**
4
+ * One body, with what a trip needs. `gmKm3s2`, `massKg` and `escapeKmS` are empty together when no page read here gives a mass.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { journeyStop, type JourneyStop } from "@johnmorrisdotca/wakusei-planets";
9
+ *
10
+ * const earth: JourneyStop = journeyStop("earth");
11
+ * console.log(earth.sunAu.toFixed(3), earth.escapeKmS);
12
+ * ```
13
+ */
14
+ export interface JourneyStop {
15
+ id: BodyId;
16
+ kind: BodyFacts["kind"];
17
+ /** The body a moon goes round. */
18
+ parent?: HostId;
19
+ name: {
20
+ en: string;
21
+ ja: string;
22
+ };
23
+ /** Equatorial radius in kilometres, the same number as `BODIES` (a moon's mean radius). */
24
+ radiusKm: number;
25
+ /** Mean distance from the Sun in astronomical units. `0` for the Sun. A moon uses its parent's. */
26
+ sunAu: number;
27
+ /** Gravitational parameter, km^3/s^2. Empty when no cited page gives it. */
28
+ gmKm3s2: number | null;
29
+ /** Mass in kilograms, GM / G with CODATA 2018 G. Empty when GM is empty. */
30
+ massKg: number | null;
31
+ /** Escape speed in km/s: the published figure, or `sqrt(2 GM / radius)` for a moon. Empty when GM is empty. */
32
+ escapeKmS: number | null;
33
+ }
34
+ /**
35
+ * Every body, in the same order as `BODY_IDS`: the Sun, the planets, the dwarf planets, then the moons.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { BODY_IDS, JOURNEY_STOPS } from "@johnmorrisdotca/wakusei-planets";
40
+ *
41
+ * console.log(JOURNEY_STOPS.length === BODY_IDS.length, JOURNEY_STOPS[0]?.id);
42
+ * ```
43
+ */
44
+ export declare const JOURNEY_STOPS: readonly JourneyStop[];
45
+ /**
46
+ * One body's row.
47
+ * @param id - The body's name.
48
+ * @returns That body's stop.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * import { journeyStop } from "@johnmorrisdotca/wakusei-planets";
53
+ *
54
+ * console.log(journeyStop("titan").parent, journeyStop("titan").gmKm3s2);
55
+ * ```
56
+ */
57
+ export declare function journeyStop(id: BodyId): JourneyStop;
58
+ /**
59
+ * Where a body is in the Sun's frame at an instant, in astronomical units. The Sun is the origin. A moon is its parent plus its offset.
60
+ * @param id - The body's name.
61
+ * @param ms - The instant, in milliseconds since 1970.
62
+ * @returns The position as x, y, z in au.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * import { stopPlaceAu } from "@johnmorrisdotca/wakusei-planets";
67
+ *
68
+ * const [x, y, z] = stopPlaceAu("mars", Date.UTC(2026, 10, 2));
69
+ * console.log(Math.hypot(x, y, z).toFixed(3));
70
+ * ```
71
+ */
72
+ export declare function stopPlaceAu(id: BodyId, ms: number): Vec3;
package/dist/stops.js ADDED
@@ -0,0 +1,144 @@
1
+ // Every body as one row a trip can use. Gravity is typed from pages read on 2026-11-04, never guessed.
2
+ // GM, where a page prints it: JPL "Planetary Satellite Physical Parameters" (https://ssd.jpl.nasa.gov/sats/phys_par/) for the
3
+ // Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto and the moons on that page. NASA fact sheets
4
+ // (https://nssdc.gsfc.nasa.gov/planetary/factsheet/) for the Sun (132,712 × 10^6), Mercury (0.022032 × 10^6) and Venus (0.32486 × 10^6).
5
+ // Ceres, Eris, Makemake and Haumea: the mass on JPL "Planetary Physical Parameters" (https://ssd.jpl.nasa.gov/planets/phys_par.html)
6
+ // times the CODATA 2018 G that page names. Escape speeds for the Sun and those planets are the speeds those pages print.
7
+ // A moon's escape speed is sqrt(2 GM / radius) from this package's radius. Nereid, and the dwarf planets and moons
8
+ // whose pages do not print a mass, are left empty.
9
+ import { heliocentric, meanSunAu, moonVector } from "./ephemeris.js";
10
+ import { BODIES, BODY_IDS } from "./facts.js";
11
+ import { add, scale } from "./vec.js";
12
+ /** The astronomical unit the ephemeris uses, in kilometres. */
13
+ const AU_KM = 149_597_870.7;
14
+ /** CODATA 2018 G, in km^3 kg^-1 s^-2: the value JPL's planetary page names (6.67430 × 10^-11 m^3 kg^-1 s^-2). */
15
+ const G_KM3_PER_KG = 6.6743e-20;
16
+ const mass = (kg) => kg * G_KM3_PER_KG;
17
+ /** GM in km^3/s^2. A body missing here has no published value in the pages above. */
18
+ const GM = {
19
+ sun: 132_712_000_000,
20
+ mercury: 22_032,
21
+ venus: 324_860,
22
+ earth: 398_600.436,
23
+ mars: 42_828.37362,
24
+ jupiter: 126_686_531.9,
25
+ saturn: 37_931_206.23,
26
+ uranus: 5_793_951.3,
27
+ neptune: 6_835_099.97,
28
+ pluto: 869.3,
29
+ ceres: mass(938.416e18),
30
+ eris: mass(16_600e18),
31
+ makemake: mass(3_100e18),
32
+ haumea: mass(4_006e18),
33
+ moon: 4_902.8,
34
+ phobos: 0.0007087,
35
+ deimos: 0.0000962,
36
+ io: 5_959.91547,
37
+ europa: 3_202.7121,
38
+ ganymede: 9_887.83275,
39
+ callisto: 7_179.2834,
40
+ mimas: 2.50349,
41
+ enceladus: 7.21037,
42
+ tethys: 41.21353,
43
+ dione: 73.11607,
44
+ rhea: 153.94175,
45
+ titan: 8_978.1371,
46
+ iapetus: 120.51511,
47
+ miranda: 4.3,
48
+ ariel: 83.5,
49
+ umbriel: 85.1,
50
+ titania: 226.9,
51
+ oberon: 205.3,
52
+ triton: 1_428.49546,
53
+ proteus: 2.58342,
54
+ charon: 106.1,
55
+ nix: 0.0015,
56
+ hydra: 0.002,
57
+ };
58
+ /** Escape speed in km/s, where a page prints one. Anything else is worked out from GM and the radius. */
59
+ const ESCAPE = {
60
+ sun: 617.6,
61
+ mercury: 4.25,
62
+ venus: 10.36,
63
+ earth: 11.19,
64
+ mars: 5.03,
65
+ jupiter: 60.2,
66
+ saturn: 36.09,
67
+ uranus: 21.38,
68
+ neptune: 23.56,
69
+ pluto: 1.21,
70
+ ceres: 0.51,
71
+ eris: 1.36,
72
+ makemake: 0.76,
73
+ haumea: 0.78,
74
+ };
75
+ const stopOf = (id) => {
76
+ const facts = BODIES[id];
77
+ const gm = GM[id] ?? null;
78
+ const host = facts.kind === "moon" ? facts.parent : id === "sun" ? undefined : id;
79
+ return {
80
+ id,
81
+ kind: facts.kind,
82
+ ...(facts.parent === undefined ? {} : { parent: facts.parent }),
83
+ name: facts.name,
84
+ radiusKm: facts.radiusKm,
85
+ sunAu: id === "sun" || host === undefined ? 0 : meanSunAu(host),
86
+ gmKm3s2: gm,
87
+ massKg: gm === null ? null : gm / G_KM3_PER_KG,
88
+ escapeKmS: ESCAPE[id] ?? (gm === null ? null : Math.sqrt((2 * gm) / facts.radiusKm)),
89
+ };
90
+ };
91
+ /**
92
+ * Every body, in the same order as `BODY_IDS`: the Sun, the planets, the dwarf planets, then the moons.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { BODY_IDS, JOURNEY_STOPS } from "@johnmorrisdotca/wakusei-planets";
97
+ *
98
+ * console.log(JOURNEY_STOPS.length === BODY_IDS.length, JOURNEY_STOPS[0]?.id);
99
+ * ```
100
+ */
101
+ export const JOURNEY_STOPS = BODY_IDS.map(stopOf);
102
+ const BY_ID = new Map(JOURNEY_STOPS.map((stop) => [stop.id, stop]));
103
+ /**
104
+ * One body's row.
105
+ * @param id - The body's name.
106
+ * @returns That body's stop.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * import { journeyStop } from "@johnmorrisdotca/wakusei-planets";
111
+ *
112
+ * console.log(journeyStop("titan").parent, journeyStop("titan").gmKm3s2);
113
+ * ```
114
+ */
115
+ export function journeyStop(id) {
116
+ const stop = BY_ID.get(id);
117
+ if (stop === undefined)
118
+ throw new Error(`no stop for ${id}`);
119
+ return stop;
120
+ }
121
+ /**
122
+ * Where a body is in the Sun's frame at an instant, in astronomical units. The Sun is the origin. A moon is its parent plus its offset.
123
+ * @param id - The body's name.
124
+ * @param ms - The instant, in milliseconds since 1970.
125
+ * @returns The position as x, y, z in au.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * import { stopPlaceAu } from "@johnmorrisdotca/wakusei-planets";
130
+ *
131
+ * const [x, y, z] = stopPlaceAu("mars", Date.UTC(2026, 10, 2));
132
+ * console.log(Math.hypot(x, y, z).toFixed(3));
133
+ * ```
134
+ */
135
+ export function stopPlaceAu(id, ms) {
136
+ if (id === "sun")
137
+ return [0, 0, 0];
138
+ const facts = BODIES[id];
139
+ if (facts.kind !== "moon")
140
+ return heliocentric(id, ms);
141
+ if (facts.parent === undefined)
142
+ throw new Error(`no parent for ${id}`);
143
+ return add(heliocentric(facts.parent, ms), scale(moonVector(id, ms), 1 / AU_KM));
144
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.15.0";
1
+ export declare const VERSION = "0.17.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.15.0";
1
+ export const VERSION = "0.17.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/wakusei-planets",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "Wakusei Planets 惑星 — The Sun, planets and moons for the web: each as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, axial tilt and rotation as data, and positions of the moons for any date and time. SVG for the lines, three.js (optional) for the rest.",
5
5
  "keywords": [
6
6
  "planets",