@johnmorrisdotca/wakusei-planets 0.73.0 → 0.74.1

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,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.74.1] - 2026-11-20
6
+
7
+ - **Saturn's ring picture lets the strip's program go.** The painted ring kept the strip's graphics program, and the vertex array that went with it, after the picture arrived. The space view's long run still held them on every other walk (148 objects against a start of 146) until the body was made again.
8
+ - **The standing page lands at every site and drives that site's rover** (MODULES-1482). A row of the seven sites chooses where Land goes. Drive uses NASA's Perseverance at Jezero, NASA's Curiosity at Gale and a lunar rover model based on the Deutsches Museum replica at Apollo 15, 16 and 17. Chang'e 3 and Chang'e 4 drive this package's shapes: NASA's catalogue has no Yutu or Yutu-2 model, and the page says so. Watching the descent stays on Apollo 17. The six newer sites still stand on a flat stand-in. The page's name is Standing on the surface. A driven model's shadow follows the points of its meshes. On the far side the Earth is below the horizon, and it is not drawn. The ground line says the ground is a flat stand-in until height data is added, and that nothing on it is measured. On a phone that line sits under the picture in the felt's own ink, and the site label sits above the row.
9
+ - **The moons of Jupiter, as circles** (MODULES-1731). `chart.html` draws every moon the catalogue gives Jupiter. A larger circle is a larger moon and a higher circle is farther from Jupiter. The circles are drawn larger than true so a small moon can be seen. Colour is the family. A size worked out from the brightness is marked with a star. Each outer group has its own rows, farthest at the top, the gap between the inner moons and those rows is shortened, and neither that spacing nor Jupiter is to scale. Labels stay at least 11 pixels on a phone. The link sits with the other moon pages on the home page, not in the header. English and Japanese.
10
+
11
+ ## [0.74.0] - 2026-11-20
12
+
13
+ - **Every moon, by group** (MODULES-1723). `groups.html` puts a giant planet on top and every moon of the catalogue below it, in the families `moonFamilies` already uses, numbered in that order. A moon the package draws in full keeps that picture. The rest are the estimated rocks, pulled back so a turned rock stays inside its tile, named with the star those rocks already carry (`Himalia*`), and the page shows that star's one legend line. Jupiter's globe is clipped to a circle. English and Japanese.
14
+
15
+ - **All the moons** (MODULES-1724). `all.html` lists Mercury through Pluto with the moon catalogue's count for each, and draws a few of that world's moons. The rest are a number, never a picture the package does not have. Kerberos and Styx are the estimated rocks. Saturn, which has the most, is marked. English and Japanese.
16
+
17
+
18
+ - **Who has the most moons** (MODULES-1725). `counts.html` on the demo draws Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto, each already painted, with the count of moons `moonCounts()` gives that host (a host the catalogue does not list shows none). The planet with the highest count is marked. Jupiter, Saturn, Uranus and Neptune are zoomed so the globe fills the tile and the rings run to its edge, where the tile crops them. Jupiter's globe is clipped to a circle so its faint ring plane does not show as a rectangle beside the disc. A line under the grid names the moon catalogue and the day it was read. A giant planet's tile opens its moon page; the others open that body on the demo. English and Japanese. Linked from the first page. `test/moon-counts.test.ts` checks the rows against the catalogue, and `e2e/moon-counts.demo.ts` checks the page.
19
+
20
+
21
+ - **Moons by distance, as dots** (MODULES-1726). `dots.html` on the demo shows a giant planet's painted edge and the moons numbered I to XVI as dots sized by diameter, nearest at the top. The moons are not photographs. Jupiter's column is Metis through Sinope. A moon whose size is estimated says so, and one with no size is an open circle. English and Japanese. `test/moon-dots.test.ts` and `e2e/moon-dots.demo.ts`.
22
+
23
+
24
+ - **The moon-page hero is sharper and reads in one line** (MODULES-1722). The hero planet's still is 960 pixels on its long side, and every other still stays 160, with 36 MB for the small ones plus that one picture. Jupiter's globe is clipped to a circle, which drops the dark strip of its faint rings beside the limb. Saturn is pitched over its pole, so the near half of the rings, drawn in front of the globe, crosses the lower part of it, and the ring picture is mipmapped so the edges stay smooth. Jupiter's globe is the whole disc at about half the hero, which the 960-pixel still can hold. Iapetus sits clear of Titan. The arc uses the height of the picture, and a moon of 1,000 km is drawn large enough to see its map; the circles under the picture stay the true diameters, each named, in the same order as the picture, on one line. A moon with no photo map is named with a star, and the line under the picture says what the star means.
25
+
26
+ - **The moon page opens on the planet's edge** (MODULES-1722). Above the four tabs, the planet is drawn huge and cropped at the right, and its main moons sit in an arc down the open side, farthest at the top, each a painted sphere at a size that follows its diameter, with a gap between the nearest moon and the planet. Jupiter's arc is Callisto, Ganymede, Europa and Io, and the globe is turned so the Great Red Spot faces them. Saturn's is Iapetus, Titan, Rhea, Dione, Tethys, Enceladus and Mimas, with the rings as the planet draws them and the moons clear of the rings. A smaller row under the arc holds the other named moons the package draws (Saturn's small moons, and Jupiter's Thebe and Amalthea), each marked estimated because it has no photo map. Methone is not in that row. Under the picture, the same moons are outline circles at their true diameters. Every disc and every circle is a button: it names the moon's diameter, distance and discovery. Full screen fills the picture. English and Japanese.
27
+
28
+ - **The portrait builder starts from the moon posters** (MODULES-1729). Start from now includes a giant planet's edge (Jupiter, Saturn, Uranus, Neptune): the planet is large at the right and its main moons stand in an arc, farthest at the top. Saturn's first step is the longer one, so Iapetus sits clear of Titan, and Saturn looks over its pole so the near half of the rings crosses the lower globe. Moons beside their planet puts every moon the package draws in a row next to its giant. Each of these is a manual scene, so a drag, a resize, a saved PNG and the code start from that layout.
29
+
5
30
  ## [0.73.0] - 2026-11-20
6
31
 
7
32
  - **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.
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.73.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.74.1/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.73.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.74.1/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.73.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
583
+ > Morris, J. (2026). *Wakusei Planets* (version 0.74.1) [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,27 @@
1
+ export declare const ALL_MOON_HOSTS: readonly ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
2
+ export type AllMoonHost = (typeof ALL_MOON_HOSTS)[number];
3
+ /** The moons the poster draws, in the order a reader meets them. Each one is in the catalogue. */
4
+ export declare const ALL_MOON_SHOW: Record<AllMoonHost, readonly string[]>;
5
+ export interface AllMoonShown {
6
+ id: string;
7
+ line: {
8
+ en: string;
9
+ ja: string;
10
+ };
11
+ estimated: boolean;
12
+ }
13
+ export interface AllMoonRow {
14
+ id: AllMoonHost;
15
+ name: {
16
+ en: string;
17
+ ja: string;
18
+ };
19
+ total: number;
20
+ most: boolean;
21
+ shown: AllMoonShown[];
22
+ /** Catalogue moons of this world that the row does not draw. */
23
+ more: number;
24
+ }
25
+ export declare const ALL_MOON_READ: string;
26
+ /** One row per world, Mercury through Pluto. A moon the package does not draw is left out of `shown`. */
27
+ export declare function allMoonPoster(): AllMoonRow[];
@@ -0,0 +1,38 @@
1
+ // Mercury through Pluto, each with the catalogue's moon count and a few moons the package can draw. The rest of a world's moons are a count, not a made-up picture. No DOM.
2
+ import { BODIES } from "./facts.js";
3
+ import { MOON_CATALOGUE_FETCHED, catalogueMoonsOf, moonCounts } from "./moon-catalogue.js";
4
+ import { estimatedRock } from "./scene/estimated-rock.js";
5
+ export const ALL_MOON_HOSTS = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
6
+ /** The moons the poster draws, in the order a reader meets them. Each one is in the catalogue. */
7
+ export const ALL_MOON_SHOW = {
8
+ mercury: [],
9
+ venus: [],
10
+ earth: ["moon"],
11
+ mars: ["phobos", "deimos"],
12
+ jupiter: ["io", "europa", "ganymede", "callisto"],
13
+ saturn: ["titan", "enceladus", "rhea", "iapetus"],
14
+ uranus: ["titania", "oberon", "umbriel", "ariel"],
15
+ neptune: ["triton", "nereid", "proteus", "larissa"],
16
+ pluto: ["charon", "nix", "hydra", "kerberos", "styx"],
17
+ };
18
+ export const ALL_MOON_READ = MOON_CATALOGUE_FETCHED;
19
+ /** One row per world, Mercury through Pluto. A moon the package does not draw is left out of `shown`. */
20
+ export function allMoonPoster() {
21
+ const counts = moonCounts();
22
+ const rows = ALL_MOON_HOSTS.map((id) => {
23
+ const own = catalogueMoonsOf(id);
24
+ const byId = new Map(own.map((moon) => [moon.id, moon]));
25
+ const shown = ALL_MOON_SHOW[id].flatMap((moonId) => {
26
+ const moon = byId.get(moonId);
27
+ if (moon === undefined)
28
+ return [];
29
+ const rock = estimatedRock(moon.id);
30
+ const line = rock === null ? { en: moon.label, ja: moon.ja ?? moon.label } : { en: rock.line.en, ja: rock.line.ja };
31
+ return [{ id: moon.id, line, estimated: rock !== null }];
32
+ });
33
+ const total = counts[id]?.total ?? 0;
34
+ return { id, name: { en: BODIES[id].name.en, ja: BODIES[id].name.ja }, total, most: false, shown, more: Math.max(0, total - shown.length) };
35
+ });
36
+ const max = Math.max(...rows.map((row) => row.total));
37
+ return rows.map((row) => ({ ...row, most: max > 0 && row.total === max }));
38
+ }
@@ -0,0 +1,46 @@
1
+ export declare const CHART_W = 1000;
2
+ export declare const CHART_H = 1300;
3
+ export interface ChartDot {
4
+ id: string;
5
+ label: string;
6
+ ja: string | null;
7
+ family: {
8
+ en: string;
9
+ ja: string;
10
+ };
11
+ color: string;
12
+ year: number | null;
13
+ estimated: boolean;
14
+ diameterKm: number;
15
+ distanceKm: number | null;
16
+ x: number;
17
+ y: number;
18
+ r: number;
19
+ }
20
+ export interface ChartLegend {
21
+ id: string;
22
+ names: {
23
+ en: string;
24
+ ja: string;
25
+ };
26
+ color: string;
27
+ count: number;
28
+ }
29
+ export interface JupiterChart {
30
+ width: number;
31
+ height: number;
32
+ read: string;
33
+ count: number;
34
+ planet: {
35
+ en: string;
36
+ ja: string;
37
+ x: number;
38
+ y: number;
39
+ r: number;
40
+ color: string;
41
+ };
42
+ legend: ChartLegend[];
43
+ dots: ChartDot[];
44
+ }
45
+ /** Every moon of Jupiter in the catalogue, packed into one picture. A circle's area follows the moon's diameter. Each outer group has its own rows, farthest at the top, and the empty gap between the inner moons and those rows is shortened. */
46
+ export declare function jupiterMoonChart(): JupiterChart;
@@ -0,0 +1,120 @@
1
+ // Jupiter's moons as a chart: one circle each, larger for a larger moon, higher for a moon farther out, coloured by family. No DOM.
2
+ import { BODIES } from "./facts.js";
3
+ import { catalogueMoonsOf, moonFamilies, moonOrbitColor, MOON_CATALOGUE_FETCHED } from "./moon-catalogue.js";
4
+ export const CHART_W = 1000;
5
+ export const CHART_H = 1300;
6
+ const PLANET = { x: 500, y: 1220, r: 34 };
7
+ const INNER_KM = 3_000_000;
8
+ /** Rows that stay inside the width. A row is one distance band, so a group is not piled onto the next. */
9
+ function rowsOf(items) {
10
+ const rows = [];
11
+ let row = [];
12
+ let width = 0;
13
+ for (const item of items) {
14
+ const need = item.r * 2 + 8;
15
+ if (row.length > 0 && width + need > CHART_W - 24) {
16
+ rows.push(row);
17
+ row = [];
18
+ width = 0;
19
+ }
20
+ row.push(item);
21
+ width += need;
22
+ }
23
+ if (row.length > 0)
24
+ rows.push(row);
25
+ return rows;
26
+ }
27
+ function layRow(items, y) {
28
+ const gap = 8;
29
+ const width = items.reduce((sum, item) => sum + item.r * 2 + gap, -gap);
30
+ let x = (CHART_W - width) / 2;
31
+ return items.map((item) => {
32
+ x += item.r;
33
+ const dot = dotOf(item.moon, item.family, item.diameter, item.distance, Math.round(x * 10) / 10, Math.round(y * 10) / 10, item.r);
34
+ x += item.r + gap;
35
+ return dot;
36
+ });
37
+ }
38
+ /** Every moon of Jupiter in the catalogue, packed into one picture. A circle's area follows the moon's diameter. Each outer group has its own rows, farthest at the top, and the empty gap between the inner moons and those rows is shortened. */
39
+ export function jupiterMoonChart() {
40
+ const moons = catalogueMoonsOf("jupiter");
41
+ const families = moonFamilies("jupiter");
42
+ const familyOf = new Map();
43
+ for (const family of families)
44
+ for (const moon of family.moons)
45
+ familyOf.set(moon.id, { id: family.id, ...family.names });
46
+ const maxD = Math.max(...moons.map((moon) => (moon.radiusKm ?? 0.5) * 2));
47
+ const pending = moons.map((moon) => {
48
+ const known = familyOf.get(moon.id);
49
+ const diameter = (moon.radiusKm ?? 0.5) * 2;
50
+ return {
51
+ moon,
52
+ family: { en: known?.en ?? "", ja: known?.ja ?? "" },
53
+ familyId: known?.id ?? "",
54
+ diameter,
55
+ distance: moon.orbit?.a ?? null,
56
+ r: Math.round((11 + 23 * Math.sqrt(diameter / maxD)) * 10) / 10,
57
+ };
58
+ });
59
+ const byDistance = (a, b) => (a.distance ?? Infinity) - (b.distance ?? Infinity);
60
+ const inner = pending.filter((item) => (item.distance ?? Infinity) < INNER_KM).sort(byDistance);
61
+ const outer = pending.filter((item) => (item.distance ?? Infinity) >= INNER_KM);
62
+ const groups = new Map();
63
+ for (const item of outer) {
64
+ const list = groups.get(item.familyId) ?? [];
65
+ list.push(item);
66
+ groups.set(item.familyId, list);
67
+ }
68
+ const outerGroups = [...groups.values()].map((items) => items.sort(byDistance)).sort((a, b) => {
69
+ const mid = (items) => items.reduce((sum, item) => sum + (item.distance ?? 0), 0) / items.length;
70
+ return mid(b) - mid(a);
71
+ });
72
+ const small = inner.filter((item) => item.r < 14);
73
+ const big = inner.filter((item) => item.r >= 14);
74
+ let y = PLANET.y - PLANET.r - 36;
75
+ const dots = [];
76
+ if (small.length > 0) {
77
+ y -= Math.max(...small.map((item) => item.r));
78
+ dots.push(...layRow(small, y));
79
+ y -= Math.max(...small.map((item) => item.r)) + 28;
80
+ }
81
+ for (const item of big) {
82
+ y -= item.r;
83
+ dots.push(...layRow([item], y));
84
+ y -= item.r + 64;
85
+ }
86
+ const outerBottom = y - 70;
87
+ const outerRows = outerGroups.flatMap((items) => rowsOf(items));
88
+ const span = Math.max(outerBottom - 56, outerRows.length * 36);
89
+ const step = span / Math.max(outerRows.length, 1);
90
+ outerRows.forEach((row, index) => {
91
+ const band = 48 + index * step;
92
+ const lift = Math.max(...row.map((item) => item.r));
93
+ dots.push(...layRow(row, Math.round((band + lift) * 10) / 10));
94
+ });
95
+ return {
96
+ width: CHART_W,
97
+ height: CHART_H,
98
+ read: MOON_CATALOGUE_FETCHED,
99
+ count: dots.length,
100
+ planet: { en: BODIES.jupiter.name.en, ja: BODIES.jupiter.name.ja, ...PLANET, color: BODIES.jupiter.colour },
101
+ legend: families.filter((family) => family.count > 0).map((family) => ({ id: family.id, names: family.names, color: family.color, count: family.count })),
102
+ dots,
103
+ };
104
+ }
105
+ function dotOf(moon, family, diameterKm, distanceKm, x, y, r) {
106
+ return {
107
+ id: moon.id,
108
+ label: moon.label,
109
+ ja: moon.ja,
110
+ family,
111
+ color: moonOrbitColor(moon, "group"),
112
+ year: moon.discovery.year,
113
+ estimated: moon.radiusFrom === "derived",
114
+ diameterKm,
115
+ distanceKm,
116
+ x,
117
+ y,
118
+ r,
119
+ };
120
+ }
@@ -0,0 +1,20 @@
1
+ /** The nine the count grid draws, in solar-system order. Pluto is last, as on the poster. */
2
+ export declare const MOON_COUNT_IDS: readonly ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
3
+ export type MoonCountId = (typeof MOON_COUNT_IDS)[number];
4
+ export interface MoonCountRow {
5
+ id: MoonCountId;
6
+ name: {
7
+ en: string;
8
+ ja: string;
9
+ };
10
+ /** Moons in the catalogue. Zero when the host has no entry. */
11
+ total: number;
12
+ /** True for every row that shares the highest count, and only when that count is at least one. */
13
+ most: boolean;
14
+ }
15
+ /** One row per painted planet, solar-system order, counts from `moonCounts()`. */
16
+ export declare function moonCountGrid(): MoonCountRow[];
17
+ /** Where a tile goes. A giant planet opens its moon page. The others have no moon page, so the tile opens that body on the demo. */
18
+ export declare function moonCountHref(id: MoonCountId): string;
19
+ /** The day the moon catalogue was read. The grid says so, because the counts change. */
20
+ export declare const MOON_COUNT_READ: string;
@@ -0,0 +1,24 @@
1
+ // Who has the most moons: the planets the package already paints, Mercury through Pluto, with each one's count taken from the moon catalogue. A host the catalogue does not list has none. No DOM.
2
+ import { BODIES } from "./facts.js";
3
+ import { MOON_CATALOGUE_FETCHED, moonCounts } from "./moon-catalogue.js";
4
+ import { MOON_PAGE_HOSTS } from "./moon-pages/data.js";
5
+ /** The nine the count grid draws, in solar-system order. Pluto is last, as on the poster. */
6
+ export const MOON_COUNT_IDS = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
7
+ /** One row per painted planet, solar-system order, counts from `moonCounts()`. */
8
+ export function moonCountGrid() {
9
+ const counts = moonCounts();
10
+ const rows = MOON_COUNT_IDS.map((id) => ({
11
+ id,
12
+ name: { en: BODIES[id].name.en, ja: BODIES[id].name.ja },
13
+ total: counts[id]?.total ?? 0,
14
+ most: false,
15
+ }));
16
+ const max = Math.max(...rows.map((row) => row.total));
17
+ return rows.map((row) => ({ ...row, most: max > 0 && row.total === max }));
18
+ }
19
+ /** Where a tile goes. A giant planet opens its moon page. The others have no moon page, so the tile opens that body on the demo. */
20
+ export function moonCountHref(id) {
21
+ return MOON_PAGE_HOSTS.includes(id) ? `${id}.html` : `index.html?body=${id}`;
22
+ }
23
+ /** The day the moon catalogue was read. The grid says so, because the counts change. */
24
+ export const MOON_COUNT_READ = MOON_CATALOGUE_FETCHED;
@@ -0,0 +1,19 @@
1
+ import { MOON_PAGE_HOSTS, type MoonPageHost } from "./moon-pages/data.ts";
2
+ /** How high an IAU number the column keeps. XVI is the last moon on the Jupiter reference. */
3
+ export declare const MOON_DOT_LIMIT = 16;
4
+ /** The value of a Roman numeral, or null when the text is not one. */
5
+ export declare function romanValue(text: string): number | null;
6
+ export interface MoonDot {
7
+ id: string;
8
+ label: string;
9
+ ja: string | null;
10
+ radiusKm: number | null;
11
+ /** True when the radius is derived from a magnitude, not measured. */
12
+ estimate: boolean;
13
+ distanceKm: number;
14
+ /** The drawn diameter in pixels. A moon with no size gets the smallest dot. */
15
+ px: number;
16
+ }
17
+ /** The moons numbered I to XVI, nearest the planet first. A dot's pixels follow the radius, with a floor so a small moon stays visible. */
18
+ export declare function moonDotColumn(host: MoonPageHost): MoonDot[];
19
+ export { MOON_PAGE_HOSTS };
@@ -0,0 +1,41 @@
1
+ // A planet's edge and a column of dots: the moons numbered I to XVI, nearest first, each dot sized by its diameter. No pictures of the moons, and no DOM.
2
+ import { catalogueMoonsOf } from "./moon-catalogue.js";
3
+ import { MOON_PAGE_HOSTS } from "./moon-pages/data.js";
4
+ /** How high an IAU number the column keeps. XVI is the last moon on the Jupiter reference. */
5
+ export const MOON_DOT_LIMIT = 16;
6
+ const ROMAN = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000 };
7
+ /** The value of a Roman numeral, or null when the text is not one. */
8
+ export function romanValue(text) {
9
+ if (!/^[IVXLCDM]+$/.test(text))
10
+ return null;
11
+ let total = 0;
12
+ let prev = 0;
13
+ for (const ch of [...text].reverse()) {
14
+ const value = ROMAN[ch] ?? 0;
15
+ total += value < prev ? -value : value;
16
+ prev = Math.max(prev, value);
17
+ }
18
+ return total;
19
+ }
20
+ /** The moons numbered I to XVI, nearest the planet first. A dot's pixels follow the radius, with a floor so a small moon stays visible. */
21
+ export function moonDotColumn(host) {
22
+ const chosen = catalogueMoonsOf(host).flatMap((moon) => {
23
+ if (moon.number === null)
24
+ return [];
25
+ const n = romanValue(moon.number);
26
+ if (n === null || n < 1 || n > MOON_DOT_LIMIT)
27
+ return [];
28
+ return [moon];
29
+ });
30
+ const max = Math.max(1, ...chosen.map((moon) => moon.radiusKm ?? 0));
31
+ return chosen.map((moon) => ({
32
+ id: moon.id,
33
+ label: moon.label,
34
+ ja: moon.ja,
35
+ radiusKm: moon.radiusKm,
36
+ estimate: moon.radiusFrom === "derived",
37
+ distanceKm: moon.orbit?.a ?? 0,
38
+ px: moon.radiusKm === null ? 8 : Math.max(8, Math.round(72 * (moon.radiusKm / max))),
39
+ }));
40
+ }
41
+ export { MOON_PAGE_HOSTS };
@@ -0,0 +1,24 @@
1
+ import { MOON_PAGE_HOSTS, type MoonPageHost } from "./moon-pages/data.ts";
2
+ export { MOON_PAGE_HOSTS };
3
+ export interface GroupMoon {
4
+ id: string;
5
+ /** Where it sits in the list, from 1, in family order. */
6
+ number: number;
7
+ /** The name to print. An estimated rock already carries the star. */
8
+ line: {
9
+ en: string;
10
+ ja: string;
11
+ };
12
+ estimated: boolean;
13
+ }
14
+ export interface MoonGroup {
15
+ id: string;
16
+ name: {
17
+ en: string;
18
+ ja: string;
19
+ };
20
+ count: number;
21
+ moons: GroupMoon[];
22
+ }
23
+ /** The families of one giant planet, in list order, every catalogue moon once. Numbers run through that order. */
24
+ export declare function moonGroupPoster(host: MoonPageHost): MoonGroup[];
@@ -0,0 +1,20 @@
1
+ // A planet, then every one of its moons in the catalogue's families. A moon the package draws in full keeps its own picture. The rest are the estimated rocks. No DOM.
2
+ import { moonFamilies } from "./moon-catalogue.js";
3
+ import { MOON_PAGE_HOSTS } from "./moon-pages/data.js";
4
+ import { estimatedRock } from "./scene/estimated-rock.js";
5
+ export { MOON_PAGE_HOSTS };
6
+ /** The families of one giant planet, in list order, every catalogue moon once. Numbers run through that order. */
7
+ export function moonGroupPoster(host) {
8
+ let number = 0;
9
+ return moonFamilies(host).map((family) => ({
10
+ id: family.id,
11
+ name: { en: family.names.en, ja: family.names.ja },
12
+ count: family.count,
13
+ moons: family.moons.map((moon) => {
14
+ number += 1;
15
+ const rock = estimatedRock(moon.id);
16
+ const line = rock === null ? { en: moon.label, ja: moon.ja ?? moon.label } : { en: rock.line.en, ja: rock.line.ja };
17
+ return { id: moon.id, number, line, estimated: rock !== null };
18
+ }),
19
+ }));
20
+ }
@@ -53,7 +53,7 @@ export interface MoonPagesState {
53
53
  *
54
54
  * It never writes the page's address. A choice made in it is reflected on its attribute and sent as `wakusei-moon-pages-change` (bubbling, composed) with `detail` the whole `MoonPagesState`; a page that keeps its
55
55
  * address writes the detail there and sets the attributes back from it when it loads. Setting an attribute sends no event. The numbers are `moonPage(planet)`'s, worked out in a few milliseconds. The plan, the
56
- * portrait, the cards' bodies and the planet's looks are fetched only when their tab is first opened, so a page that shows only the orbits and the table loads no WebGL. Nothing runs on a timer; the orbits are drawn
56
+ * portrait and the cards' bodies are fetched only when their tab is first opened. The hero above the tabs is always there: the planet cropped at the right and its main moons in an arc, each a painted sphere, and it loads those looks when the element connects. Nothing runs on a timer; the orbits are drawn
57
57
  * again only when a choice, the language or the element's width changes. `data-state` is `ready` once it has drawn.
58
58
  *
59
59
  * @example