@johnmorrisdotca/wakusei-planets 0.72.0 → 0.73.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
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.73.0] - 2026-11-20
6
+
7
+ - **An irregular moon is an estimated rock** (MODULES-1720). `<wakusei-body body="himalia">`, or a designation such as `S/2003 J 18`, draws a coarse rock sized from the catalogue and coloured from its albedo (dark, mid, bright, or grey when the albedo is unknown). The shape is a guess from the id and the same id always matches. Under 100 km it is a potato (axes about 1 : 0.6–0.9 : 0.5–0.8, plus lumps); from 200 km it stays nearly round; between, the two blend. Each rock is turned by its id, so the long axis does not point the same way on every moon. A dark albedo is charcoal, and an unknown albedo is a mid grey. The picture shows the catalogue name and a star (`Himalia*`); the star means the shape or the size is estimated (`* shape or size estimated`, and in Japanese `* 形や大きさは推定`), which a picture shows once. The line drawing follows the shape with a smooth outline and a soft light-to-dark fill, not a flat polygon. The accessible name keeps the full words. A size worked out from the brightness says so there (`data-size="derived"`); a moon with no size is drawn at 1 km and marked `unknown`. The moons drawn in full are unchanged, and any other unknown name stays the Earth. One surface shader is shared. Stills are 160 pixels on a side so a whole family fits in the 32 MB still budget: a 480-pixel still of every moon of Jupiter was dropped, and the view showed a broken image.
8
+
5
9
  ## [0.72.0] - 2026-11-20
6
10
 
7
11
  - **The copy-paste snippet names the current package** (MODULES-1719). `VERSION` in `src/version.ts` had stayed at 0.54.0 while releases bumped `package.json` only, so a copied snippet asked for `@0.54.0`. It is 0.71.0, the same as `package.json`, and `test/version.test.ts` fails when the two disagree. The texture address types in `test/api-snapshot.txt` name 0.71.0 as well.
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.72.0/docs/images/lineup-desk.png" width="640"></p>
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.73.0/docs/images/lineup-desk.png" width="640"></p>
23
23
 
24
24
  ## Who it is for
25
25
 
@@ -423,7 +423,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
423
423
 
424
424
  ## The portrait builder
425
425
 
426
- <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.72.0/docs/images/portrait-family.png" width="640"></p>
426
+ <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.73.0/docs/images/portrait-family.png" width="640"></p>
427
427
 
428
428
  [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.
429
429
 
@@ -580,7 +580,7 @@ BODIES.pluto.kind; // "dwarf-planet"
580
580
 
581
581
  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:
582
582
 
583
- > Morris, J. (2026). *Wakusei Planets* (version 0.72.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
583
+ > Morris, J. (2026). *Wakusei Planets* (version 0.73.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
584
584
 
585
585
  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).
586
586
 
@@ -0,0 +1,2 @@
1
+ export type EstimatedMoonRow = readonly [string, string, string, number, 0 | 1 | 2 | 3, number];
2
+ export declare const ESTIMATED_MOONS: readonly EstimatedMoonRow[];
@@ -0,0 +1,426 @@
1
+ export const ESTIMATED_MOONS = [
2
+ ["adrastea", "jupiter", "Adrastea", 82, 0, 100],
3
+ ["metis", "jupiter", "Metis", 215, 0, 61],
4
+ ["himalia", "jupiter", "Himalia", 850, 0, 40],
5
+ ["elara", "jupiter", "Elara", 400, 1, 30],
6
+ ["pasiphae", "jupiter", "Pasiphae", 180, 1, -1],
7
+ ["sinope", "jupiter", "Sinope", 140, 1, -1],
8
+ ["lysithea", "jupiter", "Lysithea", 120, 1, -1],
9
+ ["carme", "jupiter", "Carme", 150, 1, -1],
10
+ ["ananke", "jupiter", "Ananke", 100, 1, -1],
11
+ ["leda", "jupiter", "Leda", 50, 1, -1],
12
+ ["callirrhoe", "jupiter", "Callirrhoe", 48, 2, -1],
13
+ ["themisto", "jupiter", "Themisto", 44, 2, -1],
14
+ ["megaclite", "jupiter", "Megaclite", 33, 2, -1],
15
+ ["taygete", "jupiter", "Taygete", 28, 2, -1],
16
+ ["chaldene", "jupiter", "Chaldene", 24, 2, -1],
17
+ ["harpalyke", "jupiter", "Harpalyke", 30, 2, -1],
18
+ ["kalyke", "jupiter", "Kalyke", 29, 2, -1],
19
+ ["iocaste", "jupiter", "Iocaste", 42, 2, -1],
20
+ ["erinome", "jupiter", "Erinome", 21, 2, -1],
21
+ ["isonoe", "jupiter", "Isonoe", 22, 2, -1],
22
+ ["praxidike", "jupiter", "Praxidike", 33, 2, -1],
23
+ ["autonoe", "jupiter", "Autonoe", 28, 2, -1],
24
+ ["thyone", "jupiter", "Thyone", 24, 2, -1],
25
+ ["hermippe", "jupiter", "Hermippe", 26, 2, -1],
26
+ ["aitne", "jupiter", "Aitne", 20, 2, -1],
27
+ ["eurydome", "jupiter", "Eurydome", 20, 2, -1],
28
+ ["euanthe", "jupiter", "Euanthe", 19, 2, -1],
29
+ ["euporie", "jupiter", "Euporie", 18, 2, -1],
30
+ ["orthosie", "jupiter", "Orthosie", 16, 2, -1],
31
+ ["sponde", "jupiter", "Sponde", 17, 2, -1],
32
+ ["kale", "jupiter", "Kale", 17, 2, -1],
33
+ ["pasithee", "jupiter", "Pasithee", 15, 2, -1],
34
+ ["hegemone", "jupiter", "Hegemone", 25, 2, -1],
35
+ ["mneme", "jupiter", "Mneme", 18, 2, -1],
36
+ ["aoede", "jupiter", "Aoede", 26, 2, -1],
37
+ ["thelxinoe", "jupiter", "Thelxinoe", 18, 2, -1],
38
+ ["arche", "jupiter", "Arche", 19, 2, -1],
39
+ ["kallichore", "jupiter", "Kallichore", 19, 2, -1],
40
+ ["helike", "jupiter", "Helike", 22, 2, -1],
41
+ ["carpo", "jupiter", "Carpo", 19, 2, -1],
42
+ ["eukelade", "jupiter", "Eukelade", 22, 2, -1],
43
+ ["cyllene", "jupiter", "Cyllene", 18, 2, -1],
44
+ ["kore", "jupiter", "Kore", 16, 2, -1],
45
+ ["herse", "jupiter", "Herse", 17, 2, -1],
46
+ ["s-2010-j-1", "jupiter", "S/2010 J 1", 17, 2, -1],
47
+ ["s-2010-j-2", "jupiter", "S/2010 J 2", 11, 2, -1],
48
+ ["dia", "jupiter", "Dia", 19, 2, -1],
49
+ ["s-2016-j-1", "jupiter", "S/2016 J 1", 13, 2, -1],
50
+ ["s-2003-j-18", "jupiter", "S/2003 J 18", 17, 2, -1],
51
+ ["s-2011-j-2", "jupiter", "S/2011 J 2", 14, 2, -1],
52
+ ["eirene", "jupiter", "Eirene", 23, 2, -1],
53
+ ["philophrosyne", "jupiter", "Philophrosyne", 0, 3, -1],
54
+ ["s-2017-j-1", "jupiter", "S/2017 J 1", 15, 2, -1],
55
+ ["eupheme", "jupiter", "Eupheme", 17, 2, -1],
56
+ ["s-2003-j-19", "jupiter", "S/2003 J 19", 16, 2, -1],
57
+ ["valetudo", "jupiter", "Valetudo", 13, 2, -1],
58
+ ["s-2017-j-2", "jupiter", "S/2017 J 2", 15, 2, -1],
59
+ ["s-2017-j-3", "jupiter", "S/2017 J 3", 15, 2, -1],
60
+ ["pandia", "jupiter", "Pandia", 18, 2, -1],
61
+ ["s-2017-j-5", "jupiter", "S/2017 J 5", 16, 2, -1],
62
+ ["s-2017-j-6", "jupiter", "S/2017 J 6", 17, 2, -1],
63
+ ["s-2017-j-7", "jupiter", "S/2017 J 7", 16, 2, -1],
64
+ ["s-2017-j-8", "jupiter", "S/2017 J 8", 13, 2, -1],
65
+ ["s-2017-j-9", "jupiter", "S/2017 J 9", 20, 2, -1],
66
+ ["ersa", "jupiter", "Ersa", 21, 2, -1],
67
+ ["s-2011-j-1", "jupiter", "S/2011 J 1", 15, 2, -1],
68
+ ["s-2003-j-2", "jupiter", "S/2003 J 2", 15, 2, -1],
69
+ ["s-2003-j-4", "jupiter", "S/2003 J 4", 15, 2, -1],
70
+ ["s-2003-j-9", "jupiter", "S/2003 J 9", 14, 2, -1],
71
+ ["s-2003-j-10", "jupiter", "S/2003 J 10", 14, 2, -1],
72
+ ["s-2003-j-12", "jupiter", "S/2003 J 12", 13, 2, -1],
73
+ ["s-2003-j-16", "jupiter", "S/2003 J 16", 18, 2, -1],
74
+ ["s-2003-j-23", "jupiter", "S/2003 J 23", 15, 2, -1],
75
+ ["s-2003-j-24", "jupiter", "S/2003 J 24", 16, 2, -1],
76
+ ["s-2011-j-3", "jupiter", "S/2011 J 3", 18, 2, -1],
77
+ ["s-2018-j-2", "jupiter", "S/2018 J 2", 17, 2, -1],
78
+ ["s-2018-j-3", "jupiter", "S/2018 J 3", 12, 2, -1],
79
+ ["s-2021-j-1", "jupiter", "S/2021 J 1", 12, 2, -1],
80
+ ["s-2021-j-2", "jupiter", "S/2021 J 2", 12, 2, -1],
81
+ ["s-2021-j-3", "jupiter", "S/2021 J 3", 12, 2, -1],
82
+ ["s-2021-j-4", "jupiter", "S/2021 J 4", 11, 2, -1],
83
+ ["s-2021-j-5", "jupiter", "S/2021 J 5", 15, 2, -1],
84
+ ["s-2021-j-6", "jupiter", "S/2021 J 6", 12, 2, -1],
85
+ ["s-2016-j-3", "jupiter", "S/2016 J 3", 15, 2, -1],
86
+ ["s-2016-j-4", "jupiter", "S/2016 J 4", 12, 2, -1],
87
+ ["s-2018-j-4", "jupiter", "S/2018 J 4", 15, 2, -1],
88
+ ["s-2022-j-1", "jupiter", "S/2022 J 1", 13, 2, -1],
89
+ ["s-2022-j-2", "jupiter", "S/2022 J 2", 11, 2, -1],
90
+ ["s-2022-j-3", "jupiter", "S/2022 J 3", 12, 2, -1],
91
+ ["s-2017-j-10", "jupiter", "S/2017 J 10", 13, 2, -1],
92
+ ["s-2017-j-11", "jupiter", "S/2017 J 11", 13, 2, -1],
93
+ ["s-2011-j-4", "jupiter", "S/2011 J 4", 14, 2, -1],
94
+ ["s-2018-j-5", "jupiter", "S/2018 J 5", 13, 2, -1],
95
+ ["s-2024-j-1", "jupiter", "S/2024 J 1", 14, 2, -1],
96
+ ["s-2011-j-5", "jupiter", "S/2011 J 5", 12, 2, -1],
97
+ ["s-2010-j-3", "jupiter", "S/2010 J 3", 12, 2, -1],
98
+ ["s-2010-j-4", "jupiter", "S/2010 J 4", 12, 2, -1],
99
+ ["s-2010-j-5", "jupiter", "S/2010 J 5", 9, 2, -1],
100
+ ["s-2010-j-6", "jupiter", "S/2010 J 6", 17, 2, -1],
101
+ ["s-2011-j-6", "jupiter", "S/2011 J 6", 14, 2, -1],
102
+ ["s-2017-j-12", "jupiter", "S/2017 J 12", 12, 2, -1],
103
+ ["s-2017-j-13", "jupiter", "S/2017 J 13", 13, 2, -1],
104
+ ["s-2017-j-14", "jupiter", "S/2017 J 14", 13, 2, -1],
105
+ ["s-2017-j-15", "jupiter", "S/2017 J 15", 13, 2, -1],
106
+ ["s-2017-j-16", "jupiter", "S/2017 J 16", 12, 2, -1],
107
+ ["s-2017-j-17", "jupiter", "S/2017 J 17", 12, 2, -1],
108
+ ["s-2017-j-18", "jupiter", "S/2017 J 18", 15, 2, -1],
109
+ ["s-2021-j-7", "jupiter", "S/2021 J 7", 12, 2, -1],
110
+ ["s-2021-j-8", "jupiter", "S/2021 J 8", 14, 2, -1],
111
+ ["methone", "saturn", "Methone", 0, 3, -1],
112
+ ["polydeuces", "saturn", "Polydeuces", 0, 3, -1],
113
+ ["pallene", "saturn", "Pallene", 0, 3, -1],
114
+ ["anthe", "saturn", "Anthe", 0, 3, -1],
115
+ ["aegaeon", "saturn", "Aegaeon", 0, 3, -1],
116
+ ["s-2009-s-2", "saturn", "S/2009 S 2", 0, 3, -1],
117
+ ["ymir", "saturn", "Ymir", 121, 2, -1],
118
+ ["paaliaq", "saturn", "Paaliaq", 121, 2, -1],
119
+ ["tarvos", "saturn", "Tarvos", 76, 2, -1],
120
+ ["ijiraq", "saturn", "Ijiraq", 63, 2, -1],
121
+ ["suttungr", "saturn", "Suttungr", 42, 2, -1],
122
+ ["kiviuq", "saturn", "Kiviuq", 80, 2, -1],
123
+ ["mundilfari", "saturn", "Mundilfari", 42, 2, -1],
124
+ ["albiorix", "saturn", "Albiorix", 191, 2, -1],
125
+ ["skathi", "saturn", "Skathi", 46, 2, -1],
126
+ ["erriapus", "saturn", "Erriapus", 53, 2, -1],
127
+ ["siarnaq", "saturn", "Siarnaq", 252, 2, -1],
128
+ ["thrymr", "saturn", "Thrymr", 46, 2, -1],
129
+ ["narvi", "saturn", "Narvi", 42, 2, -1],
130
+ ["aegir", "saturn", "Aegir", 26, 2, -1],
131
+ ["bebhionn", "saturn", "Bebhionn", 33, 2, -1],
132
+ ["bergelmir", "saturn", "Bergelmir", 30, 2, -1],
133
+ ["bestla", "saturn", "Bestla", 40, 2, -1],
134
+ ["farbauti", "saturn", "Farbauti", 23, 2, -1],
135
+ ["fenrir", "saturn", "Fenrir", 23, 2, -1],
136
+ ["fornjot", "saturn", "Fornjot", 38, 2, -1],
137
+ ["hati", "saturn", "Hati", 28, 2, -1],
138
+ ["hyrrokkin", "saturn", "Hyrrokkin", 46, 2, -1],
139
+ ["kari", "saturn", "Kari", 42, 2, -1],
140
+ ["loge", "saturn", "Loge", 28, 2, -1],
141
+ ["skoll", "saturn", "Skoll", 28, 2, -1],
142
+ ["surtur", "saturn", "Surtur", 24, 2, -1],
143
+ ["jarnsaxa", "saturn", "Jarnsaxa", 25, 2, -1],
144
+ ["greip", "saturn", "Greip", 29, 2, -1],
145
+ ["tarqeq", "saturn", "Tarqeq", 36, 2, -1],
146
+ ["gridr", "saturn", "Gridr", 23, 2, -1],
147
+ ["angrboda", "saturn", "Angrboda", 20, 2, -1],
148
+ ["skrymir", "saturn", "Skrymir", 26, 2, -1],
149
+ ["gerd", "saturn", "Gerd", 22, 2, -1],
150
+ ["s-2004-s-26", "saturn", "S/2004 S 26", 24, 2, -1],
151
+ ["eggther", "saturn", "Eggther", 28, 2, -1],
152
+ ["s-2004-s-29", "saturn", "S/2004 S 29", 24, 2, -1],
153
+ ["beli", "saturn", "Beli", 20, 2, -1],
154
+ ["gunnlod", "saturn", "Gunnlod", 24, 2, -1],
155
+ ["thiazzi", "saturn", "Thiazzi", 22, 2, -1],
156
+ ["s-2004-s-34", "saturn", "S/2004 S 34", 20, 2, -1],
157
+ ["alvaldi", "saturn", "Alvaldi", 25, 2, -1],
158
+ ["geirrod", "saturn", "Geirrod", 22, 2, -1],
159
+ ["s-2004-s-31", "saturn", "S/2004 S 31", 25, 2, -1],
160
+ ["s-2004-s-24", "saturn", "S/2004 S 24", 21, 2, -1],
161
+ ["s-2004-s-28", "saturn", "S/2004 S 28", 23, 2, -1],
162
+ ["s-2004-s-21", "saturn", "S/2004 S 21", 19, 2, -1],
163
+ ["s-2004-s-36", "saturn", "S/2004 S 36", 19, 2, -1],
164
+ ["s-2004-s-37", "saturn", "S/2004 S 37", 22, 2, -1],
165
+ ["s-2004-s-39", "saturn", "S/2004 S 39", 20, 2, -1],
166
+ ["s-2004-s-7", "saturn", "S/2004 S 7", 26, 2, -1],
167
+ ["s-2004-s-12", "saturn", "S/2004 S 12", 22, 2, -1],
168
+ ["s-2004-s-13", "saturn", "S/2004 S 13", 18, 2, -1],
169
+ ["s-2004-s-17", "saturn", "S/2004 S 17", 21, 2, -1],
170
+ ["s-2006-s-1", "saturn", "S/2006 S 1", 24, 2, -1],
171
+ ["s-2006-s-3", "saturn", "S/2006 S 3", 24, 2, -1],
172
+ ["s-2007-s-2", "saturn", "S/2007 S 2", 25, 2, -1],
173
+ ["s-2007-s-3", "saturn", "S/2007 S 3", 24, 2, -1],
174
+ ["s-2019-s-1", "saturn", "S/2019 S 1", 29, 2, -1],
175
+ ["s-2019-s-2", "saturn", "S/2019 S 2", 17, 2, -1],
176
+ ["s-2019-s-3", "saturn", "S/2019 S 3", 19, 2, -1],
177
+ ["s-2020-s-1", "saturn", "S/2020 S 1", 22, 2, -1],
178
+ ["s-2020-s-2", "saturn", "S/2020 S 2", 14, 2, -1],
179
+ ["s-2004-s-40", "saturn", "S/2004 S 40", 18, 2, -1],
180
+ ["s-2006-s-9", "saturn", "S/2006 S 9", 17, 2, -1],
181
+ ["s-2007-s-5", "saturn", "S/2007 S 5", 19, 2, -1],
182
+ ["s-2020-s-3", "saturn", "S/2020 S 3", 17, 2, -1],
183
+ ["s-2019-s-4", "saturn", "S/2019 S 4", 17, 2, -1],
184
+ ["s-2004-s-41", "saturn", "S/2004 S 41", 18, 2, -1],
185
+ ["s-2020-s-4", "saturn", "S/2020 S 4", 13, 2, -1],
186
+ ["s-2020-s-5", "saturn", "S/2020 S 5", 16, 2, -1],
187
+ ["s-2007-s-6", "saturn", "S/2007 S 6", 17, 2, -1],
188
+ ["s-2004-s-42", "saturn", "S/2004 S 42", 20, 2, -1],
189
+ ["s-2006-s-10", "saturn", "S/2006 S 10", 17, 2, -1],
190
+ ["s-2019-s-5", "saturn", "S/2019 S 5", 15, 2, -1],
191
+ ["s-2004-s-43", "saturn", "S/2004 S 43", 18, 2, -1],
192
+ ["s-2004-s-44", "saturn", "S/2004 S 44", 23, 2, -1],
193
+ ["s-2004-s-45", "saturn", "S/2004 S 45", 21, 2, -1],
194
+ ["s-2006-s-11", "saturn", "S/2006 S 11", 17, 2, -1],
195
+ ["s-2006-s-12", "saturn", "S/2006 S 12", 19, 2, -1],
196
+ ["s-2019-s-6", "saturn", "S/2019 S 6", 24, 2, -1],
197
+ ["s-2006-s-13", "saturn", "S/2006 S 13", 20, 2, -1],
198
+ ["s-2019-s-7", "saturn", "S/2019 S 7", 18, 2, -1],
199
+ ["s-2019-s-8", "saturn", "S/2019 S 8", 18, 2, -1],
200
+ ["s-2019-s-9", "saturn", "S/2019 S 9", 18, 2, -1],
201
+ ["s-2004-s-46", "saturn", "S/2004 S 46", 17, 2, -1],
202
+ ["s-2019-s-10", "saturn", "S/2019 S 10", 15, 2, -1],
203
+ ["s-2004-s-47", "saturn", "S/2004 S 47", 18, 2, -1],
204
+ ["s-2019-s-11", "saturn", "S/2019 S 11", 18, 2, -1],
205
+ ["s-2006-s-14", "saturn", "S/2006 S 14", 17, 2, -1],
206
+ ["s-2019-s-12", "saturn", "S/2019 S 12", 18, 2, -1],
207
+ ["s-2020-s-6", "saturn", "S/2020 S 6", 16, 2, -1],
208
+ ["s-2019-s-13", "saturn", "S/2019 S 13", 15, 2, -1],
209
+ ["s-2005-s-4", "saturn", "S/2005 S 4", 24, 2, -1],
210
+ ["s-2007-s-7", "saturn", "S/2007 S 7", 19, 2, -1],
211
+ ["s-2007-s-8", "saturn", "S/2007 S 8", 21, 2, -1],
212
+ ["s-2020-s-7", "saturn", "S/2020 S 7", 15, 2, -1],
213
+ ["s-2019-s-14", "saturn", "S/2019 S 14", 18, 2, -1],
214
+ ["s-2019-s-15", "saturn", "S/2019 S 15", 16, 2, -1],
215
+ ["s-2005-s-5", "saturn", "S/2005 S 5", 17, 2, -1],
216
+ ["s-2006-s-15", "saturn", "S/2006 S 15", 19, 2, -1],
217
+ ["s-2006-s-16", "saturn", "S/2006 S 16", 17, 2, -1],
218
+ ["s-2006-s-17", "saturn", "S/2006 S 17", 21, 2, -1],
219
+ ["s-2004-s-48", "saturn", "S/2004 S 48", 21, 2, -1],
220
+ ["s-2020-s-8", "saturn", "S/2020 S 8", 17, 2, -1],
221
+ ["s-2004-s-49", "saturn", "S/2004 S 49", 21, 2, -1],
222
+ ["s-2004-s-50", "saturn", "S/2004 S 50", 17, 2, -1],
223
+ ["s-2006-s-18", "saturn", "S/2006 S 18", 20, 2, -1],
224
+ ["s-2019-s-16", "saturn", "S/2019 S 16", 15, 2, -1],
225
+ ["s-2019-s-17", "saturn", "S/2019 S 17", 22, 2, -1],
226
+ ["s-2019-s-18", "saturn", "S/2019 S 18", 16, 2, -1],
227
+ ["s-2019-s-19", "saturn", "S/2019 S 19", 17, 2, -1],
228
+ ["s-2019-s-20", "saturn", "S/2019 S 20", 15, 2, -1],
229
+ ["s-2006-s-19", "saturn", "S/2006 S 19", 20, 2, -1],
230
+ ["s-2004-s-51", "saturn", "S/2004 S 51", 20, 2, -1],
231
+ ["s-2020-s-9", "saturn", "S/2020 S 9", 21, 2, -1],
232
+ ["s-2004-s-52", "saturn", "S/2004 S 52", 17, 2, -1],
233
+ ["s-2007-s-9", "saturn", "S/2007 S 9", 20, 2, -1],
234
+ ["s-2004-s-53", "saturn", "S/2004 S 53", 19, 2, -1],
235
+ ["s-2020-s-10", "saturn", "S/2020 S 10", 14, 2, -1],
236
+ ["s-2019-s-21", "saturn", "S/2019 S 21", 19, 2, -1],
237
+ ["s-2006-s-20", "saturn", "S/2006 S 20", 23, 2, -1],
238
+ ["s-2004-s-54", "saturn", "S/2004 S 54", 20, 2, -1],
239
+ ["s-2004-s-55", "saturn", "S/2004 S 55", 17, 2, -1],
240
+ ["s-2004-s-56", "saturn", "S/2004 S 56", 23, 2, -1],
241
+ ["s-2004-s-57", "saturn", "S/2004 S 57", 19, 2, -1],
242
+ ["s-2004-s-58", "saturn", "S/2004 S 58", 23, 2, -1],
243
+ ["s-2004-s-59", "saturn", "S/2004 S 59", 17, 2, -1],
244
+ ["s-2004-s-60", "saturn", "S/2004 S 60", 17, 2, -1],
245
+ ["s-2004-s-61", "saturn", "S/2004 S 61", 18, 2, -1],
246
+ ["s-2005-s-6", "saturn", "S/2005 S 6", 18, 2, -1],
247
+ ["s-2005-s-7", "saturn", "S/2005 S 7", 17, 2, -1],
248
+ ["s-2006-s-21", "saturn", "S/2006 S 21", 15, 2, -1],
249
+ ["s-2006-s-22", "saturn", "S/2006 S 22", 15, 2, -1],
250
+ ["s-2006-s-23", "saturn", "S/2006 S 23", 17, 2, -1],
251
+ ["s-2006-s-24", "saturn", "S/2006 S 24", 15, 2, -1],
252
+ ["s-2006-s-25", "saturn", "S/2006 S 25", 17, 2, -1],
253
+ ["s-2006-s-26", "saturn", "S/2006 S 26", 17, 2, -1],
254
+ ["s-2006-s-27", "saturn", "S/2006 S 27", 18, 2, -1],
255
+ ["s-2006-s-28", "saturn", "S/2006 S 28", 18, 2, -1],
256
+ ["s-2006-s-29", "saturn", "S/2006 S 29", 17, 2, -1],
257
+ ["s-2007-s-10", "saturn", "S/2007 S 10", 20, 2, -1],
258
+ ["s-2007-s-11", "saturn", "S/2007 S 11", 18, 2, -1],
259
+ ["s-2019-s-22", "saturn", "S/2019 S 22", 15, 2, -1],
260
+ ["s-2019-s-23", "saturn", "S/2019 S 23", 15, 2, -1],
261
+ ["s-2019-s-24", "saturn", "S/2019 S 24", 20, 2, -1],
262
+ ["s-2019-s-25", "saturn", "S/2019 S 25", 17, 2, -1],
263
+ ["s-2019-s-26", "saturn", "S/2019 S 26", 17, 2, -1],
264
+ ["s-2019-s-27", "saturn", "S/2019 S 27", 15, 2, -1],
265
+ ["s-2019-s-28", "saturn", "S/2019 S 28", 18, 2, -1],
266
+ ["s-2019-s-29", "saturn", "S/2019 S 29", 17, 2, -1],
267
+ ["s-2019-s-30", "saturn", "S/2019 S 30", 15, 2, -1],
268
+ ["s-2019-s-31", "saturn", "S/2019 S 31", 17, 2, -1],
269
+ ["s-2019-s-32", "saturn", "S/2019 S 32", 24, 2, -1],
270
+ ["s-2019-s-33", "saturn", "S/2019 S 33", 18, 2, -1],
271
+ ["s-2019-s-34", "saturn", "S/2019 S 34", 15, 2, -1],
272
+ ["s-2019-s-35", "saturn", "S/2019 S 35", 15, 2, -1],
273
+ ["s-2019-s-36", "saturn", "S/2019 S 36", 15, 2, -1],
274
+ ["s-2019-s-37", "saturn", "S/2019 S 37", 15, 2, -1],
275
+ ["s-2019-s-38", "saturn", "S/2019 S 38", 15, 2, -1],
276
+ ["s-2019-s-39", "saturn", "S/2019 S 39", 15, 2, -1],
277
+ ["s-2019-s-40", "saturn", "S/2019 S 40", 16, 2, -1],
278
+ ["s-2019-s-41", "saturn", "S/2019 S 41", 14, 2, -1],
279
+ ["s-2019-s-42", "saturn", "S/2019 S 42", 22, 2, -1],
280
+ ["s-2019-s-43", "saturn", "S/2019 S 43", 17, 2, -1],
281
+ ["s-2019-s-44", "saturn", "S/2019 S 44", 17, 2, -1],
282
+ ["s-2020-s-11", "saturn", "S/2020 S 11", 14, 2, -1],
283
+ ["s-2020-s-12", "saturn", "S/2020 S 12", 15, 2, -1],
284
+ ["s-2020-s-13", "saturn", "S/2020 S 13", 17, 2, -1],
285
+ ["s-2020-s-14", "saturn", "S/2020 S 14", 15, 2, -1],
286
+ ["s-2020-s-15", "saturn", "S/2020 S 15", 15, 2, -1],
287
+ ["s-2020-s-16", "saturn", "S/2020 S 16", 17, 2, -1],
288
+ ["s-2020-s-17", "saturn", "S/2020 S 17", 18, 2, -1],
289
+ ["s-2020-s-18", "saturn", "S/2020 S 18", 16, 2, -1],
290
+ ["s-2020-s-19", "saturn", "S/2020 S 19", 15, 2, -1],
291
+ ["s-2020-s-20", "saturn", "S/2020 S 20", 16, 2, -1],
292
+ ["s-2020-s-21", "saturn", "S/2020 S 21", 15, 2, -1],
293
+ ["s-2020-s-22", "saturn", "S/2020 S 22", 16, 2, -1],
294
+ ["s-2020-s-23", "saturn", "S/2020 S 23", 16, 2, -1],
295
+ ["s-2020-s-24", "saturn", "S/2020 S 24", 15, 2, -1],
296
+ ["s-2020-s-25", "saturn", "S/2020 S 25", 13, 2, -1],
297
+ ["s-2020-s-26", "saturn", "S/2020 S 26", 16, 2, -1],
298
+ ["s-2020-s-27", "saturn", "S/2020 S 27", 17, 2, -1],
299
+ ["s-2020-s-28", "saturn", "S/2020 S 28", 15, 2, -1],
300
+ ["s-2020-s-29", "saturn", "S/2020 S 29", 15, 2, -1],
301
+ ["s-2020-s-30", "saturn", "S/2020 S 30", 15, 2, -1],
302
+ ["s-2020-s-31", "saturn", "S/2020 S 31", 17, 2, -1],
303
+ ["s-2020-s-32", "saturn", "S/2020 S 32", 15, 2, -1],
304
+ ["s-2020-s-33", "saturn", "S/2020 S 33", 14, 2, -1],
305
+ ["s-2020-s-34", "saturn", "S/2020 S 34", 17, 2, -1],
306
+ ["s-2020-s-35", "saturn", "S/2020 S 35", 15, 2, -1],
307
+ ["s-2020-s-36", "saturn", "S/2020 S 36", 16, 2, -1],
308
+ ["s-2020-s-37", "saturn", "S/2020 S 37", 16, 2, -1],
309
+ ["s-2020-s-38", "saturn", "S/2020 S 38", 20, 2, -1],
310
+ ["s-2020-s-39", "saturn", "S/2020 S 39", 15, 2, -1],
311
+ ["s-2020-s-40", "saturn", "S/2020 S 40", 16, 2, -1],
312
+ ["s-2020-s-41", "saturn", "S/2020 S 41", 16, 2, -1],
313
+ ["s-2020-s-42", "saturn", "S/2020 S 42", 15, 2, -1],
314
+ ["s-2020-s-43", "saturn", "S/2020 S 43", 14, 2, -1],
315
+ ["s-2020-s-44", "saturn", "S/2020 S 44", 15, 2, -1],
316
+ ["s-2023-s-1", "saturn", "S/2023 S 1", 16, 2, -1],
317
+ ["s-2023-s-2", "saturn", "S/2023 S 2", 15, 2, -1],
318
+ ["s-2023-s-3", "saturn", "S/2023 S 3", 17, 2, -1],
319
+ ["s-2023-s-4", "saturn", "S/2023 S 4", 17, 2, -1],
320
+ ["s-2023-s-5", "saturn", "S/2023 S 5", 15, 2, -1],
321
+ ["s-2023-s-6", "saturn", "S/2023 S 6", 17, 2, -1],
322
+ ["s-2023-s-7", "saturn", "S/2023 S 7", 22, 2, -1],
323
+ ["s-2023-s-8", "saturn", "S/2023 S 8", 15, 2, -1],
324
+ ["s-2023-s-9", "saturn", "S/2023 S 9", 15, 2, -1],
325
+ ["s-2023-s-10", "saturn", "S/2023 S 10", 15, 2, -1],
326
+ ["s-2023-s-11", "saturn", "S/2023 S 11", 14, 2, -1],
327
+ ["s-2023-s-12", "saturn", "S/2023 S 12", 14, 2, -1],
328
+ ["s-2023-s-13", "saturn", "S/2023 S 13", 16, 2, -1],
329
+ ["s-2023-s-14", "saturn", "S/2023 S 14", 15, 2, -1],
330
+ ["s-2023-s-15", "saturn", "S/2023 S 15", 15, 2, -1],
331
+ ["s-2023-s-16", "saturn", "S/2023 S 16", 15, 2, -1],
332
+ ["s-2023-s-17", "saturn", "S/2023 S 17", 13, 2, -1],
333
+ ["s-2023-s-18", "saturn", "S/2023 S 18", 15, 2, -1],
334
+ ["s-2023-s-19", "saturn", "S/2023 S 19", 13, 2, -1],
335
+ ["s-2023-s-20", "saturn", "S/2023 S 20", 15, 2, -1],
336
+ ["s-2023-s-21", "saturn", "S/2023 S 21", 14, 2, -1],
337
+ ["s-2023-s-22", "saturn", "S/2023 S 22", 18, 2, -1],
338
+ ["s-2023-s-23", "saturn", "S/2023 S 23", 17, 2, -1],
339
+ ["s-2023-s-24", "saturn", "S/2023 S 24", 15, 2, -1],
340
+ ["s-2023-s-25", "saturn", "S/2023 S 25", 13, 2, -1],
341
+ ["s-2023-s-26", "saturn", "S/2023 S 26", 14, 2, -1],
342
+ ["s-2023-s-27", "saturn", "S/2023 S 27", 17, 2, -1],
343
+ ["s-2023-s-28", "saturn", "S/2023 S 28", 14, 2, -1],
344
+ ["s-2023-s-29", "saturn", "S/2023 S 29", 15, 2, -1],
345
+ ["s-2023-s-30", "saturn", "S/2023 S 30", 15, 2, -1],
346
+ ["s-2023-s-31", "saturn", "S/2023 S 31", 13, 2, -1],
347
+ ["s-2023-s-32", "saturn", "S/2023 S 32", 12, 2, -1],
348
+ ["s-2023-s-33", "saturn", "S/2023 S 33", 15, 2, -1],
349
+ ["s-2023-s-34", "saturn", "S/2023 S 34", 16, 2, -1],
350
+ ["s-2023-s-35", "saturn", "S/2023 S 35", 15, 2, -1],
351
+ ["s-2023-s-36", "saturn", "S/2023 S 36", 15, 2, -1],
352
+ ["s-2023-s-37", "saturn", "S/2023 S 37", 14, 2, -1],
353
+ ["s-2023-s-38", "saturn", "S/2023 S 38", 13, 2, -1],
354
+ ["s-2023-s-39", "saturn", "S/2023 S 39", 15, 2, -1],
355
+ ["s-2023-s-40", "saturn", "S/2023 S 40", 14, 2, -1],
356
+ ["s-2023-s-41", "saturn", "S/2023 S 41", 15, 2, -1],
357
+ ["s-2023-s-42", "saturn", "S/2023 S 42", 15, 2, -1],
358
+ ["s-2023-s-43", "saturn", "S/2023 S 43", 17, 2, -1],
359
+ ["s-2023-s-44", "saturn", "S/2023 S 44", 16, 2, -1],
360
+ ["s-2023-s-45", "saturn", "S/2023 S 45", 14, 2, -1],
361
+ ["s-2023-s-46", "saturn", "S/2023 S 46", 15, 2, -1],
362
+ ["s-2023-s-47", "saturn", "S/2023 S 47", 13, 2, -1],
363
+ ["s-2023-s-48", "saturn", "S/2023 S 48", 16, 2, -1],
364
+ ["s-2023-s-49", "saturn", "S/2023 S 49", 15, 2, -1],
365
+ ["s-2023-s-50", "saturn", "S/2023 S 50", 14, 2, -1],
366
+ ["s-2020-s-45", "saturn", "S/2020 S 45", 16, 2, -1],
367
+ ["s-2020-s-46", "saturn", "S/2020 S 46", 15, 2, -1],
368
+ ["s-2020-s-47", "saturn", "S/2020 S 47", 15, 2, -1],
369
+ ["s-2020-s-48", "saturn", "S/2020 S 48", 15, 2, -1],
370
+ ["s-2023-s-51", "saturn", "S/2023 S 51", 15, 2, -1],
371
+ ["s-2023-s-52", "saturn", "S/2023 S 52", 14, 2, -1],
372
+ ["s-2023-s-53", "saturn", "S/2023 S 53", 15, 2, -1],
373
+ ["s-2023-s-54", "saturn", "S/2023 S 54", 13, 2, -1],
374
+ ["s-2023-s-55", "saturn", "S/2023 S 55", 14, 2, -1],
375
+ ["s-2023-s-56", "saturn", "S/2023 S 56", 13, 2, -1],
376
+ ["s-2023-s-57", "saturn", "S/2023 S 57", 12, 2, -1],
377
+ ["s-2020-s-49", "saturn", "S/2020 S 49", 14, 2, -1],
378
+ ["s-2023-s-58", "saturn", "S/2023 S 58", 14, 2, -1],
379
+ ["s-2023-s-59", "saturn", "S/2023 S 59", 14, 2, -1],
380
+ ["s-2023-s-60", "saturn", "S/2023 S 60", 15, 2, -1],
381
+ ["s-2023-s-61", "saturn", "S/2023 S 61", 16, 2, -1],
382
+ ["s-2023-s-62", "saturn", "S/2023 S 62", 14, 2, -1],
383
+ ["s-2023-s-63", "saturn", "S/2023 S 63", 21, 2, -1],
384
+ ["puck", "uranus", "Puck", 770, 1, 70],
385
+ ["cordelia", "uranus", "Cordelia", 130, 1, 70],
386
+ ["ophelia", "uranus", "Ophelia", 160, 1, 70],
387
+ ["bianca", "uranus", "Bianca", 220, 1, 70],
388
+ ["cressida", "uranus", "Cressida", 330, 1, 70],
389
+ ["desdemona", "uranus", "Desdemona", 290, 1, 70],
390
+ ["juliet", "uranus", "Juliet", 420, 1, 70],
391
+ ["portia", "uranus", "Portia", 550, 1, 70],
392
+ ["rosalind", "uranus", "Rosalind", 290, 1, 70],
393
+ ["belinda", "uranus", "Belinda", 340, 1, 70],
394
+ ["perdita", "uranus", "Perdita", 0, 3, -1],
395
+ ["mab", "uranus", "Mab", 0, 3, -1],
396
+ ["cupid", "uranus", "Cupid", 0, 3, -1],
397
+ ["s-2025-u-1", "uranus", "S/2025 U 1", 0, 3, -1],
398
+ ["caliban", "uranus", "Caliban", 382, 2, -1],
399
+ ["sycorax", "uranus", "Sycorax", 761, 2, -1],
400
+ ["prospero", "uranus", "Prospero", 252, 2, -1],
401
+ ["setebos", "uranus", "Setebos", 252, 2, -1],
402
+ ["stephano", "uranus", "Stephano", 159, 2, -1],
403
+ ["trinculo", "uranus", "Trinculo", 96, 2, -1],
404
+ ["francisco", "uranus", "Francisco", 87, 2, -1],
405
+ ["margaret", "uranus", "Margaret", 96, 2, -1],
406
+ ["ferdinand", "uranus", "Ferdinand", 110, 2, -1],
407
+ ["s-2023-u-1", "uranus", "S/2023 U 1", 60, 2, -1],
408
+ ["naiad", "neptune", "Naiad", 290, 0, 60],
409
+ ["thalassa", "neptune", "Thalassa", 400, 0, 60],
410
+ ["despina", "neptune", "Despina", 740, 0, 60],
411
+ ["galatea", "neptune", "Galatea", 790, 0, 60],
412
+ ["hippocamp", "neptune", "Hippocamp", 0, 3, -1],
413
+ ["halimede", "neptune", "Halimede", 348, 2, -1],
414
+ ["psamathe", "neptune", "Psamathe", 230, 2, -1],
415
+ ["sao", "neptune", "Sao", 210, 2, -1],
416
+ ["laomedeia", "neptune", "Laomedeia", 230, 2, -1],
417
+ ["neso", "neptune", "Neso", 241, 2, -1],
418
+ ["s-2002-n-5", "neptune", "S/2002 N 5", 191, 2, -1],
419
+ ["s-2021-n-1", "neptune", "S/2021 N 1", 126, 2, -1],
420
+ ["styx", "pluto", "Styx", 52, 0, -1],
421
+ ["kerberos", "pluto", "Kerberos", 60, 0, -1],
422
+ ["s-2009-s-1", "saturn", "S/2009 S 1", 0, 3, -1],
423
+ ["weywot", "quaoar", "Weywot", 0, 3, -1],
424
+ ["s-2015-136472-1", "makemake", "S/2015 (136472) 1", 0, 3, -1],
425
+ ["xiangliu", "gonggong", "Xiangliu", 0, 3, -1],
426
+ ];
package/dist/element.d.ts CHANGED
@@ -32,6 +32,7 @@ export type WakuseiState = "line" | "loading" | "still" | "live" | "lost" | "una
32
32
  * 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),
33
33
  * `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),
34
34
  * `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`).
35
+ * A `body` that names a catalogue moon the package does not draw in full (such as `himalia`, or `S/2003 J 18`) is an estimated rock: the size is the catalogue radius, the shape is a guess from that id, and the picture says the shape is estimated. A size worked out from the brightness says so. Any other unknown name stays the Earth.
35
36
  *
36
37
  * It carries the shared view controls itself: a drag turns the body, two fingers pinch, Ctrl, Command or Alt with the wheel zooms (the plain wheel scrolls the page at Fit), the arrow keys, + and - and 0 work once it is focused.
37
38
  * `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.
package/dist/element.js CHANGED
@@ -19,6 +19,7 @@ export { TEXTURE_BASE, TEXTURE_FAR_BASE, TILES_BASE } from "./scene/textures.js"
19
19
  import { mapWidthOf, ringWidthOf, zoomLimit } from "./scene/reach.js";
20
20
  import { viewPose } from "./scene/tumble.js";
21
21
  import { createBodyItem } from "./scene/body.js";
22
+ import { estimatedRock, estimatedRockLine } from "./scene/estimated-rock.js";
22
23
  import { NAME_LABEL_ATTRIBUTES, nameLabelKey, nameLabelText, readNameLabel } from "./scene/name-label.js";
23
24
  import { delegates, onRegister } from "./scene/store.js";
24
25
  import { setThreeLoader, takeRenderer } from "./scene/shared.js";
@@ -72,13 +73,17 @@ const TEMPLATE = `<style>
72
73
  #cutaway li { display: grid; grid-template-columns: 12px 1fr; gap: 2px 8px; align-items: baseline; }
73
74
  #cutaway [data-swatch] { width: 12px; height: 12px; }
74
75
  #stage svg { display: block; width: 100%; height: 100%; }
75
- </style><div id="stage"></div><ol id="cutaway" hidden></ol>`;
76
+ #estimate { position: absolute; z-index: 2; left: 2px; right: 2px; bottom: 1px; margin: 0; max-height: 2.4em; overflow: hidden; text-align: center; font: 10px/1.2 system-ui, sans-serif; color: inherit; pointer-events: none; }
77
+ #estimate[hidden] { display: none; }
78
+ :host([data-shape="estimated"]) #stage { bottom: 22px; }
79
+ </style><div id="stage"></div><p id="estimate" hidden></p><ol id="cutaway" hidden></ol>`;
76
80
  /**
77
81
  * The `<wakusei-body>` custom element: a body of the solar system, drawn in a look.
78
82
  *
79
83
  * 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),
80
84
  * `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),
81
85
  * `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`).
86
+ * A `body` that names a catalogue moon the package does not draw in full (such as `himalia`, or `S/2003 J 18`) is an estimated rock: the size is the catalogue radius, the shape is a guess from that id, and the picture says the shape is estimated. A size worked out from the brightness says so. Any other unknown name stays the Earth.
82
87
  *
83
88
  * It carries the shared view controls itself: a drag turns the body, two fingers pinch, Ctrl, Command or Alt with the wheel zooms (the plain wheel scrolls the page at Fit), the arrow keys, + and - and 0 work once it is focused.
84
89
  * `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.
@@ -686,9 +691,18 @@ export class WakuseiBody extends HTMLElement {
686
691
  }
687
692
  return this.#starMade;
688
693
  }
689
- /** The facts of what is drawn: the body's, or the star's (the Sun's with its own size, shape and outlines). */
694
+ /** A catalogue moon this element draws as an estimated rock, or `null` when `body` is a body the package draws in full (or not a moon). */
695
+ #estimate() {
696
+ if (this.hasAttribute("star"))
697
+ return null;
698
+ const id = this.getAttribute("body");
699
+ if (id === null || id in BODIES)
700
+ return null;
701
+ return estimatedRock(id);
702
+ }
703
+ /** The facts of what is drawn: the body's, the star's (the Sun's with its own size, shape and outlines), or an estimated rock's. */
690
704
  #facts() {
691
- return this.#star()?.facts ?? BODIES[this.body];
705
+ return this.#star()?.facts ?? this.#estimate()?.facts ?? BODIES[this.body];
692
706
  }
693
707
  // --- the clock ------------------------------------------------------------------------------------------------------------------------------------
694
708
  #clockFromAttributes() {
@@ -793,7 +807,7 @@ export class WakuseiBody extends HTMLElement {
793
807
  #limits() {
794
808
  if (this.look === "line")
795
809
  return LINE_LIMITS;
796
- if (this.hasAttribute("star"))
810
+ if (this.hasAttribute("star") || this.#estimate() !== null)
797
811
  return { zoomMin: 0.1, zoomMax: zoomLimit(1, 0, false), tiltMax: 90 };
798
812
  const moons = this.hasAttribute("moons");
799
813
  const look = lookOf(this.body);
@@ -901,7 +915,7 @@ export class WakuseiBody extends HTMLElement {
901
915
  }
902
916
  /** The picture's identity: a new one disposes the view and builds it again, so a cutaway gives its shells back when it is turned off. */
903
917
  #signature() {
904
- return `${this.#star()?.key ?? this.body}|${this.look}|${this.#cutawayOn() ? "cut" : "whole"}`;
918
+ return `${this.#star()?.key ?? this.#estimate()?.id ?? this.body}|${this.look}|${this.#cutawayOn() ? "cut" : "whole"}`;
905
919
  }
906
920
  #cutawayOn() {
907
921
  const value = this.getAttribute("cutaway");
@@ -953,6 +967,7 @@ export class WakuseiBody extends HTMLElement {
953
967
  if (!this.isConnected)
954
968
  return;
955
969
  this.#syncLegend();
970
+ this.#syncEstimate();
956
971
  this.setAttribute("aria-label", this.#label());
957
972
  if (this.hasAttribute("size"))
958
973
  this.style.setProperty("--wakusei-size", `${num(this.getAttribute("size"), 320)}px`);
@@ -962,7 +977,7 @@ export class WakuseiBody extends HTMLElement {
962
977
  this.#set("line");
963
978
  return;
964
979
  }
965
- const delegate = this.look === "line" ? delegates.get(this.body) : undefined;
980
+ const delegate = this.#estimate() === null && this.look === "line" ? delegates.get(this.body) : undefined;
966
981
  if (delegate !== undefined && (await this.#delegated(delegate)))
967
982
  return;
968
983
  const undelegated = this.#delegateEl !== undefined;
@@ -1018,9 +1033,36 @@ export class WakuseiBody extends HTMLElement {
1018
1033
  this.addEventListener(name, this.#hover);
1019
1034
  }
1020
1035
  }
1036
+ #syncEstimate() {
1037
+ const rock = this.#estimate();
1038
+ const note = this.shadowRoot?.querySelector("#estimate");
1039
+ if (rock === null) {
1040
+ this.removeAttribute("data-shape");
1041
+ this.removeAttribute("data-size");
1042
+ this.removeAttribute("data-estimated");
1043
+ if (note instanceof HTMLElement) {
1044
+ note.hidden = true;
1045
+ note.textContent = "";
1046
+ }
1047
+ return;
1048
+ }
1049
+ this.dataset.shape = "estimated";
1050
+ this.dataset.size = rock.sizeFrom;
1051
+ this.dataset.estimated = rock.id;
1052
+ if (note instanceof HTMLElement) {
1053
+ note.hidden = false;
1054
+ note.textContent = this.getAttribute("lang") === "ja" ? rock.line.ja : rock.line.en;
1055
+ note.title = this.getAttribute("lang") === "ja" ? rock.legend.ja : rock.legend.en;
1056
+ }
1057
+ }
1021
1058
  #label() {
1022
1059
  const star = this.#star();
1023
1060
  const ja = this.getAttribute("lang") === "ja";
1061
+ const rock = this.#estimate();
1062
+ if (rock !== null) {
1063
+ const note = ja ? rock.note.ja : rock.note.en;
1064
+ return ja ? `${rock.label}。${note}` : `${rock.label}. ${note}`;
1065
+ }
1024
1066
  if (star !== undefined)
1025
1067
  return this.look === "line" ? (ja ? `${star.facts.name.ja}の線画。${star.disclaimer.ja}` : `${star.facts.name.en}, line drawing. ${star.disclaimer.en}`) : ja ? `${star.facts.name.ja}の陰影つきの絵。${star.disclaimer.ja}` : `${star.facts.name.en}, shaded star. ${star.disclaimer.en}`;
1026
1068
  const f = BODIES[this.body];
@@ -1028,6 +1070,11 @@ export class WakuseiBody extends HTMLElement {
1028
1070
  return ja ? `${f.name.ja}の${looks[this.look]}` : `${f.name.en}, ${looks[this.look]}`;
1029
1071
  }
1030
1072
  #drawLine() {
1073
+ const rock = this.#estimate();
1074
+ if (rock !== null) {
1075
+ this.#stage.innerHTML = estimatedRockLine(rock, 480);
1076
+ return;
1077
+ }
1031
1078
  const r = this.#request();
1032
1079
  const frame = this.#frameNow();
1033
1080
  const scaleTo = this.getAttribute("scale-to");
@@ -1052,7 +1099,7 @@ export class WakuseiBody extends HTMLElement {
1052
1099
  }
1053
1100
  #key(state) {
1054
1101
  const moons = (state.moons ?? []).map((m) => `${m.id}:${m.x.toFixed(1)},${m.y.toFixed(1)}`).join(";");
1055
- 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}|${this.#labelKey()}`;
1102
+ return `${this.#star()?.key ?? this.#estimate()?.id ?? 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}|${this.#labelKey()}`;
1056
1103
  }
1057
1104
  // Replacing a view keeps the renderer lease; leaving 3D gives it back.
1058
1105
  #disposeView(releaseRenderer = false) {
@@ -1084,11 +1131,12 @@ export class WakuseiBody extends HTMLElement {
1084
1131
  this.#stilled = false;
1085
1132
  this.#stage.innerHTML = "";
1086
1133
  const star = this.#star();
1134
+ const rock = this.#estimate();
1087
1135
  const item = createBodyItem({
1088
1136
  id: this.body,
1089
- ...(star === undefined ? {} : { shaded: star.look, facts: star.facts, assetKey: `star:${star.key}` }),
1137
+ ...(star !== undefined ? { shaded: star.look, facts: star.facts, assetKey: `star:${star.key}` } : rock === null ? {} : { shaded: rock.look, facts: rock.facts, assetKey: `rock:${rock.id}`, coarse: true }),
1090
1138
  look: this.look === "illustrated" ? "realistic" : "painted",
1091
- cutaway: this.#cutawayOn(),
1139
+ cutaway: rock === null && this.#cutawayOn(),
1092
1140
  onShells: (count) => {
1093
1141
  this.dataset.shells = String(count);
1094
1142
  },
@@ -64,6 +64,8 @@ export interface BodyItemOptions {
64
64
  facts?: BodyFacts;
65
65
  /** What the renderer keeps this body's materials under, instead of `id`: a star's key, so two stars do not share a program. */
66
66
  assetKey?: string;
67
+ /** A coarse globe for an estimated rock: 48 by 24 on a large picture, 24 by 12 on a card, 12 by 6 when it is small. A page may hold every moon of a planet. */
68
+ coarse?: boolean;
67
69
  look: "realistic" | "painted";
68
70
  /** A key that changes whenever the picture would: the renderer keeps one still for each key. */
69
71
  key: string;
@@ -46,6 +46,13 @@ export function makeBodyMaterial(T, look, painted) {
46
46
  uRingOn: { value: 0 },
47
47
  uRingTex: { value: null },
48
48
  uMap: { value: null },
49
+ ...(look.rock === undefined
50
+ ? {}
51
+ : {
52
+ uRockSeed: { value: look.rock.seed },
53
+ uRockDark: { value: new T.Vector3(...look.rock.dark) },
54
+ uRockLight: { value: new T.Vector3(...look.rock.light) },
55
+ }),
49
56
  },
50
57
  });
51
58
  }
@@ -72,8 +79,11 @@ export function createBodyItem(options) {
72
79
  const wantPainted = (options.look === "painted" || look.mapped === true) && look.painted !== undefined;
73
80
  // a moon with a published shape model is the globe moved to its radii (its table is a chunk of its own, waited for here), and then needs no stretching to an ellipsoid
74
81
  const shapeTable = look.shape === undefined ? undefined : await look.shape().catch(() => undefined);
75
- // a big picture gets a globe of 192 by 96 steps (as the unshaped sphere has), a tile or a card one of 96 by 48: a page can hold a dozen moons, and the arrays of a globe stay in the page
76
- const grid = Math.min(width, height) >= 300 ? { lon: 192, lat: 96 } : { lon: 96, lat: 48 };
82
+ // a big picture gets a globe of 192 by 96 steps (as the unshaped sphere has), a tile or a card one of 96 by 48: a page can hold a dozen moons, and the arrays of a globe stay in the page.
83
+ // an estimated rock is coarser: 48 by 24 on a large picture, 24 by 12 on a card, 12 by 6 when it is small, so a page can hold every moon of Jupiter
84
+ const grid = options.coarse === true
85
+ ? (Math.min(width, height) >= 280 ? { lon: 48, lat: 24 } : Math.min(width, height) >= 140 ? { lon: 24, lat: 12 } : { lon: 12, lat: 6 })
86
+ : (Math.min(width, height) >= 300 ? { lon: 192, lat: 96 } : { lon: 96, lat: 48 });
77
87
  const geometry = shapeTable === undefined ? assets.acquire("wk:sphere", () => new T.SphereGeometry(1, 192, 96), (g) => g.dispose()) : assets.acquire(`wk:shape:${held}:${grid.lon}`, () => shapeGeometry(T, shapeTable, facts.radiusKm, grid), (g) => g.dispose());
78
88
  const shader = assets.acquire(`wk:body:${held}:r`, () => makeBodyMaterial(T, look, false), (m) => m.dispose());
79
89
  const paintedMaterial = wantPainted ? assets.acquire(`wk:body:${held}:p`, () => makeBodyMaterial(T, look, true), (m) => m.dispose()) : undefined;
@@ -0,0 +1,57 @@
1
+ import { type BodyFacts, type HostId } from "../facts.ts";
2
+ import type { BodyLook } from "./look.ts";
3
+ import { type ShapeTable } from "./shape.ts";
4
+ /** Where a catalogue radius comes from. `derived` was worked out from the brightness. `unknown` means the catalogue gives no size, and the rock is drawn at 1 km so the poster still has a picture. */
5
+ export type EstimatedSize = "measured" | "sheet" | "derived" | "unknown";
6
+ /** The colour class of an albedo. Unknown is neutral grey. */
7
+ export type AlbedoTone = "dark" | "mid" | "bright" | "grey";
8
+ /** One estimated rock, ready for `<wakusei-body>`. */
9
+ export interface EstimatedRock {
10
+ id: string;
11
+ host: HostId;
12
+ label: string;
13
+ /** The mean radius in kilometres. 1 when the catalogue gives no size. */
14
+ radiusKm: number;
15
+ sizeFrom: EstimatedSize;
16
+ albedo: number | null;
17
+ tone: AlbedoTone;
18
+ /** The flat colour of the line drawing, `#rrggbb`. */
19
+ colour: string;
20
+ /** The seed of the shape and of the craters. The same id has the same seed. */
21
+ seed: number;
22
+ facts: BodyFacts;
23
+ look: BodyLook;
24
+ /** The words under the picture: the shape is always a guess, and a derived or unknown size says so. */
25
+ note: {
26
+ en: string;
27
+ ja: string;
28
+ };
29
+ /** The short line drawn on the picture: the catalogue name and a star. The longer `note` is the accessible name. */
30
+ line: {
31
+ en: string;
32
+ ja: string;
33
+ };
34
+ /** One line for a picture that shows estimated moons: what the star means. */
35
+ legend: {
36
+ en: string;
37
+ ja: string;
38
+ };
39
+ /** The guessed shape. The same object every time for this rock. */
40
+ table: ShapeTable;
41
+ }
42
+ /**
43
+ * One surface shader for every estimated rock. `uRockSeed`, `uRockDark` and `uRockLight` are that moon's own, set on its material, so the page compiles this once.
44
+ */
45
+ export declare const ESTIMATED_SURFACE = "\nuniform float uRockSeed;\nuniform vec3 uRockDark;\nuniform vec3 uRockLight;\nvec4 surface(vec3 p) {\n float h1 = craters(p, 3.0, 0.85, uRockSeed);\n float h2 = craters(p, 8.0, 0.55, uRockSeed + 7.0) * 0.6;\n float h3 = craters(p, 18.0, 0.40, uRockSeed + 3.0) * 0.3;\n float h = h1 + h2 + h3;\n float hr = h1 * reliefShare(p, 3.0) + h2 * reliefShare(p, 8.0) + h3 * reliefShare(p, 18.0);\n float tone = fbm(p * 2.4 + uRockSeed);\n vec3 col = mix(uRockDark, uRockLight, smoothstep(0.25, 0.75, tone));\n col *= 1.0 + 0.9 * h;\n return vec4(col, hr);\n}";
46
+ /** The albedo class: dark under 0.08, mid under 0.25, bright from there, and grey when the albedo is unknown. */
47
+ export declare function albedoTone(albedo: number | null): AlbedoTone;
48
+ /** How far the longest radius is past the shortest. A potato is well above 1; a globe is near 1. */
49
+ export declare function rockSpread(seed: number, radiusKm: number): number;
50
+ /**
51
+ * The estimated rock for a catalogue id, a name or a designation (`himalia`, `Himalia`, `S/2003 J 18`). `null` for a body the package draws in full, and for a name that is not a moon.
52
+ *
53
+ * @param query - The catalogue id, name or designation.
54
+ * @returns The rock, or `null`.
55
+ */
56
+ export declare function estimatedRock(query: string): EstimatedRock | null;
57
+ export declare function estimatedRockLine(rock: EstimatedRock, size: number): string;
@@ -0,0 +1,293 @@
1
+ // An irregular moon the package does not draw in full: a coarse rock, sized from the catalogue, coloured from its albedo, with a shape guessed from its id.
2
+ // The same id always builds the same rock. A full moon (one in the body's table) is not one of these. Nothing here draws; the element asks.
3
+ import { BODIES } from "../facts.js";
4
+ import { ESTIMATED_MOONS } from "../data/estimated-moons.js";
5
+ import { shapeRadii } from "./shape.js";
6
+ const SIZES = ["measured", "sheet", "derived", "unknown"];
7
+ const TONES = {
8
+ grey: { colour: "#6e7278", dark: [0.28, 0.29, 0.31], light: [0.46, 0.48, 0.51] },
9
+ dark: { colour: "#3a342e", dark: [0.08, 0.07, 0.06], light: [0.2, 0.18, 0.16] },
10
+ mid: { colour: "#8a8174", dark: [0.38, 0.34, 0.28], light: [0.62, 0.58, 0.5] },
11
+ bright: { colour: "#d5d8dc", dark: [0.72, 0.74, 0.77], light: [0.94, 0.95, 0.97] },
12
+ };
13
+ /**
14
+ * One surface shader for every estimated rock. `uRockSeed`, `uRockDark` and `uRockLight` are that moon's own, set on its material, so the page compiles this once.
15
+ */
16
+ export const ESTIMATED_SURFACE = `
17
+ uniform float uRockSeed;
18
+ uniform vec3 uRockDark;
19
+ uniform vec3 uRockLight;
20
+ vec4 surface(vec3 p) {
21
+ float h1 = craters(p, 3.0, 0.85, uRockSeed);
22
+ float h2 = craters(p, 8.0, 0.55, uRockSeed + 7.0) * 0.6;
23
+ float h3 = craters(p, 18.0, 0.40, uRockSeed + 3.0) * 0.3;
24
+ float h = h1 + h2 + h3;
25
+ float hr = h1 * reliefShare(p, 3.0) + h2 * reliefShare(p, 8.0) + h3 * reliefShare(p, 18.0);
26
+ float tone = fbm(p * 2.4 + uRockSeed);
27
+ vec3 col = mix(uRockDark, uRockLight, smoothstep(0.25, 0.75, tone));
28
+ col *= 1.0 + 0.9 * h;
29
+ return vec4(col, hr);
30
+ }`;
31
+ /** The albedo class: dark under 0.08, mid under 0.25, bright from there, and grey when the albedo is unknown. */
32
+ export function albedoTone(albedo) {
33
+ if (albedo === null || !Number.isFinite(albedo))
34
+ return "grey";
35
+ if (albedo < 0.08)
36
+ return "dark";
37
+ if (albedo < 0.25)
38
+ return "mid";
39
+ return "bright";
40
+ }
41
+ const plain = (value) => value.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]/g, "");
42
+ function hashId(id) {
43
+ let h = 2166136261;
44
+ for (let i = 0; i < id.length; i += 1) {
45
+ h ^= id.charCodeAt(i);
46
+ h = Math.imul(h, 16777619);
47
+ }
48
+ return h >>> 0;
49
+ }
50
+ function hash01(seed, i, salt) {
51
+ let h = Math.imul(seed ^ Math.imul(i + 1, 0x9e3779b1), 0x85ebca6b) ^ Math.imul(salt, 0xc2b2ae35);
52
+ h = Math.imul(h ^ (h >>> 16), 0x7feb352d);
53
+ h = Math.imul(h ^ (h >>> 15), 0x846ca68b);
54
+ return ((h ^ (h >>> 16)) >>> 0) / 4294967296;
55
+ }
56
+ /** A lump in about -1 to 1, the same for the same seed and direction. */
57
+ function noise(seed, x, y, z) {
58
+ let n = 0;
59
+ let w = 0;
60
+ for (let i = 0; i < 4; i += 1) {
61
+ const cx = hash01(seed, i, 1) * 2 - 1;
62
+ const cy = hash01(seed, i, 2) * 2 - 1;
63
+ const cz = hash01(seed, i, 3) * 2 - 1;
64
+ const amp = 0.55 + hash01(seed, i, 4);
65
+ n += (amp * (x * cx + y * cy + z * cz)) / (Math.hypot(cx, cy, cz) || 1);
66
+ w += amp;
67
+ }
68
+ return n / w;
69
+ }
70
+ const clampLump = (value) => Math.min(1.7, Math.max(0.45, value));
71
+ /** Turn a direction by this rock's seed, so the long axis does not point the same way on every moon. */
72
+ function spin(seed, x, y, z) {
73
+ const yaw = hash01(seed, 8, 31) * Math.PI * 2;
74
+ const pitch = (hash01(seed, 9, 32) - 0.5) * Math.PI;
75
+ const roll = hash01(seed, 10, 33) * Math.PI * 2;
76
+ const cy = Math.cos(yaw);
77
+ const sy = Math.sin(yaw);
78
+ const x1 = cy * x + sy * z;
79
+ const z1 = -sy * x + cy * z;
80
+ const cp = Math.cos(pitch);
81
+ const sp = Math.sin(pitch);
82
+ const y2 = cp * y - sp * z1;
83
+ const z2 = sp * y + cp * z1;
84
+ const cr = Math.cos(roll);
85
+ const sr = Math.sin(roll);
86
+ return [cr * x1 - sr * y2, sr * x1 + cr * y2, z2];
87
+ }
88
+ /** How round the rock is: 0 is a potato (under 100 km), 1 is a globe (200 km and up), and the sizes between blend. */
89
+ function roundness(radiusKm) {
90
+ if (radiusKm >= 200)
91
+ return 1;
92
+ if (radiusKm <= 100)
93
+ return 0;
94
+ return (radiusKm - 100) / 100;
95
+ }
96
+ /**
97
+ * The three axes, longest first. A small moon is about 1 : 0.6–0.9 : 0.5–0.8, from its seed. A large one is 1 : 1 : 1.
98
+ */
99
+ function axesOf(seed, radiusKm) {
100
+ const round = roundness(radiusKm);
101
+ const b0 = 0.6 + 0.3 * hash01(seed, 1, 21);
102
+ const c0 = 0.5 + 0.3 * hash01(seed, 2, 22);
103
+ const b = Math.max(b0, c0);
104
+ const c = Math.min(b0, c0);
105
+ return [1, b + (1 - b) * round, c + (1 - c) * round];
106
+ }
107
+ /** The radius of an ellipsoid in a direction, as a fraction of its longest axis. */
108
+ function ellipsoid(x, y, z, axes) {
109
+ const t = (x * x) / (axes[0] * axes[0]) + (y * y) / (axes[1] * axes[1]) + (z * z) / (axes[2] * axes[2]);
110
+ return t > 0 ? 1 / Math.sqrt(t) : 1;
111
+ }
112
+ /**
113
+ * A table of radii whose mean is `radiusKm`. A small moon is elongated, a large one nearly round, and both carry the same lumps. The poles are one radius each.
114
+ * The steps fit in 16 bits: the unit is chosen from twelve times the radius, which covers a potato's gap between neighbours.
115
+ */
116
+ function shapeOf(seed, radiusKm) {
117
+ const lon = 16;
118
+ const lat = 8;
119
+ const rows = lat + 1;
120
+ const axes = axesOf(seed, radiusKm);
121
+ const lump = 0.35 * (1 - roundness(radiusKm));
122
+ const raw = [];
123
+ const at = (x, y, z) => {
124
+ const [rx, ry, rz] = spin(seed, x, y, z);
125
+ return clampLump(1 + lump * noise(seed, rx, ry, rz)) * ellipsoid(rx, ry, rz, axes);
126
+ };
127
+ for (let row = 0; row < rows; row += 1) {
128
+ const phi = (Math.PI * row) / lat;
129
+ const st = Math.sin(phi);
130
+ const z = Math.cos(phi);
131
+ const pole = row === 0 || row === lat ? at(0, 0, row === 0 ? 1 : -1) : undefined;
132
+ for (let column = 0; column < lon; column += 1) {
133
+ if (pole !== undefined) {
134
+ raw.push(pole);
135
+ continue;
136
+ }
137
+ const theta = (2 * Math.PI * column) / lon;
138
+ raw.push(at(st * Math.cos(theta), st * Math.sin(theta), z));
139
+ }
140
+ }
141
+ const mean = raw.reduce((sum, value) => sum + value, 0) / raw.length;
142
+ const km = raw.map((value) => (value / mean) * radiusKm);
143
+ const unit = Math.max(1, Math.floor(30000 / (12 * radiusKm + 1)));
144
+ const whole = km.map((value) => Math.round(value * unit));
145
+ const steps = new Int16Array(lon * rows);
146
+ for (let row = 0; row < rows; row += 1) {
147
+ for (let column = 0; column < lon; column += 1) {
148
+ const i = row * lon + column;
149
+ const above = row > 0 ? whole[i - lon] : 0;
150
+ const left = column > 0 ? whole[i - 1] : 0;
151
+ const aboveLeft = row > 0 && column > 0 ? whole[i - lon - 1] : 0;
152
+ const predicted = column === 0 ? above : row === 0 ? left : left + above - aboveLeft;
153
+ steps[i] = whole[i] - predicted;
154
+ }
155
+ }
156
+ const bytes = new Uint8Array(steps.buffer, steps.byteOffset, steps.byteLength);
157
+ let binary = "";
158
+ for (const byte of bytes)
159
+ binary += String.fromCharCode(byte);
160
+ return { lon, lat, unit, steps: btoa(binary) };
161
+ }
162
+ /** How far the longest radius is past the shortest. A potato is well above 1; a globe is near 1. */
163
+ export function rockSpread(seed, radiusKm) {
164
+ const radii = shapeRadii(shapeOf(seed, radiusKm));
165
+ let low = Number.POSITIVE_INFINITY;
166
+ let high = 0;
167
+ for (const radius of radii) {
168
+ if (radius < low)
169
+ low = radius;
170
+ if (radius > high)
171
+ high = radius;
172
+ }
173
+ return high / low;
174
+ }
175
+ function notes(size) {
176
+ if (size === "derived")
177
+ return { en: "Shape estimated. Size estimated from brightness.", ja: "形は推定。大きさは明るさからの推定" };
178
+ if (size === "unknown")
179
+ return { en: "Shape estimated. Size unknown.", ja: "形は推定。大きさは不明" };
180
+ return { en: "Shape estimated.", ja: "形は推定" };
181
+ }
182
+ let byKey;
183
+ function index() {
184
+ if (byKey !== undefined)
185
+ return byKey;
186
+ byKey = new Map();
187
+ for (const row of ESTIMATED_MOONS)
188
+ byKey.set(plain(row[2]), row);
189
+ for (const row of ESTIMATED_MOONS)
190
+ byKey.set(plain(row[0]), row);
191
+ return byKey;
192
+ }
193
+ const cache = new Map();
194
+ function build(row) {
195
+ const [id, hostName, label, tenths, sizeCode, albedoThousandths] = row;
196
+ const host = hostName;
197
+ const sizeFrom = SIZES[sizeCode];
198
+ const radiusKm = tenths > 0 ? tenths / 10 : 1;
199
+ const albedo = albedoThousandths < 0 ? null : albedoThousandths / 1000;
200
+ const tone = albedoTone(albedo);
201
+ const paint = TONES[tone];
202
+ const seed = hashId(id);
203
+ const table = shapeOf(seed, radiusKm);
204
+ const facts = {
205
+ id: host,
206
+ kind: "moon",
207
+ parent: host,
208
+ name: { en: label, ja: label },
209
+ radiusKm,
210
+ flattening: 0,
211
+ tiltDeg: 0,
212
+ pole: { ra: hash01(seed, 3, 41) * 360, dec: 30 + hash01(seed, 4, 42) * 60 },
213
+ prime: { w0: hash01(seed, 5, 43) * 360, rate: 360 },
214
+ rotationHours: 24,
215
+ colour: paint.colour,
216
+ };
217
+ const look = {
218
+ id: host,
219
+ surface: ESTIMATED_SURFACE,
220
+ relief: 0.85,
221
+ ambient: 0.08,
222
+ wrap: 0.08,
223
+ detail: { amount: 0.2, stretch: 1 },
224
+ rock: { seed: (seed % 10000) / 100, dark: paint.dark, light: paint.light },
225
+ shape: () => Promise.resolve(table),
226
+ };
227
+ return { id, host, label, radiusKm, sizeFrom, albedo, tone, colour: paint.colour, seed, facts, look, note: notes(sizeFrom), line: { en: `${label}*`, ja: `${label}*` }, legend: { en: "* shape or size estimated", ja: "* 形や大きさは推定" }, table };
228
+ }
229
+ /**
230
+ * The estimated rock for a catalogue id, a name or a designation (`himalia`, `Himalia`, `S/2003 J 18`). `null` for a body the package draws in full, and for a name that is not a moon.
231
+ *
232
+ * @param query - The catalogue id, name or designation.
233
+ * @returns The rock, or `null`.
234
+ */
235
+ export function estimatedRock(query) {
236
+ const key = plain(query);
237
+ if (key === "" || key in BODIES)
238
+ return null;
239
+ const row = index().get(key);
240
+ if (row === undefined)
241
+ return null;
242
+ let rock = cache.get(row[0]);
243
+ if (rock === undefined) {
244
+ rock = build(row);
245
+ cache.set(row[0], rock);
246
+ }
247
+ return rock;
248
+ }
249
+ /**
250
+ * The line drawing of an estimated rock: a smooth outline of its guessed shape, lighter on one side. Not a body's line drawing.
251
+ *
252
+ * @param rock - The rock.
253
+ * @param size - The picture's width in pixels.
254
+ * @returns The SVG.
255
+ */
256
+ const shade = (hex, toward, amount) => {
257
+ const n = Number.parseInt(hex.slice(1), 16);
258
+ const channel = (shift) => {
259
+ const value = (n >> shift) & 255;
260
+ return Math.round(value + (toward - value) * amount);
261
+ };
262
+ return `#${((channel(16) << 16) | (channel(8) << 8) | channel(0)).toString(16).padStart(6, "0")}`;
263
+ };
264
+ export function estimatedRockLine(rock, size) {
265
+ const span = Math.max(32, Math.round(size));
266
+ const radii = shapeRadii(rock.table);
267
+ const row = rock.table.lat / 2;
268
+ const lon = rock.table.lon;
269
+ const steps = 96;
270
+ const cx = span / 2;
271
+ const cy = span / 2;
272
+ const reach = span * 0.36;
273
+ const radiusAt = (t) => {
274
+ const x = (((t % 1) + 1) % 1) * lon;
275
+ const i = Math.floor(x) % lon;
276
+ const f = x - Math.floor(x);
277
+ const smooth = f * f * (3 - 2 * f);
278
+ const a = radii[row * lon + i] / rock.radiusKm;
279
+ const b = radii[row * lon + ((i + 1) % lon)] / rock.radiusKm;
280
+ return a + (b - a) * smooth;
281
+ };
282
+ let d = "";
283
+ for (let k = 0; k < steps; k += 1) {
284
+ const t = k / steps;
285
+ const radius = radiusAt(t);
286
+ const theta = 2 * Math.PI * t;
287
+ const x = cx + Math.cos(theta) * reach * radius;
288
+ const y = cy + Math.sin(theta) * reach * radius;
289
+ d += `${k === 0 ? "M" : "L"}${x.toFixed(1)} ${y.toFixed(1)}`;
290
+ }
291
+ const id = `rock-${rock.id}`;
292
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${span} ${span}" role="presentation"><defs><radialGradient id="${id}" cx="36%" cy="32%" r="78%"><stop offset="0" stop-color="${shade(rock.colour, 255, 0.45)}"/><stop offset="1" stop-color="${shade(rock.colour, 0, 0.5)}"/></radialGradient></defs><path d="${d}Z" fill="url(#${id})"/></svg>`;
293
+ }
@@ -105,6 +105,15 @@ export interface BodyLook {
105
105
  * ellipsoid of `axesKm`. Until it arrives the ellipsoid is drawn.
106
106
  */
107
107
  shape?: () => Promise<ShapeTable>;
108
+ /**
109
+ * An estimated rock shares one surface shader. These uniforms are that moon's own: a seed so the craters differ, and the dark and light colours of its albedo class.
110
+ * Only a look whose `surface` reads `uRockSeed`, `uRockDark` and `uRockLight` sets this.
111
+ */
112
+ rock?: {
113
+ seed: number;
114
+ dark: readonly [number, number, number];
115
+ light: readonly [number, number, number];
116
+ };
108
117
  /** Draw the painted map in the realistic look too: for a body with no honest drawing from numbers (the Earth's continents). */
109
118
  mapped?: boolean;
110
119
  }
@@ -29,7 +29,9 @@ export function takeRenderer(onContext) {
29
29
  listeners.add(onContext);
30
30
  shared ??= createSharedRenderer({
31
31
  load: () => loader(),
32
- stillSize: 480,
32
+ // A still is this many pixels on its long side, and the page keeps 32 MB of them. A square still is that side squared, times four bytes.
33
+ // 160 holds every moon of Saturn (293) with the planet, which a 480-pixel still cannot: those are about 0.9 MB each, and past the budget the picture is dropped and the view shows a broken image.
34
+ stillSize: 160,
33
35
  onContext: (state) => {
34
36
  for (const listener of listeners)
35
37
  listener(state);
@@ -11,7 +11,7 @@ import { type BodyMapSource } from "../door/map.ts";
11
11
  * console.log(TEXTURE_BASE);
12
12
  * ```
13
13
  */
14
- export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.72.0/dist/textures/";
14
+ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.73.0/dist/textures/";
15
15
  /**
16
16
  * 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
17
17
  * never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
@@ -23,7 +23,7 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
23
23
  * console.log(TEXTURE_FAR_BASE);
24
24
  * ```
25
25
  */
26
- export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.72.0/textures/";
26
+ export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.73.0/textures/";
27
27
  /**
28
28
  * Where the finer map tiles are by default: the demo site's `tiles/` folder (GitHub Pages sends `access-control-allow-origin: *`). The tiles are made by `scripts/make-body-tiles.py` and are in no package and no repository:
29
29
  * a page that serves its own gives the folder in the `tiles` attribute, and `tiles="off"` turns them off. A page that sets `texture-base` (it serves its own pictures) has none unless it says where they are.
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.72.0";
1
+ export declare const VERSION = "0.73.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // The published package version. Snippets and texture addresses name it. test/version.test.ts keeps it equal to package.json.
2
- export const VERSION = "0.72.0";
2
+ export const VERSION = "0.73.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/wakusei-planets",
3
- "version": "0.72.0",
3
+ "version": "0.73.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",