@johnmorrisdotca/wakusei-planets 0.62.0 → 0.64.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 +39 -1
- package/README.md +4 -3
- package/dist/asteroids.d.ts +15 -1
- package/dist/asteroids.js +28 -0
- package/dist/door/made.d.ts +4 -0
- package/dist/door/made.js +10 -0
- package/dist/door/own.d.ts +1 -4
- package/dist/door/own.js +1 -9
- package/dist/element.js +19 -22
- package/dist/fact-sheets.d.ts +103 -0
- package/dist/fact-sheets.js +135 -0
- package/dist/flat/index.d.ts +1 -0
- package/dist/flat/index.js +1 -0
- package/dist/flat/projections.d.ts +300 -0
- package/dist/flat/projections.js +414 -0
- package/dist/scene/tumble.d.ts +13 -0
- package/dist/scene/tumble.js +34 -0
- package/dist/sky/events.d.ts +2 -0
- package/dist/sky/events.js +3 -2
- package/dist/sky.d.ts +561 -0
- package/dist/sky.js +522 -0
- package/dist/space/asteroid-ids.d.ts +8 -0
- package/dist/space/asteroid-ids.js +19 -0
- package/dist/space/element.d.ts +63 -6
- package/dist/space/element.js +208 -26
- package/dist/space/scene.d.ts +32 -0
- package/dist/space/scene.js +36 -2
- package/dist/suncalc-legacy.d.ts +21 -0
- package/dist/suncalc-legacy.js +13 -0
- package/dist/suncalc.d.ts +21 -0
- package/dist/suncalc.js +23 -8
- package/dist/surface/element.d.ts +1 -1
- package/dist/surface/element.js +4 -2
- package/package.json +15 -1
package/dist/suncalc-legacy.d.ts
CHANGED
|
@@ -185,3 +185,24 @@ export declare function getTimes(date: Date | number, lat: number, lng: number,
|
|
|
185
185
|
* ```
|
|
186
186
|
*/
|
|
187
187
|
export declare function getMoonTimes(date: Date | number, lat: number, lng: number, inUTC?: boolean): LegacyMoonTimes;
|
|
188
|
+
/**
|
|
189
|
+
* Every function of this entry as one object, for code written `import SunCalc from "suncalc"` (or `const SunCalc = require("suncalc")`) against suncalc 1.x. `SunCalc.times` is the same array as the named `times`, so `addTime` reaches both.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```ts
|
|
193
|
+
* import SunCalc from "@johnmorrisdotca/wakusei-planets/suncalc/legacy";
|
|
194
|
+
*
|
|
195
|
+
* const t = SunCalc.getTimes(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
|
|
196
|
+
* console.log(t.sunrise instanceof Date);
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
declare const SunCalc: {
|
|
200
|
+
getPosition: typeof getPosition;
|
|
201
|
+
getTimes: typeof getTimes;
|
|
202
|
+
times: [number, string, string][];
|
|
203
|
+
addTime: typeof addTime;
|
|
204
|
+
getMoonPosition: typeof getMoonPosition;
|
|
205
|
+
getMoonIllumination: typeof getMoonIllumination;
|
|
206
|
+
getMoonTimes: typeof getMoonTimes;
|
|
207
|
+
};
|
|
208
|
+
export default SunCalc;
|
package/dist/suncalc-legacy.js
CHANGED
|
@@ -166,3 +166,16 @@ export function getMoonTimes(date, lat, lng, inUTC = false) {
|
|
|
166
166
|
result.alwaysDown = true;
|
|
167
167
|
return result;
|
|
168
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Every function of this entry as one object, for code written `import SunCalc from "suncalc"` (or `const SunCalc = require("suncalc")`) against suncalc 1.x. `SunCalc.times` is the same array as the named `times`, so `addTime` reaches both.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* import SunCalc from "@johnmorrisdotca/wakusei-planets/suncalc/legacy";
|
|
175
|
+
*
|
|
176
|
+
* const t = SunCalc.getTimes(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
|
|
177
|
+
* console.log(t.sunrise instanceof Date);
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
const SunCalc = { getPosition, getTimes, times, addTime, getMoonPosition, getMoonIllumination, getMoonTimes };
|
|
181
|
+
export default SunCalc;
|
package/dist/suncalc.d.ts
CHANGED
|
@@ -207,3 +207,24 @@ export declare function getTimes(date: Date | number, lat: number, lng: number,
|
|
|
207
207
|
* ```
|
|
208
208
|
*/
|
|
209
209
|
export declare function getMoonTimes(date: Date | number, lat: number, lng: number, utcOffset?: number): MoonTimes;
|
|
210
|
+
/**
|
|
211
|
+
* Every function of this entry as one object, for code written `import SunCalc from "suncalc"`. `SunCalc.times` is the same array as the named `times`, so `addTime` reaches both.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```ts
|
|
215
|
+
* import SunCalc from "@johnmorrisdotca/wakusei-planets/suncalc";
|
|
216
|
+
*
|
|
217
|
+
* const t = SunCalc.getTimes(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
|
|
218
|
+
* console.log(t.sunrise instanceof Date);
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare const SunCalc: {
|
|
222
|
+
getPosition: typeof getPosition;
|
|
223
|
+
getTimes: typeof getTimes;
|
|
224
|
+
times: [number, string, string][];
|
|
225
|
+
addTime: typeof addTime;
|
|
226
|
+
getMoonPosition: typeof getMoonPosition;
|
|
227
|
+
getMoonIllumination: typeof getMoonIllumination;
|
|
228
|
+
getMoonTimes: typeof getMoonTimes;
|
|
229
|
+
};
|
|
230
|
+
export default SunCalc;
|
package/dist/suncalc.js
CHANGED
|
@@ -122,10 +122,11 @@ export function getTimes(date, lat, lng, height = 0, utcOffset) {
|
|
|
122
122
|
const result = { solarNoon: new Date(day.noon), nadir: new Date(day.nadir) };
|
|
123
123
|
for (const [name, at] of day.events)
|
|
124
124
|
result[name] = at === null ? null : new Date(at);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
result.alwaysDown =
|
|
125
|
+
// suncalc's shape: when the Sun does not rise, both flags are there, one true and one false
|
|
126
|
+
if (result.sunrise === null) {
|
|
127
|
+
result.alwaysUp = day.noonHigh;
|
|
128
|
+
result.alwaysDown = !day.noonHigh;
|
|
129
|
+
}
|
|
129
130
|
return result;
|
|
130
131
|
}
|
|
131
132
|
/**
|
|
@@ -159,9 +160,23 @@ export function getMoonTimes(date, lat, lng, utcOffset) {
|
|
|
159
160
|
result.transit = new Date(day.transit);
|
|
160
161
|
if (day.lowerTransit !== null)
|
|
161
162
|
result.lowerTransit = new Date(day.lowerTransit);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
result.alwaysDown =
|
|
163
|
+
// suncalc's shape: on a day with no rise and no set both flags are there, one true and one false
|
|
164
|
+
if (day.rise === null && day.set === null) {
|
|
165
|
+
result.alwaysUp = day.alwaysUp;
|
|
166
|
+
result.alwaysDown = !day.alwaysUp;
|
|
167
|
+
}
|
|
166
168
|
return result;
|
|
167
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Every function of this entry as one object, for code written `import SunCalc from "suncalc"`. `SunCalc.times` is the same array as the named `times`, so `addTime` reaches both.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* import SunCalc from "@johnmorrisdotca/wakusei-planets/suncalc";
|
|
176
|
+
*
|
|
177
|
+
* const t = SunCalc.getTimes(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
|
|
178
|
+
* console.log(t.sunrise instanceof Date);
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
const SunCalc = { getPosition, getTimes, times, addTime, getMoonPosition, getMoonIllumination, getMoonTimes };
|
|
182
|
+
export default SunCalc;
|
|
@@ -52,7 +52,7 @@ export declare class WakuseiSurface extends HTMLElement {
|
|
|
52
52
|
/** The eyes' look now. Setting it turns the view (azimuth and pitch in degrees, `fov` the view's height in degrees); it is drawn at once. */
|
|
53
53
|
get look(): Look;
|
|
54
54
|
set look(value: Look);
|
|
55
|
-
/** Where the eyes are: metres east and north of the site, and metres over the ground under them. */
|
|
55
|
+
/** Where the eyes are: metres east and north of the site, and metres over the ground under them. Standing, that is a person's height; while the rover is driven or the landing watched, it is the height of the view being drawn (the seat, the chase camera). */
|
|
56
56
|
get position(): {
|
|
57
57
|
east: number;
|
|
58
58
|
north: number;
|
package/dist/surface/element.js
CHANGED
|
@@ -159,9 +159,11 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
159
159
|
this.#look = clampLook(value);
|
|
160
160
|
this.#changed();
|
|
161
161
|
}
|
|
162
|
-
/** Where the eyes are: metres east and north of the site, and metres over the ground under them. */
|
|
162
|
+
/** Where the eyes are: metres east and north of the site, and metres over the ground under them. Standing, that is a person's height; while the rover is driven or the landing watched, it is the height of the view being drawn (the seat, the chase camera). */
|
|
163
163
|
get position() {
|
|
164
|
-
|
|
164
|
+
if (this.#terrain === undefined || (this.#vehicle === undefined && this.#landing === undefined))
|
|
165
|
+
return { ...this.#at, up: EYE_HEIGHT };
|
|
166
|
+
return { ...this.#at, up: this.#eyeUp() - this.#groundAt(this.#at.east, this.#at.north) };
|
|
165
167
|
}
|
|
166
168
|
/** The sky now: the Sun and the Earth in it. */
|
|
167
169
|
get sky() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.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",
|
|
@@ -236,6 +236,11 @@
|
|
|
236
236
|
"import": "./dist/spacecraft.js",
|
|
237
237
|
"default": "./dist/spacecraft.js"
|
|
238
238
|
},
|
|
239
|
+
"./fact-sheets": {
|
|
240
|
+
"types": "./dist/fact-sheets.d.ts",
|
|
241
|
+
"import": "./dist/fact-sheets.js",
|
|
242
|
+
"default": "./dist/fact-sheets.js"
|
|
243
|
+
},
|
|
239
244
|
"./roadster": {
|
|
240
245
|
"types": "./dist/roadster.d.ts",
|
|
241
246
|
"import": "./dist/roadster.js",
|
|
@@ -436,6 +441,11 @@
|
|
|
436
441
|
"import": "./dist/sky-bodies.js",
|
|
437
442
|
"default": "./dist/sky-bodies.js"
|
|
438
443
|
},
|
|
444
|
+
"./sky": {
|
|
445
|
+
"types": "./dist/sky.d.ts",
|
|
446
|
+
"import": "./dist/sky.js",
|
|
447
|
+
"default": "./dist/sky.js"
|
|
448
|
+
},
|
|
439
449
|
"./suncalc": {
|
|
440
450
|
"types": "./dist/suncalc.d.ts",
|
|
441
451
|
"import": "./dist/suncalc.js",
|
|
@@ -715,9 +725,13 @@
|
|
|
715
725
|
},
|
|
716
726
|
"peerDependencies": {
|
|
717
727
|
"@johnmorrisdotca/chikyu-earth": ">=0.10.0",
|
|
728
|
+
"astronomy-engine": ">=2.1.19 <3",
|
|
718
729
|
"three": ">=0.160.0"
|
|
719
730
|
},
|
|
720
731
|
"peerDependenciesMeta": {
|
|
732
|
+
"astronomy-engine": {
|
|
733
|
+
"optional": true
|
|
734
|
+
},
|
|
721
735
|
"three": {
|
|
722
736
|
"optional": true
|
|
723
737
|
},
|