@johnmorrisdotca/wakusei-planets 0.39.0 → 0.41.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 +1 -1
- package/README.md +3 -3
- package/dist/element.d.ts +1 -1
- package/dist/element.js +1 -1
- package/dist/ground-track.d.ts +80 -0
- package/dist/ground-track.js +137 -0
- package/dist/paint/trail.d.ts +80 -0
- package/dist/paint/trail.js +322 -0
- package/dist/scene/body.d.ts +1 -0
- package/dist/scene/body.js +2 -2
- package/dist/scene/glsl.d.ts +2 -2
- package/dist/scene/glsl.js +4 -2
- package/dist/scene/name-label.d.ts +56 -3
- package/dist/scene/name-label.js +72 -7
- package/dist/scene/painter.d.ts +2 -1
- package/dist/scene/painter.js +5 -3
- package/dist/scene/textures.d.ts +2 -2
- package/dist/space/element.d.ts +24 -0
- package/dist/space/element.js +51 -6
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/labels.d.ts +32 -0
- package/dist/space/labels.js +39 -0
- package/dist/space/paint-overlay.d.ts +11 -0
- package/dist/space/paint-overlay.js +84 -0
- package/dist/space/scene.d.ts +6 -0
- package/dist/space/scene.js +25 -0
- package/dist/textures/pluto-1024.webp +0 -0
- package/dist/textures/pluto-512.webp +0 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
package/dist/scene/painter.js
CHANGED
|
@@ -15,7 +15,7 @@ import { moonOffset, orientation } from "./orient.js";
|
|
|
15
15
|
import { ringStrip } from "./rings.js";
|
|
16
16
|
import { createNameLabel, nameLabelText } from "./name-label.js";
|
|
17
17
|
export { moonOffset, orientation };
|
|
18
|
-
export { nameLabelText, readNameLabel, setBodyLabelFontUrl } from "./name-label.js";
|
|
18
|
+
export { nameLabelLook, nameLabelText, nameTone, readNameLabel, setBodyLabelFontUrl } from "./name-label.js";
|
|
19
19
|
export { mercuryTilesCredit, PICTURE_CREDITS, picturesCredit } from "../picture-credits.js";
|
|
20
20
|
/**
|
|
21
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).
|
|
@@ -350,7 +350,7 @@ function paint(T, id, context, bases, hold) {
|
|
|
350
350
|
let labelText = "";
|
|
351
351
|
let labelShown = false;
|
|
352
352
|
// what `label` reports: one object, written at each draw (it is read for every body at every frame)
|
|
353
|
-
const labelReport = { shown: false, text: "", turn: 0 };
|
|
353
|
+
const labelReport = { shown: false, text: "", turn: 0, look: "" };
|
|
354
354
|
const setLabel = (next) => {
|
|
355
355
|
if (next === null || next === undefined || gone) {
|
|
356
356
|
if (label !== undefined) {
|
|
@@ -366,11 +366,13 @@ function paint(T, id, context, bases, hold) {
|
|
|
366
366
|
labelText = text ?? nameLabelText(facts.name, lang ?? "en");
|
|
367
367
|
labelReport.text = labelText;
|
|
368
368
|
if (label === undefined) {
|
|
369
|
-
label = createNameLabel(T, labelText, options, look.emissive === true, redraw);
|
|
369
|
+
label = createNameLabel(T, labelText, options, look.emissive === true, redraw, facts.colour);
|
|
370
|
+
labelReport.look = label.look;
|
|
370
371
|
mesh.add(label.object);
|
|
371
372
|
}
|
|
372
373
|
else {
|
|
373
374
|
label.set(labelText, options);
|
|
375
|
+
labelReport.look = label.look;
|
|
374
376
|
redraw();
|
|
375
377
|
}
|
|
376
378
|
};
|
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.41.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.41.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/space/element.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ import { type Place } from "../places.ts";
|
|
|
17
17
|
import { type PlaceLayer } from "../place-marks.ts";
|
|
18
18
|
import { type EarthPlace, type EarthPlaceLook, type EarthPlaceMark } from "../scene/earth-places.ts";
|
|
19
19
|
import { SPACE_BODIES, type BodyPlace, type RidePoint, type RideState, type RideTarget, type SpaceBody, type SpaceLight } from "./scene.ts";
|
|
20
|
+
import { type PaintSpec } from "../paint/trail.ts";
|
|
21
|
+
export type { PaintSpec };
|
|
20
22
|
export { setPlacesLoader } from "../scene/place-layer.ts";
|
|
21
23
|
export { EARTH_PLACE_LOOKS, EARTH_PLACE_MARKS, type EarthPlace, type EarthPlaceKind, type EarthPlaceLook, type EarthPlaceMark } from "../scene/earth-places.ts";
|
|
22
24
|
export { setThreeLoader, SPACE_BODIES, type RidePoint, type RideTarget, type Sight, type SightEdge, type SpaceBody, type SpaceLight };
|
|
@@ -279,6 +281,27 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
279
281
|
*/
|
|
280
282
|
get orbiters(): boolean;
|
|
281
283
|
set orbiters(value: boolean);
|
|
284
|
+
/**
|
|
285
|
+
* Paint one orbiter's path on the body it goes round. `id` is an orbiter such as `lro` or `mro`. `length` is how long the trail is kept, in simulated time (`1d` when left out, or `1w`, `1m`).
|
|
286
|
+
* `swath` is `track` (the point under the craft, the default) or `coverage` (where it is at least 10° above the horizon). Setting another craft clears the trail. `null` clears it.
|
|
287
|
+
* The trail is drawn only while time is moving, one upload a frame, and nothing at rest.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts no-run
|
|
291
|
+
* import type { WakuseiSpace } from "@johnmorrisdotca/wakusei-planets/space/element";
|
|
292
|
+
*
|
|
293
|
+
* const paint = (space: WakuseiSpace): void => {
|
|
294
|
+
* space.paint = { id: "lro", length: "1d", swath: "track" };
|
|
295
|
+
* };
|
|
296
|
+
* console.log(typeof paint);
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
get paint(): PaintSpec | null;
|
|
300
|
+
set paint(value: PaintSpec | null);
|
|
301
|
+
/** Take the painted trail off the body. */
|
|
302
|
+
clearPaint(): void;
|
|
303
|
+
/** Texels the trail has painted. 0 after `clearPaint`, and again when the painted craft changes. */
|
|
304
|
+
get paintPixels(): number;
|
|
282
305
|
/**
|
|
283
306
|
* Show Starman and the Tesla Roadster (the attribute `roadster`; off by default): a small marked body where `/roadster` puts the car on the date shown, on its orbit line (about one trip round the Sun), with its name
|
|
284
307
|
* (`Starman`, `スターマン`) beside it, from the launch in 2018 to the end of 2035. Its path (a 20 kB table) is loaded the first time it is shown, and never when it is not. `stats.roadster` says what was drawn.
|
|
@@ -592,6 +615,7 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
592
615
|
shown: boolean;
|
|
593
616
|
text: string;
|
|
594
617
|
turn: number;
|
|
618
|
+
look: string;
|
|
595
619
|
} | null;
|
|
596
620
|
};
|
|
597
621
|
/** Starman and the Roadster at the last draw: whether the car was drawn (shown, its path in, the moment within 2018 to 2035), its place in Earth radii from the Earth's centre, and its radius on the screen in CSS pixels. */
|
package/dist/space/element.js
CHANGED
|
@@ -6,7 +6,7 @@ import { arrowCount } from "./arrows.js";
|
|
|
6
6
|
import { createGameClock } from "./clock.js";
|
|
7
7
|
import { bodyKindOf, findBody, hopFrom, hostOf, HOP_ORDER, systemOf } from "./bodies.js";
|
|
8
8
|
import { sightChanged, sightOf } from "./sight.js";
|
|
9
|
-
import { chooseLabels } from "./labels.js";
|
|
9
|
+
import { chooseLabels, nameSpot } from "./labels.js";
|
|
10
10
|
import { coverArrows } from "./covered.js";
|
|
11
11
|
import { createPainter } from "../scene/painter.js";
|
|
12
12
|
import { NAME_LABEL_ATTRIBUTES, readNameLabel } from "../scene/name-label.js";
|
|
@@ -28,6 +28,7 @@ import { createPlaceLayer, onPlacesLoader, placesLoader } from "../scene/place-l
|
|
|
28
28
|
import { createEarthPlaceLayer, EARTH_PLACE_MARKS, EARTH_PLACES_FROM_PX, earthPlacesLayout, onEarthPlacesLayout, readEarthPlaceLook } from "../scene/earth-places.js";
|
|
29
29
|
import { cross, dot } from "../vec.js";
|
|
30
30
|
import { createSpaceItem, FIT_DISTANCE, newSpaceModel, SPACE_BODIES } from "./scene.js";
|
|
31
|
+
import { paintLengthOf, paintSwathOf } from "../paint/trail.js";
|
|
31
32
|
export { setPlacesLoader } from "../scene/place-layer.js";
|
|
32
33
|
export { EARTH_PLACE_LOOKS, EARTH_PLACE_MARKS } from "../scene/earth-places.js";
|
|
33
34
|
export { setThreeLoader, SPACE_BODIES };
|
|
@@ -104,7 +105,7 @@ const readBody = (value) => {
|
|
|
104
105
|
* 1.05 radii from the surface (`FIT_DISTANCE` over the zoom), so past a zoom of about 3.9 nothing moves; 3.6 is where the finest map tiles of the Earth, Mars and the Moon (16384 pixels round) run out of detail too, so it is the same ceiling for both.
|
|
105
106
|
*/
|
|
106
107
|
const CARRIED_LIMITS = { zoomMin: 1e-6, zoomMax: 3.6, tiltMax: 90 };
|
|
107
|
-
const STYLE = `<style>:host{display:block;aspect-ratio:1/1;position:relative;overflow:hidden}:host([immersive]){aspect-ratio:auto;width:100%;height:100%;touch-action:none!important;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}#stage,#labels{position:absolute;inset:0}#labels{pointer-events:none;overflow:hidden}.sp-label{position:absolute;left:0;top:0;margin:0;padding:0;border:0;background:none;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;will-change:transform;pointer-events:none}.sp-label:focus-visible{outline:2px solid #6cd0ff;outline-offset:2px;border-radius:4px}.sp-label::before{content:"";display:inline-block;width:5px;height:5px;margin:0 5px 1px -2px;border-radius:50%;background:#fff}.sp-label[hidden]{display:none}.sp-arrow{position:absolute;left:0;top:0;margin:0;padding:0 4px 0 0;border:0;background:none;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;opacity:.8;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;will-change:transform;pointer-events:auto;cursor:pointer}.sp-arrow::before{content:"";display:inline-block;width:0;height:0;margin:0 5px 1px 0;border:5px solid transparent;border-left:7px solid #fff;transform:rotate(var(--turn,0deg));transform-origin:30% 50%}.sp-arrow[hidden]{display:none}.sp-arrow:focus-visible{outline:2px solid #6cd0ff;outline-offset:2px;border-radius:4px}.sp-label[data-far]:not([data-carried]),.sp-ring[data-far]:not([data-carried]){opacity:var(--wakusei-far-opacity,.5)}.sp-arrow[data-far]{opacity:calc(.8*var(--wakusei-far-opacity,.5))}.sp-label,.sp-ring,.sp-arrow{transition:opacity .35s ease}.sp-label[data-carried],.sp-ring[data-carried]{opacity:0;pointer-events:none}@media (prefers-reduced-motion:reduce){.sp-label,.sp-ring,.sp-arrow{transition:none}}.sp-ring{position:absolute;left:0;top:0;width:16px;height:16px;margin:-8px 0 0 -8px;box-sizing:border-box;border:1.5px solid rgba(255,255,255,.85);border-radius:50%;box-shadow:0 0 3px #000;pointer-events:none;will-change:transform}.sp-ring[hidden]{display:none}.sp-scale{position:absolute;left:10px;top:8px;margin:0;padding:0;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;opacity:.9;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}.sp-region{position:absolute;left:10px;bottom:8px;margin:0;padding:0;font:600 15px/20px system-ui,-apple-system,sans-serif;color:#fff;opacity:.95;text-shadow:0 0 4px #000,0 0 4px #000;pointer-events:none;transition:opacity .35s}.sp-region[hidden]{display:block;opacity:0}@media (prefers-reduced-motion:reduce){.sp-region{transition:none}}.sp-note{position:absolute;left:10px;right:10px;top:28px;max-width:44em;margin:0;padding:0;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;opacity:.92;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}.sp-note[hidden],.sp-oort[hidden]{display:none}.sp-oort{position:absolute;left:0;top:0;margin:0;padding:0;font:italic 12px/16px system-ui,-apple-system,sans-serif;color:#aeb8e6;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;will-change:transform;pointer-events:none}</style><div id="stage"></div><div id="labels"></div><p class="sp-scale" part="scale" role="status"></p><p class="sp-region" id="region" part="region" role="status" hidden></p><p class="sp-note" part="note" role="status" hidden></p><p class="sp-oort" part="oort" hidden></p>`;
|
|
108
|
+
const STYLE = `<style>:host{display:block;aspect-ratio:1/1;position:relative;overflow:hidden}:host([immersive]){aspect-ratio:auto;width:100%;height:100%;touch-action:none!important;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}#stage,#labels{position:absolute;inset:0}#labels{pointer-events:none;overflow:hidden}.sp-label{position:absolute;left:0;top:0;margin:0;padding:0;border:0;background:none;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;will-change:transform;pointer-events:none}.sp-label:focus-visible{outline:2px solid #6cd0ff;outline-offset:2px;border-radius:4px}.sp-label::before{content:"";display:inline-block;width:5px;height:5px;margin:0 5px 1px -2px;border-radius:50%;background:#fff}.sp-label[data-flip]{display:flex;flex-direction:row-reverse}.sp-label[data-flip]::before{margin:0 -2px 1px 5px}.sp-label[hidden]{display:none}.sp-arrow{position:absolute;left:0;top:0;margin:0;padding:0 4px 0 0;border:0;background:none;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;opacity:.8;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;will-change:transform;pointer-events:auto;cursor:pointer}.sp-arrow::before{content:"";display:inline-block;width:0;height:0;margin:0 5px 1px 0;border:5px solid transparent;border-left:7px solid #fff;transform:rotate(var(--turn,0deg));transform-origin:30% 50%}.sp-arrow[hidden]{display:none}.sp-arrow:focus-visible{outline:2px solid #6cd0ff;outline-offset:2px;border-radius:4px}.sp-label[data-far]:not([data-carried]),.sp-ring[data-far]:not([data-carried]){opacity:var(--wakusei-far-opacity,.5)}.sp-arrow[data-far]{opacity:calc(.8*var(--wakusei-far-opacity,.5))}.sp-label,.sp-ring,.sp-arrow{transition:opacity .35s ease}.sp-label[data-carried],.sp-ring[data-carried]{opacity:0;pointer-events:none}@media (prefers-reduced-motion:reduce){.sp-label,.sp-ring,.sp-arrow{transition:none}}.sp-ring{position:absolute;left:0;top:0;width:16px;height:16px;margin:-8px 0 0 -8px;box-sizing:border-box;border:1.5px solid rgba(255,255,255,.85);border-radius:50%;box-shadow:0 0 3px #000;pointer-events:none;will-change:transform}.sp-ring[hidden]{display:none}.sp-scale{position:absolute;left:10px;top:8px;margin:0;padding:0;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;opacity:.9;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}.sp-region{position:absolute;left:10px;bottom:8px;margin:0;padding:0;font:600 15px/20px system-ui,-apple-system,sans-serif;color:#fff;opacity:.95;text-shadow:0 0 4px #000,0 0 4px #000;pointer-events:none;transition:opacity .35s}.sp-region[hidden]{display:block;opacity:0}@media (prefers-reduced-motion:reduce){.sp-region{transition:none}}.sp-note{position:absolute;left:10px;right:10px;top:28px;max-width:44em;margin:0;padding:0;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;opacity:.92;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}.sp-note[hidden],.sp-oort[hidden]{display:none}.sp-oort{position:absolute;left:0;top:0;margin:0;padding:0;font:italic 12px/16px system-ui,-apple-system,sans-serif;color:#aeb8e6;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;will-change:transform;pointer-events:none}</style><div id="stage"></div><div id="labels"></div><p class="sp-scale" part="scale" role="status"></p><p class="sp-region" id="region" part="region" role="status" hidden></p><p class="sp-note" part="note" role="status" hidden></p><p class="sp-oort" part="oort" hidden></p>`;
|
|
108
109
|
const orbiterLines = (value) => (value === "chosen" || value === "none" ? value : "all");
|
|
109
110
|
/**
|
|
110
111
|
* The `<wakusei-space>` custom element: the Earth, the Moon, the Sun and the planets where they are at a date and time, drawn with three.js through the shared renderer. It takes `center`
|
|
@@ -775,6 +776,46 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
775
776
|
}
|
|
776
777
|
this.#gate?.request();
|
|
777
778
|
}
|
|
779
|
+
/**
|
|
780
|
+
* Paint one orbiter's path on the body it goes round. `id` is an orbiter such as `lro` or `mro`. `length` is how long the trail is kept, in simulated time (`1d` when left out, or `1w`, `1m`).
|
|
781
|
+
* `swath` is `track` (the point under the craft, the default) or `coverage` (where it is at least 10° above the horizon). Setting another craft clears the trail. `null` clears it.
|
|
782
|
+
* The trail is drawn only while time is moving, one upload a frame, and nothing at rest.
|
|
783
|
+
*
|
|
784
|
+
* @example
|
|
785
|
+
* ```ts no-run
|
|
786
|
+
* import type { WakuseiSpace } from "@johnmorrisdotca/wakusei-planets/space/element";
|
|
787
|
+
*
|
|
788
|
+
* const paint = (space: WakuseiSpace): void => {
|
|
789
|
+
* space.paint = { id: "lro", length: "1d", swath: "track" };
|
|
790
|
+
* };
|
|
791
|
+
* console.log(typeof paint);
|
|
792
|
+
* ```
|
|
793
|
+
*/
|
|
794
|
+
get paint() {
|
|
795
|
+
const spec = this.#model.paint;
|
|
796
|
+
return spec === null ? null : { id: spec.id, length: paintLengthOf(spec.length), swath: paintSwathOf(spec.swath) };
|
|
797
|
+
}
|
|
798
|
+
set paint(value) {
|
|
799
|
+
if (value === null) {
|
|
800
|
+
this.#model.paint = null;
|
|
801
|
+
this.#model.paintTrail.clear();
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
const next = { id: String(value.id), length: paintLengthOf(value.length), swath: paintSwathOf(value.swath) };
|
|
805
|
+
this.#model.paint = next;
|
|
806
|
+
this.#model.paintTrail.set(next);
|
|
807
|
+
this.orbiters = true;
|
|
808
|
+
}
|
|
809
|
+
this.#gate?.request();
|
|
810
|
+
}
|
|
811
|
+
/** Take the painted trail off the body. */
|
|
812
|
+
clearPaint() {
|
|
813
|
+
this.paint = null;
|
|
814
|
+
}
|
|
815
|
+
/** Texels the trail has painted. 0 after `clearPaint`, and again when the painted craft changes. */
|
|
816
|
+
get paintPixels() {
|
|
817
|
+
return this.#model.paintTrail.pixels;
|
|
818
|
+
}
|
|
778
819
|
#roadsterLoading = false;
|
|
779
820
|
/**
|
|
780
821
|
* Show Starman and the Tesla Roadster (the attribute `roadster`; off by default): a small marked body where `/roadster` puts the car on the date shown, on its orbit line (about one trip round the Sun), with its name
|
|
@@ -1646,6 +1687,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1646
1687
|
return;
|
|
1647
1688
|
const wanted = [];
|
|
1648
1689
|
const spots = new Map();
|
|
1690
|
+
const frame = { width: box.clientWidth, height: box.clientHeight };
|
|
1649
1691
|
const ids = [...new Set([...SPACE_BODIES, ...this.#pool.keys(), ...Object.keys(places)])];
|
|
1650
1692
|
for (const id of ids) {
|
|
1651
1693
|
let label = this.#pool.get(id);
|
|
@@ -1673,16 +1715,17 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1673
1715
|
}
|
|
1674
1716
|
if (!at)
|
|
1675
1717
|
continue;
|
|
1676
|
-
const
|
|
1677
|
-
|
|
1718
|
+
const width = this.#widthOf(label);
|
|
1719
|
+
// beside the dot, on the side that stays inside the view
|
|
1720
|
+
const { x, y, flipped } = nameSpot(at, { width, height: 16 }, frame);
|
|
1678
1721
|
// a body that carries its drawn name gives its floating name up (it fades, and leaves its place to the others) unless the page keeps both; a body behind another gives it up for the arrow
|
|
1679
1722
|
const carried = at.named === true && !this.#labelsAlways;
|
|
1680
1723
|
const covered = at.behind !== undefined && this.#covered === "arrow";
|
|
1681
1724
|
if (covered)
|
|
1682
1725
|
continue;
|
|
1683
|
-
spots.set(id, { x, y, small: at.r < RING_BELOW_PX, carried });
|
|
1726
|
+
spots.set(id, { x, y, small: at.r < RING_BELOW_PX, carried, flipped });
|
|
1684
1727
|
if (!carried)
|
|
1685
|
-
wanted.push({ id, x, y, width
|
|
1728
|
+
wanted.push({ id, x, y, width, height: 16, rank: this.#rank(id), size: at.r });
|
|
1686
1729
|
}
|
|
1687
1730
|
// no two names overlap: a moon gives way to its planet and a planet to the Sun
|
|
1688
1731
|
const shown = chooseLabels(wanted);
|
|
@@ -1715,6 +1758,8 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1715
1758
|
label.setAttribute("aria-hidden", String(spot.carried));
|
|
1716
1759
|
label.tabIndex = spot.carried ? -1 : 0;
|
|
1717
1760
|
}
|
|
1761
|
+
if (label.hasAttribute("data-flip") !== spot.flipped)
|
|
1762
|
+
label.toggleAttribute("data-flip", spot.flipped);
|
|
1718
1763
|
label.style.transform = `translate(${spot.x}px,${spot.y}px)`;
|
|
1719
1764
|
// a body too small to see is marked: a ring round the place it is, as well as its name
|
|
1720
1765
|
if (ring.hidden === spot.small)
|
package/dist/space/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { AU_IN_EARTH_RADII, blend, createTrack, EARTH_RADIUS_KM, eclipticToScene
|
|
|
2
2
|
export { compress, MOON_COMPRESSED, moonDistance, orbitLine, placeAround, placeBodies, placeMoon, placeSun, radiusIn, SUN_COMPRESSED, truePosition, type ScaleMode } from "./scale.ts";
|
|
3
3
|
export { groundDirection } from "./aim.ts";
|
|
4
4
|
export { RIDE_FOV, ridePose, type RideInput, type RideLook, type RidePose } from "./ride.ts";
|
|
5
|
-
export { chooseLabels, LABEL_GAP, type LabelBox } from "./labels.ts";
|
|
5
|
+
export { chooseLabels, LABEL_GAP, nameSpot, type LabelBox } from "./labels.ts";
|
|
6
6
|
export { bodyKindOf, findBody, HOP_ORDER, hopFrom, hostOf, systemOf, type SpaceKind } from "./bodies.ts";
|
|
7
7
|
export { besideMoon, BESIDE_RADII, type BesideCamera, type BesideInput } from "./beside.ts";
|
|
8
8
|
export { ARROWS_PER_ORBIT, arrowCount, arrowSites, MAX_ARROWS_PER_ORBIT, chevron, spinArrow, type OrbitArrow } from "./arrows.ts";
|
package/dist/space/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { AU_IN_EARTH_RADII, blend, createTrack, EARTH_RADIUS_KM, eclipticToScene
|
|
|
3
3
|
export { compress, MOON_COMPRESSED, moonDistance, orbitLine, placeAround, placeBodies, placeMoon, placeSun, radiusIn, SUN_COMPRESSED, truePosition } from "./scale.js";
|
|
4
4
|
export { groundDirection } from "./aim.js";
|
|
5
5
|
export { RIDE_FOV, ridePose } from "./ride.js";
|
|
6
|
-
export { chooseLabels, LABEL_GAP } from "./labels.js";
|
|
6
|
+
export { chooseLabels, LABEL_GAP, nameSpot } from "./labels.js";
|
|
7
7
|
export { bodyKindOf, findBody, HOP_ORDER, hopFrom, hostOf, systemOf } from "./bodies.js";
|
|
8
8
|
export { besideMoon, BESIDE_RADII } from "./beside.js";
|
|
9
9
|
export { ARROWS_PER_ORBIT, arrowCount, arrowSites, MAX_ARROWS_PER_ORBIT, chevron, spinArrow } from "./arrows.js";
|
package/dist/space/labels.d.ts
CHANGED
|
@@ -50,3 +50,35 @@ export declare const LABEL_GAP = 3;
|
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
52
|
export declare function chooseLabels(boxes: readonly LabelBox[], gap?: number): Set<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Where a floating name goes: beside its body's dot, and kept inside the view (MODULES-1144). It starts to the right of the dot, at `max(4, min(r, 40))` pixels from its middle and 8 pixels above it. A name that would run past the right edge goes to the dot's left side instead (`flipped`); one that fits on neither side is held against the edge, and a name past the top or the bottom is held inside. A body whose dot is itself outside the view keeps its name where it falls, since the view cuts it with the body.
|
|
55
|
+
*
|
|
56
|
+
* @param dot - The body's place on the screen in CSS pixels: its middle and its radius on the screen.
|
|
57
|
+
* @param size - The name's width and height in CSS pixels.
|
|
58
|
+
* @param frame - The view's width and height in CSS pixels.
|
|
59
|
+
* @returns The name's top-left corner, and whether it went to the left of the dot.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { nameSpot } from "@johnmorrisdotca/wakusei-planets/space";
|
|
64
|
+
*
|
|
65
|
+
* // a body 20 pixels from the right edge of a 400 pixel view: its 60 pixel name goes to the left of it
|
|
66
|
+
* const spot = nameSpot({ x: 380, y: 100, r: 10 }, { width: 60, height: 16 }, { width: 400, height: 300 });
|
|
67
|
+
* console.log(spot.flipped, spot.x + 60 <= 380);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function nameSpot(dot: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
r: number;
|
|
74
|
+
}, size: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
}, frame: {
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
80
|
+
}): {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
flipped: boolean;
|
|
84
|
+
};
|
package/dist/space/labels.js
CHANGED
|
@@ -38,3 +38,42 @@ export function chooseLabels(boxes, gap = LABEL_GAP) {
|
|
|
38
38
|
kept.push(box);
|
|
39
39
|
return new Set(kept.map((box) => box.id));
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Where a floating name goes: beside its body's dot, and kept inside the view (MODULES-1144). It starts to the right of the dot, at `max(4, min(r, 40))` pixels from its middle and 8 pixels above it. A name that would run past the right edge goes to the dot's left side instead (`flipped`); one that fits on neither side is held against the edge, and a name past the top or the bottom is held inside. A body whose dot is itself outside the view keeps its name where it falls, since the view cuts it with the body.
|
|
43
|
+
*
|
|
44
|
+
* @param dot - The body's place on the screen in CSS pixels: its middle and its radius on the screen.
|
|
45
|
+
* @param size - The name's width and height in CSS pixels.
|
|
46
|
+
* @param frame - The view's width and height in CSS pixels.
|
|
47
|
+
* @returns The name's top-left corner, and whether it went to the left of the dot.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { nameSpot } from "@johnmorrisdotca/wakusei-planets/space";
|
|
52
|
+
*
|
|
53
|
+
* // a body 20 pixels from the right edge of a 400 pixel view: its 60 pixel name goes to the left of it
|
|
54
|
+
* const spot = nameSpot({ x: 380, y: 100, r: 10 }, { width: 60, height: 16 }, { width: 400, height: 300 });
|
|
55
|
+
* console.log(spot.flipped, spot.x + 60 <= 380);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function nameSpot(dot, size, frame) {
|
|
59
|
+
const gap = Math.max(4, Math.min(dot.r, 40));
|
|
60
|
+
let x = Math.round(dot.x + gap);
|
|
61
|
+
let y = Math.round(dot.y - 8);
|
|
62
|
+
let flipped = false;
|
|
63
|
+
if (frame.width <= 0 || frame.height <= 0)
|
|
64
|
+
return { x, y, flipped };
|
|
65
|
+
if (dot.x >= 0 && dot.x <= frame.width) {
|
|
66
|
+
if (x + size.width > frame.width) {
|
|
67
|
+
const left = Math.round(dot.x - gap - size.width);
|
|
68
|
+
if (left >= 0) {
|
|
69
|
+
x = left;
|
|
70
|
+
flipped = true;
|
|
71
|
+
}
|
|
72
|
+
else
|
|
73
|
+
x = Math.max(0, frame.width - size.width);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (dot.y >= 0 && dot.y <= frame.height)
|
|
77
|
+
y = Math.max(0, Math.min(y, frame.height - size.height));
|
|
78
|
+
return { x, y, flipped };
|
|
79
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
import type { ThreeParts } from "../scene/body.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The trail drawn on a body. `show` parents it to that body's oriented mesh. `hide` draws nothing and gives the picture's and the sphere's copies on the graphics card back, so a view with paint off
|
|
5
|
+
* holds none of it. `dispose` frees the geometry, the material and the texture for good.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPaintOverlay(three: ThreeParts, data: Uint8Array): {
|
|
8
|
+
show(host: THREE.Object3D, nowMinute: number, spanMinutes: number, upload: boolean): void;
|
|
9
|
+
hide(): void;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { PAINT_H, PAINT_W } from "../paint/trail.js";
|
|
2
|
+
const VERTEX = /* glsl */ `
|
|
3
|
+
varying vec3 vLocal;
|
|
4
|
+
void main() {
|
|
5
|
+
vLocal = normalize(position);
|
|
6
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
const FRAGMENT = /* glsl */ `
|
|
10
|
+
uniform sampler2D uMap;
|
|
11
|
+
uniform float uNow;
|
|
12
|
+
uniform float uSpan;
|
|
13
|
+
varying vec3 vLocal;
|
|
14
|
+
void main() {
|
|
15
|
+
float lat = asin(clamp(vLocal.y, -1.0, 1.0));
|
|
16
|
+
float lon = atan(vLocal.x, vLocal.z);
|
|
17
|
+
vec2 uv = vec2(lon / 6.2831853 + 0.5, 0.5 - lat / 3.14159265);
|
|
18
|
+
vec4 stamp = texture2D(uMap, uv);
|
|
19
|
+
float then = floor(stamp.r * 255.0 + 0.5) * 256.0 + floor(stamp.g * 255.0 + 0.5);
|
|
20
|
+
float age = uNow - then;
|
|
21
|
+
if (age < -32768.0) age += 65536.0;
|
|
22
|
+
if (age > 32768.0) age -= 65536.0;
|
|
23
|
+
float show = stamp.a * step(-1.0, age) * (1.0 - smoothstep(uSpan * 0.82, uSpan, max(age, 0.0)));
|
|
24
|
+
if (show < 0.04) discard;
|
|
25
|
+
gl_FragColor = vec4(1.0, 0.55, 0.12, clamp(show, 0.0, 0.9));
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
/**
|
|
29
|
+
* The trail drawn on a body. `show` parents it to that body's oriented mesh. `hide` draws nothing and gives the picture's and the sphere's copies on the graphics card back, so a view with paint off
|
|
30
|
+
* holds none of it. `dispose` frees the geometry, the material and the texture for good.
|
|
31
|
+
*/
|
|
32
|
+
export function createPaintOverlay(three, data) {
|
|
33
|
+
const texture = new three.DataTexture(data, PAINT_W, PAINT_H, three.RGBAFormat);
|
|
34
|
+
texture.flipY = false;
|
|
35
|
+
texture.magFilter = three.LinearFilter;
|
|
36
|
+
texture.minFilter = three.LinearFilter;
|
|
37
|
+
texture.generateMipmaps = false;
|
|
38
|
+
texture.colorSpace = three.NoColorSpace;
|
|
39
|
+
texture.needsUpdate = false;
|
|
40
|
+
const geometry = new three.SphereGeometry(1.004, 64, 32);
|
|
41
|
+
const material = new three.ShaderMaterial({
|
|
42
|
+
vertexShader: VERTEX,
|
|
43
|
+
fragmentShader: FRAGMENT,
|
|
44
|
+
transparent: true,
|
|
45
|
+
depthWrite: false,
|
|
46
|
+
uniforms: { uMap: { value: texture }, uNow: { value: 0 }, uSpan: { value: 1440 } },
|
|
47
|
+
});
|
|
48
|
+
const mesh = new three.Mesh(geometry, material);
|
|
49
|
+
mesh.name = "ground-track";
|
|
50
|
+
mesh.frustumCulled = false;
|
|
51
|
+
mesh.renderOrder = 3;
|
|
52
|
+
mesh.visible = false;
|
|
53
|
+
/** Whether the texture or the sphere may be on the graphics card. */
|
|
54
|
+
let held = false;
|
|
55
|
+
return {
|
|
56
|
+
show(host, nowMinute, spanMinutes, upload) {
|
|
57
|
+
if (mesh.parent !== host)
|
|
58
|
+
host.add(mesh);
|
|
59
|
+
mesh.visible = true;
|
|
60
|
+
if (!held) {
|
|
61
|
+
held = true;
|
|
62
|
+
texture.needsUpdate = true;
|
|
63
|
+
}
|
|
64
|
+
material.uniforms.uNow.value = nowMinute;
|
|
65
|
+
material.uniforms.uSpan.value = spanMinutes;
|
|
66
|
+
if (upload)
|
|
67
|
+
texture.needsUpdate = true;
|
|
68
|
+
},
|
|
69
|
+
hide() {
|
|
70
|
+
mesh.visible = false;
|
|
71
|
+
if (held) {
|
|
72
|
+
held = false;
|
|
73
|
+
texture.dispose();
|
|
74
|
+
geometry.dispose();
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
dispose() {
|
|
78
|
+
mesh.parent?.remove(mesh);
|
|
79
|
+
geometry.dispose();
|
|
80
|
+
material.dispose();
|
|
81
|
+
texture.dispose();
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
package/dist/space/scene.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { type Vec3 } from "../vec.ts";
|
|
|
11
11
|
import { type OrbitArrow } from "./arrows.ts";
|
|
12
12
|
import type { SightInput } from "./sight.ts";
|
|
13
13
|
import { type SpaceFrame, type SpaceVec3 } from "./frame.ts";
|
|
14
|
+
import { type PaintSpec, type PaintTrail } from "../paint/trail.ts";
|
|
14
15
|
import { type RideLook } from "./ride.ts";
|
|
15
16
|
import { type ScaleMode } from "./scale.ts";
|
|
16
17
|
import { type SunRegion } from "./regions.ts";
|
|
@@ -218,6 +219,10 @@ export interface SpaceModel {
|
|
|
218
219
|
lines: number;
|
|
219
220
|
track: number;
|
|
220
221
|
};
|
|
222
|
+
/** The craft whose ground track is painted on its body, or null. */
|
|
223
|
+
paint: PaintSpec | null;
|
|
224
|
+
/** The trail buffer the element and the scene share. */
|
|
225
|
+
paintTrail: PaintTrail;
|
|
221
226
|
/** Show Starman and the Roadster: a small marked body on its orbit line, named. Off by default; its path is loaded when it is first shown. */
|
|
222
227
|
roadster: boolean;
|
|
223
228
|
roadsterPath: RoadsterPath | null;
|
|
@@ -237,6 +242,7 @@ export interface SpaceModel {
|
|
|
237
242
|
shown: boolean;
|
|
238
243
|
text: string;
|
|
239
244
|
turn: number;
|
|
245
|
+
look: string;
|
|
240
246
|
} | null;
|
|
241
247
|
};
|
|
242
248
|
/** How long an arrowhead drawn at the last draw is on the screen, in CSS pixels (measured from its own points), or 0 when none was drawn. */
|
package/dist/space/scene.js
CHANGED
|
@@ -14,6 +14,8 @@ import { besideMoon } from "./beside.js";
|
|
|
14
14
|
import { coveredBy } from "./covered.js";
|
|
15
15
|
import { spinAxis } from "./spin.js";
|
|
16
16
|
import { createTrack, eclipticToScene, frameAt, moonOrbit, planetOrbit, SPACE_DWARFS, SPACE_MINORS, SPACE_PLANETS } from "./frame.js";
|
|
17
|
+
import { createPaintOverlay } from "./paint-overlay.js";
|
|
18
|
+
import { createPaintTrail, groundUnder, paintMinute } from "../paint/trail.js";
|
|
17
19
|
import { BALL_FRAGMENT, VERTEX } from "../scene/glsl.js";
|
|
18
20
|
import { ridePose } from "./ride.js";
|
|
19
21
|
import { moonDistance, orbitLine, placeAround, placeBodies, placeMoon, radiusIn } from "./scale.js";
|
|
@@ -98,6 +100,8 @@ export const newSpaceModel = () => ({
|
|
|
98
100
|
orbiterLines: "all",
|
|
99
101
|
orbiterTrack: false,
|
|
100
102
|
orbitersDrawn: { count: 0, status: {}, dim: [], lines: 0, track: 0 },
|
|
103
|
+
paint: null,
|
|
104
|
+
paintTrail: createPaintTrail(),
|
|
101
105
|
roadster: false,
|
|
102
106
|
roadsterPath: null,
|
|
103
107
|
roadsterDrawn: { shown: false, position: null, radiusPx: 0 },
|
|
@@ -179,6 +183,8 @@ export function createSpaceItem(model, deps) {
|
|
|
179
183
|
const scratchB = new three.Vector3();
|
|
180
184
|
// the orbit lines of a stage out from the Sun, kept while the stage, the scale and the day are the same
|
|
181
185
|
let regionLines = null;
|
|
186
|
+
// made when the first trail is shown: a view that never paints holds none of it
|
|
187
|
+
let paintOverlay = null;
|
|
182
188
|
let ended = false;
|
|
183
189
|
const slots = new Map();
|
|
184
190
|
const empty = (slot) => {
|
|
@@ -913,6 +919,24 @@ export function createSpaceItem(model, deps) {
|
|
|
913
919
|
if (trackDrawn === 0)
|
|
914
920
|
trackLine.visible = false;
|
|
915
921
|
model.orbitersDrawn = { count: Object.keys(orbiterPlaces).length, status: orbiterStatus, dim: orbitersDim, lines: linesDrawn, track: trackDrawn };
|
|
922
|
+
// the painted trail: stepped and uploaded only while the painted craft's body is drawn, and only when the shown moment moved
|
|
923
|
+
const paintedCraft = model.paint;
|
|
924
|
+
const paintSet = model.orbiterSet;
|
|
925
|
+
const paintBody = paintedCraft !== null && paintSet !== null && paintSet.ids.includes(paintedCraft.id) ? slots.get(paintSet.centre(paintedCraft.id))?.drawing : undefined;
|
|
926
|
+
const paintHost = paintBody !== undefined && paintBody.object.visible ? paintBody.object.children[0] : undefined;
|
|
927
|
+
if (paintedCraft !== null && paintSet !== null && paintHost !== undefined) {
|
|
928
|
+
const centre = paintSet.centre(paintedCraft.id);
|
|
929
|
+
const period = paintSet.period(paintedCraft.id);
|
|
930
|
+
const trail = model.paintTrail;
|
|
931
|
+
const upload = trail.step(model.time, BODIES[centre].radiusKm, (at) => {
|
|
932
|
+
const there = paintSet.position(paintedCraft.id, at);
|
|
933
|
+
return there === null ? null : groundUnder(centre, there, at);
|
|
934
|
+
}, period === null ? undefined : period * 86_400_000);
|
|
935
|
+
(paintOverlay ??= createPaintOverlay(three, model.paintTrail.data)).show(paintHost, paintMinute(model.time), trail.spanMinutes, upload);
|
|
936
|
+
}
|
|
937
|
+
else {
|
|
938
|
+
paintOverlay?.hide();
|
|
939
|
+
}
|
|
916
940
|
model.roadsterDrawn = { shown: roadsterAt !== null, position: roadsterAt === null ? null : [roadsterAt[0] + origin[0], roadsterAt[1] + origin[1], roadsterAt[2] + origin[2]], radiusPx: roadsterPx };
|
|
917
941
|
// the arrowheads on the lines: small in screen pixels at the place, pointing the way the body goes (the lines run from the body once round in the order it goes, whichever way the clock runs)
|
|
918
942
|
const e = camera.matrixWorld.elements;
|
|
@@ -1169,6 +1193,7 @@ export function createSpaceItem(model, deps) {
|
|
|
1169
1193
|
dots?.dispose();
|
|
1170
1194
|
oortGeometry.dispose();
|
|
1171
1195
|
oortLines.material.dispose();
|
|
1196
|
+
paintOverlay?.dispose();
|
|
1172
1197
|
if (releaseTimer !== undefined)
|
|
1173
1198
|
clearTimeout(releaseTimer);
|
|
1174
1199
|
ended = true;
|
|
Binary file
|
|
Binary file
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.41.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.41.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.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",
|
|
@@ -370,6 +370,11 @@
|
|
|
370
370
|
"import": "./dist/orbiters.js",
|
|
371
371
|
"default": "./dist/orbiters.js"
|
|
372
372
|
},
|
|
373
|
+
"./ground-track": {
|
|
374
|
+
"types": "./dist/ground-track.d.ts",
|
|
375
|
+
"import": "./dist/ground-track.js",
|
|
376
|
+
"default": "./dist/ground-track.js"
|
|
377
|
+
},
|
|
373
378
|
"./suncalc": {
|
|
374
379
|
"types": "./dist/suncalc.d.ts",
|
|
375
380
|
"import": "./dist/suncalc.js",
|