@johnmorrisdotca/wakusei-planets 0.28.0 → 0.30.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 +17 -0
- package/NOTICE.md +20 -0
- package/README.md +20 -7
- package/dist/embed.d.ts +64 -0
- package/dist/embed.js +66 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/lineup/data.d.ts +160 -0
- package/dist/lineup/data.js +303 -0
- package/dist/lineup/element.d.ts +99 -0
- package/dist/lineup/element.js +782 -0
- package/dist/lineup/labels.d.ts +141 -0
- package/dist/lineup/labels.js +155 -0
- package/dist/lineup/layout.d.ts +174 -0
- package/dist/lineup/layout.js +162 -0
- package/dist/lineup/scene3d.d.ts +47 -0
- package/dist/lineup/scene3d.js +155 -0
- package/dist/portrait/element.d.ts +5 -2
- package/dist/portrait/element.js +57 -6
- package/dist/portrait/scene3d.d.ts +13 -0
- package/dist/portrait/scene3d.js +21 -2
- package/dist/scene/body.d.ts +2 -0
- package/dist/scene/body.js +2 -1
- package/dist/scene/detail.d.ts +8 -2
- package/dist/scene/detail.js +56 -28
- package/dist/scene/painter.d.ts +30 -0
- package/dist/scene/painter.js +93 -9
- package/dist/scene/textures.d.ts +4 -2
- package/dist/scene/textures.js +2 -0
- package/dist/scene/tiles.d.ts +46 -0
- package/dist/scene/tiles.js +165 -19
- package/dist/space/clock.d.ts +31 -0
- package/dist/space/clock.js +45 -0
- package/dist/space/element.d.ts +8 -1
- package/dist/space/element.js +32 -38
- package/dist/space/scene.d.ts +9 -0
- package/dist/space/scene.js +16 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.30.0] - 2026-11-10
|
|
6
|
+
|
|
7
|
+
- **The portrait and the space view zoom to their bodies' detail, with the finer map tiles** (MODULES-773). The painter, which draws every body of `<wakusei-portrait>` and `<wakusei-space>`, now takes the tiles, the window and the zoom table that `<wakusei-body>` got in 0.27.0. `PaintInfo.view` (new, optional: the camera and the size of its view in CSS pixels) lets a body work out which part of its surface the camera sees (`seenRegion`: rays through a grid of the view and round the edge of the near side, met with the body in its own frame, for an orthographic camera and a perspective one alike); a body whose disc is 150 device pixels across its radius or more, once the 2048 pixel map is not sharp enough, reads the tile set and lays the window over its map. `createPainter({ tiles })` says where the tiles are (`off` for none; the demo site's by default unless `textureBase` is given), `PaintContext.onLevels` is told what levels a body has, and `Painting.tiles` says what the window is doing. A caller that gives no `view` (chikyu-earth's space view) draws as it always did. Bodies that are not glowing take the generic detail in the painter's shader too, as in `<wakusei-body>`.
|
|
8
|
+
- **The portrait's zoom range follows its bodies** (MODULES-773). A shaded portrait goes as far as its farthest-reaching body (the table of `scene/reach.ts`, each body measured in the radii its picture reaches from the middle of the short side of the view at Fit, on its finest tile level once the tiles are found): 8x at least, 1000x at most, as before 0.1x at the least. A line portrait stays at 8x, and so does a scene of bodies with no finer maps. `stats.tiles` and `stats.zoomMax` say what it is doing. The `tiles` attribute (new on `<wakusei-portrait>` and `<wakusei-space>`; `off` for none) names the tile folder, the demo's embed page and space page set it.
|
|
9
|
+
- **The space view's ceiling stays at 3x** (MODULES-773). The camera is held 1.05 radii from the surface, and at 3x, 0.13 radii above the ground, a texel of the finest tiles of the Earth, Mars and the Moon is about two pixels wide in a view 420 pixels high, which is where the zoom table says their detail runs out: the table gives the space view no further to go. What changes is the picture at 3x: the level 3 tiles (four to nine of them on a view as wide as the demo's) at their own size, where the 2048 pixel map was enlarged eight times. The tiles are used where a body is drawn from its map: the Earth in both looks, Mars and the Moon in the `painted` look. A far view reads no tile set and no tile. `stats.tiles` of the space view adds up its bodies' windows.
|
|
10
|
+
- **Tests** (MODULES-773). `seenRegion` against the box it replaces and against a pinhole camera; the painter with a camera, in Node, with a faked network; the portrait and the space view in a browser with the made-up tile set (what is fetched and how often, which level is on the body, nothing fetched far away, nothing drawn at rest, what the window took given back) and in the freeze test; the star presets.
|
|
11
|
+
- **The star page's presets are the size line-up's rows** (MODULES-795). Sirius A, Betelgeuse, Rigel and Vega on the star page now read `LINEUP_STARS`, so the two pages agree: Betelgeuse 1,057 Suns (the measured angle at 222 pc, 3,650 K), Sirius A 1.7144 (9,845 K) and Vega 2.726 equatorial (9,660 K, flattening 0.113, turning in 0.71 days). They were 764 (Joyce et al. 2020, a value from stellar models that the line-up names and does not use), 1.711 and 2.362. The README, the star-look guide (English and Japanese) and the examples that named those numbers use the line-up's. The size line-up guide no longer says the star page's preset is the model value.
|
|
12
|
+
|
|
13
|
+
## [0.29.0] - 2026-11-10
|
|
14
|
+
|
|
15
|
+
- **Time keeps up on slow machines** (MODULES-797). `<wakusei-space>`'s clock now lives in `createGameClock` (`src/space/clock.ts`, internal): it advances by the time the page's clock says passed, never by a frame, so 86400x is a day for every real second whether the machine draws 60 frames a second or 5 (a unit test with a 5-frames-a-second clock moves 2 days in 2 s within 1 percent). There is no cap on a long gap: a tab that was hidden or a laptop that slept finds the date where the speed would have taken it. Three faults found on the way: the `time` property and `stats.time` read the moment of the last step, up to a long draw old, and now read the moment now; a picture drawn late showed the moment of the last step and now shows the moment it is drawn at; and starting, switching or stopping a ride dropped the time since the last step (up to a minute at real time on a held date). The speed, Pause, Back and the `wakusei-timechange` events are as they were. The date-play test times the clock against the page's own clock again.
|
|
16
|
+
- **Three browser tests that failed on a Mac are fixed, in the tests** (MODULES-788, MODULES-775). The space view's "paused, nothing is drawn" test began 600 ms after the page was live, and the Earth's finer map (1024 pixels, after the 512 one) arrives later on a busy machine and draws one frame when it does: 39 to 52 draw calls, the same each time, reproduced by holding that file back 1.8 s. It now waits for the map and for the view to be quiet, and the limit (no draw in 4 seconds) is as it was. "The view can be moved sideways and rolled" and the embed panel's "picture fits its box" both waited a fixed time (800 ms, 150 ms) for a frame, and on a busy Mac the next frame can be seconds away: they now wait for the frame that draws the change (the draw counter moves past its value at the change; the panel's layout fits), and the limits (1 pixel, half a pixel) are as they were. The reduced-motion ride test (a ride runs at about one step a second) divided its draws by 4 seconds although a busy machine takes longer between the two reads, and counted the frame of a late Earth map: it now counts over the real time between the reads, taken with the page's clock, and waits for the map; the element's step rate (one a second) does not drift, and the limit (1.6 a second) is as it was. The date-play tests that read the date box (a ride "keeps moving", Play moves the date on, the body page's day) waited a fixed 1.5 to 2.2 s for the box, which is written from the element's events and can be held back a second or two by a long draw: they now wait for the box to reach the later date (15 s at most), the dates asked for as they were. The space view's tests no longer run as a serial group, so one failure no longer hides the 21 after it.
|
|
17
|
+
|
|
5
18
|
## [0.28.0] - 2026-11-09
|
|
6
19
|
|
|
7
20
|
- **The date follows the clock, and Play runs it** (MODULES-759, MODULES-755 wakusei part). John, on the space page: "The date is never reflected by the action in the page" and "Where are the Play controls to see the planets rotate starting from the Date and time selected?" `<wakusei-space>` and `<wakusei-body>` (with a `time` or `moons`) send `wakusei-timechange` with `{ time, running }`: four times a second at most while time runs (once a second at real time; only while the tab is shown), and once with `running: false` when the clock holds. `<wakusei-body>` has a `time` property (the moment shown). A held clock (`rate="0"`) is not "moving" any more, so it draws nothing. In the demo the date box follows the clock (never while the reader is typing in it), a ride along (the Moon, Io) starts the clock, and the loose Speed row is kazoku-ui's `<kazoku-replay-bar>` on the space page and the body page: Play runs the clock from the date shown, Pause holds it, Back returns to the date chosen, and `play=on`, `speed` and the date (`t`, when the clock stops or the reader leaves) stay in the address. Reduced motion leaves Play off. An old address with `speed` alone is paused now (add `play=on`); the speed starts at 3600 (an hour a second). The body page's real sky no longer adds the portrait turn to a dated picture (it turned 12 degrees a second even when held); Play is what moves it. `wakusei-time` is unchanged.
|
|
8
21
|
- **kazoku-ui 0.27 (with 0.26): a plain drag always turns, lighter sheets for children, and the shared renderer draws at most 30 frames a second** (MODULES-743). On the space view and the views that turn, a plain drag (and one finger) now turns at every zoom; the middle or right button, Ctrl or Command and a drag, Space and a drag, and the wheel move; the Move or Turn choice is gone (`initial: { drag: "turn" }` is no longer asked of the shared controls). The colouring sheets draw their outline at kazoku-ui's kid line, 1.2 mm (was 3), and the lines inside at 1 mm (was 2.5), so a sheet is lighter and the names have room.
|
|
22
|
+
- **A size line-up of stars in 3D** (MODULES-722). `<wakusei-lineup>` (entry point `/lineup`) puts the Sun, Sirius A, Vega, Arcturus, Aldebaran, Rigel, Antares, Betelgeuse and the largest stars known (VY Canis Majoris, WOH G64, UY Scuti, Stephenson 2-18) side by side or one above the next at true relative size, each drawn with the star look and labelled with its radius in Suns and kilometres, its error and its source, in English and Japanese. A slider zooms smoothly (a logarithmic scale of radius, the camera resting on each body) from the smallest body up to the largest, from the Earth and Jupiter (`planets`) or the Sun; each star turns slowly and a drag turns the one it takes hold of; ring markers show a body too small to see. All the bodies are in one three.js scene on the shared renderer (one WebGL context, nothing drawn at rest or out of sight, no frame cap of its own, a freeze test in `e2e/lineup-freeze.demo.ts`). Attributes `stars`, `planets`, `layout`, `zoom`, `at`, `turn`, `look`, `labels`, `controls`, `size`, `lang`, `quality`, `live`; methods `zoomTo`, `turnBy`, `resetTurns`, `picture`, `toSvg`, `toPng`; the `wakusei-lineup-zoom` event.
|
|
23
|
+
- **The radii are a typed table with a paper for each row** (MODULES-722). `LINEUP_STARS` holds each star's radius with its error below and above, the method, the angular diameter, the ADS bibcodes and the date read; `basis` says how well a size is known (defined, measured angle and distance, measured angle with a distance that is not a parallax, or from brightness and temperature) and the label says *estimated* for the last two. The tests check each radius against the distance its paper adopted. Betelgeuse is 1,057 (+228, -162) Suns, the measured angle at the distance of Harper et al. 2017; the 764 of Joyce et al. 2020 is from stellar models and is named and not used. UY Scuti is 1,708 (±192) Suns, the measured angle at the paper's old distance, with the revised 909 (photometry and a Gaia distance) named and not used. WOH G64 and Stephenson 2-18 have no measured angular diameter. Nothing is taken from an infographic, Wikipedia's text or the Gaia, Hipparcos and Tycho catalogues; `NOTICE.md` lists every source and each disagreement.
|
|
24
|
+
- **The pure side** (MODULES-722): `lineupBodies`, `placeLineup`, `lineupView`, `lineupZoomOf`, `lineupFocus`, `lineupProject`, `lineupText`, `lineupKm`, `lineupLabels`, `lineupLabelsSvg`, `lineupCode` and `lineupCredit`.
|
|
25
|
+
- **The demo's size line-up page and its embed** (MODULES-722). `lineup.html` has its choices in rows of clicks kept in the address (stars, planets, layout, turning, a button for each body), a card for the body in frame with its radius, method, papers and where they disagree, "Save as an image" (kazoku-ui's `saveImage`, PNG and SVG) and "Print as a poster" (kazoku-ui's print part, A4 and US Letter, landscape, a QR code back to the page), and "Put it in your page" for all seven ways. The embed page takes `?lineup=1`. A guide in both languages, `docs/guides/size-lineup.md`, holds every tested example word for word (`pnpm test:usage` builds and opens each).
|
|
9
26
|
|
|
10
27
|
## [0.27.0] - 2026-11-09
|
|
11
28
|
|
package/NOTICE.md
CHANGED
|
@@ -39,6 +39,26 @@ Voyager 1 and 2, New Horizons, Pioneer 10 and 11, Cassini, Galileo, Juno, Parker
|
|
|
39
39
|
- **Facts and events**: NASA mission pages, read 2026-11-08: Voyager 1 (https://science.nasa.gov/mission/voyager/voyager-1/), Voyager 2 (https://science.nasa.gov/mission/voyager/voyager-2/), New Horizons (https://science.nasa.gov/mission/new-horizons/), Pioneer 10 (https://science.nasa.gov/mission/pioneer-10/), Pioneer 11 (https://science.nasa.gov/mission/pioneer-11/), Cassini (https://science.nasa.gov/mission/cassini/ and its timeline, https://science.nasa.gov/mission/cassini/the-journey/timeline/), Galileo (https://science.nasa.gov/mission/galileo/), Juno (https://science.nasa.gov/mission/juno/ and the NSSDCA record 2011-040A, https://nssdc.gsfc.nasa.gov/nmc/spacecraft/display.action?id=2011-040A), Parker Solar Probe (https://science.nasa.gov/mission/parker-solar-probe/ and the NSSDCA record 2018-065A, https://nssdc.gsfc.nasa.gov/nmc/spacecraft/display.action?id=2018-065A) and the James Webb Space Telescope (https://science.nasa.gov/mission/webb/ and https://science.nasa.gov/mission/webb/launch/). A time is given only where a page gives one. Where a page's date for a flyby disagrees with the closest approach of Horizons' path, the package keeps the date of the path (listed in the guide).
|
|
40
40
|
- **Japanese names** are the usual Japanese spellings of the missions' names.
|
|
41
41
|
|
|
42
|
+
## The size line-up's radii
|
|
43
|
+
|
|
44
|
+
The twelve stars of `<wakusei-lineup>` (`src/lineup/data.ts`, `LINEUP_STARS`). Every radius and temperature was typed from a refereed paper (the abstract and the tables, on arXiv and in the journal's own record, read on 2026-11-09); the papers are credited and none of their text, figures or tables is copied. Facts are not copyrightable. A radius is an angular diameter that was measured (interferometry where it exists) times a distance, or, where the row says so, a radius worked out from brightness. Nothing is taken from an infographic, from Wikipedia's text, or from the catalogues of Hipparcos, Gaia or Tycho (ESA, CC BY-NC 3.0 IGO): where a paper's distance is a catalogue parallax (Vega, Arcturus, Aldebaran, Rigel, Antares), only the paper's published radius and angle are typed here, never the parallax. Each ADS bibcode below opens the paper at https://ui.adsabs.harvard.edu/abs/<bibcode>/abstract.
|
|
45
|
+
|
|
46
|
+
- **The Sun**: the IAU's nominal radius, 695,700 km, and effective temperature, 5,772 K: I. Prša et al. (2016), "Nominal values for selected solar and planetary quantities: IAU 2015 Resolution B3", AJ 152, 41 (2016AJ....152...41P).
|
|
47
|
+
- **Sirius A**: radius 1.7144 ± 0.0090 Suns and 9,845 K, H. E. Bond et al. (2017), "The Sirius System and its Astrophysical Puzzles", ApJ 840, 70 (2017ApJ...840...70B), from the angular diameter 6.048 ± 0.040 mas of J. Davis et al. (2011), "The Angular Diameter and Fundamental Parameters of Sirius A", PASA 28, 58 (2011PASA...28...58D).
|
|
48
|
+
- **Vega**: equatorial radius 2.726 ± 0.006 Suns, polar radius 2.418, apparent temperature 9,660 K and rotation period 0.71 days, J. D. Monnier et al. (2012), "Resolving Vega and the inclination controversy with CHARA/MIRC", ApJ 761, L3 (2012ApJ...761L...3M).
|
|
49
|
+
- **Arcturus**: 25.4 ± 0.2 Suns and 4,286 K, I. Ramírez and C. Allende Prieto (2011), "Fundamental Parameters and Chemical Composition of Arcturus", ApJ 743, 135 (2011ApJ...743..135R), from the weighted mean of the interferometric angular diameters, 21.06 ± 0.17 mas.
|
|
50
|
+
- **Aldebaran**: 44.2 ± 0.9 Suns, a limb-darkened diameter of 20.58 ± 0.03 mas, and 3,934 K, A. Richichi and V. Roccatagliata (2005), "Aldebaran's angular diameter: how well do we know it?", A&A 433, 305 (2005A&A...433..305R).
|
|
51
|
+
- **Rigel**: 78.9 ± 7.4 Suns from the limb-darkened diameter 2.75 ± 0.01 mas (Aufdenberg et al. 2008) and 12,100 K (Przybilla et al. 2010), as listed by E. Moravveji et al. (2012), "Asteroseismology of the Nearby SN-II Progenitor: Rigel Part I", ApJ 747, 108 (2012ApJ...747..108M).
|
|
52
|
+
- **Antares**: 680 Suns from the limb-darkened diameter 37.38 ± 0.06 mas, and 3,660 K, K. Ohnaka et al. (2013), "High spectral resolution imaging of the dynamical atmosphere of the red supergiant Antares in the CO first overtone lines with VLTI/AMBER", A&A 555, A24 (2013A&A...555A..24O). The error (-99, +139) is worked out here from the 17 percent error of the parallax the paper uses.
|
|
53
|
+
- **Betelgeuse**: the limb-darkened diameter 44.28 ± 0.15 mas, X. Haubois et al. (2009), "Imaging the spotty surface of Betelgeuse in the H band", A&A 508, 923 (2009A&A...508..923H), and the distance 222 (+48, -34) pc, G. M. Harper et al. (2017), "An Updated 2017 Astrometric Solution for Betelgeuse", AJ 154, 11 (2017AJ....154...11H); the radius, 1,057 (+228, -162) Suns, is half the angle times the distance, worked out here. 3,650 K: E. M. Levesque et al. (2005), "The Effective Temperature Scale of Galactic Red Supergiants: Cool, But Not As Cool As We Thought", ApJ 628, 973 (2005ApJ...628..973L). Not used: the 764 Suns of M. Joyce et al. (2020), ApJ 902, 63 (2020ApJ...902...63J), which come from stellar models.
|
|
54
|
+
- **VY Canis Majoris**: 1,420 ± 120 Suns from the Rosseland angular diameter 11.3 ± 0.3 mas at 1.17 ± 0.08 kpc, and 3,490 K, M. Wittkowski et al. (2012), "Fundamental properties and atmospheric structure of the red supergiant VY CMa based on VLTI/AMBER spectro-interferometry", A&A 540, L12 (2012A&A...540L..12W); the distance is the mean of the radio parallaxes of Choi et al. (2008) and B. Zhang et al. (2012), ApJ 744, 23 (2012ApJ...744...23Z).
|
|
55
|
+
- **WOH G64**: 1,540 Suns (an error of 5 percent) and 3,400 ± 25 K, from the spectrum and the brightness at the Large Magellanic Cloud's 50 kpc, E. M. Levesque et al. (2009), "The Physical Properties of the Red Supergiant WOH G64: The Largest Star Known?", AJ 137, 4744 (2009AJ....137.4744L). No angular diameter of the star itself has been measured. Named and not used: 1,730 Suns from a dust model, K. Ohnaka et al. (2008), A&A 484, 371 (2008A&A...484..371O); the star changed between 2009 and 2016, K. Ohnaka et al. (2024), A&A 691, L15 (2024A&A...691L..15O).
|
|
56
|
+
- **UY Scuti**: 1,708 ± 192 Suns from the Rosseland angular diameter 5.48 ± 0.10 mas and 3,365 K, B. Arroyo-Torres et al. (2013), "The atmospheric structure and fundamental parameters of the red supergiants AH Sco, UY Sct and KW Sgr", A&A 554, A76 (2013A&A...554A..76A). The distance of about 2.9 kpc is an old estimate and not a parallax, so the size is marked estimated. Named and not used: 909 Suns, from photometry and a Gaia distance, S. Healy et al. (2024), "Red Supergiant Candidates for Multimessenger Monitoring of the Next Galactic Supernova", MNRAS 529, 3630 (Gaia's value is not copied).
|
|
57
|
+
- **Stephenson 2-18**: 3,200 K and log L = 5.64 (at 5.5 kpc) from a dust-shell fit, T. K. T. Fok et al. (2012), "Maser Observations of Westerlund 1 and Comprehensive Considerations on Maser Properties of Red Supergiants Associated with Massive Clusters", ApJ 760, 65 (2012ApJ...760...65F); the distance is the cluster's kinematic one, S. Deguchi et al. (2010), PASJ 62, 391 (2010PASJ...62..391D), with the range 5.83 (+1.91, -0.78) kpc of B. Davies et al. (2007), ApJ 671, 781 (2007ApJ...671..781D). The radius, 2,150 (+710, -290) Suns, is worked out here by the Stefan-Boltzmann law (the error is the distance's alone). No angular diameter has been measured.
|
|
58
|
+
- **The Earth and Jupiter** beside them are the package's own facts: equatorial radii 6,378.137 km and 71,492 km, IAU and NASA (above).
|
|
59
|
+
|
|
60
|
+
The star's look (the cells, the spots, the glow) is invented to look right and says so; only the temperature, the radius and the class are the papers'.
|
|
61
|
+
|
|
42
62
|
## The Earth
|
|
43
63
|
|
|
44
64
|
The Earth's line drawing is chikyu-earth's own globe (MIT, by John Morris; https://github.com/johnmorrisdotca/chikyu-earth), an optional peer dependency: its own NOTICE.md has the terms of its outlines. The Earth's realistic and painted looks are drawn here, like every other body, from NASA's Blue Marble picture (below).
|
package/README.md
CHANGED
|
@@ -15,9 +15,9 @@ A clean line drawing, a shaded realistic drawing, or a painted surface map, with
|
|
|
15
15
|
|
|
16
16
|
<p align="center"><a href="https://johnmorrisdotca.github.io/wakusei-planets/"><strong>Open the demo →</strong></a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/embed.html">Embed page</a> · <a href="https://johnmorrisdotca.github.io/wakusei-planets/docs/">Docs</a></p>
|
|
17
17
|
|
|
18
|
-
<p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
18
|
+
<p align="center"><img alt="Jupiter and Saturn drawn in the realistic look, and Saturn as a line drawing" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.30.0/docs/images/hero-desk.png" width="640"></p>
|
|
19
19
|
|
|
20
|
-
<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.
|
|
20
|
+
<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.30.0/docs/images/lineup-desk.png" width="640"></p>
|
|
21
21
|
|
|
22
22
|
## One minute
|
|
23
23
|
|
|
@@ -107,21 +107,33 @@ Import the element once in client code, and the entry point of each body you dra
|
|
|
107
107
|
|---|---|---|
|
|
108
108
|
| `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 |
|
|
109
109
|
| `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 |
|
|
110
|
-
| `painted` | A real surface map from public-domain NASA, USGS and JPL imagery. 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 (Mars, the Moon, the Earth and ten moons: [close zoom](docs/guides/close-zoom.md)). | `three`, the body's entry point |
|
|
110
|
+
| `painted` | A real surface map from public-domain NASA, USGS and JPL imagery. 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 |
|
|
111
111
|
|
|
112
112
|
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) 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.
|
|
113
113
|
|
|
114
114
|
## A star from its numbers
|
|
115
115
|
|
|
116
|
-
`<wakusei-body star="Betelgeuse" temperature-k="
|
|
116
|
+
`<wakusei-body star="Betelgeuse" temperature-k="3650" radius-sun="1057" luminosity-class="Iab">` draws any star in 3D or as a line drawing, from a few numbers and with no catalogue: the temperature gives the colour, the radius the size beside the Sun, the luminosity class the grain of the surface, the rotation how it turns, and a flattened star such as Vega or Altair is squashed with hotter poles. Granulation boils, an active star has spots, prominences and flares, and a soft corona glows round it, all through the same shared renderer, with a cheaper `quality="low"` for weak devices. Every star says which parts are measured and which are drawn for looks: *drawn from its numbers, not a photo*. The Sun keeps its own look. See [A star from its numbers](docs/guides/star-look.md) and the [star page](https://johnmorrisdotca.github.io/wakusei-planets/star.html).
|
|
117
117
|
|
|
118
118
|
```ts
|
|
119
119
|
import { starLook } from "@johnmorrisdotca/wakusei-planets";
|
|
120
120
|
|
|
121
|
-
const vega = starLook({ name: "Vega", temperatureK:
|
|
121
|
+
const vega = starLook({ name: "Vega", temperatureK: 9660, radiusSun: 2.726, oblateness: 0.113, rotationDays: 0.71 });
|
|
122
122
|
console.log(vega.colour, vega.parts.map((part) => part.status).join(", "));
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
## The size line-up
|
|
126
|
+
|
|
127
|
+
`<wakusei-lineup stars="bright" planets at="betelgeuse">` shows the Sun, Sirius A, Vega, Arcturus, Aldebaran, Rigel, Antares, Betelgeuse and the largest stars known (VY Canis Majoris, WOH G64, UY Scuti, Stephenson 2-18) side by side or one above the next at **true relative size**, each drawn with the star look and labelled with its radius in Suns and kilometres, its error and its paper. A slider zooms smoothly from the Sun (or the Earth, with `planets`) up to the largest star; each star turns slowly and a drag turns the one it takes hold of. Every radius is from a refereed paper that measured the star's angular diameter, or says it did not (WOH G64 and Stephenson 2-18 are estimated from brightness, UY Scuti's distance is not a parallax); where the papers disagree, the label and [the guide](docs/guides/size-lineup.md) say so. The demo's [size line-up page](https://johnmorrisdotca.github.io/wakusei-planets/lineup.html) saves the picture as a PNG or SVG, prints it as a poster on A4 or US Letter, and writes the code for every way of putting it in a page. The table needs no browser:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import { lineupBodies, lineupText } from "@johnmorrisdotca/wakusei-planets";
|
|
131
|
+
|
|
132
|
+
const largest = lineupBodies({ set: "largest" }).at(-1)!;
|
|
133
|
+
const text = lineupText(largest, "en");
|
|
134
|
+
console.log(`${text.name}: ${text.radius}, ${text.km}, ${text.source}`);
|
|
135
|
+
```
|
|
136
|
+
|
|
125
137
|
## Two packages: this one and chikyu-earth
|
|
126
138
|
|
|
127
139
|
This package is the Sun, the planets, the dwarf planets and the moons, and where they are. [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth) is the Earth in detail: its countries, day and night, places and satellites. Each works alone; install both and the Earth's line look becomes chikyu-earth's globe with the countries. The dependency runs one way: this package may use chikyu-earth, never the reverse. [Why two packages](docs/guides/two-packages.md) has the rule, a table of what lives where and how to use them together.
|
|
@@ -290,7 +302,7 @@ A body that turns by itself and a moving sky, in HTML:
|
|
|
290
302
|
|
|
291
303
|
## The portrait builder
|
|
292
304
|
|
|
293
|
-
<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.
|
|
305
|
+
<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.30.0/docs/images/portrait-family.png" width="640"></p>
|
|
294
306
|
|
|
295
307
|
[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.
|
|
296
308
|
|
|
@@ -341,7 +353,7 @@ The reference is a site, made from the source's own doc comments: every export h
|
|
|
341
353
|
|
|
342
354
|
| Entry point | What it gives |
|
|
343
355
|
| --- | --- |
|
|
344
|
-
| `@johnmorrisdotca/wakusei-planets` | The pure side: `BODIES`, `apparent`, `system`, `orbitPath`, `portrait`, `lineSvg`, `embedCode`, `starLook`, `starLineSvg`. No browser. |
|
|
356
|
+
| `@johnmorrisdotca/wakusei-planets` | The pure side: `BODIES`, `apparent`, `system`, `orbitPath`, `portrait`, `lineSvg`, `embedCode`, `lineupCode`, `lineupBodies`, `starLook`, `starLineSvg`. No browser. |
|
|
345
357
|
| `.../element` | `<wakusei-body>`; three.js is loaded only for a shaded look. |
|
|
346
358
|
| `.../portrait` | `<wakusei-portrait>`: many bodies in one scene. The scene model (`addBody`, `layoutPortrait`, `encodeScene`, `decodeScene`) is in the main entry. |
|
|
347
359
|
| `.../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. |
|
|
@@ -377,6 +389,7 @@ Each guide has a Japanese twin in [docs/guides/ja](docs/guides/ja/getting-starte
|
|
|
377
389
|
| [Moons and time](docs/guides/moons-and-time.md) | The sky on a date, time that runs fast |
|
|
378
390
|
| [The space view](docs/guides/space-view.md) | The Earth, Moon, Sun and planets in their places; two scales; time both ways |
|
|
379
391
|
| [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 |
|
|
392
|
+
| [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 |
|
|
380
393
|
| [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 |
|
|
381
394
|
| [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 |
|
|
382
395
|
| [Riding along](docs/guides/ride-along.md) | The camera on a moon, a planet or any moving point, looking at what it goes round |
|
package/dist/embed.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type BodyId, type Look } from "./facts.ts";
|
|
2
|
+
import type { LineupSet } from "./lineup/data.ts";
|
|
3
|
+
import type { LineupLayout } from "./lineup/layout.ts";
|
|
2
4
|
import type { StarNumbers } from "./star.ts";
|
|
3
5
|
/**
|
|
4
6
|
* The ways `embedCode` writes a body into a page.
|
|
@@ -119,6 +121,68 @@ export interface PortraitEmbed {
|
|
|
119
121
|
* ```
|
|
120
122
|
*/
|
|
121
123
|
export declare function portraitCode(options: PortraitEmbed, kind?: EmbedKind, settings?: EmbedSettings): string;
|
|
124
|
+
/**
|
|
125
|
+
* The size line-up to put in a page: which stars, the planets, how they stand, where the camera starts, and how wide it is.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* import { lineupCode, type LineupEmbed } from "@johnmorrisdotca/wakusei-planets";
|
|
130
|
+
*
|
|
131
|
+
* const options: LineupEmbed = { stars: "bright", planets: true, at: "betelgeuse", width: 720 };
|
|
132
|
+
* console.log(lineupCode(options, "html"));
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
export interface LineupEmbed {
|
|
136
|
+
/** `all` (the default), `bright` or `largest`, or a list of ids from `LINEUP_STARS`. */
|
|
137
|
+
stars?: LineupSet | readonly string[];
|
|
138
|
+
/** Add the Earth and Jupiter. */
|
|
139
|
+
planets?: boolean;
|
|
140
|
+
/** `row` (the default) or `stack`. */
|
|
141
|
+
layout?: LineupLayout;
|
|
142
|
+
/** The id of the body the camera starts on; the Sun when left out. */
|
|
143
|
+
at?: string;
|
|
144
|
+
/** Where the camera starts, 0 to 1 (over `at`). */
|
|
145
|
+
zoom?: number;
|
|
146
|
+
/** False stops the bodies turning by themselves. */
|
|
147
|
+
turn?: boolean;
|
|
148
|
+
/** The planets' look: `realistic` (the default) or `painted`. */
|
|
149
|
+
look?: "realistic" | "painted";
|
|
150
|
+
/** The words: `en` (the default) or `ja`. */
|
|
151
|
+
lang?: "en" | "ja";
|
|
152
|
+
/** Pixels across; default 720. */
|
|
153
|
+
width?: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The text that puts the size line-up in a page, for each way a page is made, as `embedCode` does for a single body: a script tag, an ES module, React, Vue, Angular, Svelte or an iframe of the demo's `embed.html`.
|
|
157
|
+
* Every way is built, parsed or run by the package's tests.
|
|
158
|
+
*
|
|
159
|
+
* @param options - The stars, the planets, the layout, where the camera starts and the width.
|
|
160
|
+
* @param kind - The way the page is made; `html` by default.
|
|
161
|
+
* @param settings - The CDN and the demo's address, when they are not the package's own.
|
|
162
|
+
* @returns The text to paste into the page's source.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* import { lineupCode } from "@johnmorrisdotca/wakusei-planets";
|
|
167
|
+
*
|
|
168
|
+
* console.log(lineupCode({ stars: "largest", at: "vy-canis-majoris" }, "react"));
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare function lineupCode(options: LineupEmbed, kind?: EmbedKind, settings?: EmbedSettings): string;
|
|
172
|
+
/**
|
|
173
|
+
* 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.
|
|
174
|
+
*
|
|
175
|
+
* @param options - The choices, so the planets and their pictures are named only when they are used.
|
|
176
|
+
* @returns A short line of credit to put near the picture.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* import { lineupCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
181
|
+
*
|
|
182
|
+
* console.log(lineupCredit({ planets: true }));
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
export declare function lineupCredit(options: LineupEmbed): string;
|
|
122
186
|
/**
|
|
123
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 maps.
|
|
124
188
|
*
|
package/dist/embed.js
CHANGED
|
@@ -127,6 +127,72 @@ export function portraitCode(options, kind = "html", settings = {}) {
|
|
|
127
127
|
attrs.push(["size", String(width)]);
|
|
128
128
|
return snippet(kind, { tag: "wakusei-portrait", element: "portrait", entries, attrs, name: "portrait", iframe: { src: `${site}embed.html?${new URLSearchParams({ scene: options.scene }).toString()}`, title: "Wakusei Planets portrait", width, height: Math.round(width / scene.aspect) } }, cdn);
|
|
129
129
|
}
|
|
130
|
+
/** The element's attributes for a line-up, in the order they are written. */
|
|
131
|
+
function lineupAttributes(o) {
|
|
132
|
+
const out = [];
|
|
133
|
+
const stars = o.stars === undefined || o.stars === "all" ? undefined : typeof o.stars === "string" ? o.stars : o.stars.join(",");
|
|
134
|
+
if (stars !== undefined)
|
|
135
|
+
out.push(["stars", stars]);
|
|
136
|
+
if (o.planets === true)
|
|
137
|
+
out.push(["planets", ""]);
|
|
138
|
+
if (o.layout === "stack")
|
|
139
|
+
out.push(["layout", "stack"]);
|
|
140
|
+
if (o.zoom !== undefined && Number.isFinite(o.zoom))
|
|
141
|
+
out.push(["zoom", String(Math.round(o.zoom * 1000) / 1000)]);
|
|
142
|
+
else if (o.at !== undefined && o.at !== "sun")
|
|
143
|
+
out.push(["at", o.at]);
|
|
144
|
+
if (o.turn === false)
|
|
145
|
+
out.push(["turn", "off"]);
|
|
146
|
+
if (o.look === "painted")
|
|
147
|
+
out.push(["look", "painted"]);
|
|
148
|
+
if (o.lang === "ja")
|
|
149
|
+
out.push(["lang", "ja"]);
|
|
150
|
+
if (o.width !== undefined && o.width !== 720)
|
|
151
|
+
out.push(["size", String(o.width)]);
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The text that puts the size line-up in a page, for each way a page is made, as `embedCode` does for a single body: a script tag, an ES module, React, Vue, Angular, Svelte or an iframe of the demo's `embed.html`.
|
|
156
|
+
* Every way is built, parsed or run by the package's tests.
|
|
157
|
+
*
|
|
158
|
+
* @param options - The stars, the planets, the layout, where the camera starts and the width.
|
|
159
|
+
* @param kind - The way the page is made; `html` by default.
|
|
160
|
+
* @param settings - The CDN and the demo's address, when they are not the package's own.
|
|
161
|
+
* @returns The text to paste into the page's source.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* import { lineupCode } from "@johnmorrisdotca/wakusei-planets";
|
|
166
|
+
*
|
|
167
|
+
* console.log(lineupCode({ stars: "largest", at: "vy-canis-majoris" }, "react"));
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export function lineupCode(options, kind = "html", settings = {}) {
|
|
171
|
+
const cdn = settings.cdn ?? CDN;
|
|
172
|
+
const site = settings.site ?? SITE;
|
|
173
|
+
const width = options.width ?? 720;
|
|
174
|
+
const attrs = lineupAttributes(options);
|
|
175
|
+
const query = new URLSearchParams([["lineup", "1"], ...attrs.map(([name, value]) => [name, name === "planets" ? "1" : value])]);
|
|
176
|
+
return snippet(kind, { tag: "wakusei-lineup", element: "lineup", entries: [], attrs, name: "lineup", iframe: { src: `${site}embed.html?${query.toString()}`, title: "Wakusei Planets size line-up", width, height: Math.round((width * 9) / 16) } }, cdn);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 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.
|
|
180
|
+
*
|
|
181
|
+
* @param options - The choices, so the planets and their pictures are named only when they are used.
|
|
182
|
+
* @returns A short line of credit to put near the picture.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* import { lineupCredit } from "@johnmorrisdotca/wakusei-planets";
|
|
187
|
+
*
|
|
188
|
+
* console.log(lineupCredit({ planets: true }));
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export function lineupCredit(options) {
|
|
192
|
+
const base = "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.";
|
|
193
|
+
const planets = options.planets === true ? " Earth and Jupiter: IAU and NASA sizes." + (options.look === "painted" ? " Surface pictures: NASA and Nestaeric (CC BY 4.0), see NOTICE.md." : "") : "";
|
|
194
|
+
return `${base}${planets}`;
|
|
195
|
+
}
|
|
130
196
|
/**
|
|
131
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 maps.
|
|
132
198
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export { JOURNEY_STOPS, journeyStop, stopPlaceAu, type JourneyStop } from "./sto
|
|
|
4
4
|
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
|
-
export { embedCode, embedCredit, EMBED_KINDS, portraitCode, type EmbedKind, type EmbedOptions, type EmbedSettings, type PortraitEmbed } from "./embed.ts";
|
|
7
|
+
export { embedCode, embedCredit, EMBED_KINDS, lineupCode, lineupCredit, portraitCode, type EmbedKind, type EmbedOptions, type EmbedSettings, type LineupEmbed, type PortraitEmbed } from "./embed.ts";
|
|
8
8
|
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
9
|
export { LUMINOSITY_CLASSES, STAR_SUN, starLook, type LuminosityClass, type StarLook, type StarNumberName, type StarNumbers, type StarPart, type StarStatus } from "./star.ts";
|
|
10
10
|
export { starLineSvg } from "./star-line.ts";
|
|
11
|
+
export { LINEUP_SETS, LINEUP_STARS, lineupBodies, type LineupBody, type LineupSet, type RadiusBasis, type RadiusRow } from "./lineup/data.ts";
|
|
12
|
+
export { LINEUP_LAYOUTS, lineupFocus, lineupProject, lineupView, lineupZoomFor, lineupZoomOf, placeLineup, type LineupDot, type LineupLayout, type LineupPlace, type LineupView } from "./lineup/layout.ts";
|
|
13
|
+
export { lineupKm, lineupLabels, lineupLabelsSvg, lineupText, type LineupLabel, type LineupLang, type LineupText } from "./lineup/labels.ts";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,10 @@ export { JOURNEY_STOPS, journeyStop, stopPlaceAu } from "./stops.js";
|
|
|
4
4
|
export { drawnTilt, portrait } from "./pose.js";
|
|
5
5
|
export { lineSvg, mix } from "./line.js";
|
|
6
6
|
export { ringStrip } from "./scene/rings.js";
|
|
7
|
-
export { embedCode, embedCredit, EMBED_KINDS, portraitCode } from "./embed.js";
|
|
7
|
+
export { embedCode, embedCredit, EMBED_KINDS, lineupCode, lineupCredit, portraitCode } from "./embed.js";
|
|
8
8
|
export { addBody, decodeScene, defaultPortrait, encodeScene, PRESETS as PORTRAIT_PRESETS, resolve as layoutPortrait } from "./portrait/model.js";
|
|
9
9
|
export { LUMINOSITY_CLASSES, STAR_SUN, starLook } from "./star.js";
|
|
10
10
|
export { starLineSvg } from "./star-line.js";
|
|
11
|
+
export { LINEUP_SETS, LINEUP_STARS, lineupBodies } from "./lineup/data.js";
|
|
12
|
+
export { LINEUP_LAYOUTS, lineupFocus, lineupProject, lineupView, lineupZoomFor, lineupZoomOf, placeLineup } from "./lineup/layout.js";
|
|
13
|
+
export { lineupKm, lineupLabels, lineupLabelsSvg, lineupText } from "./lineup/labels.js";
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { StarNumbers } from "../star.ts";
|
|
2
|
+
/** The Sun's nominal radius in kilometres (IAU 2015 Resolution B3), the unit of every radius in the table. */
|
|
3
|
+
export declare const SUN_RADIUS_KM = 695700;
|
|
4
|
+
/**
|
|
5
|
+
* How well a radius is known: `defined` is the IAU's nominal value for the Sun, `angle` is a measured angular diameter times a measured distance, `weak-distance` is a measured angular diameter times a distance that is
|
|
6
|
+
* not a parallax (so the size could be much off), and `luminosity` is worked out from the star's brightness, temperature and distance because no angular diameter has been measured.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { LINEUP_STARS, type RadiusBasis } from "@johnmorrisdotca/wakusei-planets";
|
|
11
|
+
*
|
|
12
|
+
* const basis: RadiusBasis = LINEUP_STARS[0]!.basis;
|
|
13
|
+
* console.log(basis);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type RadiusBasis = "defined" | "angle" | "weak-distance" | "luminosity";
|
|
17
|
+
/**
|
|
18
|
+
* One row of the radius table: a star, its radius in Suns with the error on each side, how it was got, and the paper. `how` says whether the radius is the paper's own (`paper`) or was worked out here from numbers
|
|
19
|
+
* the paper gives (`worked-out`: the radius of an angular diameter at the paper's distance, or of a luminosity and a temperature by the Stefan-Boltzmann law).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { LINEUP_STARS, type RadiusRow } from "@johnmorrisdotca/wakusei-planets";
|
|
24
|
+
*
|
|
25
|
+
* const row: RadiusRow = LINEUP_STARS.find((one) => one.id === "betelgeuse")!;
|
|
26
|
+
* console.log(row.radiusSun, row.bibcodes[0]);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export interface RadiusRow {
|
|
30
|
+
/** A short key: `sirius-a`. */
|
|
31
|
+
id: string;
|
|
32
|
+
name: {
|
|
33
|
+
en: string;
|
|
34
|
+
ja: string;
|
|
35
|
+
};
|
|
36
|
+
/** The radius in solar radii (equatorial, for a star that is flattened). */
|
|
37
|
+
radiusSun: number;
|
|
38
|
+
/** The error below and above the radius, in solar radii, both positive or 0. */
|
|
39
|
+
minus: number;
|
|
40
|
+
plus: number;
|
|
41
|
+
basis: RadiusBasis;
|
|
42
|
+
how: "paper" | "worked-out";
|
|
43
|
+
/** One sentence: what was measured and how the radius follows. */
|
|
44
|
+
method: {
|
|
45
|
+
en: string;
|
|
46
|
+
ja: string;
|
|
47
|
+
};
|
|
48
|
+
/** The measured angular diameter in milliarcseconds (limb-darkened, or Rosseland where the paper says so), when the radius comes from one. */
|
|
49
|
+
thetaMas?: number;
|
|
50
|
+
/** The distance in parsecs when it is the paper's own result and not a catalogue parallax (the catalogue parallaxes of Hipparcos and Gaia are not copied here). */
|
|
51
|
+
distancePc?: number;
|
|
52
|
+
/** The papers, as a short citation for a label. */
|
|
53
|
+
cite: string;
|
|
54
|
+
/** The ADS bibcodes of the papers the radius and the temperature come from, the first being the radius's. */
|
|
55
|
+
bibcodes: readonly string[];
|
|
56
|
+
/** The date the paper was read, `YYYY-MM-DD`. */
|
|
57
|
+
read: string;
|
|
58
|
+
/** What the literature disagrees about, when it does: it goes on the label and in the guide. */
|
|
59
|
+
note?: {
|
|
60
|
+
en: string;
|
|
61
|
+
ja: string;
|
|
62
|
+
};
|
|
63
|
+
/** Other published radii that are not used, and why. */
|
|
64
|
+
others?: readonly {
|
|
65
|
+
radiusSun: number;
|
|
66
|
+
cite: string;
|
|
67
|
+
why: {
|
|
68
|
+
en: string;
|
|
69
|
+
ja: string;
|
|
70
|
+
};
|
|
71
|
+
}[];
|
|
72
|
+
/** What the star is drawn from: the temperature, its class and the rest. The radius is filled in from this row. */
|
|
73
|
+
look: Omit<StarNumbers, "radiusSun" | "name" | "estimated">;
|
|
74
|
+
/** Where the temperature comes from. */
|
|
75
|
+
temperatureFrom: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The stars of the line-up with their radii, smallest first: the Sun, Sirius A, Vega, Arcturus, Aldebaran, Rigel, Antares, Betelgeuse, VY Canis Majoris, WOH G64, UY Scuti and Stephenson 2-18. Each radius comes from a refereed
|
|
79
|
+
* paper that measured the star's angular diameter and used a distance, except where the row's `basis` says otherwise; `NOTICE.md` and the guide list the sources and every disagreement.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* import { LINEUP_STARS } from "@johnmorrisdotca/wakusei-planets";
|
|
84
|
+
*
|
|
85
|
+
* for (const row of LINEUP_STARS) console.log(row.name.en, row.radiusSun, `(-${row.minus} +${row.plus})`, row.cite);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare const LINEUP_STARS: readonly RadiusRow[];
|
|
89
|
+
/**
|
|
90
|
+
* The names of the sets of stars: `all` is every star in the table, `bright` the Sun, Sirius A, Vega, Arcturus, Aldebaran, Rigel, Antares and Betelgeuse, and `largest` the Sun beside the largest stars known.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* import { LINEUP_SETS, type LineupSet } from "@johnmorrisdotca/wakusei-planets";
|
|
95
|
+
*
|
|
96
|
+
* const set: LineupSet = LINEUP_SETS[1];
|
|
97
|
+
* console.log(set);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare const LINEUP_SETS: readonly ["all", "bright", "largest"];
|
|
101
|
+
/**
|
|
102
|
+
* One of the sets in `LINEUP_SETS`.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* import type { LineupSet } from "@johnmorrisdotca/wakusei-planets";
|
|
107
|
+
*
|
|
108
|
+
* const set: LineupSet = "largest";
|
|
109
|
+
* console.log(set);
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export type LineupSet = (typeof LINEUP_SETS)[number];
|
|
113
|
+
/**
|
|
114
|
+
* Something the line-up draws: a star of the table, or a planet from the package's facts. The size, the error and what to say about it are all here.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { lineupBodies, type LineupBody } from "@johnmorrisdotca/wakusei-planets";
|
|
119
|
+
*
|
|
120
|
+
* const first: LineupBody = lineupBodies({ planets: true })[0]!;
|
|
121
|
+
* console.log(first.kind, first.id, first.radiusKm);
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export interface LineupBody {
|
|
125
|
+
id: string;
|
|
126
|
+
kind: "star" | "planet";
|
|
127
|
+
name: {
|
|
128
|
+
en: string;
|
|
129
|
+
ja: string;
|
|
130
|
+
};
|
|
131
|
+
radiusSun: number;
|
|
132
|
+
radiusKm: number;
|
|
133
|
+
/** The error in solar radii below and above (0 for a planet and the Sun). */
|
|
134
|
+
minus: number;
|
|
135
|
+
plus: number;
|
|
136
|
+
/** A planet: the body's id in the package's facts. */
|
|
137
|
+
body?: "earth" | "jupiter";
|
|
138
|
+
/** A star: its row of the table. */
|
|
139
|
+
row?: RadiusRow;
|
|
140
|
+
/** How flattened the body is at its poles, 0 to 1. */
|
|
141
|
+
flattening: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* What the line-up draws for some choices, smallest first: the stars of a set (or the ids of your own list) and, with `planets`, the Earth and Jupiter. The radius of a planet is its equatorial radius from the package's facts.
|
|
145
|
+
* An id that is not in the table throws a `RangeError`.
|
|
146
|
+
*
|
|
147
|
+
* @param options - `set` (`all` by default, or a list of ids from `LINEUP_STARS`) and `planets` (add the Earth and Jupiter).
|
|
148
|
+
* @returns The bodies, ordered by radius.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* import { lineupBodies } from "@johnmorrisdotca/wakusei-planets";
|
|
153
|
+
*
|
|
154
|
+
* console.log(lineupBodies({ set: "bright", planets: true }).map((body) => body.id).join(", "));
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export declare function lineupBodies(options?: {
|
|
158
|
+
set?: LineupSet | readonly string[];
|
|
159
|
+
planets?: boolean;
|
|
160
|
+
}): LineupBody[];
|