@johnmorrisdotca/chikyu-earth 0.2.0 → 0.3.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +28 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ The shared-controls integration is documented and covered in every motion preference, and the future of the
6
+ country data is written down.
7
+
8
+ - The README's new Controls section has the kazoku-ui snippet and the exact yaw/tilt/zoom/pan mapping. The browser
9
+ suite now proves reduced motion leaves the globe still, as well as Auto-turn continuing after a zoom.
10
+ - Inspected chizu 1.5.1 from npm: `@johnmorrisdotca/chizu/world` is Miller-projected canvas data centred on 155°E,
11
+ not longitude/latitude, so chikyu keeps its own Natural Earth 1:110m outlines and d3-geo.
12
+ [docs/chizu-proposal.md](docs/chizu-proposal.md) proposes the `world-geo` export that would let it share chizu's
13
+ data later.
14
+ - The demo and test servers move to this work's port block, 8200–8299.
15
+
3
16
  ## 0.2.0
4
17
 
5
18
  The globe now uses the family's shared view controls.
package/README.md CHANGED
@@ -44,6 +44,32 @@ Centre it yourself instead:
44
44
  <chikyu-earth center="139.7,35.7" style="thick" graticule></chikyu-earth>
45
45
  ```
46
46
 
47
+ ## Controls
48
+
49
+ The shared [kazoku-ui view controls](https://github.com/johnmorrisdotca/kazoku-ui) supply every hand and button:
50
+ drag to turn, tilt up to either pole, zoom, pan, touch pinch, Front and Fit. Chikyu does not draw its own zoom,
51
+ rotate or drag controls.
52
+
53
+ ```html
54
+ <div id="globe" tabindex="0"><chikyu-earth size="420"></chikyu-earth></div>
55
+ <kazoku-view-controls id="controls" for="globe" address tilt-max="90" speed="0.004178" autoplay></kazoku-view-controls>
56
+ ```
57
+
58
+ ```ts
59
+ import "@johnmorrisdotca/kazoku-ui/view-controls/define";
60
+
61
+ const earth = document.querySelector("chikyu-earth");
62
+ document.getElementById("controls").addEventListener("kazoku-viewchange", (event) => {
63
+ const { yaw, tilt, zoom, panX, panY, final } = event.detail;
64
+ earth.setView({ yaw, tilt, zoom, panX, panY }, final);
65
+ });
66
+ ```
67
+
68
+ The mapping is `rotate([lambda0 + yaw, phi0 - tilt])`, `scale(baseScale * zoom)` and
69
+ `translate([cx + panX, cy + panY])`, where `lambda0` and `phi0` are the home centre. Front returns to that home
70
+ view. Auto-turn's `0.004178` degrees a second is 360° per sidereal day; kazoku-ui leaves it still for a reader who
71
+ prefers reduced motion, and a drag or zoom never stops or resets it.
72
+
47
73
  ## Draw one as a string
48
74
 
49
75
  `globe()` returns the SVG markup, so a server, a build step or a test can draw the same globe with no DOM:
@@ -91,4 +117,5 @@ To refresh the outlines after a Natural Earth or kuni update, run `pnpm countrie
91
117
  ## The rest
92
118
 
93
119
  [CONTRIBUTING.md](CONTRIBUTING.md) · [docs/](docs/index.md) · [NOTICE.md](NOTICE.md) ·
94
- [CHANGELOG.md](CHANGELOG.md) · MIT licence. Projection by d3-geo; shared view controls by kazoku-ui.
120
+ [CHANGELOG.md](CHANGELOG.md) · MIT licence. No third-party dependencies except d3-geo; shared view controls are
121
+ John Morris's kazoku-ui (MIT).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/chikyu-earth",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Chikyu Earth 地球: a line-drawn globe with country outlines that turns at the Earth's own rate and opens centred on where you are. Country codes and names come from kuni; the outlines are Natural Earth's, drawn with d3-geo. SVG, no canvas.",
5
5
  "keywords": [
6
6
  "earth",