spacemap 0.1.10 → 0.1.12
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/README.md +21 -1
- package/dist/spacemap.iife.js +99 -99
- package/dist/spacemap.js +99 -99
- package/index.d.ts +19 -0
- package/index.js +180 -52
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ your page:
|
|
|
44
44
|
```html
|
|
45
45
|
<div id="map" style="height: 500px"></div>
|
|
46
46
|
<script type="module">
|
|
47
|
-
import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.
|
|
47
|
+
import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.12/dist/spacemap.js';
|
|
48
48
|
const map = await createMap({ container: '#map' });
|
|
49
49
|
</script>
|
|
50
50
|
```
|
|
@@ -184,6 +184,26 @@ moons and small bodies as the map does. Spacecraft are not placed, and a
|
|
|
184
184
|
satellite of Earth only near the present: those need the map. A failed
|
|
185
185
|
download rejects.
|
|
186
186
|
|
|
187
|
+
`sunlight` is a fourth, with no map form. It says how much of the Sun's light
|
|
188
|
+
reaches a body, which is how to know that the map will draw it in eclipse:
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
import { sunlight } from 'spacemap';
|
|
192
|
+
|
|
193
|
+
// Enceladus goes into the shadow of Saturn.
|
|
194
|
+
await sunlight('naif-602', new Date('2026-10-08T04:19:00Z')); // 1
|
|
195
|
+
await sunlight('naif-602', new Date('2026-10-08T04:20:00Z')); // 0.6
|
|
196
|
+
await sunlight('naif-602', new Date('2026-10-08T04:21:00Z')); // 0
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
It is 1 in full sunlight and 0 when the whole body is in the shadow of another;
|
|
200
|
+
between the two, that share of its sunlit face is lit. The bodies of its own
|
|
201
|
+
system are what can be in the way: the body it orbits, and the planet and moons
|
|
202
|
+
that orbit the same body. Each is a ball of the radius the map draws it with,
|
|
203
|
+
and the shadow is the one the map shades with. The answer is a mean over 1024
|
|
204
|
+
points of the sunlit face, so a shadow smaller than a thousandth of that face
|
|
205
|
+
can be missed: a small moon's on its planet, say.
|
|
206
|
+
|
|
187
207
|
### Drawing on it
|
|
188
208
|
|
|
189
209
|
Everything you draw is put somewhere by an **anchor**, and the anchor is what
|