@johnmorrisdotca/wakusei-planets 0.60.0 → 0.61.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,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.61.0] - 2026-11-17
6
+
7
+ - **IM-2's three rovers stand on Athena, east of the prime meridian** (MODULES-1402; John Morris, 2026-11-17). GCAT's lander catalogue has the whole IM-2 landing at 84.7906 S, 29.1957 W; NASA's table, which the places take, puts Athena at 29.1957 E, but GRACE, MAPP and Yaoki, which NASA's table does not list, kept the catalogue's point on the far side of the prime meridian. `scripts/make-places-data.py` now moves a rover the catalogue puts at its lander's own point with the lander whenever a better source moves the lander more than 0.05 degree and has no position of its own for the rover; the rovers keep the catalogue's figure in `gcatPosition`. No other rover on the Moon or Mars disagrees with its lander, and a test pins both.
8
+ - **The `loading` state says it also waits for the picture to come into sight** (MODULES-1462; John Morris, 2026-11-17). A still is made only for a picture on the screen. On spaceprogramx.com the star card, held short by a notice above the time bar, scrolls inside itself, and its star picture below the card's fold stayed `loading` until it was scrolled to, which read as a picture that never settled. Nothing in the drawing changes. A new freeze test holds both halves: a star below the fold of a scrolling box takes no still, and once scrolled to it is `still` in about half a second in software.
9
+ - **The flat solar system: `<wakusei-flat-system>`** (MODULES-1396; John Morris, 2026-11-17). A top-down map in the plane of the ecliptic, in the same family as `<wakusei-flat>`: the Sun in the middle, the eight planets and Pluto at their places for the time shown with their orbits, the dwarf planets and the asteroids Vesta and Pallas and the centaurs Chiron and Pholus, the main belt, the Hildas, the Jupiter Trojans, the Centaurs and the Kuiper belt as clouds of points (the package's sample, 3,340 bodies), the 34 comets with a tail turned from the Sun, and the 19 spacecraft with their whole paths, the Tesla Roadster among them (red, named by its car, drawn as a ring because its place is a prediction). It is an element of its own, not `body="sun"` of `<wakusei-flat>`, because it has no picture, no wrap and no latitude: new entries `@johnmorrisdotca/wakusei-planets/flat/system/define` (the element) and `@johnmorrisdotca/wakusei-planets/flat/system` (the pure side, with no DOM: `systemMarks`, `systemBelts`, `systemOrbit`, `systemCometOrbit`, `craftPath`, `squeezeAu`, `radiusAu`, `systemExtent`, the view's `projectSystem`, `unprojectSystem`, `zoomSystemAbout` and `clampSystemView`, and `SYSTEM_WORDS`). Distances use the plan's logarithm (`planRadius`, 0.1 au inner, rings at 1, 5, 10, 30 and 100 au) or `spacing="true"`; the edge is the smallest of 50 to 2,000 au that holds the planets, dwarf planets and craft shown (200 au with Voyager 1), or `extent`. It has `<wakusei-flat>`'s `time`, `speed`, `paused`, `selected`, `dot-size`, `controls`, `lang`, `track` and `names`, its events `wakusei-flat-pick`, `-view`, `-filter` and `wakusei-timechange`, its pan, pinch, wheel and keyboard (arrows from body to body, Enter, Escape, plus and minus), and the game clock; `center` follows a body, `layers`, `craft`, `comets`, `belts`, `orbits` and `spacing` choose what is drawn. It draws nothing at rest, out of sight or in a hidden tab, redraws the disc only when the view or scale changes, and keeps its canvases inside 6 MP and 4096 a side. English and Japanese through `SYSTEM_WORDS`. The demo is `system.html`, the guide is "The flat solar system" in both languages, and the tests are `test/flat-system.test.ts`, `e2e/flat-system.demo.ts` and `e2e/flat-system-freeze.demo.ts`.
10
+ - **npm keywords from the survey** (MODULES-532; John Morris, 2026-11-17). The package keywords now carry every true name from the survey (the planets and dwarf planets, orbit, rotation, heliocentric, celestial, space, nasa, jpl, javascript, 3d, browser) and `asteroids`, `comets` and `stars`, which the `/asteroids`, `/comets` and `/stars` entry points ship today; the names of other kinds of package (astrology, zodiac, swisseph, mcp, interstellar and the like) stay out. `test/keywords.test.ts` pins the kept names, the left-out names, lower case and no repeats. The rest are added as each feature ships.
11
+ - **An ended event for the watched landing, and its state readable** (MODULES-1347). `<wakusei-surface watch="landing">` sends `wakusei-landing-ended` (`detail` `{ t: 725, rate, camera }`) once each time the clock arrives at the touchdown, running or by a seek, and `wakusei-landing-state` (`detail` `{ t, playing, rate, camera, ended }`) when the descent starts or stops running (play, pause, the clock arriving at the touchdown), when `landingRate` changes and when the camera changes. A page can now carry the pause state in an address without reading `landing` every second. Arriving at the touchdown by a seek while running now stops the clock at once. The `wakusei-landing-clock` event is as it was. `e2e/surface.demo.ts` tests both.
12
+ - **The Earth without chikyu-earth: tested, and said in the console** (MODULES-542, part 1). `<wakusei-body body="earth" look="line">` already fell back to this package's own outline when chikyu-earth's element is not on the page; that is now tested without a browser (`test/earth-fallback.test.ts`: no globe, the message once, none when the element arrives within the grace) and in a real bundle with chikyu-earth missing (`pnpm test:usage`, step `earth-without-chikyu`), and the page's console gets one `console.info` line, once, if the element has still not come two seconds after the first line Earth is drawn. Documented in "Looks and bodies" in both languages. Part 2 (chikyu-earth's `/realistic` for the shaded Earth) is not built here.
13
+ - **The two-packages guide says two WebGL contexts, not one** (MODULES-1483; John Morris, 2026-11-17). With a shaded wakusei body and chikyu-earth's realistic Earth or space view on one page, each package calls kazoku-ui's `createSharedRenderer` itself, so the page has two contexts (measured). The guide, in English and Japanese, now says so, and names chikyu-earth's `setSharedRenderer` (before its first element connects; one live view, the rest stills) and that wakusei-planets does not yet export or accept a renderer.
14
+ - **A move between two moons of one planet never passes through an empty picture** (MODULES-1228, MODULES-1254). The last case left was Phobos to Deimos at true scale in a tall picture, from one side: 15 samples of its turn showed neither moon. Every way of making that move needed the camera to back off, and the backing off of the aim-point turn (a smooth step in the log of the distance) had to go about 500 units out to be far enough early in the turn, further than the pace limits allow in the turn's share of the move, so no aim turn was taken. Where a picture is still empty after every way has been tried, each way's turn is now made once more with the backing off fitted to the two moons: the camera is no further from the aim point than keeps the nearer moon inside 0.9 of the way to the nearer edge of the picture (about 21 units for that move). Walked from ten sides at three picture shapes and both scales, the six pairs of moons (Callisto to Europa, Io to Ganymede, Titan to Enceladus, Oberon to Miranda, Phobos to Deimos, Triton to Proteus; 360 walks of 241 samples) have no empty picture, no destination lost after the turn, none drifting from its place and none jumping, so the list of cases left in `test/space-travel.test.ts` is empty. A move that had no empty picture is the move it was, sample for sample (`test/travel-baseline.test.ts`). The fitted turn is quick (one backing off for each lean and pace), so it is tried whatever the planning budget: with no time at all for the other ways, 6 of the 360 walks have a fault where 17 had (95 empty samples where 285 were). Tests: `test/space-travel.test.ts`, `test/travel-budget.test.ts`; the table is `scripts/travel-table.ts`.
15
+ - **A real rover model for the standing view: `drive-model`** (MODULES-1482, part). `<wakusei-surface drive="on" drive-model="/models/perseverance.glb">` loads a GLB (three.js's own glTF loader and meshopt decoder, imported only then; the whole of three.js is needed) and draws it in place of the drawn rover, over the ground, lit by the Sun of the place, with a shadow the size of its body. Its `wheel-fl|fr|ml|mr|rl|rr` nodes roll from the drive state, its `steer-fl|fr|rl|rr` pivots turn with the steering, and `eye` (or `seat-commander`) is the seat view; the drive takes the model's own wheelbase, track and wheel size (`rigOf`, `Rig`, and a `rig` argument to `driveStep` and `driveView`, the lunar rover's by default). `wakusei-model` and `wakusei-model-error` say how the load went, `driveModel` reads it, and `loadVehicleModel` (`/surface/model`) loads one for a page's own use. **Models**: NASA's Perseverance (1,020,496 bytes) and Curiosity (1,065,672 bytes), public domain, in `models/`, served by the site and in no npm package, each its own file fetched only when asked for (credits in NOTICE.md). **Not here yet**: the new sites (Perseverance and Curiosity on Mars, Apollo 15 and 16, Yutu and Yutu-2). They need ground height tiles made from source data this machine does not hold, and Mars has no standing view yet.
16
+ - **Test floors: a coverage floor and a size budget** (MODULES-551; John Morris, 2026-11-17). `pnpm test:coverage` runs the unit tests with Node's own coverage over `src/` and fails under a floor set just under what was measured (lines 96, branches 93, functions 95; it only goes up), and `pnpm check`, which CI runs, now uses it. `pnpm size:budget` bundles, minifies and gzips each of the 97 published entry points and fails when one grows more than 5 per cent and 256 bytes over `scripts/size-baseline.json`; `pnpm size:budget:update` records a growth on purpose. New guide, "How we test" (テストの方法), in both languages. No new dependency.
17
+ - **A public API snapshot test** (MODULES-552; John Morris, 2026-11-17). `test/api-snapshot.test.ts` lists every export of every published entry point with its kind and signature, read from the source with the TypeScript compiler API (no build, no new dependency), and fails when `test/api-snapshot.txt` differs: a renamed, removed or re-typed export, or a new one. A change you mean is recorded with `pnpm api:update`, in the same commit, with the reason here. Nothing in `src/` changed.
18
+
5
19
  ## [0.60.0] - 2026-11-17
6
20
 
7
21
  - **Flat maps of the Moon and Mars: `<wakusei-flat body="moon|mars">`** (MODULES-1395; John Morris, 2026-11-17). A new entry, `@johnmorrisdotca/wakusei-planets/flat/define` (the element) and `@johnmorrisdotca/wakusei-planets/flat` (the pure side, with no DOM): the body's own painted picture as a flat, wrapping equirectangular map, with the night side shaded from the Sun's place for the time shown (sharp on the Moon, an 8 degree dusk on Mars), the Sun's mark, the landing, rover, crash and planned sites and the named features of the places data as marks, and the orbiters as dots that move over it for the time shown, with a coverage circle (`footprint`) and a ground track (`track`) cut at the map's edge (longitude 180) and the poles. The Moon draws LRO, Chandrayaan-2, Danuri, ARTEMIS P1 and P2 and Mars draws MRO, Odyssey, MAVEN, Mars Express, TGO and Hope; CAPSTONE and Tianwen-1 have no public path and are not drawn, and a craft whose place may be more than 2 per cent of the body's radius out is drawn as a ring. It uses the space view's game clock, so it is smooth at any speed (a short streak at a fast clock), and draws nothing at rest, out of sight or in a hidden tab. It has the same attributes and events as chikyu-earth's `<chikyu-flat>` (`center`, `home-lon`, `home-lat`, `time`, `speed`, `paused`, `footprint`, `track`, `selected`, `shade`, `dot-size`, `controls`, `lang`; `wakusei-flat-pick`, `-view`, `-filter` and `wakusei-timechange`), so one control can swap bodies. A press or tap sends one `wakusei-flat-pick` for every pressable thing (an orbiter, a place of the tables, a crater or mountain, a landing site), with `kind`, `id`, `name`, `via`, and for a place its `place` record and its `site` from `/landing-sites`; the landing sites are named by their own names and carry their country's flag as `<hata-flag>` with `site-flags` (the page imports hata; no new dependency), and the demo draws a card from the event; the marks and dots can be reached with the arrow keys; a drag pans and two fingers pinch. English and Japanese through `FLAT_WORDS`. The demo is `flat.html`, the guide is "Flat maps of the Moon and Mars" in both languages, and the tests are `test/flat.test.ts`, `e2e/flat.demo.ts` and `e2e/flat-freeze.demo.ts` (a canvas: no WebGL context, no graphics object, the canvas inside 6 MP and 4096 a side, and no draw at rest). The tiles are not used yet: the map is the 1024 and 2048 pixel pictures.
package/NOTICE.md CHANGED
@@ -274,6 +274,15 @@ The height tiles of `<wakusei-surface>` (`scripts/make-moon-terrain.py`; they ar
274
274
  - **Left out**: the merged LOLA and Kaguya (SELENE) height grid. The JAXA part's terms could not be found, and an MIT-licensed package can pass on only what it knows to be free to pass on.
275
275
  - **Made, not measured**: everything below the 5 m grid (small craters from 0.5 to 20 m, the roughness of the dust, rocks of 0.1 to 1.5 m) is made by this package from a seeded random grid, by the lunar size-frequency law, and is not a picture or a measurement of any place. The picture says so under the ground.
276
276
 
277
+ ## Rover models
278
+
279
+ Two rover models for `drive-model` on `<wakusei-surface>`, in `models/` (served beside the demo at `models/`, in no npm package; each is a GLB the page fetches only when it asks for it). Both are NASA 3D Resources, NASA content, public domain; each was prepared for this package (split into separate wheels and steering pivots, simplified, textures shrunk to WebP at 512 px, packed with meshopt) and nothing was repainted.
280
+
281
+ | File | Title | Author | Licence | Source | Size |
282
+ |---|---|---|---|---|---|
283
+ | `perseverance.glb` | Mars 2020 Perseverance Rover | NASA/Jet Propulsion Laboratory (JPL-Caltech) | Public domain (NASA 3D Resources; NASA content is not copyrighted) | https://science.nasa.gov/3d-resources/mars-2020-perseverance-rover/ | 1,020,496 bytes |
284
+ | `curiosity.glb` | Curiosity Rover, 3D Model | NASA/JPL-Caltech | Public domain (NASA 3D Resources; NASA content is not copyrighted) | https://science.nasa.gov/resource/curiosity-rover-3d-model/ | 1,065,672 bytes |
285
+
277
286
  ## Interior cutaway
278
287
 
279
288
  The cutaway's figures were read on 2026-11-13. NASA content is not subject to copyright in the United States. Nothing was copied from the pages; the numbers and the materials they name are the pages' facts, and a figure the page gives as "about" stays marked about.
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.60.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.61.0/docs/images/lineup-desk.png" width="640"></p>
23
23
 
24
24
  ## Who it is for
25
25
 
@@ -174,6 +174,19 @@ const lro = flatOrbiter("lro", Date.UTC(2026, 10, 12));
174
174
  console.log(lro?.altitudeKm.toFixed(0), "km up");
175
175
  ```
176
176
 
177
+ ## The flat solar system
178
+
179
+ `<wakusei-flat-system>` is the solar system from above on a flat map: the Sun, the planets on their orbits at the time shown, the dwarf planets, the asteroid and Kuiper belts as clouds of points, 34 comets and the spacecraft with their whole paths, the Tesla Roadster among them. Distances are squeezed by the plan's logarithm so Mercury and Neptune both show, or true with `spacing="true"`. It is a canvas with no WebGL, takes `time`, `speed` and `paused`, sends `wakusei-flat-pick`, works by keyboard and touch, and has the attributes and events of `<wakusei-flat>`. [The flat solar system](docs/guides/flat-system.md) has the attributes.
180
+
181
+ ```ts
182
+ import { loadSpacecraft } from "@johnmorrisdotca/wakusei-planets/spacecraft";
183
+ import { systemMarks } from "@johnmorrisdotca/wakusei-planets/flat/system";
184
+
185
+ await loadSpacecraft("roadster");
186
+ const car = systemMarks(Date.UTC(2026, 10, 17), { layers: ["craft"], craft: ["roadster"] }).find((mark) => mark.id === "roadster");
187
+ console.log(car?.distanceAu.toFixed(2), "au from the Sun");
188
+ ```
189
+
177
190
  ## A name on the body
178
191
 
179
192
  `body-label="painted"` writes the body's name on its own globe, large and in capitals, lying on the surface and turning with it, as a film lays a title over the thing it names: on `<wakusei-body>` and on every body of `<wakusei-space>`, in the page's language, in Michroma by default or a font of yours. Four looks (`painted`, `etched`, `outline`, `burned`), once or on both sides, at the equator or near a pole, turning with the body or always facing you; nothing on a body too small on the screen. [A name on the body](docs/guides/name-on-the-body.md) has the attributes.
@@ -399,7 +412,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
399
412
 
400
413
  ## The portrait builder
401
414
 
402
- <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.60.0/docs/images/portrait-family.png" width="640"></p>
415
+ <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.61.0/docs/images/portrait-family.png" width="640"></p>
403
416
 
404
417
  [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.
405
418
 
@@ -456,6 +469,7 @@ The reference is a site, made from the source's own doc comments: every export h
456
469
  | `.../space` | Where the Sun, the Moon and the planets are for a date, in two scales, and where a camera riding along looks: `frameAt`, `createTrack`, `placeSun`, `placeAround`, `ridePose`. No browser. |
457
470
  | `.../space/element` | `<wakusei-space>`: the Earth, the Moon, the Sun and the planets in their places. |
458
471
  | `.../flat` | The flat maps' pure side: `flatSun`, `flatOrbiter`, `shadeNight`, `circleOutline`, `flatTrack`, the geometry and the words. `.../flat/define` is `<wakusei-flat>`, the Moon or Mars on a flat map, in a canvas with no WebGL. |
472
+ | `.../flat/system` | The flat solar system's pure side: `systemMarks`, `systemBelts`, `systemOrbit`, `craftPath`, `squeezeAu`, the view and the words. `.../flat/system/define` is `<wakusei-flat-system>`, in a canvas with no WebGL. |
459
473
  | `.../plan` | The top-down plan: `planAt`, `planSvg`, `planText`. `.../plan/element` is `<wakusei-plan>`, in SVG with no WebGL. |
460
474
  | `.../landing-sites` | The 39 soft landings on the Moon and Mars as plain data: `LANDING_SITES`, `landingSitesOf`, `findLandingSite`, `flagCodeOf`. No browser, no three.js. |
461
475
  | `.../nearest` | The bodies nearest to a body on a date (`nearest`, `within`), when two bodies come closest (`closestApproach`, `conjunctions`) and how far apart they are (`distance`, `distanceRange`). No browser. |
@@ -492,6 +506,7 @@ Each guide has a Japanese twin in [docs/guides/ja](docs/guides/ja/getting-starte
492
506
  | [A star from its numbers](docs/guides/star-look.md) | Any star in 3D or as lines, what is measured and what is drawn, every way to put it in a page |
493
507
  | [The size line-up](docs/guides/size-lineup.md) | The Sun and the largest stars at true relative size, with each radius, its error and its paper, where the papers disagree, every way to put it in a page |
494
508
  | [Flat maps of the Moon and Mars](docs/guides/flat.md) | The Moon or Mars on a flat map: day and night, the sites, the orbiters moving with their coverage and ground tracks, the same attributes and events as the Earth's flat map |
509
+ | [The flat solar system](docs/guides/flat-system.md) | The Sun, planets, belts, comets and spacecraft (the Tesla Roadster) from above on a flat map: squeezed or true distances, the same attributes and events as the flat maps |
495
510
  | [The top-down plan](docs/guides/plan.md) | The solar system or one planet's moons from above, with one body marked: squeezed or to-scale distances, drawing only on change |
496
511
  | [Zoom and pan](docs/guides/zoom-and-pan.md) | Every view zooms and moves by itself: the range of each and why it ends there, the bar, the embed page |
497
512
  | [Close zoom and map tiles](docs/guides/close-zoom.md) | How far each body zooms and why, the finer map tiles for a close zoom (made from public-domain maps, served beside the demo, never in the package), the generic detail, what it costs |
@@ -552,7 +567,7 @@ BODIES.pluto.kind; // "dwarf-planet"
552
567
 
553
568
  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:
554
569
 
555
- > Morris, J. (2026). *Wakusei Planets* (version 0.60.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
570
+ > Morris, J. (2026). *Wakusei Planets* (version 0.61.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
556
571
 
557
572
  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).
558
573
 
@@ -4,10 +4,31 @@ import { delegates, waiting } from "../scene/store.js";
4
4
  // This entry never imports chikyu-earth itself, so a project without that optional peer still builds. The realistic and painted looks are drawn here like every other body's (earth-look.ts).
5
5
  const CENTRE = "10,20";
6
6
  const TAG = "chikyu-earth";
7
+ /** What a page's console is told, once, when the line Earth is the plain outline because chikyu-earth's element is not on the page. */
8
+ const MESSAGE = `wakusei-planets: the Earth's line look is drawn as a plain outline because chikyu-earth's element is not on the page. Import "@johnmorrisdotca/chikyu-earth/element" for the globe with the countries.`;
9
+ /** How long the element has to arrive before the page is told (an import that comes a moment after this one is not a missing package). */
10
+ const GRACE_MS = 2000;
11
+ const present = () => typeof customElements !== "undefined" && customElements.get(TAG) !== undefined;
12
+ let told = false;
13
+ let timer;
14
+ /** The line Earth fell back to the outline: after a grace, if the element still has not come, say so once in the console (`console.info`: a missing optional peer is not an error). */
15
+ function missing() {
16
+ if (told || timer !== undefined)
17
+ return;
18
+ timer = setTimeout(() => {
19
+ timer = undefined;
20
+ if (present() || told)
21
+ return;
22
+ told = true;
23
+ console.info(MESSAGE);
24
+ }, GRACE_MS);
25
+ }
7
26
  delegates.set("earth", {
8
27
  async line({ center, size }) {
9
- if (customElements.get(TAG) === undefined)
28
+ if (!present()) {
29
+ missing();
10
30
  return null;
31
+ }
11
32
  const globe = document.createElement(TAG);
12
33
  globe.setAttribute("center", center || CENTRE);
13
34
  globe.setAttribute("look", "line");
@@ -1881,18 +1881,19 @@ export declare const PLACES_MOON: readonly [{
1881
1881
  };
1882
1882
  readonly gcatName: "GRACE";
1883
1883
  readonly lat: -84.7906;
1884
- readonly lon: -29.1957;
1884
+ readonly lon: 29.1957;
1885
1885
  readonly date: "2025-03-06T17:28Z";
1886
1886
  readonly mission: "GRACE";
1887
1887
  readonly operator: "INTMA";
1888
1888
  readonly country: "US";
1889
1889
  readonly outcome: "soft";
1890
1890
  readonly source: {
1891
- readonly id: "gcat-landercat";
1892
- readonly read: "2026-11-09";
1891
+ readonly id: "nssdca";
1892
+ readonly read: "2026-11-11";
1893
1893
  };
1894
1894
  readonly note: "Rover, not deployed";
1895
1895
  readonly until: "2025-03-07T05:43Z";
1896
+ readonly gcatPosition: readonly [-84.7906, -29.1957];
1896
1897
  }, {
1897
1898
  readonly id: "moon/mapp";
1898
1899
  readonly kind: "rover";
@@ -1902,18 +1903,19 @@ export declare const PLACES_MOON: readonly [{
1902
1903
  };
1903
1904
  readonly gcatName: "MAPP";
1904
1905
  readonly lat: -84.7906;
1905
- readonly lon: -29.1957;
1906
+ readonly lon: 29.1957;
1906
1907
  readonly date: "2025-03-06T17:28Z";
1907
1908
  readonly mission: "MAPP";
1908
1909
  readonly operator: "LOUT";
1909
1910
  readonly country: "US";
1910
1911
  readonly outcome: "soft";
1911
1912
  readonly source: {
1912
- readonly id: "gcat-landercat";
1913
- readonly read: "2026-11-09";
1913
+ readonly id: "nssdca";
1914
+ readonly read: "2026-11-11";
1914
1915
  };
1915
1916
  readonly note: "Rover, not deployed";
1916
1917
  readonly until: "2025-03-07T05:43Z";
1918
+ readonly gcatPosition: readonly [-84.7906, -29.1957];
1917
1919
  }, {
1918
1920
  readonly id: "moon/yaoki";
1919
1921
  readonly kind: "rover";
@@ -1923,18 +1925,19 @@ export declare const PLACES_MOON: readonly [{
1923
1925
  };
1924
1926
  readonly gcatName: "Yaoki";
1925
1927
  readonly lat: -84.7906;
1926
- readonly lon: -29.1957;
1928
+ readonly lon: 29.1957;
1927
1929
  readonly date: "2025-03-06T17:28Z";
1928
1930
  readonly mission: "Yaoki";
1929
1931
  readonly operator: "DYMON";
1930
1932
  readonly country: "J";
1931
1933
  readonly outcome: "soft";
1932
1934
  readonly source: {
1933
- readonly id: "gcat-landercat";
1934
- readonly read: "2026-11-09";
1935
+ readonly id: "nssdca";
1936
+ readonly read: "2026-11-11";
1935
1937
  };
1936
1938
  readonly note: "Rover, not deployed";
1937
1939
  readonly until: "2025-03-07T05:43Z";
1940
+ readonly gcatPosition: readonly [-84.7906, -29.1957];
1938
1941
  }, {
1939
1942
  readonly id: "moon/oceanus-procellarum";
1940
1943
  readonly kind: "feature";
@@ -88,9 +88,9 @@ export const PLACES_MOON = [{ "id": "moon/luna-2", "kind": "impact", "name": { "
88
88
  { "id": "moon/resilience", "kind": "crash", "name": { "en": "Resilience", "ja": "レジリエンス" }, "gcatName": "Resilience", "lat": 60.4445, "lon": -4.588, "date": "2025-01-15T06:11Z", "mission": "Resilience", "operator": "ISPACE", "country": "J", "outcome": "hard", "source": { "id": "nssdca", "read": "2026-11-11" }, "note": "Lunar lander, crashed", "until": "2025-06-05T19:15Z", "gcatPosition": [60.5, -4.6] },
89
89
  { "id": "moon/blue-ghost-1", "kind": "landing", "name": { "en": "Blue Ghost 1", "ja": "ブルーゴースト ミッション1" }, "gcatName": "Blue Ghost", "lat": 18.562, "lon": 61.81, "date": "2025-03-02T08:34Z", "mission": "Blue Ghost", "operator": "FFLY", "country": "US", "outcome": "soft", "source": { "id": "nssdca", "read": "2026-11-11" }, "note": "Lander", "until": "2025-03-16T23:15Z" },
90
90
  { "id": "moon/im-2-athena", "kind": "landing", "name": { "en": "IM-2 Athena", "ja": "IM-2 アテナ" }, "gcatName": "IM-2 Athena", "lat": -84.7906, "lon": 29.1957, "date": "2025-03-06T17:28Z", "mission": "IM-2 Athena", "operator": "INTMA", "country": "US", "outcome": "soft", "source": { "id": "nssdca", "read": "2026-11-11" }, "note": "Lander, toppled", "until": "2025-03-07T05:43Z", "gcatPosition": [-84.7906, -29.1957] },
91
- { "id": "moon/grace", "kind": "rover", "name": { "en": "GRACE", "ja": "GRACE" }, "gcatName": "GRACE", "lat": -84.7906, "lon": -29.1957, "date": "2025-03-06T17:28Z", "mission": "GRACE", "operator": "INTMA", "country": "US", "outcome": "soft", "source": { "id": "gcat-landercat", "read": "2026-11-09" }, "note": "Rover, not deployed", "until": "2025-03-07T05:43Z" },
92
- { "id": "moon/mapp", "kind": "rover", "name": { "en": "MAPP", "ja": "MAPP" }, "gcatName": "MAPP", "lat": -84.7906, "lon": -29.1957, "date": "2025-03-06T17:28Z", "mission": "MAPP", "operator": "LOUT", "country": "US", "outcome": "soft", "source": { "id": "gcat-landercat", "read": "2026-11-09" }, "note": "Rover, not deployed", "until": "2025-03-07T05:43Z" },
93
- { "id": "moon/yaoki", "kind": "rover", "name": { "en": "Yaoki", "ja": "Yaoki" }, "gcatName": "Yaoki", "lat": -84.7906, "lon": -29.1957, "date": "2025-03-06T17:28Z", "mission": "Yaoki", "operator": "DYMON", "country": "J", "outcome": "soft", "source": { "id": "gcat-landercat", "read": "2026-11-09" }, "note": "Rover, not deployed", "until": "2025-03-07T05:43Z" },
91
+ { "id": "moon/grace", "kind": "rover", "name": { "en": "GRACE", "ja": "GRACE" }, "gcatName": "GRACE", "lat": -84.7906, "lon": 29.1957, "date": "2025-03-06T17:28Z", "mission": "GRACE", "operator": "INTMA", "country": "US", "outcome": "soft", "source": { "id": "nssdca", "read": "2026-11-11" }, "note": "Rover, not deployed", "until": "2025-03-07T05:43Z", "gcatPosition": [-84.7906, -29.1957] },
92
+ { "id": "moon/mapp", "kind": "rover", "name": { "en": "MAPP", "ja": "MAPP" }, "gcatName": "MAPP", "lat": -84.7906, "lon": 29.1957, "date": "2025-03-06T17:28Z", "mission": "MAPP", "operator": "LOUT", "country": "US", "outcome": "soft", "source": { "id": "nssdca", "read": "2026-11-11" }, "note": "Rover, not deployed", "until": "2025-03-07T05:43Z", "gcatPosition": [-84.7906, -29.1957] },
93
+ { "id": "moon/yaoki", "kind": "rover", "name": { "en": "Yaoki", "ja": "Yaoki" }, "gcatName": "Yaoki", "lat": -84.7906, "lon": 29.1957, "date": "2025-03-06T17:28Z", "mission": "Yaoki", "operator": "DYMON", "country": "J", "outcome": "soft", "source": { "id": "nssdca", "read": "2026-11-11" }, "note": "Rover, not deployed", "until": "2025-03-07T05:43Z", "gcatPosition": [-84.7906, -29.1957] },
94
94
  { "id": "moon/oceanus-procellarum", "kind": "feature", "name": { "en": "Oceanus Procellarum", "ja": "嵐の大洋" }, "lat": 20.6714, "lon": -56.6774, "feature": { "type": "Oceanus, oceani", "typeWord": { "en": "ocean", "ja": "大洋" }, "diameterKm": 2592.24, "approved": "1935-01-01" }, "source": { "id": "iau-gazetteer", "read": "2026-11-11" }, "famous": true },
95
95
  { "id": "moon/mare-frigoris", "kind": "feature", "name": { "en": "Mare Frigoris", "ja": "氷の海" }, "lat": 57.5923, "lon": -0.0064, "feature": { "type": "Mare, maria", "typeWord": { "en": "sea", "ja": "海" }, "diameterKm": 1446.41, "approved": "1935-01-01" }, "source": { "id": "iau-gazetteer", "read": "2026-11-11" } },
96
96
  { "id": "moon/mare-imbrium", "kind": "feature", "name": { "en": "Mare Imbrium", "ja": "雨の海" }, "lat": 34.7244, "lon": -14.9086, "feature": { "type": "Mare, maria", "typeWord": { "en": "sea", "ja": "海" }, "diameterKm": 1145.53, "approved": "1935-01-01" }, "source": { "id": "iau-gazetteer", "read": "2026-11-11" }, "famous": true },
package/dist/element.d.ts CHANGED
@@ -15,7 +15,7 @@ import { type PlaceLayer } from "./place-marks.ts";
15
15
  export { setThreeLoader };
16
16
  export { placeLine, setPlacesLoader } from "./scene/place-layer.ts";
17
17
  /**
18
- * What the element is doing: `line` (an SVG), `loading` (waiting for three.js or a picture), `still` (a picture of the 3D look, nothing running), `live` (drawing), `lost` (the GPU took the context; it comes back by itself) or `unavailable` (no WebGL: the line drawing is shown).
18
+ * What the element is doing: `line` (an SVG), `loading` (waiting for three.js or a picture, or for the element to come into sight: a still is made only for a picture on the screen, so one below the fold of a box that scrolls, a short card for instance, stays `loading` until it is scrolled to), `still` (a picture of the 3D look, nothing running), `live` (drawing), `lost` (the GPU took the context; it comes back by itself) or `unavailable` (no WebGL: the line drawing is shown).
19
19
  *
20
20
  * @example
21
21
  * ```ts no-run
@@ -0,0 +1,3 @@
1
+ import { WakuseiFlatSystem } from "./system-element.ts";
2
+ export { WakuseiFlatSystem };
3
+ export type { SystemPick } from "./system-element.ts";
@@ -0,0 +1,6 @@
1
+ // Registers <wakusei-flat-system>. Importing this entry point (`@johnmorrisdotca/wakusei-planets/flat/system/define`) defines the tag once. It needs no WebGL and no peer.
2
+ import { WakuseiFlatSystem } from "./system-element.js";
3
+ export { WakuseiFlatSystem };
4
+ if (typeof customElements !== "undefined" && !customElements.get("wakusei-flat-system")) {
5
+ customElements.define("wakusei-flat-system", WakuseiFlatSystem);
6
+ }
@@ -0,0 +1,133 @@
1
+ import { type BeltId } from "../belts/index.ts";
2
+ import { type SystemKind, type SystemLayer } from "./system.ts";
3
+ import type { FlatLang } from "./words.ts";
4
+ /**
5
+ * What `wakusei-flat-pick` carries from the flat solar system: a body under the pointer, tapped, or reached by the keyboard. A tap on nothing sends `id: null` and clears the choice.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import type { SystemPick } from "@johnmorrisdotca/wakusei-planets/flat/system";
10
+ *
11
+ * const show = (pick: SystemPick): string => (pick.id === null ? "nothing" : `${pick.name} (${pick.kind}), ${pick.distanceAu?.toFixed(1)} au`);
12
+ * console.log(typeof show);
13
+ * ```
14
+ */
15
+ export interface SystemPick {
16
+ /** What was chosen: the Sun, a planet, a dwarf planet, an asteroid, a centaur, a comet, a spacecraft, or a `belt` body (one point of a belt). */
17
+ kind: SystemKind | "belt" | null;
18
+ /** The body's id (`earth`, `halley`, `roadster`), a belt body's name (`4 Vesta`), or null when a tap lands on nothing. */
19
+ id: string | null;
20
+ name: string | null;
21
+ /** The layer it is in. */
22
+ layer: SystemLayer | "sun" | null;
23
+ /** The belt a belt body is in. */
24
+ belt?: BeltId;
25
+ /** Its distance from the Sun in astronomical units, and its place in the ecliptic plane in au (x to the March equinox). */
26
+ distanceAu: number | null;
27
+ x: number | null;
28
+ y: number | null;
29
+ /** True for a craft whose place is a prediction (the Tesla Roadster, a craft whose mission is over). */
30
+ predicted: boolean | null;
31
+ /** What chose it: a pointer going over it (`hover`), a tap or click (`tap`), or the keyboard (`key`). */
32
+ via: "hover" | "tap" | "key";
33
+ }
34
+ /**
35
+ * The `<wakusei-flat-system>` custom element: the solar system as a flat, top-down map in the plane of the ecliptic, the planets at their places for the time shown, with their orbits, the dwarf planets and a few small bodies, the asteroid belts and the Kuiper belt as clouds of points,
36
+ * 34 comets (with a tail turned from the Sun when near it), and our spacecraft, the Tesla Roadster among them, each with its whole path to draw. Import `@johnmorrisdotca/wakusei-planets/flat/system/define` to register the tag. It needs no WebGL and no peer.
37
+ * Distances are squeezed by the plan's logarithm (`ln(1 + d / 0.1 au)`), so Mercury and Neptune both show, with rings at 1, 5, 10, 30 and 100 au, or `spacing="true"` for the real proportion. A body further out than the edge is left off; the edge is the smallest of 50, 100, 200, 500, 1,000 and 2,000 au that holds the planets, dwarf planets and craft shown.
38
+ *
39
+ * Attributes (the ones marked "same" are the names and meanings `<wakusei-flat>` has): `time` (same: `now`, an ISO date or milliseconds since 1970; live when absent), `speed` (same: 1 is real time, 0 holds, 86400 is a day a second, negative runs backwards), `paused` (same: hold the clock and keep the speed),
40
+ * `selected` (same: the chosen body's id such as `earth`, `halley` or `roadster`), `center` (a body to centre the map on and follow: `sun` by default; a drag lets go of it), `dot-size` (same: pixels), `controls` (same: `none`, or any of `centre zoom orbits track scale chips`; all by default), `lang` (same: `en` or `ja`; the page's language by default),
41
+ * `layers` (`planets dwarfs belts comets craft`: what is drawn; all by default, `off` for none), `craft`, `comets` and `belts` (`all`, `off` or ids with commas: which craft, comets or belts), `orbits` (`off` hides the orbit lines of the planets and dwarf planets), `track` (same: the whole path of the chosen craft and the orbit of the chosen comet, or of every one shown when none is chosen),
42
+ * `spacing` (`squeezed`, the default, or `true`), `extent` (the distance at the edge in au; `auto`, the default, is the smallest step that holds what is shown), `names` (same: `off` for no names beside the bodies, or the most names to show). `footprint`, `shade`, `home-lon` and `home-lat` belong to a map of a surface and are not read.
43
+ *
44
+ * Events (the names `<wakusei-flat>` sends): `wakusei-flat-pick` (a body or a belt body under the pointer, tapped, or reached by the keyboard: a `SystemPick`; `detail.id` is null when a tap lands on nothing and clears the choice), `wakusei-flat-filter` (a chip changed what is shown: `{ layers }`),
45
+ * `wakusei-flat-view` (the reader panned or zoomed: `{ center, x, y, zoom }`) and `wakusei-timechange` (`{ time, running, paused }`, at most four a second while time runs).
46
+ * Style it with the custom properties `--wakusei-flat-space`, `--wakusei-flat-aspect`, `--wakusei-flat-aspect-narrow` and `--wakusei-flat-radius`.
47
+ *
48
+ * @example
49
+ * ```ts no-run
50
+ * import "@johnmorrisdotca/wakusei-planets/flat/system/define";
51
+ * import type { WakuseiFlatSystem } from "@johnmorrisdotca/wakusei-planets/flat/system";
52
+ *
53
+ * const system = document.createElement("wakusei-flat-system") as WakuseiFlatSystem;
54
+ * system.setAttribute("selected", "roadster");
55
+ * system.setAttribute("track", "");
56
+ * document.body.append(system);
57
+ * system.addEventListener("wakusei-flat-pick", (event) => console.log((event as CustomEvent).detail.name));
58
+ * ```
59
+ */
60
+ export declare class WakuseiFlatSystem extends HTMLElement {
61
+ #private;
62
+ static observedAttributes: string[];
63
+ /** The id of the chosen body (or the name of a chosen belt body), or null. Set it to choose one from code (no `wakusei-flat-pick` is sent), `null` to clear. */
64
+ get selected(): string | null;
65
+ set selected(id: string | null);
66
+ /** The id of the body the map is centred on and follows, or null while it is centred on the Sun or the reader has dragged it away. Set it to a body's id to centre there, or to `sun` or null for the Sun. */
67
+ get center(): string | null;
68
+ set center(id: string | null);
69
+ /** The zoom: 1 shows the whole disc, up to 8. */
70
+ get zoom(): number;
71
+ set zoom(value: number);
72
+ /** The moment shown, in milliseconds since the Unix epoch. Set it to a number (or a `Date`) to move the clock, or "now" to go live. */
73
+ get time(): number;
74
+ set time(value: number | Date | "now");
75
+ /** How fast the clock runs: 1 is real time, 0 holds, 86400 is a day a second, negative runs backwards. */
76
+ get speed(): number;
77
+ set speed(value: number);
78
+ /** True while the clock is held with its speed kept: nothing is drawn but what the reader changes. Setting it false carries on from the moment shown at the same speed. */
79
+ get paused(): boolean;
80
+ set paused(value: boolean);
81
+ /** The language of the words: the `lang` attribute, else the page's. */
82
+ get language(): FlatLang;
83
+ /** The layers drawn now: `planets`, `dwarfs`, `belts`, `comets` and `craft`. */
84
+ get layers(): readonly SystemLayer[];
85
+ /** The distance at the edge of the map in au, as of the last draw. */
86
+ get extent(): number;
87
+ /** The bodies drawn at the last draw, with their place on the screen: their ids, names, kinds and layers, whether each is inside the box, and its distance from the Sun in au. */
88
+ get bodies(): readonly {
89
+ id: string;
90
+ name: string;
91
+ kind: SystemKind;
92
+ layer: SystemLayer | "sun";
93
+ shown: boolean;
94
+ distanceAu: number;
95
+ predicted: boolean;
96
+ }[];
97
+ /** Counters for a test or a page: draws of the bodies, draws of the disc, the bodies and belt points drawn at the last draw, the milliseconds the last draw and the slowest took, and the canvases' size in pixels. */
98
+ get stats(): {
99
+ draws: number;
100
+ mapDraws: number;
101
+ dots: number;
102
+ beltPoints: number;
103
+ lastDrawMs: number;
104
+ maxDrawMs: number;
105
+ averageDrawMs: number;
106
+ running: boolean;
107
+ paused: boolean;
108
+ extent: number;
109
+ canvases: {
110
+ width: number;
111
+ height: number;
112
+ }[];
113
+ };
114
+ /** Where a body is on the screen as of the last draw, in CSS pixels from the map's top left, or null when it is not drawn (a layer off, outside the edge, or a craft with no path at the moment shown). */
115
+ placeOf(id: string): {
116
+ x: number;
117
+ y: number;
118
+ au: readonly [number, number, number];
119
+ distanceAu: number;
120
+ } | null;
121
+ /** Choose a body from code, as a reader's tap would, without sending `wakusei-flat-pick`. An id the map does not hold, or `null`, clears the choice. */
122
+ pick(id: string | null): void;
123
+ connectedCallback(): void;
124
+ disconnectedCallback(): void;
125
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
126
+ /** The distance in au under a point of the box, in the map's present scale: for a page that reads where a pointer is. */
127
+ auAt(x: number, y: number): number;
128
+ }
129
+ declare global {
130
+ interface HTMLElementTagNameMap {
131
+ "wakusei-flat-system": WakuseiFlatSystem;
132
+ }
133
+ }