@johnmorrisdotca/chikyu-earth 0.46.5 → 0.47.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 +13 -0
- package/README.md +4 -3
- package/dist/beam/geometry.d.ts +131 -0
- package/dist/beam/geometry.js +141 -0
- package/dist/beam/layer.d.ts +47 -0
- package/dist/beam/layer.js +308 -0
- package/dist/markers/place-layer.d.ts +4 -0
- package/dist/markers/place-layer.js +20 -6
- package/dist/place/index.d.ts +230 -0
- package/dist/place/index.js +183 -0
- package/dist/place/land.d.ts +30 -0
- package/dist/place/land.js +177 -0
- package/dist/place/water.d.ts +15 -0
- package/dist/place/water.js +63 -0
- package/dist/realistic/earth.d.ts +9 -1
- package/dist/realistic/earth.js +13 -0
- package/dist/realistic/element-base.d.ts +21 -0
- package/dist/realistic/element-base.js +58 -3
- package/dist/space/element-base.d.ts +136 -2
- package/dist/space/element-base.js +356 -8
- package/dist/space/ephemeris.d.ts +1 -1
- package/dist/space/ephemeris.js +4 -2
- package/dist/space/follow.d.ts +36 -0
- package/dist/space/follow.js +46 -0
- package/dist/space/index.d.ts +3 -1
- package/dist/space/index.js +2 -0
- package/dist/space/ride.d.ts +3 -2
- package/dist/space/ride.js +6 -4
- package/dist/space/satellite-hover.d.ts +47 -0
- package/dist/space/satellite-hover.js +183 -0
- package/dist/space/satellite-layer.d.ts +56 -1
- package/dist/space/satellite-layer.js +93 -31
- package/dist/space/satellite-model.d.ts +2 -1
- package/dist/space/satellite-model.js +4 -3
- package/dist/space/scene.d.ts +41 -0
- package/dist/space/scene.js +96 -12
- package/package.json +6 -1
|
@@ -10,6 +10,7 @@ import { cameraCentre, createEarthItem, discRadius, lookAt, newModel } from "./e
|
|
|
10
10
|
import { createPaintState, paintedGround, paintedPeriod } from "../paint/buffer.js";
|
|
11
11
|
import { MAX_ORBIT_GROUP, readStreakMax } from "../space/satellite-layer.js";
|
|
12
12
|
import { applySatelliteFocus, satelliteEmphasis, satelliteGroupRows, shellRadiusOf, zoomForOrthographicShell } from "../space/satellite-focus.js";
|
|
13
|
+
import { bindSatelliteHover, hoverPathOn, hoverStyleOf, namesOnHover as namesHoverOn } from "../space/satellite-hover.js";
|
|
13
14
|
import { readMeteorStrength } from "../meteors/strength.js";
|
|
14
15
|
import { METEOR_NOTE_STYLE, prefersLessMotion, setMeteorNote } from "../meteors/note.js";
|
|
15
16
|
import { createDoorHost } from "../door/host.js";
|
|
@@ -39,7 +40,7 @@ import { setSharedRenderer, setThreeLoader, takeRenderer } from "./shared.js";
|
|
|
39
40
|
export { setSharedRenderer, setThreeLoader };
|
|
40
41
|
import { MAX_TEXTURE, TIERS } from "./tiers.js";
|
|
41
42
|
import { mayWriteZoomMax, raisedZoomMax } from "./zoom-reach.js";
|
|
42
|
-
const STYLE = ":host{display:block;aspect-ratio:1/1;position:relative;isolation:isolate}" + IMMERSIVE_STYLE + "#stage,#overlay{position:absolute;inset:0}#overlay{pointer-events:none}" + PLACE_STYLE + SKY_STYLE + COUNTRY_NAMES_STYLE + SEA_NAMES_STYLE + CITY_NAMES_STYLE + METEOR_NOTE_STYLE + NOTES_STYLE;
|
|
43
|
+
const STYLE = ":host{display:block;aspect-ratio:1/1;position:relative;isolation:isolate}" + IMMERSIVE_STYLE + "#stage,#overlay{position:absolute;inset:0}#overlay{pointer-events:none}.sp-sat{position:absolute;left:0;top:0;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}.sp-sat[hidden]{display:none}.sp-sat[data-hover]{transition:opacity 180ms linear}@media (prefers-reduced-motion: reduce){.sp-sat[data-hover]{transition:none}}" + PLACE_STYLE + SKY_STYLE + COUNTRY_NAMES_STYLE + SEA_NAMES_STYLE + CITY_NAMES_STYLE + METEOR_NOTE_STYLE + NOTES_STYLE;
|
|
43
44
|
const RAD = Math.PI / 180;
|
|
44
45
|
/** The Sun and the clouds are re-placed this often at real time: 15 degrees an hour is 0.25 degree a minute. */
|
|
45
46
|
const LIVE_TICK_MS = 60_000;
|
|
@@ -161,7 +162,7 @@ export const readTime = (value) => {
|
|
|
161
162
|
* ```
|
|
162
163
|
*/
|
|
163
164
|
export class ChikyuEarthRealistic extends HTMLElement {
|
|
164
|
-
static observedAttributes = ["cloud-drift", "center", "time", "speed", "clouds", "lights", "light", "live-seconds", "tiles", "tiles-finer", "tiles-finer-layer", "tiles-finer-date", "tiles-finer-timeout", "data", "camera", "immersive", "meteors", "meteors-label", "meteors-strength", ...BODY_LABEL_ATTRIBUTES, ...SKY_ATTRIBUTES, ...CITY_NAMES_ATTRIBUTES, ...BORDER_ATTRIBUTES, ...GRID_ATTRIBUTES, ...COUNTRY_NAMES_ATTRIBUTES, ...SEA_NAMES_ATTRIBUTES, "air-thickness", "air-label", "lang", "places", "places-look", "place-groups", "here-city", "route", "satellite-tint", "satellite-streak-max"];
|
|
165
|
+
static observedAttributes = ["cloud-drift", "center", "time", "speed", "clouds", "lights", "light", "live-seconds", "tiles", "tiles-finer", "tiles-finer-layer", "tiles-finer-date", "tiles-finer-timeout", "data", "camera", "immersive", "meteors", "meteors-label", "meteors-strength", ...BODY_LABEL_ATTRIBUTES, ...SKY_ATTRIBUTES, ...CITY_NAMES_ATTRIBUTES, ...BORDER_ATTRIBUTES, ...GRID_ATTRIBUTES, ...COUNTRY_NAMES_ATTRIBUTES, ...SEA_NAMES_ATTRIBUTES, "air-thickness", "air-label", "lang", "places", "places-look", "place-groups", "here-city", "route", "satellite-tint", "satellite-streak-max", "hover-path", "names-on-hover"];
|
|
165
166
|
#model = newModel();
|
|
166
167
|
#paint = createPaintState();
|
|
167
168
|
#mode = "now";
|
|
@@ -208,6 +209,8 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
208
209
|
#hands;
|
|
209
210
|
/** The view from before a satellite group was framed, put back when the focus is cleared. */
|
|
210
211
|
#focusView = null;
|
|
212
|
+
/** The name and the faint orbit while the pointer rests on a satellite. */
|
|
213
|
+
#hover;
|
|
211
214
|
#reach = null;
|
|
212
215
|
/** The page has set a `speed` since the element came into the page: for a reader who prefers reduced motion, that is the Play that lets meteors start. */
|
|
213
216
|
#played = false;
|
|
@@ -358,6 +361,7 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
358
361
|
},
|
|
359
362
|
onPlaceRings: (drawn) => this.#ringsDrawn(drawn),
|
|
360
363
|
onSatellitesError: (error) => this.dispatchEvent(new CustomEvent("chikyu-satellites-unavailable", { detail: { reason: error instanceof Error ? error.message : String(error) } })),
|
|
364
|
+
onHover: (place) => this.#hover?.follow(place),
|
|
361
365
|
paint: {
|
|
362
366
|
data: () => this.#paint.data,
|
|
363
367
|
width: this.#paint.width,
|
|
@@ -389,10 +393,26 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
389
393
|
// before the shared hands (which hear it after this): a plain wheel in an immersive view zooms
|
|
390
394
|
this.addEventListener("wheel", this.#wheel, { capture: true, passive: false });
|
|
391
395
|
this.#hands = carryControls(this, { initial: this.#model.view, limits: LIMITS, onChange: (state, info) => this.setView(state, info.final) });
|
|
396
|
+
this.#hover = bindSatelliteHover({
|
|
397
|
+
element: this,
|
|
398
|
+
state: this.#model.satellites,
|
|
399
|
+
pick: (x, y) => this.#model.pick?.(x, y, 12) ?? null,
|
|
400
|
+
place: (ref) => this.placeSatellite(ref),
|
|
401
|
+
name: (ref) => this.satelliteInfo(ref)?.name,
|
|
402
|
+
selected: () => this.selectedSatellite,
|
|
403
|
+
request: () => this.#gate?.soon(),
|
|
404
|
+
labelParent: () => this.#overlay ?? null,
|
|
405
|
+
pathOn: () => hoverPathOn(this.getAttribute("hover-path"), this.getAttribute("names-on-hover")),
|
|
406
|
+
namesOn: () => namesHoverOn(this.getAttribute("names-on-hover")),
|
|
407
|
+
style: () => hoverStyleOf(this),
|
|
408
|
+
});
|
|
409
|
+
this.#hover.sync();
|
|
392
410
|
this.#startTick();
|
|
393
411
|
document.addEventListener("visibilitychange", this.#onVisible);
|
|
394
412
|
}
|
|
395
413
|
disconnectedCallback() {
|
|
414
|
+
this.#hover?.stop();
|
|
415
|
+
this.#hover = undefined;
|
|
396
416
|
this.removeEventListener("pointerdown", this.#take);
|
|
397
417
|
this.removeEventListener("pointerdown", this.#down);
|
|
398
418
|
this.removeEventListener("wheel", this.#wheel, { capture: true });
|
|
@@ -519,6 +539,8 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
519
539
|
this.#model.satellites.orbitTint = value === "orbit";
|
|
520
540
|
this.#gate?.soon();
|
|
521
541
|
}
|
|
542
|
+
else if (name === "hover-path" || name === "names-on-hover")
|
|
543
|
+
this.#hover?.sync();
|
|
522
544
|
else if (name === "satellite-streak-max") {
|
|
523
545
|
this.#model.satellites.streakMax = readStreakMax(value);
|
|
524
546
|
this.#gate?.soon();
|
|
@@ -1286,6 +1308,10 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
1286
1308
|
this.#restoreFocusView();
|
|
1287
1309
|
this.dispatchEvent(new CustomEvent("chikyu-satellite-focus", { detail: { group: null, count: 0 }, bubbles: true, composed: true }));
|
|
1288
1310
|
}
|
|
1311
|
+
if (this.#model.satellites.hover.ref?.group === group) {
|
|
1312
|
+
this.#model.satellites.hover.ref = null;
|
|
1313
|
+
this.#model.satellites.hover.fade = 0;
|
|
1314
|
+
}
|
|
1289
1315
|
}
|
|
1290
1316
|
else {
|
|
1291
1317
|
const was = groups.get(group);
|
|
@@ -1371,12 +1397,41 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
1371
1397
|
else
|
|
1372
1398
|
this.setView(view, true);
|
|
1373
1399
|
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Draw a faint orbit while the pointer rests on a satellite. On unless `hover-path="off"`. Left unset, it is on when `names-on-hover` is on.
|
|
1402
|
+
* The colour and the opacity are the custom properties `--chikyu-hover-path` and `--chikyu-hover-path-opacity`.
|
|
1403
|
+
*/
|
|
1404
|
+
get hoverPath() {
|
|
1405
|
+
return hoverPathOn(this.getAttribute("hover-path"), this.getAttribute("names-on-hover"));
|
|
1406
|
+
}
|
|
1407
|
+
set hoverPath(value) {
|
|
1408
|
+
if (value)
|
|
1409
|
+
this.setAttribute("hover-path", "");
|
|
1410
|
+
else
|
|
1411
|
+
this.setAttribute("hover-path", "off");
|
|
1412
|
+
}
|
|
1413
|
+
/** Show a satellite's name while the pointer rests on it. On unless `names-on-hover="off"`. A touch does not rest, so it shows nothing. */
|
|
1414
|
+
get namesOnHover() {
|
|
1415
|
+
return namesHoverOn(this.getAttribute("names-on-hover"));
|
|
1416
|
+
}
|
|
1417
|
+
set namesOnHover(value) {
|
|
1418
|
+
if (value)
|
|
1419
|
+
this.removeAttribute("names-on-hover");
|
|
1420
|
+
else
|
|
1421
|
+
this.setAttribute("names-on-hover", "off");
|
|
1422
|
+
}
|
|
1374
1423
|
/** Mark one satellite: a larger ring round it and its orbit drawn. `null` lets it go. */
|
|
1375
1424
|
selectSatellite(ref) {
|
|
1376
1425
|
const found = ref ? this.#model.satellites.groups.get(ref.group) : undefined;
|
|
1377
1426
|
this.#model.satellites.selected = ref && found && ref.index >= 0 && ref.index < found.satellites.count ? { group: ref.group, index: ref.index } : null;
|
|
1378
1427
|
this.#gate?.soon();
|
|
1379
1428
|
}
|
|
1429
|
+
/**
|
|
1430
|
+
* Where a satellite is on the screen as of the last draw: `{ x, y, visible, heightKm }` in CSS pixels from the view's top left, `visible` meaning it is inside the box and not behind the Earth. `null` when its group is not set or not shown, it cannot be placed, or it is behind the camera.
|
|
1431
|
+
*/
|
|
1432
|
+
placeSatellite(ref) {
|
|
1433
|
+
return this.#model.placeSatellite?.(ref) ?? null;
|
|
1434
|
+
}
|
|
1380
1435
|
/** The satellite marked by `selectSatellite` or by a press on it, if any. */
|
|
1381
1436
|
get selectedSatellite() {
|
|
1382
1437
|
const chosen = this.#model.satellites.selected;
|
|
@@ -1399,7 +1454,7 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
1399
1454
|
let epochMs = 0;
|
|
1400
1455
|
for (const group of this.#model.satellites.groups.values())
|
|
1401
1456
|
epochMs = Math.max(epochMs, group.satellites.newestEpochMs);
|
|
1402
|
-
return { groups: this.#model.satellites.groups.size, placed: drawn.placed, segments: drawn.segments, tooFast: drawn.tooFast, dotScale: drawn.dotScale, longestStreakPx: drawn.longestStreakPx, streakCapPx: drawn.streakCapPx, weight: drawn.weight, fade: drawn.fade, earthPx: drawn.earthPx, epochMs, propagations, lastBatchMs, maxBatchMs, updateMs: drawn.updateMs, maxUpdateMs: drawn.maxUpdateMs, averageUpdateMs: drawn.updates ? drawn.totalMs / drawn.updates : 0, updates: drawn.updates, selectedRing: drawn.selectedRing };
|
|
1457
|
+
return { groups: this.#model.satellites.groups.size, placed: drawn.placed, segments: drawn.segments, tooFast: drawn.tooFast, dotScale: drawn.dotScale, longestStreakPx: drawn.longestStreakPx, streakCapPx: drawn.streakCapPx, weight: drawn.weight, fade: drawn.fade, earthPx: drawn.earthPx, epochMs, propagations, lastBatchMs, maxBatchMs, updateMs: drawn.updateMs, maxUpdateMs: drawn.maxUpdateMs, averageUpdateMs: drawn.updates ? drawn.totalMs / drawn.updates : 0, updates: drawn.updates, selectedRing: drawn.selectedRing, hoverPath: drawn.hoverPath, hoverOpacity: drawn.hoverOpacity, selectedOpacity: drawn.selectedOpacity };
|
|
1403
1458
|
}
|
|
1404
1459
|
// A press that does not turn the view (under 6 pixels) on a satellite tells the page, which chooses it with `selectSatellite` if it likes.
|
|
1405
1460
|
#downX = 0;
|
|
@@ -9,6 +9,7 @@ import { type BorderSets } from "../borders/lines.ts";
|
|
|
9
9
|
import type { BorderData, BorderStats } from "../borders/layer.ts";
|
|
10
10
|
import { type RouteLeg } from "../route.ts";
|
|
11
11
|
import type { GridStats } from "../grid/layer.ts";
|
|
12
|
+
import type { BeamStats } from "../beam/layer.ts";
|
|
12
13
|
import { type CountryNamesStats, type CountryNamesStyle } from "../country-names/host.ts";
|
|
13
14
|
import { type SeaNamesStats } from "../sea-names/host.ts";
|
|
14
15
|
import type { TileStats } from "../realistic/tile-set.ts";
|
|
@@ -114,7 +115,11 @@ export interface RideOptions {
|
|
|
114
115
|
look?: RideLook;
|
|
115
116
|
/** Face this way as the ride opens (`face`). */
|
|
116
117
|
face?: RideFace;
|
|
117
|
-
/**
|
|
118
|
+
/** The radius of the ridden satellite's model as a share of the picture's height (0.02 to 1.2), for this ride: the element's `ride-model-share` when not given. Along the way it goes the default is 0.22, above the satellite 0.17 (its size at the lowest height). */
|
|
119
|
+
modelShare?: number;
|
|
120
|
+
/** Where the model's middle sits, as a share of the picture's height from the top (0.5 to 1.4: 0.5 the middle, 1 the bottom edge), for this ride along the way it goes: the element's `ride-model-seat` when not given; 0.86 by default. */
|
|
121
|
+
modelSeat?: number;
|
|
122
|
+
/** `outside` (the default, or the element\'s `ride-viewpoint`) shows the satellite: with `view: "from"` the camera is a little behind and above it (straight above it with `look: "down"`), and a satellite the page has no model for is drawn small from the package's own sketch of its kind. `inside` is the camera at the satellite, as before, and no sketch. A body is always ridden from inside. */
|
|
118
123
|
viewpoint?: RideViewpoint;
|
|
119
124
|
/** `distance` (the default, or the element's `ride-model-size`) lets the model of a satellite seen from above shrink as the camera rises and hand over to the ordinary mark, ring and name, between 1,000 and 2,000 km; `fixed` keeps one share of the picture at every height. */
|
|
120
125
|
modelSize?: RideModelSize;
|
|
@@ -163,6 +168,9 @@ type SatelliteStats = {
|
|
|
163
168
|
averageUpdateMs: number;
|
|
164
169
|
updates: number;
|
|
165
170
|
selectedRing: boolean;
|
|
171
|
+
hoverPath: boolean;
|
|
172
|
+
hoverOpacity: number;
|
|
173
|
+
selectedOpacity: number;
|
|
166
174
|
};
|
|
167
175
|
/**
|
|
168
176
|
* The `<chikyu-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`, `time` (`now` or an ISO date), `speed` (1 is real time, 0 holds, 86400 is a day a second, negative runs backwards), `scale` (`compressed` or `true`), `labels` and `orbits` (`off` hides them); positions are computed in the browser by astronomy-engine, an optional peer dependency. It draws only when something changes, and nothing while it is out of sight.
|
|
@@ -179,6 +187,9 @@ type SatelliteStats = {
|
|
|
179
187
|
* `borders` draws the borders on the Earth's land as thin lines that turn with it, as on `<chikyu-earth-realistic>`: `countries`, `regions` (from the page's `borderData.regions`, once the Earth is
|
|
180
188
|
* large enough), or both with a bare attribute; `chikyu-borders-unavailable` is sent when the shapes cannot be loaded.
|
|
181
189
|
*
|
|
190
|
+
* `beam` draws a beam of light from the chosen satellite (the one marked, or the one ridden) down to the ground below it: a soft cone ending in a lit footprint, the circle from which the satellite is above
|
|
191
|
+
* `beam-elevation` degrees (25), with `beam-cells` spot cells inside it (an illustration, never an operator's plan), `beam-cell-size`, `beam-color` and `beam-strength` (the property `beam` and its siblings, and `stats.beam`).
|
|
192
|
+
*
|
|
182
193
|
* `grid` draws the meridians and parallels on the Earth, and `country-names` names its countries, as on `<chikyu-earth-realistic>`: the names keep clear of the bodies', the places' and the
|
|
183
194
|
* cities' names and stay on the Earth's disc; `chikyu-country-names-unavailable` is sent when the outlines cannot be loaded.
|
|
184
195
|
*
|
|
@@ -350,6 +361,39 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
350
361
|
*/
|
|
351
362
|
get cityNamesStyle(): CityNamesStyle;
|
|
352
363
|
set cityNamesStyle(value: CityNamesStyle);
|
|
364
|
+
/**
|
|
365
|
+
* Whether a beam of light is drawn from the chosen satellite down to the ground below it (the attribute `beam`, off unless set). The chosen satellite is the one marked with `selectSatellite` or a press,
|
|
366
|
+
* or the one ridden (Ride along and Ride above, where the camera looks down the beam). The beam is a soft cone, brighter at the satellite and fading towards the ground, ending in a lit ring on the
|
|
367
|
+
* surface: the footprint, the circle from which the satellite stands above `beamElevation` degrees (25), true to its height. Behind the Earth it is cut off by the limb. It is drawn with the draw that
|
|
368
|
+
* moves the satellite, and nothing is drawn at rest. Setting it writes the attribute, or takes it away; `stats.beam` says the footprint's radius in kilometres.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```ts no-run
|
|
372
|
+
* import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
373
|
+
*
|
|
374
|
+
* const space = document.querySelector<ChikyuSpace>("chikyu-space")!;
|
|
375
|
+
* space.beam = true;
|
|
376
|
+
* space.beamElevation = 30;
|
|
377
|
+
* console.log(space.stats.beam.radiusKm);
|
|
378
|
+
* ```
|
|
379
|
+
*/
|
|
380
|
+
get beam(): boolean;
|
|
381
|
+
set beam(value: boolean);
|
|
382
|
+
/** The least elevation, in degrees, from which the footprint counts the satellite as seen (the attribute `beam-elevation`, 25). Setting it writes the attribute. */
|
|
383
|
+
get beamElevation(): number;
|
|
384
|
+
set beamElevation(value: number);
|
|
385
|
+
/** How many spot cells are drawn inside the footprint, 0 for none (the attribute `beam-cells`, up to 91). They are an illustration of a satellite that serves the ground in cells, not any operator's plan. */
|
|
386
|
+
get beamCells(): number;
|
|
387
|
+
set beamCells(value: number);
|
|
388
|
+
/** A spot cell's radius on the ground in kilometres, at most what fits (the attribute `beam-cell-size`, 0 for the fit). */
|
|
389
|
+
get beamCellSize(): number;
|
|
390
|
+
set beamCellSize(value: number);
|
|
391
|
+
/** The beam's colour, any CSS colour (the attribute `beam-color`, a pale blue). */
|
|
392
|
+
get beamColor(): string;
|
|
393
|
+
set beamColor(value: string);
|
|
394
|
+
/** How strong the beam is, from 0 to 1 (the attribute `beam-strength`, 0.6). */
|
|
395
|
+
get beamStrength(): number;
|
|
396
|
+
set beamStrength(value: number);
|
|
353
397
|
/** Whether the meridians and parallels are drawn on the Earth (the attribute `grid`). Setting it writes the attribute, or takes it away. */
|
|
354
398
|
get grid(): boolean;
|
|
355
399
|
set grid(value: boolean);
|
|
@@ -401,6 +445,19 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
401
445
|
*/
|
|
402
446
|
get camera(): CameraMode;
|
|
403
447
|
set camera(value: CameraMode);
|
|
448
|
+
/**
|
|
449
|
+
* How much of the Earth's turn the space camera takes, from 0 to 1. 0, the default, holds the stars: the Earth turns beneath the camera, which is what `camera="space"` already does, so a page that sets nothing keeps that.
|
|
450
|
+
* 1 turns with the Earth, so the ground under the middle stays. A value between takes that share of the turn. Changing it does not move the longitude under the middle. `follow-ease` is how many seconds the change takes (0.4 when left out, 0 for none; at once when the reader asks for reduced motion). It asks for no frame of its own once the change has settled, and none while the clock is stopped.
|
|
451
|
+
*/
|
|
452
|
+
get follow(): number;
|
|
453
|
+
set follow(value: number);
|
|
454
|
+
/** Seconds `follow` takes to change. Left out, 0.4. `0` changes at once. */
|
|
455
|
+
get followEase(): number;
|
|
456
|
+
set followEase(value: number);
|
|
457
|
+
/** The longitude, in degrees, under the middle of the view, or null before the first draw. */
|
|
458
|
+
get centreLongitude(): number | null;
|
|
459
|
+
/** The moment of the last draw, in milliseconds, or null before the first. The longitude under the middle belongs to this moment. */
|
|
460
|
+
get shownTime(): number | null;
|
|
404
461
|
/** The share of the view's shorter side the Earth's disc fills at zoom 1 (the `earth-size` attribute): 0.9 by default, so the atmosphere's glow is never cut at any shape of box. Above 1 the Earth is larger than the view. */
|
|
405
462
|
get earthSize(): number;
|
|
406
463
|
set earthSize(value: number);
|
|
@@ -426,6 +483,20 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
426
483
|
*/
|
|
427
484
|
get bodies(): string;
|
|
428
485
|
set bodies(value: string);
|
|
486
|
+
/**
|
|
487
|
+
* Dim the name of a satellite the Earth hides, and leave its ring off (the attribute `dim-occluded`). On by default. `off` leaves that name out.
|
|
488
|
+
*
|
|
489
|
+
* @example
|
|
490
|
+
* ```ts
|
|
491
|
+
* import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
492
|
+
*
|
|
493
|
+
* const space = document.createElement("chikyu-space") as ChikyuSpace;
|
|
494
|
+
* space.dimOccluded = false;
|
|
495
|
+
* console.log(space.dimOccluded);
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
get dimOccluded(): boolean;
|
|
499
|
+
set dimOccluded(value: boolean);
|
|
429
500
|
/** How the Earth is lit: `sun` (true, the default), `lit` (always lit, as if by daylight from the camera's side, so a ride on the night side is never a black frame) or `boost` (the true terminator, with the night side raised). The Sun, the Moon and the planets keep their true places. */
|
|
430
501
|
get light(): LightMode;
|
|
431
502
|
set light(value: LightMode);
|
|
@@ -511,6 +582,51 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
511
582
|
*/
|
|
512
583
|
get rideModelSize(): RideModelSize;
|
|
513
584
|
set rideModelSize(value: RideModelSize);
|
|
585
|
+
/**
|
|
586
|
+
* The radius of the ridden satellite's model as a share of the picture's height, 0.02 to 1.2 (the attribute `ride-model-share`), or `null` for the ride's own: 0.22 along the way it goes, 0.17 above the satellite (its size at the lowest height; `ride-model-size="distance"` still shrinks it as the ride rises).
|
|
587
|
+
* Set while riding it glides in 0.4 s (at once for a reader who asked for less motion). `stats.followModel.share` is the share in use.
|
|
588
|
+
*
|
|
589
|
+
* @example
|
|
590
|
+
* ```ts
|
|
591
|
+
* import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
592
|
+
*
|
|
593
|
+
* const space = document.createElement("chikyu-space") as ChikyuSpace;
|
|
594
|
+
* space.rideModelShare = 0.4;
|
|
595
|
+
* console.log(space.rideModelShare);
|
|
596
|
+
* ```
|
|
597
|
+
*/
|
|
598
|
+
get rideModelShare(): number | null;
|
|
599
|
+
set rideModelShare(value: number | null);
|
|
600
|
+
/**
|
|
601
|
+
* Where the middle of the ridden model sits in a ride along the way it goes, as a share of the picture's height from the top, 0.5 to 1.4 (the attribute `ride-model-seat`; 0.5 the middle, 1 the bottom edge), or `null` for the ride's own (0.86). The camera moves to keep the satellite there.
|
|
602
|
+
* Set while riding it glides in 0.4 s (at once for a reader who asked for less motion). `stats.followModel.seat` is the seat in use.
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* ```ts
|
|
606
|
+
* import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
607
|
+
*
|
|
608
|
+
* const space = document.createElement("chikyu-space") as ChikyuSpace;
|
|
609
|
+
* space.rideModelSeat = 1;
|
|
610
|
+
* console.log(space.rideModelSeat);
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
get rideModelSeat(): number | null;
|
|
614
|
+
set rideModelSeat(value: number | null);
|
|
615
|
+
/**
|
|
616
|
+
* The zoom of a ride, 0.5 to 40 (the attribute `ride-zoom`): the field of view is 60 degrees over it from the satellite, so 40 looks at 1.5 degrees of the ground below. Set while riding the view glides in 0.4 s (at once for a reader who asked for less motion).
|
|
617
|
+
* It is the shared controls' zoom, so their pinch, wheel and keys move it too. `stats.ride.groundKm` says how many kilometres of ground the picture spans, to stop where the tiles stop being sharp.
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
* ```ts
|
|
621
|
+
* import type { ChikyuSpace } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
622
|
+
*
|
|
623
|
+
* const space = document.createElement("chikyu-space") as ChikyuSpace;
|
|
624
|
+
* space.rideZoom = 8;
|
|
625
|
+
* console.log(space.rideZoom);
|
|
626
|
+
* ```
|
|
627
|
+
*/
|
|
628
|
+
get rideZoom(): number;
|
|
629
|
+
set rideZoom(value: number);
|
|
514
630
|
/** What the camera is riding along with now, or null. */
|
|
515
631
|
get riding(): Riding | null;
|
|
516
632
|
/**
|
|
@@ -583,6 +699,15 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
583
699
|
ok: false;
|
|
584
700
|
reason: "not-set";
|
|
585
701
|
};
|
|
702
|
+
/**
|
|
703
|
+
* Draw a faint orbit while the pointer rests on a satellite. On unless `hover-path="off"`. Left unset, it is on when `names-on-hover` is on.
|
|
704
|
+
* The colour and the opacity are the custom properties `--chikyu-hover-path` and `--chikyu-hover-path-opacity`.
|
|
705
|
+
*/
|
|
706
|
+
get hoverPath(): boolean;
|
|
707
|
+
set hoverPath(value: boolean);
|
|
708
|
+
/** Show a satellite's name while the pointer rests on it. On unless `names-on-hover="off"`. A touch does not rest, so it shows nothing. */
|
|
709
|
+
get namesOnHover(): boolean;
|
|
710
|
+
set namesOnHover(value: boolean);
|
|
586
711
|
/** Mark one satellite: a larger ring round it, its orbit drawn, and its name beside it. `null` lets it go. */
|
|
587
712
|
selectSatellite(ref: SatelliteRef | null): void;
|
|
588
713
|
/** The satellite marked by `selectSatellite` or by a press on it, if any. */
|
|
@@ -610,7 +735,7 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
610
735
|
get satelliteNames(): Record<number, string>;
|
|
611
736
|
set satelliteNames(value: Record<number, string>);
|
|
612
737
|
/**
|
|
613
|
-
* Where a satellite is on the screen as of the last draw: `{ x, y, visible, heightKm, edge, behind }` in CSS pixels from the view's top left. `visible` means it is inside the box, in front of the camera and not behind the Earth. `edge` is `top`, `right`, `bottom` or `left` when the place lies beyond that edge, and `null` when it is inside the box. `behind` is true when it is behind the camera (the picture would mirror it, so `edge` is read from the camera's own axes). `x` and `y` may lie outside the box. `null` when its group is not set or not shown, or it cannot be placed (its elements are too old). It is the picture's own camera maths and its own test for the Earth in the way, so a page that draws its own rings, or a mark on the edge, need not repeat either.
|
|
738
|
+
* Where a satellite is on the screen as of the last draw: `{ x, y, visible, heightKm, edge, behind, occluded }` in CSS pixels from the view's top left. `visible` means it is inside the box, in front of the camera and not behind the Earth. `edge` is `top`, `right`, `bottom` or `left` when the place lies beyond that edge, and `null` when it is inside the box. `behind` is true when it is behind the camera (the picture would mirror it, so `edge` is read from the camera's own axes). `occluded` is true when the Earth hides the satellite and false at the limb, in front, and when it is only behind the camera. `x` and `y` may lie outside the box. `null` when its group is not set or not shown, or it cannot be placed (its elements are too old). It is the picture's own camera maths and its own test for the Earth in the way, so a page that draws its own rings, or a mark on the edge, need not repeat either.
|
|
614
739
|
*/
|
|
615
740
|
placeSatellite(ref: SatelliteRef): SatelliteScreen | null;
|
|
616
741
|
/** Facts about one satellite at the moment shown (name, number, element age, height, speed, period, and `ownerCountry` when the owner is one country); undefined if it cannot be placed then. */
|
|
@@ -649,6 +774,10 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
649
774
|
lost: boolean;
|
|
650
775
|
gliding: boolean;
|
|
651
776
|
facing: RideFace | null;
|
|
777
|
+
groundKm: {
|
|
778
|
+
across: number;
|
|
779
|
+
tall: number;
|
|
780
|
+
} | null;
|
|
652
781
|
};
|
|
653
782
|
/** The camera as the last draw left it: its place in Earth radii from the Earth's centre, the way it is turned (a unit quaternion, x y z w) and its field of view in degrees. */
|
|
654
783
|
camera: {
|
|
@@ -709,6 +838,9 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
709
838
|
y: number;
|
|
710
839
|
shown: boolean;
|
|
711
840
|
parts: number;
|
|
841
|
+
share: number;
|
|
842
|
+
seat: number;
|
|
843
|
+
weight: number;
|
|
712
844
|
radiusPx: number;
|
|
713
845
|
box: {
|
|
714
846
|
left: number;
|
|
@@ -762,6 +894,8 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
762
894
|
borders: BorderStats;
|
|
763
895
|
/** The grid: whether it was drawn at the last draw, whether every 15 degrees (else 30), its segments then, how many times its lines were made, and whether it could not be made. */
|
|
764
896
|
grid: GridStats;
|
|
897
|
+
/** The beam: whether it was drawn at the last draw, the chosen satellite's height, the footprint's radius in kilometres and its angle at the Earth's centre, the elevation, the cells drawn and a cell's radius, and how many times its geometry was made. */
|
|
898
|
+
beam: BeamStats;
|
|
765
899
|
/** The route between two places: whether one is set, and its geodesic distance, great-circle distance and flight time at 900 km/h. */
|
|
766
900
|
route: {
|
|
767
901
|
on: boolean;
|