@johnmorrisdotca/wakusei-planets 0.75.0 → 0.75.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/NOTICE.md +4 -3
  3. package/README.md +3 -3
  4. package/dist/bodies/dwarfs.js +1 -1
  5. package/dist/bodies/earth-look.js +1 -1
  6. package/dist/bodies/jupiter.js +1 -1
  7. package/dist/bodies/mars.js +1 -1
  8. package/dist/bodies/moons-neptune.js +1 -1
  9. package/dist/bodies/moons-pluto.js +2 -0
  10. package/dist/bodies/moons-saturn.js +1 -1
  11. package/dist/bodies/neptune.js +1 -1
  12. package/dist/bodies/pluto.js +1 -0
  13. package/dist/bodies/saturn.js +1 -1
  14. package/dist/bodies/uranus.js +1 -1
  15. package/dist/bodies/venus.js +1 -1
  16. package/dist/data/discovery.js +30 -0
  17. package/dist/data/estimated-moons.js +354 -354
  18. package/dist/data/moon-catalogue.d.ts +1 -1
  19. package/dist/data/moon-catalogue.js +368 -368
  20. package/dist/data/orbits.js +3 -0
  21. package/dist/facts.d.ts +1 -1
  22. package/dist/facts.js +4 -1
  23. package/dist/moon-catalogue.d.ts +9 -9
  24. package/dist/moon-catalogue.js +11 -10
  25. package/dist/moon-pages/element.js +0 -2
  26. package/dist/moon-pages/hero.d.ts +1 -4
  27. package/dist/moon-pages/hero.js +5 -10
  28. package/dist/portrait/model.js +3 -3
  29. package/dist/scene/body.d.ts +1 -0
  30. package/dist/scene/body.js +8 -4
  31. package/dist/scene/glsl.js +3 -1
  32. package/dist/scene/look.d.ts +15 -0
  33. package/dist/scene/look.js +19 -0
  34. package/dist/scene/name-label.d.ts +10 -0
  35. package/dist/scene/name-label.js +93 -1
  36. package/dist/scene/painter.d.ts +2 -1
  37. package/dist/scene/painter.js +8 -4
  38. package/dist/scene/textures.d.ts +2 -2
  39. package/dist/space/element.d.ts +15 -1
  40. package/dist/space/element.js +23 -1
  41. package/dist/version.d.ts +1 -1
  42. package/dist/version.js +1 -1
  43. package/package.json +1 -1
@@ -206,6 +206,8 @@ export class WakuseiSpace extends HTMLElement {
206
206
  #hands;
207
207
  #markLayer;
208
208
  #markList;
209
+ /** The body the camera stands at while `turnTo` has turned the view to another: the body looked at is `to`, the camera is still at `at`. Let go when the camera goes to a body. */
210
+ #turned = null;
209
211
  #markLoading;
210
212
  #markHeard;
211
213
  #placeGlide = 0;
@@ -1716,6 +1718,22 @@ export class WakuseiSpace extends HTMLElement {
1716
1718
  get body() {
1717
1719
  return this.#model.focus;
1718
1720
  }
1721
+ /**
1722
+ * The body the camera is at, which is `body` unless `turnTo` has turned the view to another body from where the camera stands: then `body` is the body looked at and `at` is the one the camera is still at, so a page can tell "looking at" from "at".
1723
+ * It follows `body` the moment the camera goes anywhere (`goTo`, setting `body`, a hop).
1724
+ *
1725
+ * @example
1726
+ * ```ts no-run
1727
+ * import type { WakuseiSpace } from "@johnmorrisdotca/wakusei-planets/space/element";
1728
+ *
1729
+ * const space = document.querySelector<WakuseiSpace>("wakusei-space")!;
1730
+ * space.turnTo("mars", { smooth: false });
1731
+ * console.log(space.body, space.at);
1732
+ * ```
1733
+ */
1734
+ get at() {
1735
+ return this.#turned !== null && this.#turned.to === this.#model.focus ? this.#turned.at : this.#model.focus;
1736
+ }
1719
1737
  set body(name) {
1720
1738
  const id = readBody(name);
1721
1739
  if (!id)
@@ -1725,6 +1743,7 @@ export class WakuseiSpace extends HTMLElement {
1725
1743
  /** Move the camera to `id` (not yet drawn) and tell the page. */
1726
1744
  #centre(id) {
1727
1745
  const was = this.#model.focus;
1746
+ this.#turned = null;
1728
1747
  this.#model.focus = id;
1729
1748
  this.#gate?.request();
1730
1749
  if (was !== id)
@@ -1786,6 +1805,7 @@ export class WakuseiSpace extends HTMLElement {
1786
1805
  model.region = null;
1787
1806
  this.#showRegion();
1788
1807
  this.#selected = id;
1808
+ this.#turned = null;
1789
1809
  this.#model.focus = id;
1790
1810
  const zoom = options.zoom ?? 1;
1791
1811
  // the side the camera comes from, as the controls' yaw and tilt: the element's own hands are set to it here, and a bar bound to the element (which holds the view's state) hears it in the event with the zoom
@@ -1809,7 +1829,7 @@ export class WakuseiSpace extends HTMLElement {
1809
1829
  /**
1810
1830
  * Turn the camera where it stands until a body is in the picture, by the least turn: no move of the camera's place, only the way it looks. A body is in the picture when its middle is inside the picture less `margin` of
1811
1831
  * each side (the left and right margins are `margin` of the width, the top and bottom `margin` of the height; 0.15 by default, 0 to 0.45). One already so is left alone and the answer is `false`, as it is for an id the
1812
- * view does not know, the body already looked at, and a view that is riding. The body becomes the one looked at: the camera stays at its place and looks at it, from as far
1832
+ * view does not know, the body already looked at, and a view that is riding (a camera beside the Moon in a ride is not turned: ride off first). The body becomes the one looked at (`body`) while `at` still names the body the camera stands at: the camera stays at its place and looks at it, from as far
1813
1833
  * as it stands (the zoom is worked out from that distance, inside the controls' limits; a body so far that the zoom's limit would move the camera is not turned to). It glides the way a move does, or at once with
1814
1834
  * `smooth: false` or for a reader who prefers reduced motion; nothing is drawn at rest and one draw more at most ends it.
1815
1835
  *
@@ -1869,6 +1889,8 @@ export class WakuseiSpace extends HTMLElement {
1869
1889
  model.region = null;
1870
1890
  this.#showRegion();
1871
1891
  this.#selected = id;
1892
+ // the camera stays at the body it stood at, or the one it was already turned from: the view looks at `id`
1893
+ this.#turned = { at: this.#turned !== null && this.#turned.to === model.focus ? this.#turned.at : model.focus, to: id };
1872
1894
  model.focus = id;
1873
1895
  if (this.#hands !== undefined && !this.hasAttribute("data-kazoku-bar"))
1874
1896
  this.#hands.controller.set({ yaw, tilt, zoom }, true, "jump");
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.75.0";
1
+ export declare const VERSION = "0.75.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // The published package version. Snippets and texture addresses name it. test/version.test.ts keeps it equal to package.json.
2
- export const VERSION = "0.75.0";
2
+ export const VERSION = "0.75.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/wakusei-planets",
3
- "version": "0.75.0",
3
+ "version": "0.75.1",
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",