@johnmorrisdotca/chikyu-earth 0.46.0 → 0.46.1

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.46.1 - 2026-11-13
4
+
5
+ - **Ride along keeps the satellite at the bottom, large, sharp and steady** (MODULES-1303). In an outside ride along (`view: "from"`, `look: "horizon"`) the satellite's middle is at 90 per cent of the picture's height and its model is drawn 17 per cent of the height in radius, so it sits at the bottom middle with part of it below the bottom edge; the page's model is told that real size (`update({ radiusPx })`) so it can be drawn sharp. Looking down (Ride above) it is at the centre. Its attitude is the track frame (long axis along the way it goes, top straight up) at every frame; a moment with no level speed keeps the last good frame instead of dropping the model. The ridden satellite's model does not depend on the satellite layers (`showSatellites`, a focus that hides the others), and its ring and name are left off, since they would cover it. `stats.followModel` gains `radiusPx`, `box` and `axes`. The page must call `setSatellitePainter` with its models before `ride`, and `ride(ref, { view: "from", look: "horizon" })` (outside is the default); the satellite must stay in a group set with `setSatellites` (removing the group ends the ride). `e2e/ride-model.gl.ts` holds the tests.
6
+
3
7
  ## 0.46.0 - 2026-11-13
4
8
 
5
9
  - **A satellite's streak keeps its short look at any clock speed and any Earth size** (MODULES-1282). Above 60 times real time each satellite is a streak along its orbit for the stretch one frame spans; at 10 minutes a second that is a few millimetres, but at an hour a second it was a long straight line across the globe, the stretch also grew when frames came slowly, and on a small Earth the streaks and the dark rim of the dots stayed as long and heavy as on a large one, so thousands of them blackened it. Now a streak is never longer than the smaller of 0.025 of the Earth's drawn radius (about 160 km of orbit, what a low satellite covers in a frame at 10 minutes a second, so it shrinks in proportion as the Earth is drawn smaller, down to a dot) and `satellite-streak-max`, new on `<chikyu-space>` and `<chikyu-earth-realistic>` (the property `satelliteStreakMax`), a ceiling in CSS pixels, 8 when the page says nothing; `off` or `0` draws the whole stretch, as before. It is a length on the screen and not seconds of travel, so a low and a high satellite are drawn equally long. A streak is also always one frame at 30 a second, whatever the frames really take, so its length does not depend on the frame rate; it ends at the satellite and points back along its orbit. The marks lose weight as the Earth is drawn smaller: from a drawn radius of 150 pixels down to 40 the streaks are fainter and the dark rim of the dots fades until it is gone, at normal speed too, and a crowd of satellites that would cover more of a small Earth's near side than a limit (6% for dots, 35% for streaks) is drawn fainter in proportion, so 16,000 satellites leave a small Earth no more washed than a whole one; a whole Earth is drawn as before. `stats.satellites` has `longestStreakPx`, `streakCapPx`, `weight`, `fade` and `earthPx`; `Satellites.arc` takes the cap, in Earth radii, as an optional last argument.
package/README.md CHANGED
@@ -611,7 +611,7 @@ console.log(countryList().filter((country) => country.alpha2 === null).map((coun
611
611
 
612
612
  ## How to cite
613
613
 
614
- > Morris, J. (2026). *Chikyu Earth* (version 0.46.0) [Computer software]. https://github.com/johnmorrisdotca/chikyu-earth
614
+ > Morris, J. (2026). *Chikyu Earth* (version 0.46.1) [Computer software]. https://github.com/johnmorrisdotca/chikyu-earth
615
615
 
616
616
  GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA. Cite the version you used (`npm ls @johnmorrisdotca/chikyu-earth`), and credit the sources behind the numbers and pictures: [NOTICE.md](NOTICE.md) says who made each one and under what terms.
617
617
 
@@ -684,6 +684,18 @@ export declare class ChikyuSpace extends HTMLElement {
684
684
  y: number;
685
685
  shown: boolean;
686
686
  parts: number;
687
+ radiusPx: number;
688
+ box: {
689
+ left: number;
690
+ top: number;
691
+ right: number;
692
+ bottom: number;
693
+ };
694
+ axes: {
695
+ x: readonly number[];
696
+ y: readonly number[];
697
+ z: readonly number[];
698
+ };
687
699
  } | null;
688
700
  /** The finer map tiles (`tiles`): the level wanted now (`null` while the package's own pictures are sharp enough), the tiles held and shown, and the fetches made. */
689
701
  tiles: TileStats;
@@ -1637,6 +1637,11 @@ export class ChikyuSpace extends HTMLElement {
1637
1637
  #showMarks(marks) {
1638
1638
  if (marks.length > 0)
1639
1639
  this.#prepareSatLabelLang();
1640
+ // a satellite ridden from outside is drawn as its model: a ring and a name on it would cover the model (MODULES-1303)
1641
+ const ride = this.#model.ride;
1642
+ const ridden = ride && ride.viewpoint === "outside" && typeof ride.target !== "string" ? ride.target : null;
1643
+ if (ridden)
1644
+ marks = marks.filter((m) => !(m.ref.group === ridden.group && m.ref.index === ridden.index));
1640
1645
  this.#marks = marks.map((m) => ({ id: `${m.ref.group}:${m.ref.index}`, label: this.#satelliteName(m.ref), x: m.x, y: m.y, visible: m.visible }));
1641
1646
  const now = new Map();
1642
1647
  for (const m of marks) {
@@ -132,8 +132,8 @@ const unit = (a) => {
132
132
  * ```
133
133
  */
134
134
  export const OUTSIDE_KM = 25;
135
- /** How far below the middle of the picture the satellite is drawn in an outside ride that looks along the way it goes, as a share of half the picture's height (0.56: about a fifth of the height below the middle). */
136
- const OUTSIDE_LOW = 0.56;
135
+ /** How far below the middle of the picture the satellite's middle is drawn in an outside ride that looks along the way it goes, as a share of half the picture's height (0.8: at 90 per cent of the height, so with the model drawn 17 per cent of the height in radius it crosses the bottom edge). */
136
+ const OUTSIDE_LOW = 0.8;
137
137
  /**
138
138
  * The camera of an outside ride: the pose `ridePose` works out for a camera at the satellite, moved to `OUTSIDE_KM` back along its own line of sight so the satellite is in front of it. Looking along the way it goes (`look: "horizon"`) the satellite sits a little below the middle of the picture, so the camera is behind and above it; looking
139
139
  * down (`look: "down"`) it is at the middle, with the camera straight above it. Where the satellite sits in the picture does not change with the zoom. Which way the camera looks and which way is up are the pose's own, so the look-around is the same as from the satellite itself; the camera goes round the satellite as it looks about. Pure. Never nearer the ground than half the satellite's height.
@@ -228,6 +228,18 @@ export interface SpaceModel {
228
228
  y: number;
229
229
  shown: boolean;
230
230
  parts: number;
231
+ radiusPx: number;
232
+ box: {
233
+ left: number;
234
+ top: number;
235
+ right: number;
236
+ bottom: number;
237
+ };
238
+ axes: {
239
+ x: Vec3;
240
+ y: Vec3;
241
+ z: Vec3;
242
+ };
231
243
  } | null;
232
244
  /** The map tiles laid over the Earth while the scene is built: what they are doing, for a page or a test. */
233
245
  tiles: TileSet | null;
@@ -24,7 +24,9 @@ const MAX_MARKED = 80;
24
24
  const RAD = Math.PI / 180;
25
25
  const FOV = 35;
26
26
  /** How big a satellite seen from outside by a ride from itself is drawn: its radius is this share of the height of the view (a model about a fifth of the height across; the satellite is a few metres, so this is not to scale). */
27
- const OUTSIDE_RADIUS_SHARE = 0.09;
27
+ const OUTSIDE_RADIUS_SHARE = 0.1;
28
+ /** The share of the view's height an outside ride along (looking along the way it goes) draws the satellite's radius at: it sits at the bottom middle with part of it below the bottom edge, large enough to read and to be drawn sharp (MODULES-1303). */
29
+ const OUTSIDE_ALONG_SHARE = 0.17;
28
30
  /** How much of the view's shorter side the Earth's disc fills at zoom 1 when the page does not say: 0.9, so the atmosphere's glow (8% beyond the disc) is inside the view and never cut. */
29
31
  export const DEFAULT_EARTH_SIZE = 0.9;
30
32
  /**
@@ -372,7 +374,7 @@ export function createSpaceItem(model, deps) {
372
374
  let routeLayer = null;
373
375
  let marksTold = false;
374
376
  // the followed satellite's model: which satellite it is for, the drawing once it is made, and a count so that a model made for a satellite no longer followed is let go
375
- const modelSlot = { key: "", drawing: null, turn: 0, parts: 0 };
377
+ const modelSlot = { key: "", drawing: null, turn: 0, parts: 0, axes: null };
376
378
  const dropModel = () => {
377
379
  if (!modelSlot.drawing)
378
380
  return;
@@ -812,13 +814,19 @@ export function createSpaceItem(model, deps) {
812
814
  .catch((error) => deps.onPainterError?.(error));
813
815
  }
814
816
  }
815
- const axes = shownSat ? satelliteAxes(shownSat.place, shownSat.velocity) : null;
817
+ // the model's attitude is the track frame (x along the way it goes, level; z straight up). A moment with no level speed keeps the last good frame, so the model neither drops nor turns (MODULES-1303)
818
+ const freshAxes = shownSat ? satelliteAxes(shownSat.place, shownSat.velocity) : null;
819
+ if (freshAxes)
820
+ modelSlot.axes = freshAxes;
821
+ else if (!shownSat)
822
+ modelSlot.axes = null;
823
+ const axes = freshAxes ?? (shownSat ? modelSlot.axes : null);
816
824
  // a generic drawing is for an outside ride only; a page's model is drawn wherever the camera is not at the satellite
817
825
  const drawn = shownSat !== null && (ride?.viewpoint === "outside" || (followed !== null && painted));
818
826
  if (modelSlot.drawing && shownSat && axes && drawn) {
819
827
  const object = modelSlot.drawing.object;
820
828
  const away = Math.hypot(shownSat.place[0] - camera.position.x, shownSat.place[1] - camera.position.y, shownSat.place[2] - camera.position.z);
821
- const share = followed ? MODEL_RADIUS_SHARE : OUTSIDE_RADIUS_SHARE;
829
+ const share = followed ? MODEL_RADIUS_SHARE : ride?.look === "horizon" ? OUTSIDE_ALONG_SHARE : OUTSIDE_RADIUS_SHARE;
822
830
  object.matrix.set(...modelMatrix(shownSat.place, axes, modelRadius(away, half, share, 1e-9)));
823
831
  object.matrixWorldNeedsUpdate = true;
824
832
  object.visible = true;
@@ -826,7 +834,10 @@ export function createSpaceItem(model, deps) {
826
834
  modelSlot.drawing.light?.(toSunNow);
827
835
  modelSlot.drawing.update?.({ toSun: toSunNow, ms: model.time, radiusPx: size.height * share });
828
836
  projected.set(shownSat.place[0], shownSat.place[1], shownSat.place[2]).project(camera);
829
- model.followModel = { x: ((projected.x + 1) / 2) * size.width, y: ((1 - projected.y) / 2) * size.height, shown: true, parts: modelSlot.parts };
837
+ const sx = ((projected.x + 1) / 2) * size.width;
838
+ const sy = ((1 - projected.y) / 2) * size.height;
839
+ const radiusPx = size.height * share;
840
+ model.followModel = { x: sx, y: sy, shown: true, parts: modelSlot.parts, radiusPx, box: { left: sx - radiusPx, top: sy - radiusPx, right: sx + radiusPx, bottom: sy + radiusPx }, axes };
830
841
  }
831
842
  else {
832
843
  if (modelSlot.drawing)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/chikyu-earth",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "description": "Chikyu Earth 地球 — A line-drawn globe for the web: country outlines that turn at the Earth's own rate, centred on the place you give it, with an optional realistic Earth from space (three.js), the Sun, Moon and planets, satellites on their orbits, and markers for any place. A web component and an SVG string.",
5
5
  "keywords": [
6
6
  "earth",