spacemap 0.1.4 → 0.1.6
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 +39 -1
- package/dist/spacemap.iife.js +68 -37
- package/dist/spacemap.js +74 -43
- package/index.d.ts +35 -0
- package/index.js +481 -49
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -369,6 +369,10 @@ export declare function dateToJD(date: Date): number;
|
|
|
369
369
|
* renderer through the same effects a host's own store drives. */
|
|
370
370
|
export declare function defaultSceneSettings(): SceneSettings;
|
|
371
371
|
|
|
372
|
+
/** Kilometres between two places at `date`. Null and rejection are those of
|
|
373
|
+
* {@link offsetKm}. */
|
|
374
|
+
export declare function distanceKm(from: Anchor, to: Anchor, date: Date): Promise<number | null>;
|
|
375
|
+
|
|
372
376
|
/**
|
|
373
377
|
* A Keplerian orbit, propagated from its epoch by the mean motion the elements
|
|
374
378
|
* carry. Defined at every date, so an object on one is always drawn.
|
|
@@ -1198,6 +1202,13 @@ export declare type NoticeTopic = Notice['topic'];
|
|
|
1198
1202
|
* ecliptic north pole. */
|
|
1199
1203
|
export declare type OffsetKm = readonly [number, number, number];
|
|
1200
1204
|
|
|
1205
|
+
/**
|
|
1206
|
+
* From one place to another at `date`, in kilometres on ecliptic J2000 axes.
|
|
1207
|
+
* Null when either end is nowhere at that date. Rejects when the data does
|
|
1208
|
+
* not load.
|
|
1209
|
+
*/
|
|
1210
|
+
export declare function offsetKm(from: Anchor, to: Anchor, date: Date): Promise<OffsetKm | null>;
|
|
1211
|
+
|
|
1201
1212
|
export declare interface OrbitalElements {
|
|
1202
1213
|
a: number;
|
|
1203
1214
|
e: number;
|
|
@@ -1587,6 +1598,9 @@ export declare interface PolylineOptions {
|
|
|
1587
1598
|
widthPx?: number;
|
|
1588
1599
|
/** 0 to 1. */
|
|
1589
1600
|
opacity?: number;
|
|
1601
|
+
/** A dash and a gap in screen pixels, written as the flat map takes them:
|
|
1602
|
+
* `"4 3"`. Solid when left out. */
|
|
1603
|
+
dash?: string;
|
|
1590
1604
|
/** Fade the line toward its last point, the way an orbit trail fades
|
|
1591
1605
|
* behind a body. */
|
|
1592
1606
|
fade?: boolean;
|
|
@@ -2035,6 +2049,17 @@ export declare class SpaceMap {
|
|
|
2035
2049
|
* is nothing to choose once a host has said what it looks like.
|
|
2036
2050
|
*/
|
|
2037
2051
|
setBodyAppearance(id: string, appearance: BodyAppearance): this;
|
|
2052
|
+
/**
|
|
2053
|
+
* Keep these bodies in sight from however far: named, with their orbits,
|
|
2054
|
+
* where the map would let a small or distant one drop out and would give
|
|
2055
|
+
* its name up to a bigger neighbour's. A hidden layer does not take them
|
|
2056
|
+
* either. An id the map has not loaded yet is pinned once it has. Each call
|
|
2057
|
+
* replaces the last; an empty list gives the map its own judgement back.
|
|
2058
|
+
*
|
|
2059
|
+
* A moon is only drawn inside the system the camera is in, pinned or not:
|
|
2060
|
+
* pin its planet to mark it from outside.
|
|
2061
|
+
*/
|
|
2062
|
+
setPinnedBodies(ids: readonly string[]): this;
|
|
2038
2063
|
/** A cap's radius as an angle, from whichever of the two ways the host gave
|
|
2039
2064
|
* it. A radius in kilometres needs the body's own radius, which an
|
|
2040
2065
|
* unloaded body has not published yet. */
|
|
@@ -2084,6 +2109,13 @@ export declare interface SpaceMapOptions {
|
|
|
2084
2109
|
layers?: Partial<Record<MapLayerId, boolean>>;
|
|
2085
2110
|
}
|
|
2086
2111
|
|
|
2112
|
+
/**
|
|
2113
|
+
* The place on `id` where the Sun is overhead at `date`, in the frame of a
|
|
2114
|
+
* surface anchor. Null for the Sun, and for a body that is nowhere at that
|
|
2115
|
+
* date. Rejects when the data does not load.
|
|
2116
|
+
*/
|
|
2117
|
+
export declare function subsolarPoint(id: string, date: Date): Promise<LonLat | null>;
|
|
2118
|
+
|
|
2087
2119
|
/** A place on (or above) the body's surface, turning with it. */
|
|
2088
2120
|
export declare interface SurfaceAnchor {
|
|
2089
2121
|
body: string;
|
|
@@ -2114,6 +2146,9 @@ export declare interface SurfacePolygonOptions extends SurfaceShapeOptions {
|
|
|
2114
2146
|
export declare interface SurfacePolylineOptions extends SurfaceShapeOptions {
|
|
2115
2147
|
/** Join the last place back to the first. */
|
|
2116
2148
|
closed?: boolean;
|
|
2149
|
+
/** A dash and a gap in screen pixels, written as the flat map takes them:
|
|
2150
|
+
* `"4 3"`. Solid when left out. */
|
|
2151
|
+
dash?: string;
|
|
2117
2152
|
}
|
|
2118
2153
|
|
|
2119
2154
|
/** A shape on a body's surface, for as long as the host keeps it. */
|