@johnmorrisdotca/wakusei-planets 0.69.0 → 0.71.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 +55 -0
- package/NOTICE.md +29 -1
- package/README.md +20 -8
- package/dist/bodies/moons-jupiter.js +2 -0
- package/dist/bodies/moons-mars.js +2 -2
- package/dist/bodies/moons-neptune.js +2 -1
- package/dist/bodies/moons-pluto.js +2 -2
- package/dist/bodies/moons-saturn.js +14 -2
- package/dist/data/discovery.js +225 -0
- package/dist/data/moon-catalogue.js +15 -15
- package/dist/data/orbits.js +15 -0
- package/dist/data/shapes/amalthea.d.ts +2 -0
- package/dist/data/shapes/amalthea.js +1 -0
- package/dist/data/shapes/atlas.d.ts +2 -0
- package/dist/data/shapes/atlas.js +1 -0
- package/dist/data/shapes/calypso.d.ts +2 -0
- package/dist/data/shapes/calypso.js +1 -0
- package/dist/data/shapes/daphnis.d.ts +2 -0
- package/dist/data/shapes/daphnis.js +1 -0
- package/dist/data/shapes/deimos.d.ts +2 -0
- package/dist/data/shapes/deimos.js +1 -0
- package/dist/data/shapes/epimetheus.d.ts +2 -0
- package/dist/data/shapes/epimetheus.js +1 -0
- package/dist/data/shapes/helene.d.ts +2 -0
- package/dist/data/shapes/helene.js +1 -0
- package/dist/data/shapes/hydra.d.ts +2 -0
- package/dist/data/shapes/hydra.js +1 -0
- package/dist/data/shapes/hyperion.d.ts +2 -0
- package/dist/data/shapes/hyperion.js +1 -0
- package/dist/data/shapes/janus.d.ts +2 -0
- package/dist/data/shapes/janus.js +1 -0
- package/dist/data/shapes/larissa.d.ts +2 -0
- package/dist/data/shapes/larissa.js +1 -0
- package/dist/data/shapes/nix.d.ts +2 -0
- package/dist/data/shapes/nix.js +1 -0
- package/dist/data/shapes/pan.d.ts +2 -0
- package/dist/data/shapes/pan.js +1 -0
- package/dist/data/shapes/pandora.d.ts +2 -0
- package/dist/data/shapes/pandora.js +1 -0
- package/dist/data/shapes/phobos.d.ts +2 -0
- package/dist/data/shapes/phobos.js +1 -0
- package/dist/data/shapes/phoebe.d.ts +2 -0
- package/dist/data/shapes/phoebe.js +1 -0
- package/dist/data/shapes/prometheus.d.ts +2 -0
- package/dist/data/shapes/prometheus.js +1 -0
- package/dist/data/shapes/proteus.d.ts +2 -0
- package/dist/data/shapes/proteus.js +1 -0
- package/dist/data/shapes/telesto.d.ts +2 -0
- package/dist/data/shapes/telesto.js +1 -0
- package/dist/data/shapes/thebe.d.ts +2 -0
- package/dist/data/shapes/thebe.js +1 -0
- package/dist/discovery.d.ts +1 -1
- package/dist/earth-places.d.ts +7 -6
- package/dist/earth-places.js +11 -8
- package/dist/facts.d.ts +21 -4
- package/dist/facts.js +71 -38
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/moon-catalogue.d.ts +1 -1
- package/dist/moon-pages/data.d.ts +157 -0
- package/dist/moon-pages/data.js +138 -0
- package/dist/moon-pages/element.d.ts +82 -0
- package/dist/moon-pages/element.js +670 -0
- package/dist/moon-pages/index.d.ts +1 -0
- package/dist/moon-pages/index.js +2 -0
- package/dist/moon-pages/words.d.ts +115 -0
- package/dist/moon-pages/words.js +116 -0
- package/dist/nearest.js +2 -0
- package/dist/picture-credits.js +3 -0
- package/dist/scene/body-places.js +4 -5
- package/dist/scene/body.js +10 -5
- package/dist/scene/earth-places.d.ts +110 -2
- package/dist/scene/earth-places.js +149 -9
- package/dist/scene/glsl.d.ts +2 -2
- package/dist/scene/glsl.js +11 -0
- package/dist/scene/look.d.ts +7 -0
- package/dist/scene/look.js +1 -0
- package/dist/scene/painter.js +18 -3
- package/dist/scene/recipes.js +6 -2
- package/dist/scene/rings.js +11 -2
- package/dist/scene/shape.d.ts +50 -0
- package/dist/scene/shape.js +110 -0
- package/dist/shape-basis.d.ts +43 -0
- package/dist/shape-basis.js +45 -0
- package/dist/space/all-moons.d.ts +6 -1
- package/dist/space/all-moons.js +5 -1
- package/dist/space/element.d.ts +28 -3
- package/dist/space/element.js +169 -40
- package/dist/space/orbit-lines.d.ts +66 -0
- package/dist/space/orbit-lines.js +118 -0
- package/dist/space/scale.d.ts +1 -1
- package/dist/space/scale.js +20 -5
- package/dist/space/scene.d.ts +8 -0
- package/dist/space/scene.js +116 -9
- package/dist/stops.js +12 -0
- package/dist/surface/element.js +3 -3
- package/dist/surface/glsl.d.ts +2 -2
- package/dist/surface/glsl.js +15 -3
- package/dist/surface/height.d.ts +7 -0
- package/dist/surface/height.js +10 -0
- package/dist/textures/deimos-1024.webp +0 -0
- package/dist/textures/deimos-512.webp +0 -0
- package/dist/textures/phobos-1024.webp +0 -0
- package/dist/textures/phobos-512.webp +0 -0
- package/dist/textures/phoebe-1024.webp +0 -0
- package/dist/textures/phoebe-512.webp +0 -0
- package/package.json +13 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { moonPage, MOON_PAGE_HOSTS, MOON_PAGE_TIME, type MoonPage, type MoonPageHost, type PageCard, type PageMoon } from "./data.ts";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** The words of `<wakusei-moon-pages>`, by language. */
|
|
2
|
+
export declare const MOON_PAGE_WORDS: {
|
|
3
|
+
readonly en: {
|
|
4
|
+
readonly tabs: "Views";
|
|
5
|
+
readonly title: "{planet} and its moons";
|
|
6
|
+
readonly lede: "{total} known moons, {named} of them with a name. {prograde} go round the same way {planet} spins and {retrograde} go the other way. {featured} are drawn in full.";
|
|
7
|
+
readonly tab_orbits: "Orbits";
|
|
8
|
+
readonly tab_views: "Map and portrait";
|
|
9
|
+
readonly tab_cards: "Main moons";
|
|
10
|
+
readonly tab_table: "Every moon";
|
|
11
|
+
readonly view: "Seen from";
|
|
12
|
+
readonly above: "Above";
|
|
13
|
+
readonly tilted: "At an angle";
|
|
14
|
+
readonly side: "The side";
|
|
15
|
+
readonly reach: "Show";
|
|
16
|
+
readonly all: "Every moon";
|
|
17
|
+
readonly inner: "Inner moons";
|
|
18
|
+
readonly colour: "Colour by";
|
|
19
|
+
readonly direction: "Direction";
|
|
20
|
+
readonly family: "Family";
|
|
21
|
+
readonly view_above: "{planet}'s moons seen from above its north pole";
|
|
22
|
+
readonly view_tilted: "{planet}'s moons seen at an angle";
|
|
23
|
+
readonly view_side: "{planet}'s moons seen from the side, level with its equator";
|
|
24
|
+
readonly orbit_caption: "Each line is a moon's orbit on {date}, and each dot is where that moon is on that day. The orbits are to scale; the dots are not.";
|
|
25
|
+
readonly orbits_hint: "Point at an orbit, or tap it, to see whose it is.";
|
|
26
|
+
readonly pick: "{name}: {direction}, {distance} km from {planet}, once round in {period} days.";
|
|
27
|
+
readonly prograde: "Prograde";
|
|
28
|
+
readonly retrograde: "Retrograde";
|
|
29
|
+
readonly plan_caption: "{planet}'s moons drawn in full, from above its north pole, on {date}. Press a moon to mark it.";
|
|
30
|
+
readonly portrait_caption: "{planet} and the moons drawn in full, nearest first. The sizes are squeezed so the small moons can be seen.";
|
|
31
|
+
readonly cards_intro: "The {n} moons this package draws in full, nearest to {planet} first.";
|
|
32
|
+
readonly cards_shaped: "{shaped} of them are drawn with the shape that was measured.";
|
|
33
|
+
readonly card_size: "Diameter";
|
|
34
|
+
readonly card_axes: "Size";
|
|
35
|
+
readonly card_distance: "Distance";
|
|
36
|
+
readonly card_period: "Once round";
|
|
37
|
+
readonly card_found: "Found";
|
|
38
|
+
readonly card_where: "Where";
|
|
39
|
+
readonly card_by: "By";
|
|
40
|
+
readonly days: "{n} days";
|
|
41
|
+
readonly col_name: "Name";
|
|
42
|
+
readonly col_family: "Family";
|
|
43
|
+
readonly col_size: "Diameter (km)";
|
|
44
|
+
readonly col_distance: "Distance (km)";
|
|
45
|
+
readonly col_period: "Period (days)";
|
|
46
|
+
readonly col_year: "Found";
|
|
47
|
+
readonly col_where: "Where";
|
|
48
|
+
readonly col_by: "By";
|
|
49
|
+
readonly col_direction: "Direction";
|
|
50
|
+
readonly table_intro: "{n} moons, sorted by {col}, {order}. Press a column's name to sort by it.";
|
|
51
|
+
readonly up: "lowest first";
|
|
52
|
+
readonly down: "highest first";
|
|
53
|
+
readonly az: "A to Z";
|
|
54
|
+
readonly za: "Z to A";
|
|
55
|
+
readonly table_note: "≈ marks a size worked out from the moon's brightness, not measured. — means no source gives it. The place of discovery is known here only for the moons drawn in full, which are in bold.";
|
|
56
|
+
readonly credits: "Every number on this page is the package's own, worked out when the page was built: the moons, their orbits, sizes and discoveries from NASA/JPL's moon pages and Horizons, read on {fetched}, and the places of discovery from the IAU Gazetteer.";
|
|
57
|
+
readonly short: "{total} moons · {named} named · {retrograde} go the other way";
|
|
58
|
+
};
|
|
59
|
+
readonly ja: {
|
|
60
|
+
readonly tabs: "表示";
|
|
61
|
+
readonly title: "{planet}とその衛星";
|
|
62
|
+
readonly lede: "知られている衛星は{total}個で、そのうち{named}個に名前があります。{prograde}個は{planet}の自転と同じ向きに回り、{retrograde}個は反対向きに回ります。{featured}個はくわしく描いています。";
|
|
63
|
+
readonly tab_orbits: "軌道";
|
|
64
|
+
readonly tab_views: "地図と集合写真";
|
|
65
|
+
readonly tab_cards: "主な衛星";
|
|
66
|
+
readonly tab_table: "衛星の一覧";
|
|
67
|
+
readonly view: "見る向き";
|
|
68
|
+
readonly above: "真上から";
|
|
69
|
+
readonly tilted: "ななめから";
|
|
70
|
+
readonly side: "真横から";
|
|
71
|
+
readonly reach: "見る範囲";
|
|
72
|
+
readonly all: "すべての衛星";
|
|
73
|
+
readonly inner: "内側の衛星";
|
|
74
|
+
readonly colour: "色分け";
|
|
75
|
+
readonly direction: "回る向き";
|
|
76
|
+
readonly family: "グループ";
|
|
77
|
+
readonly view_above: "{planet}の北極の真上から見た衛星";
|
|
78
|
+
readonly view_tilted: "ななめから見た{planet}の衛星";
|
|
79
|
+
readonly view_side: "{planet}の赤道の真横から見た衛星";
|
|
80
|
+
readonly orbit_caption: "線は{date}の各衛星の軌道で、点はその日に衛星がいる場所です。軌道の大きさは実際の比率どおりですが、点の大きさはちがいます。";
|
|
81
|
+
readonly orbits_hint: "軌道を指すかタップすると、どの衛星の軌道かがわかります。";
|
|
82
|
+
readonly pick: "{name}:{direction}。{planet}から{distance} km、{period}日で1周します。";
|
|
83
|
+
readonly prograde: "同じ向き";
|
|
84
|
+
readonly retrograde: "逆向き";
|
|
85
|
+
readonly plan_caption: "{date}に{planet}の北極の真上から見た、くわしく描いている衛星です。衛星を押すと印がつきます。";
|
|
86
|
+
readonly portrait_caption: "{planet}と、くわしく描いている衛星を近い順に並べました。小さな衛星も見えるように、大きさの差は縮めています。";
|
|
87
|
+
readonly cards_intro: "このパッケージがくわしく描く{n}個の衛星を、{planet}に近い順に並べました。";
|
|
88
|
+
readonly cards_shaped: "そのうち{shaped}個は、測定された形で描いています。";
|
|
89
|
+
readonly card_size: "直径";
|
|
90
|
+
readonly card_axes: "大きさ";
|
|
91
|
+
readonly card_distance: "距離";
|
|
92
|
+
readonly card_period: "1周";
|
|
93
|
+
readonly card_found: "発見";
|
|
94
|
+
readonly card_where: "場所";
|
|
95
|
+
readonly card_by: "発見した人";
|
|
96
|
+
readonly days: "{n}日";
|
|
97
|
+
readonly col_name: "名前";
|
|
98
|
+
readonly col_family: "グループ";
|
|
99
|
+
readonly col_size: "直径 (km)";
|
|
100
|
+
readonly col_distance: "距離 (km)";
|
|
101
|
+
readonly col_period: "1周の日数";
|
|
102
|
+
readonly col_year: "発見した年";
|
|
103
|
+
readonly col_where: "発見した場所";
|
|
104
|
+
readonly col_by: "発見した人";
|
|
105
|
+
readonly col_direction: "回る向き";
|
|
106
|
+
readonly table_intro: "{n}個の衛星を「{col}」の{order}に並べています。列の名前を押すと並べかえます。";
|
|
107
|
+
readonly up: "小さい順";
|
|
108
|
+
readonly down: "大きい順";
|
|
109
|
+
readonly az: "名前の順";
|
|
110
|
+
readonly za: "名前の逆の順";
|
|
111
|
+
readonly table_note: "≈ は、測定ではなく衛星の明るさから見積もった大きさです。— は、資料に値がないことを表します。発見した場所は、くわしく描いている衛星(太字)だけにあります。";
|
|
112
|
+
readonly credits: "このページの数字はすべて、ページを作ったときにパッケージのデータから計算したものです。衛星の軌道・大きさ・発見は NASA/JPL の衛星のページと Horizons({fetched}に読み込み)から、発見した場所は IAU 惑星地名辞典からです。";
|
|
113
|
+
readonly short: "衛星{total}個・名前つき{named}個・反対向き{retrograde}個";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// The moon pages' own words, in English and Japanese. `{planet}` and the other braces are filled in. Proper names come from the data (the package's Japanese names), never from here.
|
|
2
|
+
/** The words of `<wakusei-moon-pages>`, by language. */
|
|
3
|
+
export const MOON_PAGE_WORDS = {
|
|
4
|
+
en: {
|
|
5
|
+
tabs: "Views",
|
|
6
|
+
title: "{planet} and its moons",
|
|
7
|
+
lede: "{total} known moons, {named} of them with a name. {prograde} go round the same way {planet} spins and {retrograde} go the other way. {featured} are drawn in full.",
|
|
8
|
+
tab_orbits: "Orbits",
|
|
9
|
+
tab_views: "Map and portrait",
|
|
10
|
+
tab_cards: "Main moons",
|
|
11
|
+
tab_table: "Every moon",
|
|
12
|
+
view: "Seen from",
|
|
13
|
+
above: "Above",
|
|
14
|
+
tilted: "At an angle",
|
|
15
|
+
side: "The side",
|
|
16
|
+
reach: "Show",
|
|
17
|
+
all: "Every moon",
|
|
18
|
+
inner: "Inner moons",
|
|
19
|
+
colour: "Colour by",
|
|
20
|
+
direction: "Direction",
|
|
21
|
+
family: "Family",
|
|
22
|
+
view_above: "{planet}'s moons seen from above its north pole",
|
|
23
|
+
view_tilted: "{planet}'s moons seen at an angle",
|
|
24
|
+
view_side: "{planet}'s moons seen from the side, level with its equator",
|
|
25
|
+
orbit_caption: "Each line is a moon's orbit on {date}, and each dot is where that moon is on that day. The orbits are to scale; the dots are not.",
|
|
26
|
+
orbits_hint: "Point at an orbit, or tap it, to see whose it is.",
|
|
27
|
+
pick: "{name}: {direction}, {distance} km from {planet}, once round in {period} days.",
|
|
28
|
+
prograde: "Prograde",
|
|
29
|
+
retrograde: "Retrograde",
|
|
30
|
+
plan_caption: "{planet}'s moons drawn in full, from above its north pole, on {date}. Press a moon to mark it.",
|
|
31
|
+
portrait_caption: "{planet} and the moons drawn in full, nearest first. The sizes are squeezed so the small moons can be seen.",
|
|
32
|
+
cards_intro: "The {n} moons this package draws in full, nearest to {planet} first.",
|
|
33
|
+
cards_shaped: "{shaped} of them are drawn with the shape that was measured.",
|
|
34
|
+
card_size: "Diameter",
|
|
35
|
+
card_axes: "Size",
|
|
36
|
+
card_distance: "Distance",
|
|
37
|
+
card_period: "Once round",
|
|
38
|
+
card_found: "Found",
|
|
39
|
+
card_where: "Where",
|
|
40
|
+
card_by: "By",
|
|
41
|
+
days: "{n} days",
|
|
42
|
+
col_name: "Name",
|
|
43
|
+
col_family: "Family",
|
|
44
|
+
col_size: "Diameter (km)",
|
|
45
|
+
col_distance: "Distance (km)",
|
|
46
|
+
col_period: "Period (days)",
|
|
47
|
+
col_year: "Found",
|
|
48
|
+
col_where: "Where",
|
|
49
|
+
col_by: "By",
|
|
50
|
+
col_direction: "Direction",
|
|
51
|
+
table_intro: "{n} moons, sorted by {col}, {order}. Press a column's name to sort by it.",
|
|
52
|
+
up: "lowest first",
|
|
53
|
+
down: "highest first",
|
|
54
|
+
az: "A to Z",
|
|
55
|
+
za: "Z to A",
|
|
56
|
+
table_note: "≈ marks a size worked out from the moon's brightness, not measured. — means no source gives it. The place of discovery is known here only for the moons drawn in full, which are in bold.",
|
|
57
|
+
credits: "Every number on this page is the package's own, worked out when the page was built: the moons, their orbits, sizes and discoveries from NASA/JPL's moon pages and Horizons, read on {fetched}, and the places of discovery from the IAU Gazetteer.",
|
|
58
|
+
short: "{total} moons · {named} named · {retrograde} go the other way",
|
|
59
|
+
},
|
|
60
|
+
ja: {
|
|
61
|
+
tabs: "表示",
|
|
62
|
+
title: "{planet}とその衛星",
|
|
63
|
+
lede: "知られている衛星は{total}個で、そのうち{named}個に名前があります。{prograde}個は{planet}の自転と同じ向きに回り、{retrograde}個は反対向きに回ります。{featured}個はくわしく描いています。",
|
|
64
|
+
tab_orbits: "軌道",
|
|
65
|
+
tab_views: "地図と集合写真",
|
|
66
|
+
tab_cards: "主な衛星",
|
|
67
|
+
tab_table: "衛星の一覧",
|
|
68
|
+
view: "見る向き",
|
|
69
|
+
above: "真上から",
|
|
70
|
+
tilted: "ななめから",
|
|
71
|
+
side: "真横から",
|
|
72
|
+
reach: "見る範囲",
|
|
73
|
+
all: "すべての衛星",
|
|
74
|
+
inner: "内側の衛星",
|
|
75
|
+
colour: "色分け",
|
|
76
|
+
direction: "回る向き",
|
|
77
|
+
family: "グループ",
|
|
78
|
+
view_above: "{planet}の北極の真上から見た衛星",
|
|
79
|
+
view_tilted: "ななめから見た{planet}の衛星",
|
|
80
|
+
view_side: "{planet}の赤道の真横から見た衛星",
|
|
81
|
+
orbit_caption: "線は{date}の各衛星の軌道で、点はその日に衛星がいる場所です。軌道の大きさは実際の比率どおりですが、点の大きさはちがいます。",
|
|
82
|
+
orbits_hint: "軌道を指すかタップすると、どの衛星の軌道かがわかります。",
|
|
83
|
+
pick: "{name}:{direction}。{planet}から{distance} km、{period}日で1周します。",
|
|
84
|
+
prograde: "同じ向き",
|
|
85
|
+
retrograde: "逆向き",
|
|
86
|
+
plan_caption: "{date}に{planet}の北極の真上から見た、くわしく描いている衛星です。衛星を押すと印がつきます。",
|
|
87
|
+
portrait_caption: "{planet}と、くわしく描いている衛星を近い順に並べました。小さな衛星も見えるように、大きさの差は縮めています。",
|
|
88
|
+
cards_intro: "このパッケージがくわしく描く{n}個の衛星を、{planet}に近い順に並べました。",
|
|
89
|
+
cards_shaped: "そのうち{shaped}個は、測定された形で描いています。",
|
|
90
|
+
card_size: "直径",
|
|
91
|
+
card_axes: "大きさ",
|
|
92
|
+
card_distance: "距離",
|
|
93
|
+
card_period: "1周",
|
|
94
|
+
card_found: "発見",
|
|
95
|
+
card_where: "場所",
|
|
96
|
+
card_by: "発見した人",
|
|
97
|
+
days: "{n}日",
|
|
98
|
+
col_name: "名前",
|
|
99
|
+
col_family: "グループ",
|
|
100
|
+
col_size: "直径 (km)",
|
|
101
|
+
col_distance: "距離 (km)",
|
|
102
|
+
col_period: "1周の日数",
|
|
103
|
+
col_year: "発見した年",
|
|
104
|
+
col_where: "発見した場所",
|
|
105
|
+
col_by: "発見した人",
|
|
106
|
+
col_direction: "回る向き",
|
|
107
|
+
table_intro: "{n}個の衛星を「{col}」の{order}に並べています。列の名前を押すと並べかえます。",
|
|
108
|
+
up: "小さい順",
|
|
109
|
+
down: "大きい順",
|
|
110
|
+
az: "名前の順",
|
|
111
|
+
za: "名前の逆の順",
|
|
112
|
+
table_note: "≈ は、測定ではなく衛星の明るさから見積もった大きさです。— は、資料に値がないことを表します。発見した場所は、くわしく描いている衛星(太字)だけにあります。",
|
|
113
|
+
credits: "このページの数字はすべて、ページを作ったときにパッケージのデータから計算したものです。衛星の軌道・大きさ・発見は NASA/JPL の衛星のページと Horizons({fetched}に読み込み)から、発見した場所は IAU 惑星地名辞典からです。",
|
|
114
|
+
short: "衛星{total}個・名前つき{named}個・反対向き{retrograde}個",
|
|
115
|
+
},
|
|
116
|
+
};
|
package/dist/nearest.js
CHANGED
|
@@ -30,6 +30,8 @@ const MOON_DEGREES = {
|
|
|
30
30
|
mimas: 2.1, enceladus: 0.72, tethys: 0.27, dione: 0.23, rhea: 0.27, titan: 0.06, iapetus: 0.04,
|
|
31
31
|
miranda: 3, ariel: 0.3, umbriel: 0.28, titania: 0.52, oberon: 0.6,
|
|
32
32
|
triton: 0.17, nereid: 6.3, proteus: 0.17, charon: 0.06, nix: 2.6, hydra: 2.1,
|
|
33
|
+
// the moons added with their shape models: the limits of test/accuracy.test.ts (their dates are the years Horizons has an ephemeris for)
|
|
34
|
+
amalthea: 1.2, thebe: 0.25, hyperion: 20, phoebe: 2.8, janus: 9, epimetheus: 31, helene: 22, telesto: 3.5, calypso: 7.5, atlas: 12, prometheus: 22, pandora: 40, pan: 0.9, daphnis: 0.8, larissa: 0.4,
|
|
33
35
|
};
|
|
34
36
|
/** The same for the moons of Jupiter and Saturn when `tables` has not been imported and their fitted orbits answer. */
|
|
35
37
|
const FITTED_MOON_DEGREES = { io: 0.15, europa: 0.18, ganymede: 0.6, callisto: 0.09, mimas: 7.5, enceladus: 0.72, tethys: 0.45, dione: 0.23, rhea: 0.27, titan: 0.08, iapetus: 0.72 };
|
package/dist/picture-credits.js
CHANGED
|
@@ -45,6 +45,9 @@ export const PICTURE_CREDITS = [
|
|
|
45
45
|
pd("mimas", "NASA/JPL/Space Science Institute", "NASA/JPL/Space Science Institute"),
|
|
46
46
|
pd("ceres", "NASA/JPL-Caltech/UCLA/MPS/DLR/IDA", "NASA/JPL-Caltech/UCLA/MPS/DLR/IDA"),
|
|
47
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("phobos", "USGS Astrogeology Science Center, P. Stooke (DLR control), from Viking Orbiter images, NASA/JPL", "USGS Astrogeology Science Center、P. Stooke(DLRの制御点)、Viking Orbiterの画像(NASA/JPL)"),
|
|
49
|
+
pd("deimos", "USGS Astrogeology Science Center, P. Stooke, from Viking Orbiter images, NASA/JPL", "USGS Astrogeology Science Center、P. Stooke、Viking Orbiterの画像(NASA/JPL)"),
|
|
50
|
+
pd("phoebe", "NASA/JPL/Space Science Institute, Cassini ISS mosaic (DLR and the Cassini ISS team, 2006)", "NASA/JPL/Space Science Institute、Cassini ISSのモザイク(DLRとCassini ISSチーム、2006年)"),
|
|
48
51
|
pd("tethys", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
49
52
|
pd("dione", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
50
53
|
pd("iapetus", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute", "NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute"),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// keyed by body, reading it, and laying the lists of several bodies in one draw. Pure: no DOM, no clock reads.
|
|
4
4
|
import { BODIES } from "../facts.js";
|
|
5
5
|
import { pointUnder, spotView } from "../place-marks.js";
|
|
6
|
-
import { EARTH_PLACE_MARKS, EARTH_PLACES_FROM_PX } from "./earth-places.js";
|
|
6
|
+
import { EARTH_PLACE_MARKS, EARTH_PLACES_FROM_PX, inMarkOrder, placeRank } from "./earth-places.js";
|
|
7
7
|
/** The most places kept from a list, as `earth-places` keeps. */
|
|
8
8
|
export const BODY_PLACES_KEPT = 5000;
|
|
9
9
|
/**
|
|
@@ -79,9 +79,8 @@ export function layBodyPlaces(places, surfaces, using, look, options) {
|
|
|
79
79
|
const scale = bodyScale(surface.id);
|
|
80
80
|
if (scale === undefined)
|
|
81
81
|
continue;
|
|
82
|
-
// the places that matter most first: where the reader is, then the rest in the order given
|
|
83
|
-
const
|
|
84
|
-
const mine = [...here.filter((place) => place.kind === "here"), ...here.filter((place) => place.kind !== "here")];
|
|
82
|
+
// the places that matter most first: where the reader is, then the rest in the order given, then those whose name is low
|
|
83
|
+
const mine = inMarkOrder(places.filter((place) => place.body === surface.id));
|
|
85
84
|
if (mine.length === 0)
|
|
86
85
|
continue;
|
|
87
86
|
const view = spotView({ ...surface, scale });
|
|
@@ -104,7 +103,7 @@ export function layBodyPlaces(places, surfaces, using, look, options) {
|
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
// the places of the reader come first on every body, then the others; the first few in sight stand up and the rest are counted, never silently left out
|
|
107
|
-
const rank = (shape) => (merged[shape.index]
|
|
106
|
+
const rank = (shape) => placeRank(merged[shape.index]);
|
|
108
107
|
const ordered = shapes.map((shape, i) => ({ shape, i })).sort((a, b) => rank(a.shape) - rank(b.shape) || a.i - b.i).map((entry) => entry.shape);
|
|
109
108
|
const limit = options.marks ?? EARTH_PLACE_MARKS;
|
|
110
109
|
const kept = ordered.slice(0, limit);
|
package/dist/scene/body.js
CHANGED
|
@@ -3,6 +3,7 @@ import { silhouette } from "../pose.js";
|
|
|
3
3
|
import { cross } from "../vec.js";
|
|
4
4
|
import { BALL_FRAGMENT, bodyFragment, GLOW_FRAGMENT, GLOW_VERTEX, PAINTED_SURFACE, PAINTED_SURFACE_WINDOWED, RING_FRAGMENT_DETAIL, RING_VERTEX, STAR_GLOW_FRAGMENT, VERTEX } from "./glsl.js";
|
|
5
5
|
import { detailOf, lookOf } from "./look.js";
|
|
6
|
+
import { shapeGeometry } from "./shape.js";
|
|
6
7
|
import { createDetail } from "./detail.js";
|
|
7
8
|
import { fallbackLook } from "./fallback.js";
|
|
8
9
|
import { writeBasis } from "./basis.js";
|
|
@@ -69,7 +70,11 @@ export function createBodyItem(options) {
|
|
|
69
70
|
async build({ three: T, assets, width, height }) {
|
|
70
71
|
const look = options.shaded ?? lookOf(options.id) ?? fallbackLook(facts);
|
|
71
72
|
const wantPainted = (options.look === "painted" || look.mapped === true) && look.painted !== undefined;
|
|
72
|
-
|
|
73
|
+
// a moon with a published shape model is the globe moved to its radii (its table is a chunk of its own, waited for here), and then needs no stretching to an ellipsoid
|
|
74
|
+
const shapeTable = look.shape === undefined ? undefined : await look.shape().catch(() => undefined);
|
|
75
|
+
// a big picture gets a globe of 192 by 96 steps (as the unshaped sphere has), a tile or a card one of 96 by 48: a page can hold a dozen moons, and the arrays of a globe stay in the page
|
|
76
|
+
const grid = Math.min(width, height) >= 300 ? { lon: 192, lat: 96 } : { lon: 96, lat: 48 };
|
|
77
|
+
const geometry = shapeTable === undefined ? assets.acquire("wk:sphere", () => new T.SphereGeometry(1, 192, 96), (g) => g.dispose()) : assets.acquire(`wk:shape:${held}:${grid.lon}`, () => shapeGeometry(T, shapeTable, facts.radiusKm, grid), (g) => g.dispose());
|
|
73
78
|
const shader = assets.acquire(`wk:body:${held}:r`, () => makeBodyMaterial(T, look, false), (m) => m.dispose());
|
|
74
79
|
const paintedMaterial = wantPainted ? assets.acquire(`wk:body:${held}:p`, () => makeBodyMaterial(T, look, true), (m) => m.dispose()) : undefined;
|
|
75
80
|
const materials = paintedMaterial === undefined ? [shader] : [shader, paintedMaterial];
|
|
@@ -270,10 +275,10 @@ export function createBodyItem(options) {
|
|
|
270
275
|
const orient = (state) => {
|
|
271
276
|
const { pole, meridian } = state.pose;
|
|
272
277
|
const east = cross(pole, meridian);
|
|
273
|
-
const ax = facts.axesKm;
|
|
278
|
+
const ax = shapeTable === undefined ? facts.axesKm : undefined;
|
|
274
279
|
const mean = facts.radiusKm;
|
|
275
280
|
const scaleX = ax ? ax[1] / mean : 1;
|
|
276
|
-
const scaleY = ax ? ax[2] / mean : 1 - facts.flattening;
|
|
281
|
+
const scaleY = ax ? ax[2] / mean : shapeTable === undefined ? 1 - facts.flattening : 1;
|
|
277
282
|
const scaleZ = ax ? ax[0] / mean : 1;
|
|
278
283
|
setBasis(mesh, east, pole, meridian, scaleX, scaleY, scaleZ);
|
|
279
284
|
if (cut !== undefined)
|
|
@@ -463,9 +468,9 @@ export function createBodyItem(options) {
|
|
|
463
468
|
label.update(camera, ((aspect >= 1 ? viewHeight : viewWidth) / 2) * (state.zoom / state.extent), state.pose.light);
|
|
464
469
|
if (detail !== undefined && textureWidth > 0) {
|
|
465
470
|
const east = cross(state.pose.pole, state.pose.meridian);
|
|
466
|
-
const ax = facts.axesKm;
|
|
471
|
+
const ax = shapeTable === undefined ? facts.axesKm : undefined;
|
|
467
472
|
const mean = facts.radiusKm;
|
|
468
|
-
detail.sync({ left: camera.left, right: camera.right, bottom: camera.bottom, top: camera.top }, { east, pole: state.pose.pole, meridian: state.pose.meridian, scale: [ax ? ax[1] / mean : 1, ax ? ax[2] / mean : 1 - facts.flattening, ax ? ax[0] / mean : 1] }, viewWidth);
|
|
473
|
+
detail.sync({ left: camera.left, right: camera.right, bottom: camera.bottom, top: camera.top }, { east, pole: state.pose.pole, meridian: state.pose.meridian, scale: [ax ? ax[1] / mean : 1, ax ? ax[2] / mean : shapeTable === undefined ? 1 - facts.flattening : 1, ax ? ax[0] / mean : 1] }, viewWidth);
|
|
469
474
|
}
|
|
470
475
|
};
|
|
471
476
|
apply(latest);
|
|
@@ -38,7 +38,39 @@ export interface EarthPlace {
|
|
|
38
38
|
kind?: EarthPlaceKind;
|
|
39
39
|
/** A CSS colour for this place alone: a hex colour, `rgb()` or `hsl()` with numbers, or a colour's name. */
|
|
40
40
|
color?: string;
|
|
41
|
+
/** A set of places (spaceports, harbours) the page shows or hides together with `earth-place-layers`; left out, the place is always shown. */
|
|
42
|
+
layer?: string;
|
|
43
|
+
/** `small` draws a shorter, narrower mark; left out, the kind's own size. */
|
|
44
|
+
size?: EarthPlaceSize;
|
|
45
|
+
/** How this place is drawn, over `earth-places-look`; left out, `earth-places-look`. */
|
|
46
|
+
look?: EarthPlaceLook;
|
|
47
|
+
/** `low` lays this place's name after the others' (and, past the 32 markers, its marker too), so its name gives way where they crowd; left out (`high`), it is laid with the rest. */
|
|
48
|
+
namePriority?: EarthPlaceNamePriority;
|
|
41
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* How big a place's mark is: `normal` (the default) or `small`, a shorter, narrower stick and a smaller ring, so a harbour can stand beside a city and "You are here" stays the tall beam.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import type { EarthPlaceSize } from "@johnmorrisdotca/wakusei-planets/earth-places";
|
|
56
|
+
*
|
|
57
|
+
* const size: EarthPlaceSize = "small";
|
|
58
|
+
* console.log(size);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export type EarthPlaceSize = "normal" | "small";
|
|
62
|
+
/**
|
|
63
|
+
* Where a place's name is laid among the others: `high` (the default) in the order given, or `low`, after all the others.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* import type { EarthPlaceNamePriority } from "@johnmorrisdotca/wakusei-planets/earth-places";
|
|
68
|
+
*
|
|
69
|
+
* const priority: EarthPlaceNamePriority = "low";
|
|
70
|
+
* console.log(priority);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export type EarthPlaceNamePriority = "high" | "low";
|
|
42
74
|
/**
|
|
43
75
|
* How a place is drawn: `beam` (a light rising out of the ground with a ring at its foot, the default), `pin` (a thin stick with a round head) or `ring` (only the ring lying on the ground).
|
|
44
76
|
*
|
|
@@ -139,6 +171,51 @@ export interface EarthPlaceLayoutOptions {
|
|
|
139
171
|
lat: number;
|
|
140
172
|
} | null;
|
|
141
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Which layers of places are shown (the attribute `earth-place-layers`): a JSON object of layer names to true or false, such as `{"harbours":false}`. A layer that is not named is shown, and so is a place with no layer. Anything that is not an object
|
|
176
|
+
* of that kind is no switches. chikyu-earth's `readPlaceLayers`.
|
|
177
|
+
*
|
|
178
|
+
* @param value - The attribute's text, or null.
|
|
179
|
+
* @returns The switches, a name to whether it is shown.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* import { readEarthPlaceLayers } from "@johnmorrisdotca/wakusei-planets/earth-places";
|
|
184
|
+
*
|
|
185
|
+
* console.log(readEarthPlaceLayers('{"harbours":false,"airports":true,"x":1}')); // { harbours: false, airports: true }
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
export declare function readEarthPlaceLayers(value: string | null | undefined): Record<string, boolean>;
|
|
189
|
+
/**
|
|
190
|
+
* The places whose layer is shown: a place with no layer is always in, and a layer is in unless `layers` says `false` for it. A place of a layer that is off is not drawn, not named and cannot be pressed. The list is returned as it came when nothing is left out.
|
|
191
|
+
*
|
|
192
|
+
* @param places - The places, as `readEarthPlaces` makes them.
|
|
193
|
+
* @param layers - The switches, a layer's name to whether it is shown (`readEarthPlaceLayers`).
|
|
194
|
+
* @returns The places to draw.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* import { shownEarthPlaces } from "@johnmorrisdotca/wakusei-planets/earth-places";
|
|
199
|
+
*
|
|
200
|
+
* const places = [{ id: "yvr", lon: -123.18, lat: 49.19, layer: "airports" }, { id: "cavan", lon: -123.1, lat: 49.29, layer: "harbours" }, { id: "me", lon: -79.4, lat: 43.7 }];
|
|
201
|
+
* console.log(shownEarthPlaces(places, { harbours: false }).map((place) => place.id)); // ["yvr", "me"]
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
export declare function shownEarthPlaces<T extends EarthPlace>(places: readonly T[], layers: Readonly<Record<string, boolean>>): readonly T[];
|
|
205
|
+
/** The order the markers are given out in: where the reader is, then the rest in the order given, then the places whose name is `low`. */
|
|
206
|
+
export declare const placeRank: (place: EarthPlace) => number;
|
|
207
|
+
/** The places in that order (the order given within each rank). */
|
|
208
|
+
export declare const inMarkOrder: <T extends EarthPlace>(places: readonly T[]) => T[];
|
|
209
|
+
/**
|
|
210
|
+
* The fields beyond chikyu-earth's own that a place may carry (`layer`, `size`, `look`, `namePriority`), put back on the places its reader (older than them) made from the same text, so the views need no newer chikyu-earth. A place is found by its `id`
|
|
211
|
+
* (or, with none, its place in the list, as chikyu-earth gives it); a field that is not valid is left out.
|
|
212
|
+
*/
|
|
213
|
+
export declare function keepPlaceFields(value: string | null | undefined, places: EarthPlace[]): EarthPlace[];
|
|
214
|
+
/**
|
|
215
|
+
* A layout that gives each place its own `size` and `look`: the places' markers are laid as beams (chikyu-earth knows one look for a whole list), then a `small` place's stick is cut to about half and its ring to 70 per cent, and a place whose look is `ring`
|
|
216
|
+
* (its own or the list's) has no stick, its name moving with the top of what is left. A list with no `size` or `look` of its own is laid as `layout` lays it, untouched.
|
|
217
|
+
*/
|
|
218
|
+
export declare function layWithOwn(layout: EarthPlacesLayout["layout"], places: readonly EarthPlace[], view: SpotView, look: EarthPlaceLook, options?: EarthPlaceLayoutOptions): EarthPlaceLayout;
|
|
142
219
|
/** The two things `@johnmorrisdotca/wakusei-planets/earth-places` hands the views: reading the attribute, and laying places on a picture. Both are chikyu-earth's. */
|
|
143
220
|
export interface EarthPlacesLayout {
|
|
144
221
|
read(value: string | null | undefined): EarthPlace[];
|
|
@@ -172,6 +249,37 @@ export interface EarthPlaceMark {
|
|
|
172
249
|
/** For a place on a body other than the Earth (`body-places`): the body. */
|
|
173
250
|
body?: string;
|
|
174
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* What `wakusei-place-click` carries in `event.detail`: the place that was pressed (chikyu-earth's `chikyu-place-click` detail, with the `body` it is on, `earth` for the Earth's), and where the press was, in CSS pixels inside the element's box.
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```ts
|
|
257
|
+
* import type { EarthPlaceClickDetail } from "@johnmorrisdotca/wakusei-planets/earth-places";
|
|
258
|
+
*
|
|
259
|
+
* const on = (event: Event): void => {
|
|
260
|
+
* const { body, id, kind, layer } = (event as CustomEvent<EarthPlaceClickDetail>).detail;
|
|
261
|
+
* console.log(body, id, kind, layer ?? "no layer");
|
|
262
|
+
* };
|
|
263
|
+
* console.log(typeof on);
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
export interface EarthPlaceClickDetail {
|
|
267
|
+
/** The body the place is on: `earth`, `moon`, `mars` and so on. */
|
|
268
|
+
body: string;
|
|
269
|
+
id: string;
|
|
270
|
+
/** `here` or `favourite`. */
|
|
271
|
+
kind: EarthPlaceKind;
|
|
272
|
+
/** The place's `layer`, when it has one. */
|
|
273
|
+
layer?: string;
|
|
274
|
+
label?: string;
|
|
275
|
+
lon: number;
|
|
276
|
+
lat: number;
|
|
277
|
+
/** Where the press was, in CSS pixels inside the element's box. */
|
|
278
|
+
x: number;
|
|
279
|
+
y: number;
|
|
280
|
+
}
|
|
281
|
+
/** The detail of `wakusei-place-click` for a pressed place. */
|
|
282
|
+
export declare function earthPlaceClick(body: string, place: EarthPlace, x: number, y: number): EarthPlaceClickDetail;
|
|
175
283
|
/** The markers over one view. */
|
|
176
284
|
export interface EarthPlaceLayerView {
|
|
177
285
|
/** Draw the markers of a layout, moving the ones already there and hiding the rest. */
|
|
@@ -187,9 +295,9 @@ export interface EarthPlaceLayerView {
|
|
|
187
295
|
* Make the layer of markers inside a view's shadow root, above its picture. It holds a handful of elements made once and kept; a draw only writes the numbers that changed.
|
|
188
296
|
*
|
|
189
297
|
* @param root - The view's shadow root.
|
|
190
|
-
* @param options - `press`, called with the mark
|
|
298
|
+
* @param options - `press`, called with the mark, the pointer event and the place when a press that did not move ends over a drawn name or a foot ring (the layer itself takes no pointer: a press on it goes on to the view's controls, as a name on a body's surface does).
|
|
191
299
|
* @returns The layer.
|
|
192
300
|
*/
|
|
193
301
|
export declare function createEarthPlaceLayer(root: ShadowRoot, options?: {
|
|
194
|
-
press?: (mark: EarthPlaceMark, event: PointerEvent) => void;
|
|
302
|
+
press?: (mark: EarthPlaceMark, event: PointerEvent, place: EarthPlace) => void;
|
|
195
303
|
}): EarthPlaceLayerView;
|