@johnmorrisdotca/wakusei-planets 0.38.0 → 0.39.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 +6 -0
- package/NOTICE.md +2 -2
- package/README.md +4 -4
- package/dist/door/own.js +4 -2
- package/dist/embed.d.ts +4 -1
- package/dist/embed.js +21 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/picture-credits.d.ts +78 -0
- package/dist/picture-credits.js +120 -0
- package/dist/scene/painter.d.ts +11 -0
- package/dist/scene/painter.js +30 -2
- package/dist/scene/textures.d.ts +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.39.0] - 2026-11-13
|
|
6
|
+
|
|
7
|
+
- **The portrait builder's credit names each body's picture** (MODULES-1157). It was one fixed public-domain sentence for every painted scene; it is now `picturesCredit` for the bodies in the scene, so Saturn names Solar System Scope, Nestaeric, CC BY 4.0 and the changes. The builder's browser test now expects the source names of the body it shows, not the old public-domain sentence.
|
|
8
|
+
- **The painter carries the credit for the pictures it draws** (MODULES-1146). `WakuseiPainter.credit` is `{ en, ja }`. Before `make` it names every surface picture the painter can draw. After `make` it names only the bodies made in a look that draws the map, so the Moon and Mars add no CC BY 4.0 line and a shaded body with no map adds nothing. While finer map tiles are on a body it adds the `wakusei-tiles` credit from `OWN_SOURCES`, and Mercury's tiles say that their colour is the CC BY 4.0 map. `PICTURE_CREDITS` is the table of which body's map comes from which source (the rows of `NOTICE.md`), and `picturesCredit(bodies, lang)` writes the line for the bodies a page shows. Jupiter names Nestaeric and CC BY 4.0, including the changes.
|
|
9
|
+
- **Embed and door credits name the CC BY 4.0 pictures** (MODULES-1157). `embedCredit` and `lineupCredit` are written from `picturesCredit` for the bodies shown (`lang` is `en` or `ja`). A painted or realistic Mercury, Venus, Jupiter, Saturn, Uranus, Neptune or Sun names its CC BY 4.0 author and the changes; the Moon and Mars stay public domain. The line-up's painted Earth and Jupiter no longer share one "NASA and Nestaeric" line. `OWN_SOURCES`' `wakusei-pictures` credit is the same table for every picture, so it names Shady Tex and does not call a public-domain map CC BY 4.0. The source's licence name stays the stricter "CC BY 4.0".
|
|
10
|
+
|
|
5
11
|
## [0.38.0] - 2026-11-13
|
|
6
12
|
|
|
7
13
|
- **You are here, and favourite places, on the space view's Earth** (MODULES-1073). `<wakusei-space>` takes `earth-places` (a JSON list of `{ id, lon, lat, label, kind, color }`, `kind` `here` or `favourite`; the property `earthPlaces` writes the attribute and an empty list takes it away) and `earth-places-look` (`beam`, the default, `pin` or `ring`; the property `earthPlacesLook`). Each place is a marker standing out of the ground that turns with the Earth, is hidden on the far side, fades at the edge, is dimmer in the night (not with `light="lit"`) and keeps its size in pixels; its name sits at the top of the marker, `here` first, never over another place's name or a body's name. It is drawn wherever the Earth is in the picture, not only when the camera looks at it, while the Earth is at least 40 CSS pixels in radius. The attribute is `earth-places`, not chikyu-earth's `places`, because `places` here already chooses the layers of marks on the body looked at. The layout is chikyu-earth's own `layoutPlaces` and `readPlaces` (its `/markers`, 0.36.0 or later), not a copy, brought by the new entry point `@johnmorrisdotca/wakusei-planets/earth-places` (an optional peer: nothing else here imports chikyu-earth, and without the import the attribute draws nothing). `/places` gains `spotView` (a body as a view draws it, flat or in perspective, as a picture a layout can use) and `pointUnder`; `/earth-places` has `readEarthPlaces` and `layEarthPlaces` for a page or a server. At most 32 markers (`here` first), the rest of those in sight counted in `earthPlacesShown().omitted`; no pulse and no animation; nothing is drawn at rest (the markers are laid inside the draws the view makes, a few SVG shapes kept and moved); the markers take no pointer. `space.earthPlacesShown` reports what was laid. A guide ("You are here, and places on the Earth") and its Japanese twin; chikyu-earth is now `^0.36.0` as a dev dependency. Unit tests (the layout agrees with chikyu-earth's own on a flat picture), browser tests of the attribute, the property and the three looks, and a freeze test.
|
package/NOTICE.md
CHANGED
|
@@ -97,7 +97,7 @@ The painted looks' pictures in `textures/` (the 512 and 1024 pixel widths are al
|
|
|
97
97
|
|
|
98
98
|
NASA says its content "generally are not subject to copyright in the United States" and asks for acknowledgement (https://www.nasa.gov/nasa-brand-center/images-and-media/); USGS and JPL maps are works of the United States government. This package is not endorsed by NASA, the USGS or any mission, and uses none of their insignia or logotypes.
|
|
99
99
|
|
|
100
|
-
Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equirectangular maps (https://www.solarsystemscope.com/textures/), CC BY 4.0. Mercury is the natural grey 8K map, credited to Shady Tex (https://sketchfab.com/3d-models/mercury-realistic-8k-215f364627054d25ae03bcd72afda714) and to Solar System Scope, also CC BY 4.0. Jupiter and Uranus use Nestaeric's band maps, and Saturn's poles, including the north-polar hexagon, are reprojected from Nestaeric's Saturn (https://sketchfab.com/3d-models/saturn-c09a1970148c43ad99db134a9d6d00b5), also CC BY 4.0. The originals are kept outside this repository. The code of this package stays MIT.
|
|
100
|
+
The same rows are `PICTURE_CREDITS` (`picturesCredit` writes the line for the bodies a page shows; the English credit is the credit column below). Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equirectangular maps (https://www.solarsystemscope.com/textures/), CC BY 4.0. Mercury is the natural grey 8K map, credited to Shady Tex (https://sketchfab.com/3d-models/mercury-realistic-8k-215f364627054d25ae03bcd72afda714) and to Solar System Scope, also CC BY 4.0. Jupiter and Uranus use Nestaeric's band maps, and Saturn's poles, including the north-polar hexagon, are reprojected from Nestaeric's Saturn (https://sketchfab.com/3d-models/saturn-c09a1970148c43ad99db134a9d6d00b5), also CC BY 4.0. The originals are kept outside this repository. The code of this package stays MIT.
|
|
101
101
|
|
|
102
102
|
| Pictures | Body | Source file | Licence | Credit | What was done |
|
|
103
103
|
|---|---|---|---|---|---|
|
|
@@ -205,7 +205,7 @@ Credit: Horizons is NASA/JPL-Caltech's service; the trajectories above are credi
|
|
|
205
205
|
|
|
206
206
|
## The data door
|
|
207
207
|
|
|
208
|
-
- **The package's own credits (`OWN_SOURCES` in `@johnmorrisdotca/wakusei-planets/door`, MODULES-831, written 2026-11-10)**: three rows, written from the entries of this file and read nowhere else. `wakusei-pictures` is the surface pictures (Surface pictures above
|
|
208
|
+
- **The package's own credits (`OWN_SOURCES` in `@johnmorrisdotca/wakusei-planets/door`, MODULES-831, written 2026-11-10)**: three rows, written from the entries of this file and read nowhere else. `wakusei-pictures` is the surface pictures (Surface pictures above). Its credit is `picturesCredit` over every pictured body, so a public-domain map stays public domain and a CC BY 4.0 map names Solar System Scope, Shady Tex or Nestaeric and the changes. The source's licence name stays the stricter, "CC BY 4.0", read 2026-11-02. `wakusei-tiles` is the finer map tiles (Finer map tiles above: public domain, read 2026-11-09). `wakusei-orbits` is the series and tables the positions come from (The numbers above: IMCCE's VSOP87B and ELP2000-82B, which "carry no licence text" and are published for use with the credit, and JPL Horizons, NASA/JPL-Caltech, read 2026-11-07; its licence name says "Published for use with credit"). A test holds that none of the three is marked non-commercial or share-alike.
|
|
209
209
|
- **Data a caller hands in is not part of this package.** A source passed to `addSource` or `sources` carries its own credit and licence, and the credit line prints them (with "non-commercial" or "share-alike" where the source says so). This package bundles no such data and takes none as a dependency. The small-body source is a list of orbital elements a caller supplies; this package holds no catalogue of them.
|
|
210
210
|
|
|
211
211
|
## Orbiter's MIT notice
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Wakusei Planets runs in the browser of a phone, a tablet or a computer: nothing
|
|
|
19
19
|
|
|
20
20
|
<p align="center"><img alt="The demo on a desk: Saturn in the painted look, turning in the big view, with the page's links to the portrait builder, the colouring sheets, the space view, the star page and the size line-up above it, and the choice of body and its moons below" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-desk.webp" width="620"> <img alt="The same page on a phone: the same links in rows, and Saturn in the painted look below them" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-phone.webp" width="200"></p>
|
|
21
21
|
|
|
22
|
-
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
22
|
+
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.39.0/docs/images/lineup-desk.png" width="640"></p>
|
|
23
23
|
|
|
24
24
|
## Who it is for
|
|
25
25
|
|
|
@@ -125,7 +125,7 @@ Import the element once in client code, and the entry point of each body you dra
|
|
|
125
125
|
|---|---|---|
|
|
126
126
|
| `line` | A clean outline drawing with the body's key features: bands, craters, rings and their gaps, caps, the dark side dashed off. An SVG. | nothing |
|
|
127
127
|
| `realistic` | A shaded sphere drawn from the body's real colours and features, lit from the Sun's side, with the rings casting shadows. No pictures: the surface is worked out in a shader. | `three`, the body's entry point |
|
|
128
|
-
| `painted` | A real surface map
|
|
128
|
+
| `painted` | A real surface map: public-domain NASA, USGS and JPL imagery, or for Mercury, Venus, Jupiter, Saturn, Uranus, Neptune and the Sun a CC BY 4.0 map (`picturesCredit` writes each body's credit). Small pictures first (1.31 MB for all of them in the package), a sharper one fetched when you zoom in, and finer map tiles for the part in view when you zoom right up, in a body, a portrait or the space view (Mars, the Moon, the Earth and ten moons: [close zoom](docs/guides/close-zoom.md)). | `three`, the body's entry point |
|
|
129
129
|
|
|
130
130
|
Every body has its real size relative to the others (`scale-to="jupiter"`), its axial tilt and its rotation. The Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto are drawn, and so are the eight other dwarf planets (Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna; Haumea and Quaoar as the long shapes they are, and Ceres with a painted map from Dawn) five minor bodies (Vesta, with Dawn's own map, Pallas, Chiron, Pholus and Halley's comet, each its own shape, size and spin as the Small-Body Database has them) and 29 moons (the Moon, Phobos and Deimos, the four Galilean moons, Saturn's seven larger moons, Uranus's five, Proteus, Triton and Nereid, Charon, Nix and Hydra, and Vanth, Hiʻiaka, Namaka and Dysnomia, the moons of the dwarf planets whose orbits are published with a date). The Earth is drawn like the rest in the realistic and painted looks (NASA's Blue Marble), and its line look is [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth)'s own globe: `import "@johnmorrisdotca/wakusei-planets/earth"` (it needs `@johnmorrisdotca/chikyu-earth` 0.10.0 or later installed). The painted looks cover the Sun, the planets from Mercury to Earth and Pluto, Ceres, the Moon, the four Galilean moons, Saturn's Mimas, Enceladus, Tethys, Dione, Rhea, Titan and Iapetus, Triton and Charon, and Saturn's rings are Cassini's own picture of them.
|
|
131
131
|
|
|
@@ -388,7 +388,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
|
|
|
388
388
|
|
|
389
389
|
## The portrait builder
|
|
390
390
|
|
|
391
|
-
<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.
|
|
391
|
+
<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.39.0/docs/images/portrait-family.png" width="640"></p>
|
|
392
392
|
|
|
393
393
|
[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.
|
|
394
394
|
|
|
@@ -534,7 +534,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
534
534
|
|
|
535
535
|
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:
|
|
536
536
|
|
|
537
|
-
> Morris, J. (2026). *Wakusei Planets* (version 0.
|
|
537
|
+
> Morris, J. (2026). *Wakusei Planets* (version 0.39.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
|
|
538
538
|
|
|
539
539
|
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).
|
|
540
540
|
|
package/dist/door/own.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PICTURE_CREDITS, picturesCredit } from "../picture-credits.js";
|
|
2
|
+
const PICTURE_IDS = PICTURE_CREDITS.map((row) => row.id);
|
|
1
3
|
const NOTICE = "https://github.com/johnmorrisdotca/wakusei-planets/blob/main/NOTICE.md";
|
|
2
4
|
function freeze(value) {
|
|
3
5
|
if (typeof value === "object" && value !== null)
|
|
@@ -21,8 +23,8 @@ export const OWN_SOURCES = freeze([
|
|
|
21
23
|
id: "wakusei-pictures",
|
|
22
24
|
name: { en: "Surface pictures", ja: "表面の地図" },
|
|
23
25
|
credit: {
|
|
24
|
-
en:
|
|
25
|
-
ja:
|
|
26
|
+
en: picturesCredit(PICTURE_IDS, "en"),
|
|
27
|
+
ja: picturesCredit(PICTURE_IDS, "ja"),
|
|
26
28
|
},
|
|
27
29
|
licence: { name: "CC BY 4.0", url: `${NOTICE}#surface-pictures`, spdx: "CC-BY-4.0" },
|
|
28
30
|
url: "https://github.com/johnmorrisdotca/wakusei-planets/tree/main/textures",
|
package/dist/embed.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export interface EmbedOptions {
|
|
|
49
49
|
turn?: number;
|
|
50
50
|
/** Pixels across. */
|
|
51
51
|
size?: number;
|
|
52
|
+
/** The credit's language: `en` (the default) or `ja`. */
|
|
53
|
+
lang?: "en" | "ja";
|
|
52
54
|
/** How far in the embed page starts, as its `zoom` address key has it (1 is the whole body). Left out or 1, the page starts at Fit. Only the iframe way carries it: the element's own start is Fit. */
|
|
53
55
|
zoom?: number;
|
|
54
56
|
}
|
|
@@ -171,6 +173,7 @@ export interface LineupEmbed {
|
|
|
171
173
|
export declare function lineupCode(options: LineupEmbed, kind?: EmbedKind, settings?: EmbedSettings): string;
|
|
172
174
|
/**
|
|
173
175
|
* The credits that travel with a picture of the size line-up: the radii are from refereed papers, the stars are drawn from numbers and not photographs, and the planets' sizes are the IAU's and NASA's.
|
|
176
|
+
* A painted Earth and Jupiter add `picturesCredit` for those two, in `options.lang` (`en` when left out).
|
|
174
177
|
*
|
|
175
178
|
* @param options - The choices, so the planets and their pictures are named only when they are used.
|
|
176
179
|
* @returns A short line of credit to put near the picture.
|
|
@@ -184,7 +187,7 @@ export declare function lineupCode(options: LineupEmbed, kind?: EmbedKind, setti
|
|
|
184
187
|
*/
|
|
185
188
|
export declare function lineupCredit(options: LineupEmbed): string;
|
|
186
189
|
/**
|
|
187
|
-
* The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and `realistic` and `painted` use the surface
|
|
190
|
+
* The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and `realistic` and `painted` use the surface map of that body (`picturesCredit`). `lang` is `en` or `ja` (`en` when left out).
|
|
188
191
|
*
|
|
189
192
|
* @param options - The choices, so only what is used is named.
|
|
190
193
|
* @returns A short line of credit to put near the picture.
|
package/dist/embed.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// section shows these as the reader changes a choice, and the tests build or parse every one. Pure: no DOM.
|
|
3
3
|
import { embedSnippet } from "@johnmorrisdotca/kazoku-ui/embed-panel";
|
|
4
4
|
import { BODIES, DWARF_IDS, MINOR_IDS } from "./facts.js";
|
|
5
|
+
import { picturesCredit } from "./picture-credits.js";
|
|
5
6
|
import { decodeScene } from "./portrait/model.js";
|
|
6
7
|
import { VERSION } from "./version.js";
|
|
7
8
|
/**
|
|
@@ -177,6 +178,7 @@ export function lineupCode(options, kind = "html", settings = {}) {
|
|
|
177
178
|
}
|
|
178
179
|
/**
|
|
179
180
|
* The credits that travel with a picture of the size line-up: the radii are from refereed papers, the stars are drawn from numbers and not photographs, and the planets' sizes are the IAU's and NASA's.
|
|
181
|
+
* A painted Earth and Jupiter add `picturesCredit` for those two, in `options.lang` (`en` when left out).
|
|
180
182
|
*
|
|
181
183
|
* @param options - The choices, so the planets and their pictures are named only when they are used.
|
|
182
184
|
* @returns A short line of credit to put near the picture.
|
|
@@ -189,12 +191,18 @@ export function lineupCode(options, kind = "html", settings = {}) {
|
|
|
189
191
|
* ```
|
|
190
192
|
*/
|
|
191
193
|
export function lineupCredit(options) {
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
|
|
194
|
+
const lang = options.lang ?? "en";
|
|
195
|
+
const base = lang === "ja"
|
|
196
|
+
? "Wakusei Planets(John Morris、MIT)。大きさは実際の比です。星の半径は、角直径を測った査読論文によります(出典と食い違いはパッケージのNOTICE.md)。星は数字から描いたもので、写真ではありません。表面の模様、黒点、輝きは説明のためのものです。"
|
|
197
|
+
: "Wakusei Planets by John Morris (MIT). Sizes at true relative scale; each star's radius is from a refereed paper that measured its angular diameter (sources and disagreements in the package's NOTICE.md). The stars are drawn from their numbers, not photographs: the cells, spots and glow are illustrative.";
|
|
198
|
+
if (options.planets !== true)
|
|
199
|
+
return base;
|
|
200
|
+
const sizes = lang === "ja" ? " 地球と木星:IAUとNASAの大きさ。" : " Earth and Jupiter: IAU and NASA sizes.";
|
|
201
|
+
const pictures = options.look === "painted" ? ` ${picturesCredit(["earth", "jupiter"], lang)}` : "";
|
|
202
|
+
return `${base}${sizes}${pictures}`;
|
|
195
203
|
}
|
|
196
204
|
/**
|
|
197
|
-
* The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and `realistic` and `painted` use the surface
|
|
205
|
+
* The credits that travel with a picture of a body: the line and illustrated looks are drawn from numbers, and `realistic` and `painted` use the surface map of that body (`picturesCredit`). `lang` is `en` or `ja` (`en` when left out).
|
|
198
206
|
*
|
|
199
207
|
* @param options - The choices, so only what is used is named.
|
|
200
208
|
* @returns A short line of credit to put near the picture.
|
|
@@ -207,11 +215,14 @@ export function lineupCredit(options) {
|
|
|
207
215
|
* ```
|
|
208
216
|
*/
|
|
209
217
|
export function embedCredit(options) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
const lang = options.lang ?? "en";
|
|
219
|
+
if (options.star !== undefined) {
|
|
220
|
+
return lang === "ja"
|
|
221
|
+
? "Wakusei Planets(John Morris、MIT)。数字から描いた星で、写真ではありません。色は温度から、大きさは半径から。表面の模様、黒点、輝きは説明のためのものです。"
|
|
222
|
+
: "Wakusei Planets by John Morris (MIT). A star drawn from its numbers, not a photo: the colour from its temperature, the size from its radius; the surface cells, spots and glow are illustrative.";
|
|
223
|
+
}
|
|
224
|
+
const base = lang === "ja" ? "Wakusei Planets(John Morris、MIT)。大きさ、傾き、自転はIAUとNASAのファクトシートによります。" : "Wakusei Planets by John Morris (MIT). Sizes, tilt and rotation: IAU and NASA fact sheets.";
|
|
213
225
|
const photos = options.look !== "line" && options.look !== "illustrated";
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
return `${base}${painted}${earth}`;
|
|
226
|
+
const pictures = photos ? picturesCredit([options.body], lang) : "";
|
|
227
|
+
return pictures === "" ? base : `${base} ${pictures}`;
|
|
217
228
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { drawnTilt, portrait, type PortraitOptions } from "./pose.ts";
|
|
|
5
5
|
export { lineSvg, mix, type LineOptions } from "./line.ts";
|
|
6
6
|
export { ringStrip, type RingStrip } from "./scene/rings.ts";
|
|
7
7
|
export { embedCode, embedCredit, EMBED_KINDS, lineupCode, lineupCredit, portraitCode, type EmbedKind, type EmbedOptions, type EmbedSettings, type LineupEmbed, type PortraitEmbed } from "./embed.ts";
|
|
8
|
+
export { mercuryTilesCredit, PICTURE_CREDITS, picturesCredit, type PictureCredit } from "./picture-credits.ts";
|
|
8
9
|
export { addBody, decodeScene, defaultPortrait, encodeScene, PRESETS as PORTRAIT_PRESETS, resolve as layoutPortrait, type Item as PortraitItem, type Placed as PlacedItem, type Portrait, type Preset as PortraitPreset, type Resolved as PortraitLayout } from "./portrait/model.ts";
|
|
9
10
|
export { LUMINOSITY_CLASSES, STAR_SUN, starLook, type LuminosityClass, type StarLook, type StarNumberName, type StarNumbers, type StarPart, type StarStatus } from "./star.ts";
|
|
10
11
|
export { starLineSvg } from "./star-line.ts";
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { drawnTilt, portrait } from "./pose.js";
|
|
|
5
5
|
export { lineSvg, mix } from "./line.js";
|
|
6
6
|
export { ringStrip } from "./scene/rings.js";
|
|
7
7
|
export { embedCode, embedCredit, EMBED_KINDS, lineupCode, lineupCredit, portraitCode } from "./embed.js";
|
|
8
|
+
export { mercuryTilesCredit, PICTURE_CREDITS, picturesCredit } from "./picture-credits.js";
|
|
8
9
|
export { addBody, decodeScene, defaultPortrait, encodeScene, PRESETS as PORTRAIT_PRESETS, resolve as layoutPortrait } from "./portrait/model.js";
|
|
9
10
|
export { LUMINOSITY_CLASSES, STAR_SUN, starLook } from "./star.js";
|
|
10
11
|
export { starLineSvg } from "./star-line.js";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type BodyId } from "./facts.ts";
|
|
2
|
+
/**
|
|
3
|
+
* One body's surface picture: who made the map, the licence named in `NOTICE.md`, and, for a CC BY 4.0 map, what this package changed.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { PICTURE_CREDITS, type PictureCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
8
|
+
*
|
|
9
|
+
* const jupiter: PictureCredit = PICTURE_CREDITS.find((row) => row.id === "jupiter")!;
|
|
10
|
+
* console.log(jupiter.licence);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export interface PictureCredit {
|
|
14
|
+
/** The body, as `BODY_IDS` names it. */
|
|
15
|
+
readonly id: BodyId;
|
|
16
|
+
/** The licence of that body's map in `NOTICE.md`: `CC BY 4.0` or `Public domain`. */
|
|
17
|
+
readonly licence: "CC BY 4.0" | "Public domain";
|
|
18
|
+
/** The credit column of `NOTICE.md` for this picture, in English, and the same fact in Japanese. */
|
|
19
|
+
readonly credit: {
|
|
20
|
+
readonly en: string;
|
|
21
|
+
readonly ja: string;
|
|
22
|
+
};
|
|
23
|
+
/** What this package changed, from the table's "What was done" column. Present for a CC BY 4.0 map, which asks that changes be named. */
|
|
24
|
+
readonly changes?: {
|
|
25
|
+
readonly en: string;
|
|
26
|
+
readonly ja: string;
|
|
27
|
+
};
|
|
28
|
+
/** Another picture drawn with the body (Saturn's rings), with its own credit and licence. */
|
|
29
|
+
readonly also?: {
|
|
30
|
+
readonly en: string;
|
|
31
|
+
readonly ja: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The surface picture of every body that has one, in the order of the table in `NOTICE.md`. A body with no row is drawn from numbers and has no picture to credit.
|
|
36
|
+
* The English of a CC BY 4.0 row is that table's credit column. Jupiter and Uranus keep the authors' own attribution sentences, including the spelling of the name.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { PICTURE_CREDITS } from "@johnmorrisdotca/wakusei-planets";
|
|
41
|
+
*
|
|
42
|
+
* console.log(PICTURE_CREDITS.filter((row) => row.licence === "CC BY 4.0").map((row) => row.id).join(","));
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const PICTURE_CREDITS: readonly PictureCredit[];
|
|
46
|
+
/**
|
|
47
|
+
* The credit for Mercury's finer map tiles. Their detail is a public-domain map, and their colour is the 2048 picture, which is CC BY 4.0, so the tiles carry that credit too.
|
|
48
|
+
* The words are the Mercury row of `NOTICE.md`'s "Finer map tiles" table.
|
|
49
|
+
*
|
|
50
|
+
* @param lang - `en` or `ja`.
|
|
51
|
+
* @returns The one sentence.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { mercuryTilesCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
56
|
+
*
|
|
57
|
+
* console.log(mercuryTilesCredit("en").includes("CC BY 4.0"));
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function mercuryTilesCredit(lang: "en" | "ja"): string;
|
|
61
|
+
/**
|
|
62
|
+
* The credit line for the surface pictures of the named bodies, in one language. A name is a body id in any case (`Jupiter`, `moon`). A body with no picture is left out.
|
|
63
|
+
* Only the named bodies are credited: Jupiter names Nestaeric and CC BY 4.0, and the Moon and Mars, whose maps are public domain, name no CC BY 4.0 source.
|
|
64
|
+
* An empty list, or a list of bodies with no pictures, is an empty string.
|
|
65
|
+
*
|
|
66
|
+
* @param bodies - The bodies a page is showing.
|
|
67
|
+
* @param lang - `en` or `ja`.
|
|
68
|
+
* @returns The line, or `""` when none of the bodies has a picture.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { picturesCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
73
|
+
*
|
|
74
|
+
* console.log(picturesCredit(["Jupiter"], "en").includes("Nestaeric"));
|
|
75
|
+
* console.log(picturesCredit(["Moon", "Mars"], "en").includes("CC BY") === false);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function picturesCredit(bodies: readonly string[], lang: "en" | "ja"): string;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Which body's surface picture comes from which source, written from the rows of NOTICE.md (the "Surface pictures" table). Pure: no DOM, no three.js.
|
|
2
|
+
// A page that shows a body names only that body's row. The English credit is the table's credit column, unchanged; the Japanese says the same fact.
|
|
3
|
+
import { BODIES } from "./facts.js";
|
|
4
|
+
const cc = (id, en, ja, changesEn, changesJa, also) => ({
|
|
5
|
+
id,
|
|
6
|
+
licence: "CC BY 4.0",
|
|
7
|
+
credit: { en, ja },
|
|
8
|
+
changes: { en: changesEn, ja: changesJa },
|
|
9
|
+
...(also === undefined ? {} : { also: { en: also.en, ja: also.ja } }),
|
|
10
|
+
});
|
|
11
|
+
const pd = (id, en, ja) => ({ id, licence: "Public domain", credit: { en, ja } });
|
|
12
|
+
/**
|
|
13
|
+
* The surface picture of every body that has one, in the order of the table in `NOTICE.md`. A body with no row is drawn from numbers and has no picture to credit.
|
|
14
|
+
* The English of a CC BY 4.0 row is that table's credit column. Jupiter and Uranus keep the authors' own attribution sentences, including the spelling of the name.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { PICTURE_CREDITS } from "@johnmorrisdotca/wakusei-planets";
|
|
19
|
+
*
|
|
20
|
+
* console.log(PICTURE_CREDITS.filter((row) => row.licence === "CC BY 4.0").map((row) => row.id).join(","));
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export const PICTURE_CREDITS = [
|
|
24
|
+
cc("mercury", "Shady Tex and Solar System Scope", "Shady TexとSolar System Scope", "Natural grey, resized to 512, 1024 and 2048. The normal map is not used.", "自然な灰色にし、512、1024、2048に縮小しました。法線マップは使っていません。"),
|
|
25
|
+
cc("venus", "Solar System Scope", "Solar System Scope", "Equirectangular surface map, resized to 512, 1024 and 2048.", "正距円筒図法の表面の地図を、512、1024、2048に縮小しました。"),
|
|
26
|
+
pd("mars", "NASA / Jet Propulsion Lab / USGS", "NASA / Jet Propulsion Lab / USGS"),
|
|
27
|
+
cc("jupiter", 'This work is based on "Jupiter" (https://sketchfab.com/3d-models/jupiter-6380860bdb4247b98b30643615c3afab) by Nestaeric (https://sketchfab.com/Nestaeric) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)', "Nestaeric(https://sketchfab.com/Nestaeric)による「Jupiter」(https://sketchfab.com/3d-models/jupiter-6380860bdb4247b98b30643615c3afab)をもとにしています。ライセンスは CC-BY-4.0(http://creativecommons.org/licenses/by/4.0/)です", "The band half of the texture, with the Great Red Spot and turbulent detail, resized to 512, 1024 and 2048.", "大赤斑と細かい乱れのある帯の半分を使い、512、1024、2048に縮小しました。"),
|
|
28
|
+
cc("saturn", "Solar System Scope; pole caps by Nestaeric", "Solar System Scope。極の冠はNestaeric", "The bands are Solar System Scope's map. The last 20 degrees at each pole are reprojected from Nestaeric's caps, and the north cap has the hexagon.", "縞はSolar System Scopeの地図です。両極の端の20度はNestaericの冠を張り直し、北の冠には六角形があります。", {
|
|
29
|
+
en: "Rings: NASA / JPL / Space Science Institute (public domain).",
|
|
30
|
+
ja: "環:NASA / JPL / Space Science Institute(パブリックドメイン)。",
|
|
31
|
+
}),
|
|
32
|
+
cc("uranus", 'This work is based on "Uranus" (https://sketchfab.com/3d-models/uranus-0009a69dbace44608c0bd09af9ba20db) by NestaEric (https://sketchfab.com/Nestaeric) licensed under CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)', "NestaEric(https://sketchfab.com/Nestaeric)による「Uranus」(https://sketchfab.com/3d-models/uranus-0009a69dbace44608c0bd09af9ba20db)をもとにしています。ライセンスは CC-BY-4.0(http://creativecommons.org/licenses/by/4.0/)です", "The band half of the texture, which has a bright spot, resized to 512, 1024 and 2048.", "明るい斑のある帯の半分を使い、512、1024、2048に縮小しました。"),
|
|
33
|
+
cc("neptune", "Solar System Scope", "Solar System Scope", "Equirectangular map, resized to 512, 1024 and 2048.", "正距円筒図法の地図を、512、1024、2048に縮小しました。"),
|
|
34
|
+
pd("pluto", "NASA / Johns Hopkins University Applied Physics Laboratory / Southwest Research Institute", "NASA / Johns Hopkins University Applied Physics Laboratory / Southwest Research Institute"),
|
|
35
|
+
cc("sun", "Solar System Scope", "Solar System Scope", "Equirectangular map, resized to 512, 1024 and 2048.", "正距円筒図法の地図を、512、1024、2048に縮小しました。"),
|
|
36
|
+
pd("moon", "NASA's Scientific Visualization Studio (Ernie Wright, Noah Petro); Lunar Reconnaissance Orbiter Camera", "NASA Scientific Visualization Studio(Ernie Wright、Noah Petro)、Lunar Reconnaissance Orbiter Camera"),
|
|
37
|
+
pd("io", "NASA / JPL (Galileo SSI and Voyager images); the file page names no author", "NASA / JPL(Galileo SSIとVoyagerの画像)。ファイルのページに作者の名はありません"),
|
|
38
|
+
pd("europa", "U.S. Geological Survey / Planetary Data System / Tammy Becker", "U.S. Geological Survey / Planetary Data System / Tammy Becker"),
|
|
39
|
+
pd("ganymede", "USGS", "USGS"),
|
|
40
|
+
pd("callisto", "USGS", "USGS"),
|
|
41
|
+
pd("titan", "NASA / JPL / Space Science Institute", "NASA / JPL / Space Science Institute"),
|
|
42
|
+
pd("earth", "NASA Earth Observatory (Reto Stockli), Blue Marble", "NASA Earth Observatory(Reto Stockli)、Blue Marble"),
|
|
43
|
+
pd("rhea", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
44
|
+
pd("enceladus", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
45
|
+
pd("mimas", "NASA/JPL/Space Science Institute", "NASA/JPL/Space Science Institute"),
|
|
46
|
+
pd("ceres", "NASA/JPL-Caltech/UCLA/MPS/DLR/IDA", "NASA/JPL-Caltech/UCLA/MPS/DLR/IDA"),
|
|
47
|
+
pd("vesta", "NASA/JPL-Caltech/UCLA/MPS/DLR/IDA (as the file page gives it; hosted by the USGS Astrogeology Science Center's Gazetteer of Planetary Nomenclature)", "NASA/JPL-Caltech/UCLA/MPS/DLR/IDA(ファイルのページの表記。USGS Astrogeology Science CenterのGazetteer of Planetary Nomenclatureが公開)"),
|
|
48
|
+
pd("tethys", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
49
|
+
pd("dione", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
50
|
+
pd("iapetus", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
51
|
+
pd("triton", "NASA/JPL-Caltech/Lunar & Planetary Institute (Paul Schenk; Voyager 2 images)", "NASA/JPL-Caltech/Lunar & Planetary Institute(Paul Schenk、Voyager 2の画像)"),
|
|
52
|
+
pd("charon", "NASA/Johns Hopkins University Applied Physics Laboratory/Southwest Research Institute (via the IAU)", "NASA/Johns Hopkins University Applied Physics Laboratory/Southwest Research Institute(IAU経由)"),
|
|
53
|
+
];
|
|
54
|
+
const BY_ID = new Map(PICTURE_CREDITS.map((row) => [row.id, row]));
|
|
55
|
+
/**
|
|
56
|
+
* The credit for Mercury's finer map tiles. Their detail is a public-domain map, and their colour is the 2048 picture, which is CC BY 4.0, so the tiles carry that credit too.
|
|
57
|
+
* The words are the Mercury row of `NOTICE.md`'s "Finer map tiles" table.
|
|
58
|
+
*
|
|
59
|
+
* @param lang - `en` or `ja`.
|
|
60
|
+
* @returns The one sentence.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { mercuryTilesCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
65
|
+
*
|
|
66
|
+
* console.log(mercuryTilesCredit("en").includes("CC BY 4.0"));
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export function mercuryTilesCredit(lang) {
|
|
70
|
+
return lang === "ja"
|
|
71
|
+
? "水星の細かい地図のタイルの色は、2048の絵(Solar System Scopeの地図、CC BY 4.0)の色です。タイルもその出典を持ちます。"
|
|
72
|
+
: "The colour of Mercury's finer map tiles is the 2048 picture's (Solar System Scope's map, CC BY 4.0), so these tiles carry that credit too.";
|
|
73
|
+
}
|
|
74
|
+
const phrase = (row, lang) => {
|
|
75
|
+
const name = BODIES[row.id].name[lang];
|
|
76
|
+
if (lang === "ja") {
|
|
77
|
+
const licence = row.licence === "CC BY 4.0" ? "CC BY 4.0" : "パブリックドメイン";
|
|
78
|
+
const changes = row.changes === undefined ? "" : `変更:${row.changes.ja}`;
|
|
79
|
+
const also = row.also === undefined ? "" : row.also.ja;
|
|
80
|
+
return `${name}:${row.credit.ja}(${licence})。${changes}${also}`;
|
|
81
|
+
}
|
|
82
|
+
const licence = row.licence === "CC BY 4.0" ? "CC BY 4.0" : "public domain";
|
|
83
|
+
const changes = row.changes === undefined ? "" : ` Changes made: ${row.changes.en}`;
|
|
84
|
+
const also = row.also === undefined ? "" : ` ${row.also.en}`;
|
|
85
|
+
return `${name}: ${row.credit.en} (${licence}).${changes}${also}`;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* The credit line for the surface pictures of the named bodies, in one language. A name is a body id in any case (`Jupiter`, `moon`). A body with no picture is left out.
|
|
89
|
+
* Only the named bodies are credited: Jupiter names Nestaeric and CC BY 4.0, and the Moon and Mars, whose maps are public domain, name no CC BY 4.0 source.
|
|
90
|
+
* An empty list, or a list of bodies with no pictures, is an empty string.
|
|
91
|
+
*
|
|
92
|
+
* @param bodies - The bodies a page is showing.
|
|
93
|
+
* @param lang - `en` or `ja`.
|
|
94
|
+
* @returns The line, or `""` when none of the bodies has a picture.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* import { picturesCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
99
|
+
*
|
|
100
|
+
* console.log(picturesCredit(["Jupiter"], "en").includes("Nestaeric"));
|
|
101
|
+
* console.log(picturesCredit(["Moon", "Mars"], "en").includes("CC BY") === false);
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export function picturesCredit(bodies, lang) {
|
|
105
|
+
const seen = new Set();
|
|
106
|
+
const rows = [];
|
|
107
|
+
for (const name of bodies) {
|
|
108
|
+
const id = name.toLowerCase();
|
|
109
|
+
if (seen.has(id))
|
|
110
|
+
continue;
|
|
111
|
+
seen.add(id);
|
|
112
|
+
const row = BY_ID.get(id);
|
|
113
|
+
if (row !== undefined)
|
|
114
|
+
rows.push(row);
|
|
115
|
+
}
|
|
116
|
+
if (rows.length === 0)
|
|
117
|
+
return "";
|
|
118
|
+
const head = lang === "ja" ? "表面の地図:" : "Surface pictures: ";
|
|
119
|
+
return head + rows.map((row) => phrase(row, lang)).join(lang === "ja" ? "" : " ");
|
|
120
|
+
}
|
package/dist/scene/painter.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { moonOffset, orientation } from "./orient.ts";
|
|
|
8
8
|
import { type NameLabelOptions } from "./name-label.ts";
|
|
9
9
|
export { moonOffset, orientation };
|
|
10
10
|
export { nameLabelText, readNameLabel, setBodyLabelFontUrl, type NameLabelOptions } from "./name-label.ts";
|
|
11
|
+
export { mercuryTilesCredit, PICTURE_CREDITS, picturesCredit, type PictureCredit } from "../picture-credits.ts";
|
|
11
12
|
/**
|
|
12
13
|
* The looks the painter draws: `realistic` (shaded from the body's real colours and features) and `painted` (a public-domain surface map, with the shaded look until it arrives).
|
|
13
14
|
*
|
|
@@ -201,6 +202,16 @@ export interface PainterOptions {
|
|
|
201
202
|
export interface WakuseiPainter {
|
|
202
203
|
/** The looks `make` takes in `context.look`. */
|
|
203
204
|
readonly looks: readonly PainterLook[];
|
|
205
|
+
/**
|
|
206
|
+
* The credit for the pictures this painter is drawing, in English and Japanese, written from `PICTURE_CREDITS` and from `OWN_SOURCES`.
|
|
207
|
+
* Until `make` has been called it names every surface picture the painter can draw, because it does not yet know which a page will show. After `make` it names only the bodies it has made in a look that draws the map
|
|
208
|
+
* (`painted`, or a body whose look is mapped). A shaded body with no map is left out, so the Moon and Mars name no CC BY 4.0 source. While a window of finer map tiles is on a body, the `wakusei-tiles` credit is added;
|
|
209
|
+
* Mercury's tiles also say that their colour is the CC BY 4.0 map.
|
|
210
|
+
*/
|
|
211
|
+
readonly credit: {
|
|
212
|
+
readonly en: string;
|
|
213
|
+
readonly ja: string;
|
|
214
|
+
};
|
|
204
215
|
/** Make a body: `Sun`, a planet, `Pluto` or a moon, in any case. Throws for a name it does not know. */
|
|
205
216
|
/** `three` is the three.js module (or a subset of it holding the parts `PainterThree` names); it is typed loosely so that another package can hand over its own subset. */
|
|
206
217
|
make(three: object, name: string, context?: PaintContext): Painting;
|
package/dist/scene/painter.js
CHANGED
|
@@ -3,6 +3,8 @@ import { BODIES, MOONS_OF } from "../facts.js";
|
|
|
3
3
|
import { writeBasis } from "./basis.js";
|
|
4
4
|
import { TEXTURE_BASE, TEXTURE_FAR_BASE, TILES_BASE, slash, loadImage, mapSourceFor, tilesAllowed } from "./textures.js";
|
|
5
5
|
import { createSourceBook } from "../door/book.js";
|
|
6
|
+
import { OWN_BY_ID } from "../door/own.js";
|
|
7
|
+
import { mercuryTilesCredit, PICTURE_CREDITS, picturesCredit } from "../picture-credits.js";
|
|
6
8
|
import { cross } from "../vec.js";
|
|
7
9
|
import { bodyFragment, GLOW_FRAGMENT, GLOW_VERTEX, PAINTED_SURFACE, PAINTED_SURFACE_WINDOWED, RING_FRAGMENT_WORLD, RING_VERTEX_WORLD, VERTEX_WORLD } from "./glsl.js";
|
|
8
10
|
import { fallbackLook } from "./fallback.js";
|
|
@@ -14,6 +16,7 @@ import { ringStrip } from "./rings.js";
|
|
|
14
16
|
import { createNameLabel, nameLabelText } from "./name-label.js";
|
|
15
17
|
export { moonOffset, orientation };
|
|
16
18
|
export { nameLabelText, readNameLabel, setBodyLabelFontUrl } from "./name-label.js";
|
|
19
|
+
export { mercuryTilesCredit, PICTURE_CREDITS, picturesCredit } from "../picture-credits.js";
|
|
17
20
|
/**
|
|
18
21
|
* The looks the painter draws: `realistic` (shaded from the body's real colours and features) and `painted` (a public-domain surface map, with the shaded look until it arrives).
|
|
19
22
|
*
|
|
@@ -92,7 +95,7 @@ function sightOf(T, view) {
|
|
|
92
95
|
},
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
|
-
function paint(T, id, context, bases) {
|
|
98
|
+
function paint(T, id, context, bases, hold) {
|
|
96
99
|
const facts = BODIES[id];
|
|
97
100
|
const look = lookOf(id) ?? fallbackLook(facts);
|
|
98
101
|
const wantPainted = (context.look === "painted" || look.mapped === true || context.mapped === true) && look.painted !== undefined;
|
|
@@ -373,6 +376,7 @@ function paint(T, id, context, bases) {
|
|
|
373
376
|
};
|
|
374
377
|
if (context.label)
|
|
375
378
|
setLabel(context.label);
|
|
379
|
+
const drop = hold?.({ id, picture: wantPainted, tiles: () => detail?.stats.shown != null });
|
|
376
380
|
return {
|
|
377
381
|
object: group,
|
|
378
382
|
setLabel,
|
|
@@ -433,6 +437,7 @@ function paint(T, id, context, bases) {
|
|
|
433
437
|
},
|
|
434
438
|
dispose() {
|
|
435
439
|
gone = true;
|
|
440
|
+
drop?.();
|
|
436
441
|
setLabel(null);
|
|
437
442
|
if (windowUniforms !== undefined) {
|
|
438
443
|
windowUniforms.uDetailOn.value = 0;
|
|
@@ -471,9 +476,32 @@ export function createPainter(options = {}) {
|
|
|
471
476
|
const own = options.tiles;
|
|
472
477
|
const tiles = own === "off" || own === "none" || own === "" ? undefined : own !== undefined ? slash(own) : options.textureBase !== undefined ? undefined : TILES_BASE;
|
|
473
478
|
const book = options.book ?? createSourceBook({ kinds: ["tiles"] });
|
|
479
|
+
let made = false;
|
|
480
|
+
const live = new Set();
|
|
481
|
+
const creditLine = (lang) => {
|
|
482
|
+
const ids = made ? [...live].filter((body) => body.picture).map((body) => body.id) : PICTURE_CREDITS.map((row) => row.id);
|
|
483
|
+
const parts = [picturesCredit(ids, lang)];
|
|
484
|
+
const tiled = [...live].filter((body) => body.tiles());
|
|
485
|
+
if (tiled.length > 0) {
|
|
486
|
+
parts.push(OWN_BY_ID.get("wakusei-tiles").credit[lang]);
|
|
487
|
+
if (tiled.some((body) => body.id === "mercury"))
|
|
488
|
+
parts.push(mercuryTilesCredit(lang));
|
|
489
|
+
}
|
|
490
|
+
return parts.filter((part) => part !== "").join(" ");
|
|
491
|
+
};
|
|
474
492
|
return {
|
|
475
493
|
looks: LOOKS,
|
|
476
|
-
|
|
494
|
+
get credit() {
|
|
495
|
+
return { en: creditLine("en"), ja: creditLine("ja") };
|
|
496
|
+
},
|
|
497
|
+
make: (three, name, context = {}) => {
|
|
498
|
+
const id = idOf(name);
|
|
499
|
+
made = true;
|
|
500
|
+
return paint(three, id, context, { near, far, tiles, book, shared: options.book !== undefined }, (body) => {
|
|
501
|
+
live.add(body);
|
|
502
|
+
return () => live.delete(body);
|
|
503
|
+
});
|
|
504
|
+
},
|
|
477
505
|
moons(planet, ms) {
|
|
478
506
|
const radius = BODIES[idOf(planet)]?.radiusKm;
|
|
479
507
|
if (radius === undefined)
|
package/dist/scene/textures.d.ts
CHANGED
|
@@ -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.
|
|
14
|
+
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.39.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.
|
|
26
|
+
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.39.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.
|
|
1
|
+
export declare const VERSION = "0.39.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.39.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.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",
|