@rubin-epo/epo-widget-lib 2.0.3 → 2.0.5
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/dist/SortableTable.cjs +1 -0
- package/dist/SortableTable.d.ts +3 -0
- package/dist/SortableTable.js +5 -0
- package/dist/SourceSelector.cjs +1 -1
- package/dist/SourceSelector.js +6 -4
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.d.ts +1 -0
- package/dist/atomic/Blinker/Blinker.js +27 -25
- package/dist/atomic/SelectionList/index.cjs +1 -0
- package/dist/{widgets/SourceSelector → atomic}/SelectionList/index.d.ts +1 -1
- package/dist/atomic/SelectionList/index.js +31 -0
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +18 -25
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +50 -53
- package/dist/localeStrings/en/epo-widget-lib.json +11 -3
- package/dist/localeStrings/es/epo-widget-lib.json +8 -5
- package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
- package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -1
- package/dist/widgets/OrbitalSim/Camera/Camera.js +9 -8
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
- package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
- package/dist/widgets/OrbitalSim/Context/index.js +58 -32
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +95 -78
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
- package/dist/widgets/OrbitalSim/styles.cjs +33 -5
- package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
- package/dist/widgets/OrbitalSim/styles.js +36 -6
- package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
- package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
- package/dist/widgets/SortableTable/SortableTable.js +41 -0
- package/dist/widgets/SortableTable/index.d.ts +1 -0
- package/dist/widgets/SortableTable/styles.cjs +8 -0
- package/dist/widgets/SortableTable/styles.d.ts +1 -0
- package/dist/widgets/SortableTable/styles.js +13 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
- package/dist/widgets/SourceSelector/index.d.ts +2 -1
- package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
- package/package.json +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
- package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.js +0 -0
|
@@ -5,46 +5,46 @@ import t from "../../../node_modules/prop-types/index.js";
|
|
|
5
5
|
import * as L from "three";
|
|
6
6
|
import { useFrame as Te } from "@react-three/fiber";
|
|
7
7
|
import { Html as h } from "@react-three/drei";
|
|
8
|
-
import { degsToRads as V, auToUnit as Ce, getMinorAxis as ve, getFocus as ze, getCurve as je, getLineGeometry as Be, getPosFromArcLength as T, getVelocity as C, auToMeters as Le, unitToAu as Ve, ORBITAL_COLORS as v, getLabelSize as Ge, getAngleFromPos as
|
|
8
|
+
import { degsToRads as V, auToUnit as Ce, getMinorAxis as ve, getFocus as ze, getCurve as je, getLineGeometry as Be, getPosFromArcLength as T, getVelocity as C, auToMeters as Le, unitToAu as Ve, ORBITAL_COLORS as v, getLabelSize as Ge, getAngleFromPos as Z, DAY_PER_VIZ_SEC as Re } from "../orbitalUtilities.js";
|
|
9
9
|
import Se from "../chartColors.module.css.js";
|
|
10
10
|
import { useOrbitalSimContext as _e } from "../Context/index.js";
|
|
11
11
|
import { useTranslation as Ae } from "react-i18next";
|
|
12
12
|
import { Label as d } from "./styles.js";
|
|
13
|
-
const
|
|
13
|
+
const N = ({
|
|
14
14
|
data: z,
|
|
15
15
|
selectionCallback: G,
|
|
16
16
|
active: y,
|
|
17
|
-
playing:
|
|
18
|
-
dayPerVizSec:
|
|
19
|
-
stepDirection:
|
|
17
|
+
playing: K,
|
|
18
|
+
dayPerVizSec: U,
|
|
19
|
+
stepDirection: Y,
|
|
20
20
|
frameOverride: R,
|
|
21
|
-
orbitColor:
|
|
21
|
+
orbitColor: q,
|
|
22
22
|
objectColor: S,
|
|
23
|
-
objectRadius:
|
|
24
|
-
initialized:
|
|
23
|
+
objectRadius: J,
|
|
24
|
+
initialized: Q,
|
|
25
25
|
initCallback: _,
|
|
26
|
-
devMode:
|
|
27
|
-
zoomMod:
|
|
28
|
-
defaultZoom:
|
|
29
|
-
type:
|
|
26
|
+
devMode: W,
|
|
27
|
+
zoomMod: X,
|
|
28
|
+
defaultZoom: $,
|
|
29
|
+
type: A,
|
|
30
30
|
// noLabels,
|
|
31
|
-
reset:
|
|
31
|
+
reset: k
|
|
32
32
|
}) => {
|
|
33
33
|
const { t: ee } = Ae(), { orbits: te } = _e(), { activeVelocityCallback: oe } = te, re = Me(), {
|
|
34
|
-
a:
|
|
34
|
+
a: w,
|
|
35
35
|
e: ie,
|
|
36
36
|
i: ne,
|
|
37
37
|
M: se,
|
|
38
|
-
Node:
|
|
39
|
-
Peri:
|
|
38
|
+
Node: E,
|
|
39
|
+
Peri: F,
|
|
40
40
|
Principal_desig: ae,
|
|
41
|
-
Translated_desig_key:
|
|
41
|
+
Translated_desig_key: I,
|
|
42
42
|
name: ce
|
|
43
43
|
} = z || {}, [le] = r(() => [
|
|
44
44
|
0,
|
|
45
45
|
V(ne),
|
|
46
|
-
|
|
47
|
-
]), [n] = r(() => Ce(
|
|
46
|
+
E ? V(E) : 0
|
|
47
|
+
]), [n] = r(() => Ce(w)), [u] = r(() => ve(w, ie)), [me] = r(() => ze(n, u)), [o] = r(new L.Vector3(me, 0, 0)), [c] = r(new L.Vector3(0, 0, 0)), [he, de] = r(!1), [l] = r(
|
|
48
48
|
() => je(n, u, o.x, o.y)
|
|
49
49
|
), [pe] = r(() => Be(l.getPoints(360))), f = T(0, l), [p, j] = r({
|
|
50
50
|
position: f,
|
|
@@ -54,21 +54,21 @@ const Z = ({
|
|
|
54
54
|
period: 0
|
|
55
55
|
});
|
|
56
56
|
M(() => {
|
|
57
|
-
|
|
57
|
+
k > 0 && j({
|
|
58
58
|
position: f,
|
|
59
59
|
rotation: [0, 0, 0],
|
|
60
60
|
progress: 0,
|
|
61
61
|
velocity: C(f.distanceTo(c), n),
|
|
62
62
|
period: 0
|
|
63
63
|
});
|
|
64
|
-
}, [
|
|
64
|
+
}, [k]);
|
|
65
65
|
function ge(m) {
|
|
66
66
|
let s = 0, a = T(s, l);
|
|
67
67
|
if (m) {
|
|
68
68
|
const x = m > 180, B = x ? m - 180 : m;
|
|
69
|
-
let g =
|
|
69
|
+
let g = Z(a, c);
|
|
70
70
|
for (; g < B; )
|
|
71
|
-
s += 0.01, a = T(s, l), g =
|
|
71
|
+
s += 0.01, a = T(s, l), g = Z(a, c);
|
|
72
72
|
x && (s += 0.5, a = T(s, l));
|
|
73
73
|
}
|
|
74
74
|
return _ ? _() : de(!0), {
|
|
@@ -79,36 +79,36 @@ const Z = ({
|
|
|
79
79
|
period: 0
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function O(m, b) {
|
|
83
83
|
const {
|
|
84
84
|
progress: s,
|
|
85
85
|
position: a,
|
|
86
86
|
velocity: x,
|
|
87
87
|
period: B
|
|
88
|
-
} = p, g = m ? 0 : b * (
|
|
89
|
-
let
|
|
90
|
-
P > 1 && (
|
|
88
|
+
} = p, g = m ? 0 : b * (U || Re), ye = x * g * Y, P = s + ye / l.getLength(), D = P > 1 ? 1 - P : P, { x: ue, y: fe } = l.getPoint(D), be = new L.Vector3(ue, fe, 0), xe = C(a.distanceTo(c), n);
|
|
89
|
+
let H = g + B;
|
|
90
|
+
P > 1 && (H = 0), j({
|
|
91
91
|
...p,
|
|
92
92
|
position: be,
|
|
93
|
-
progress:
|
|
93
|
+
progress: D,
|
|
94
94
|
velocity: xe,
|
|
95
|
-
period:
|
|
95
|
+
period: H
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
return M(() => {
|
|
99
99
|
j(ge(se || Math.floor(Math.random() * Math.floor(180))));
|
|
100
100
|
}, []), M(() => {
|
|
101
|
-
R &&
|
|
101
|
+
R && O(!1, 1 / 60);
|
|
102
102
|
}, [R]), M(() => {
|
|
103
103
|
y && oe(Le(Ve(p.velocity / 1e5)));
|
|
104
104
|
}, [p]), Te((m, b) => {
|
|
105
|
-
(
|
|
106
|
-
}), /* @__PURE__ */ e("group", { rotation: le, children: /* @__PURE__ */ i("group", { rotation: [0, 0,
|
|
105
|
+
(Q || he) && O(!K, b);
|
|
106
|
+
}), /* @__PURE__ */ e("group", { rotation: le, children: /* @__PURE__ */ i("group", { rotation: [0, 0, F ? V(F + 90) : 0], children: [
|
|
107
107
|
/* @__PURE__ */ e("line", { ref: re, geometry: pe, children: /* @__PURE__ */ e(
|
|
108
108
|
"lineBasicMaterial",
|
|
109
109
|
{
|
|
110
110
|
attach: "material",
|
|
111
|
-
color: y ? v.asteroid.orbitHighlight :
|
|
111
|
+
color: y ? v.asteroid.orbitHighlight : q || v.asteroid.orbitColor
|
|
112
112
|
}
|
|
113
113
|
) }),
|
|
114
114
|
/* @__PURE__ */ i(
|
|
@@ -117,22 +117,22 @@ const Z = ({
|
|
|
117
117
|
position: p.position,
|
|
118
118
|
onClick: () => G(z, "neo"),
|
|
119
119
|
children: [
|
|
120
|
-
(
|
|
120
|
+
(A === "planet" || A === "neo" || y) && /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(
|
|
121
121
|
"button",
|
|
122
122
|
{
|
|
123
123
|
type: "button",
|
|
124
124
|
style: {
|
|
125
|
-
fontSize: Ge(
|
|
125
|
+
fontSize: Ge(X, $)
|
|
126
126
|
},
|
|
127
127
|
onClick: () => G(z, "neo"),
|
|
128
|
-
children:
|
|
128
|
+
children: I ? ee(I) : ce || ae
|
|
129
129
|
}
|
|
130
130
|
) }) }),
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
132
|
"sphereGeometry",
|
|
133
133
|
{
|
|
134
134
|
attach: "geometry",
|
|
135
|
-
args: [
|
|
135
|
+
args: [J || 4, 10, 10]
|
|
136
136
|
}
|
|
137
137
|
),
|
|
138
138
|
/* @__PURE__ */ e(
|
|
@@ -145,7 +145,7 @@ const Z = ({
|
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
|
-
|
|
148
|
+
W && /* @__PURE__ */ i(Pe, { children: [
|
|
149
149
|
/* @__PURE__ */ i("mesh", { position: o, children: [
|
|
150
150
|
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
151
151
|
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: Se.chart1 }),
|
|
@@ -225,10 +225,10 @@ const Z = ({
|
|
|
225
225
|
] })
|
|
226
226
|
] }) });
|
|
227
227
|
};
|
|
228
|
-
|
|
228
|
+
N.defaultProps = {
|
|
229
229
|
type: "object"
|
|
230
230
|
};
|
|
231
|
-
|
|
231
|
+
N.propTypes = {
|
|
232
232
|
data: t.object,
|
|
233
233
|
selectionCallback: t.func,
|
|
234
234
|
active: t.bool,
|
|
@@ -250,5 +250,5 @@ Z.propTypes = {
|
|
|
250
250
|
reset: t.number
|
|
251
251
|
};
|
|
252
252
|
export {
|
|
253
|
-
|
|
253
|
+
N as default
|
|
254
254
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),c=require("@rubin-epo/epo-react-lib/Button"),u=require("../Context/index.cjs"),s=require("./styles.cjs"),d=require("../styles.cjs"),a=t=>t&&t.__esModule?t:{default:t},x=a(c);function h(){const{orbits:t}=u.useOrbitalSimContext(),{detailsRows:l}=t,[i,r]=n.useState(!1);return
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),c=require("@rubin-epo/epo-react-lib/Button"),u=require("../Context/index.cjs"),s=require("./styles.cjs"),d=require("../styles.cjs"),a=t=>t&&t.__esModule?t:{default:t},x=a(c);function h(){const{orbits:t}=u.useOrbitalSimContext(),{detailsRows:l}=t,[i,r]=n.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(d.GlobalStyles,{}),e.jsx(s.ButtonWrapper,{styleAs:"secondary",isInactive:!l,onClick:()=>{r(!i),console.error("click!")},children:"Show Details"}),e.jsx(s.SlideoutWrapper,{slideFrom:"left",isOpen:i,children:e.jsxs(s.SlideoutPanel,{children:[e.jsx("h3",{children:"Orbital Details"}),l&&l.map(o=>e.jsxs(s.SlideoutRow,{children:[e.jsx(s.SlideoutColLeft,{children:e.jsx("p",{children:o.rowTitle})}),e.jsx(s.SlideoutColRight,{children:e.jsx("p",{children:o.rowContent})})]})),e.jsx(x.default,{isBlock:!0,onClick:()=>r(!i),children:"Close"})]})})]})}exports.default=h;
|
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as c
|
|
4
|
-
import
|
|
5
|
-
import { useOrbitalSimContext as
|
|
6
|
-
import { ButtonWrapper as
|
|
7
|
-
import { GlobalStyles as
|
|
8
|
-
function
|
|
9
|
-
const { orbits: n } =
|
|
2
|
+
import { jsxs as o, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as c } from "react";
|
|
4
|
+
import a from "@rubin-epo/epo-react-lib/Button";
|
|
5
|
+
import { useOrbitalSimContext as d } from "../Context/index.js";
|
|
6
|
+
import { ButtonWrapper as m, SlideoutWrapper as p, SlideoutPanel as h, SlideoutRow as u, SlideoutColLeft as f, SlideoutColRight as S } from "./styles.js";
|
|
7
|
+
import { GlobalStyles as C } from "../styles.js";
|
|
8
|
+
function y() {
|
|
9
|
+
const { orbits: n } = d(), {
|
|
10
10
|
detailsRows: t
|
|
11
|
-
} = n, [i,
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
}, [t]), /* @__PURE__ */ r(s, { children: [
|
|
15
|
-
/* @__PURE__ */ e(w, {}),
|
|
11
|
+
} = n, [i, r] = c(!1);
|
|
12
|
+
return /* @__PURE__ */ o(s, { children: [
|
|
13
|
+
/* @__PURE__ */ e(C, {}),
|
|
16
14
|
/* @__PURE__ */ e(
|
|
17
|
-
|
|
15
|
+
m,
|
|
18
16
|
{
|
|
19
17
|
styleAs: "secondary",
|
|
20
|
-
isInactive: t,
|
|
18
|
+
isInactive: !t,
|
|
21
19
|
onClick: () => {
|
|
22
|
-
|
|
20
|
+
r(!i), console.error("click!");
|
|
23
21
|
},
|
|
24
22
|
children: "Show Details"
|
|
25
23
|
}
|
|
26
24
|
),
|
|
27
|
-
/* @__PURE__ */ e(p, { slideFrom: "left", isOpen:
|
|
25
|
+
/* @__PURE__ */ e(p, { slideFrom: "left", isOpen: i, children: /* @__PURE__ */ o(h, { children: [
|
|
28
26
|
/* @__PURE__ */ e("h3", { children: "Orbital Details" }),
|
|
29
|
-
t && t.map((l) => /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ e(
|
|
31
|
-
/* @__PURE__ */ e(
|
|
27
|
+
t && t.map((l) => /* @__PURE__ */ o(u, { children: [
|
|
28
|
+
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e("p", { children: l.rowTitle }) }),
|
|
29
|
+
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("p", { children: l.rowContent }) })
|
|
32
30
|
] })),
|
|
33
31
|
/* @__PURE__ */ e(
|
|
34
|
-
|
|
32
|
+
a,
|
|
35
33
|
{
|
|
36
34
|
isBlock: !0,
|
|
37
|
-
onClick: () =>
|
|
35
|
+
onClick: () => r(!i),
|
|
38
36
|
children: "Close"
|
|
39
37
|
}
|
|
40
38
|
)
|
|
@@ -42,5 +40,5 @@ function B() {
|
|
|
42
40
|
] });
|
|
43
41
|
}
|
|
44
42
|
export {
|
|
45
|
-
|
|
43
|
+
y as default
|
|
46
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),O=require("react"),e=require("../../../node_modules/prop-types/index.cjs"),R=require("@react-three/fiber"),x=require("./Orbital.cjs"),F=require("./PotentialOrbits.cjs"),v=require("../orbitalUtilities.cjs");function h({playing:s,dayPerVizSec:i,stepDirection:u,frameOverride:a,defaultZoom:b,potentialOrbits:C,elapsedTime:m,setElapsedTime:p,reset:j,zoomLevel:l,setZoomLevel:M,orbits:$}){const{neos:n,refObjs:I,activeNeo:P}=$;function _(r){const{remainingInits:t}=r;return{remainingInits:t-1}}const{camera:g}=R.useThree(),[k,q]=O.useReducer(_,{remainingInits:n&&Array.isArray(n)?n.length:0});function T(){return(I||["earth","jupiter","mars","neptune"]).map(v.getRefObjProps).map(t=>{const{orbitColor:c,objectColor:f,objectRadius:d,Ref:y,Principal_desig:z,name:A}=t;return o.jsx(x.default,{type:"planet",data:t,position:[0,0,0],zoomMod:l,defaultZoom:b,playing:s,stepDirection:u,dayPerVizSec:i,frameOverride:a,orbitColor:c,objectColor:f,objectRadius:d,reset:j},`${y}-${z||A}`)})}return R.useFrame((r,t)=>{g.zoom!==l&&M(g.zoom),s&&p(m+u*t*i)}),O.useEffect(()=>{a&&p(m+u*(1/60)*i)},[a]),o.jsxs(o.Fragment,{children:[T(),C?o.jsx(F.default,{data:n,position:[0,0,0],initialized:!0,zoomMod:l,defaultZoom:b,playing:s,stepDirection:u,dayPerVizSec:i,frameOverride:a,initCallback:q}):n?n.map((r,t)=>{const{Ref:c,Principal_desig:f,name:d}=r;return o.jsx(x.default,{type:"neo",data:r,position:[0,0,0],active:r===P,initialized:k.remainingInits<=0,zoomMod:l,defaultZoom:b,playing:s,stepDirection:u,dayPerVizSec:i,frameOverride:a,reset:j,initCallback:q},c&&(f||d)?`${c}-${f||d}`:`orbit-${t}`)}):null]})}h.propTypes={playing:e.default.bool,dayPerVizSec:e.default.number,stepDirection:e.default.number,frameOverride:e.default.number,activeVelocityCallback:e.default.func,defaultZoom:e.default.number,zoomLevel:e.default.number,setZoomLevel:e.default.func,potentialOrbits:e.default.bool,elapsedTime:e.default.number,setElapsedTime:e.default.func,reset:e.default.number};exports.default=h;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default Orbitals;
|
|
2
|
-
declare function Orbitals({ playing, dayPerVizSec, stepDirection, frameOverride, defaultZoom, potentialOrbits, elapsedTime, setElapsedTime, reset, zoomLevel, setZoomLevel }: {
|
|
2
|
+
declare function Orbitals({ playing, dayPerVizSec, stepDirection, frameOverride, defaultZoom, potentialOrbits, elapsedTime, setElapsedTime, reset, zoomLevel, setZoomLevel, orbits }: {
|
|
3
3
|
playing: any;
|
|
4
4
|
dayPerVizSec: any;
|
|
5
5
|
stepDirection: any;
|
|
@@ -11,6 +11,7 @@ declare function Orbitals({ playing, dayPerVizSec, stepDirection, frameOverride,
|
|
|
11
11
|
reset: any;
|
|
12
12
|
zoomLevel: any;
|
|
13
13
|
setZoomLevel: any;
|
|
14
|
+
orbits: any;
|
|
14
15
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
declare namespace Orbitals {
|
|
16
17
|
namespace propTypes {
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useReducer as
|
|
2
|
+
import { jsxs as A, Fragment as F, jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { useReducer as _, useEffect as E } from "react";
|
|
4
4
|
import t from "../../../node_modules/prop-types/index.js";
|
|
5
5
|
import { useThree as N, useFrame as q } from "@react-three/fiber";
|
|
6
|
-
import
|
|
6
|
+
import R from "./Orbital.js";
|
|
7
7
|
import w from "./PotentialOrbits.js";
|
|
8
8
|
import { getRefObjProps as B } from "../orbitalUtilities.js";
|
|
9
|
-
|
|
10
|
-
function H({
|
|
9
|
+
function G({
|
|
11
10
|
playing: a,
|
|
12
11
|
dayPerVizSec: n,
|
|
13
|
-
stepDirection:
|
|
12
|
+
stepDirection: i,
|
|
14
13
|
frameOverride: s,
|
|
15
14
|
defaultZoom: c,
|
|
16
|
-
potentialOrbits:
|
|
15
|
+
potentialOrbits: h,
|
|
17
16
|
elapsedTime: l,
|
|
18
17
|
setElapsedTime: d,
|
|
19
18
|
reset: j,
|
|
20
19
|
zoomLevel: m,
|
|
21
|
-
setZoomLevel:
|
|
20
|
+
setZoomLevel: C,
|
|
21
|
+
orbits: $
|
|
22
22
|
}) {
|
|
23
|
-
const {
|
|
24
|
-
neos:
|
|
25
|
-
refObjs:
|
|
26
|
-
activeNeo:
|
|
23
|
+
const {
|
|
24
|
+
neos: e,
|
|
25
|
+
refObjs: I,
|
|
26
|
+
activeNeo: P
|
|
27
27
|
} = $;
|
|
28
|
-
function
|
|
28
|
+
function k(o) {
|
|
29
29
|
const { remainingInits: r } = o;
|
|
30
30
|
return { remainingInits: r - 1 };
|
|
31
31
|
}
|
|
32
|
-
const { camera: g } = N(), [
|
|
33
|
-
remainingInits:
|
|
32
|
+
const { camera: g } = N(), [x, O] = _(k, {
|
|
33
|
+
remainingInits: e && Array.isArray(e) ? e.length : 0
|
|
34
34
|
});
|
|
35
35
|
function M() {
|
|
36
|
-
return (
|
|
36
|
+
return (I || ["earth", "jupiter", "mars", "neptune"]).map(B).map((r) => {
|
|
37
37
|
const {
|
|
38
38
|
orbitColor: u,
|
|
39
|
-
objectColor:
|
|
40
|
-
objectRadius:
|
|
39
|
+
objectColor: p,
|
|
40
|
+
objectRadius: b,
|
|
41
41
|
Ref: T,
|
|
42
|
-
Principal_desig:
|
|
43
|
-
name:
|
|
42
|
+
Principal_desig: y,
|
|
43
|
+
name: z
|
|
44
44
|
} = r;
|
|
45
45
|
return /* @__PURE__ */ f(
|
|
46
|
-
|
|
46
|
+
R,
|
|
47
47
|
{
|
|
48
48
|
type: "planet",
|
|
49
49
|
data: r,
|
|
@@ -51,62 +51,63 @@ function H({
|
|
|
51
51
|
zoomMod: m,
|
|
52
52
|
defaultZoom: c,
|
|
53
53
|
playing: a,
|
|
54
|
-
stepDirection:
|
|
54
|
+
stepDirection: i,
|
|
55
55
|
dayPerVizSec: n,
|
|
56
56
|
frameOverride: s,
|
|
57
57
|
orbitColor: u,
|
|
58
|
-
objectColor:
|
|
59
|
-
objectRadius:
|
|
58
|
+
objectColor: p,
|
|
59
|
+
objectRadius: b,
|
|
60
60
|
reset: j
|
|
61
61
|
},
|
|
62
|
-
`${T}-${
|
|
62
|
+
`${T}-${y || z}`
|
|
63
63
|
);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
return q((o, r) => {
|
|
67
|
-
g.zoom !== m &&
|
|
67
|
+
g.zoom !== m && C(g.zoom), a && d(l + i * r * n);
|
|
68
68
|
}), E(() => {
|
|
69
|
-
s && d(l +
|
|
70
|
-
}, [s]), /* @__PURE__ */ F
|
|
69
|
+
s && d(l + i * (1 / 60) * n);
|
|
70
|
+
}, [s]), /* @__PURE__ */ A(F, { children: [
|
|
71
71
|
M(),
|
|
72
|
-
|
|
72
|
+
h ? /* @__PURE__ */ f(
|
|
73
73
|
w,
|
|
74
74
|
{
|
|
75
|
-
data:
|
|
75
|
+
data: e,
|
|
76
76
|
position: [0, 0, 0],
|
|
77
77
|
initialized: !0,
|
|
78
78
|
zoomMod: m,
|
|
79
79
|
defaultZoom: c,
|
|
80
80
|
playing: a,
|
|
81
|
-
stepDirection:
|
|
81
|
+
stepDirection: i,
|
|
82
82
|
dayPerVizSec: n,
|
|
83
83
|
frameOverride: s,
|
|
84
84
|
initCallback: O
|
|
85
85
|
}
|
|
86
|
-
) :
|
|
87
|
-
const { Ref: u, Principal_desig:
|
|
86
|
+
) : e ? e.map((o, r) => {
|
|
87
|
+
const { Ref: u, Principal_desig: p, name: b } = o;
|
|
88
88
|
return /* @__PURE__ */ f(
|
|
89
|
-
|
|
89
|
+
R,
|
|
90
90
|
{
|
|
91
|
+
type: "neo",
|
|
91
92
|
data: o,
|
|
92
93
|
position: [0, 0, 0],
|
|
93
|
-
active: o ===
|
|
94
|
-
initialized:
|
|
94
|
+
active: o === P,
|
|
95
|
+
initialized: x.remainingInits <= 0,
|
|
95
96
|
zoomMod: m,
|
|
96
97
|
defaultZoom: c,
|
|
97
98
|
playing: a,
|
|
98
|
-
stepDirection:
|
|
99
|
+
stepDirection: i,
|
|
99
100
|
dayPerVizSec: n,
|
|
100
101
|
frameOverride: s,
|
|
101
102
|
reset: j,
|
|
102
103
|
initCallback: O
|
|
103
104
|
},
|
|
104
|
-
u && (
|
|
105
|
+
u && (p || b) ? `${u}-${p || b}` : `orbit-${r}`
|
|
105
106
|
);
|
|
106
107
|
}) : null
|
|
107
108
|
] });
|
|
108
109
|
}
|
|
109
|
-
|
|
110
|
+
G.propTypes = {
|
|
110
111
|
playing: t.bool,
|
|
111
112
|
dayPerVizSec: t.number,
|
|
112
113
|
stepDirection: t.number,
|
|
@@ -121,5 +122,5 @@ H.propTypes = {
|
|
|
121
122
|
reset: t.number
|
|
122
123
|
};
|
|
123
124
|
export {
|
|
124
|
-
|
|
125
|
+
G as default
|
|
125
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("three");function p(e){if(e&&e.__esModule)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const s=p(C),c=100,j=1,r={sun:{objectColor:"#f8da86"},earth:{objectColor:"#3f9ef0",orbitColor:"#3079b8"},mars:{objectColor:"#ed4c4c",orbitColor:"#b53a3a"},jupiter:{objectColor:"#f1b571",orbitColor:"#b98b57"},neptune:{objectColor:"#3cae3f",orbitColor:"#29762b"},asteroid:{objectColor:"#b1f2ef",orbitColor:"#6a6e6e",objectHighlight:"#00ffff",orbitHighlight:"#ffffff"},neos:{objectColor:"#0ff",orbitColor:"#b2ffff"}},b={a:1.4700451,e:.5598234,i:6.35515,H:16.25,Ref:"Apollo",name:"Apollo",Principal_desig:"1932 HA",Translated_desig_key:"neo.apollo",orbitColor:r.neos.orbitColor,objectColor:r.neos.objectColor,objectRadius:5},d={a:.740919,e:.3221221,i:25.62023,H:16.3,Ref:"Atira",Principal_desig:"2003 CP20",Translated_desig_key:"neo.atira",orbitColor:r.neos.orbitColor,objectColor:r.neos.objectColor,objectRadius:5},g={a:1.9194158,e:.4353207,i:11.87658,H:17.7,Ref:"Amor",Principal_desig:"1932 EA1",Translated_desig_key:"neo.amor",orbitColor:r.neos.orbitColor,objectColor:r.neos.objectColor,objectRadius:5},_={a:1,e:.01671022,i:0,H:-3.9,Ref:"Earth",Principal_desig:"Earth",Translated_desig_key:"planets.earth",orbitColor:r.earth.orbitColor,objectColor:r.earth.objectColor,objectRadius:5},m={a:1.52366231,e:.09341233,i:1.85061,H:-1.52,Ref:"Mars",Principal_desig:"Mars",Translated_desig_key:"planets.mars",orbitColor:r.mars.orbitColor,objectColor:r.mars.objectColor,objectRadius:4},A={a:5.2028,e:.048,i:1.31,H:-25.9,Ref:"Jupiter",Principal_desig:"Jupiter",Translated_desig_key:"planets.jupiter",orbitColor:r.jupiter.orbitColor,objectColor:r.jupiter.objectColor,objectRadius:7},R={a:30.06896348,e:.00858587,i:1.76917,H:-25.9,Ref:"Neptune",Principal_desig:"Neptune",Translated_desig_key:"planets.neptune",orbitColor:r.neptune.orbitColor,objectColor:r.neptune.objectColor,objectRadius:6},T=e=>({neptune:R,earth:_,mars:m,jupiter:A,atira:d,apollo:b,amor:g})[e]||null,P=function(e,o){return Number.parseFloat(Number.parseFloat(e).toFixed(o))},y=(e,o,t=0,n=0)=>new s.EllipseCurve(t,n,e,o,0,2*Math.PI,!1,0),h=e=>new s.BufferGeometry().setFromPoints(e),S=(e,o)=>{const t=e.distanceTo(o),{x:n,y:i}=e;return Math.acos((t**2+n**2-i**2)/(2*t*n))*180/Math.PI},O=(e,o)=>{const{x:t,y:n}=o.getPoint(e);return new s.Vector3(t,n,0)},f=e=>e*c,M=e=>e/c,x=(e,o)=>f(e*Math.sqrt(1-o**2)),E=e=>1496e8*e,a=e=>e*(Math.PI/180),z=(e,o)=>{const t=.000296005155*c**3;return Math.sqrt(t*(2/e-1/o))},L=(e,o)=>Math.sqrt(e**2-o**2),H=(e,o)=>{const{i:t,Peri:n,Node:i}=o,l=new s.Vector3(0,1,0),u=new s.Vector3(0,0,1);return new s.Vector3(e.x,e.y,0).applyAxisAngle(u,n?a(n+90):0).applyAxisAngle(l,a(t)).applyAxisAngle(u,i?a(i):0)},V=(e,o)=>{const i=15*(e/o);return i<=4?4:i>=15?15:i};exports.AU_TO_VIZ_SCALER=c;exports.DAY_PER_VIZ_SEC=j;exports.ORBITAL_COLORS=r;exports.amor=g;exports.apollo=b;exports.atira=d;exports.auToMeters=E;exports.auToUnit=f;exports.convert2dTo3d=H;exports.degsToRads=a;exports.formatValue=P;exports.getAngleFromPos=S;exports.getCurve=y;exports.getFocus=L;exports.getLabelSize=V;exports.getLineGeometry=h;exports.getMinorAxis=x;exports.getPosFromArcLength=O;exports.getRefObjProps=T;exports.getVelocity=z;exports.unitToAu=M;
|
|
@@ -47,6 +47,71 @@ export namespace ORBITAL_COLORS {
|
|
|
47
47
|
export let objectHighlight: string;
|
|
48
48
|
export let orbitHighlight: string;
|
|
49
49
|
}
|
|
50
|
+
namespace neos {
|
|
51
|
+
let objectColor_8: string;
|
|
52
|
+
export { objectColor_8 as objectColor };
|
|
53
|
+
let orbitColor_7: string;
|
|
54
|
+
export { orbitColor_7 as orbitColor };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export namespace apollo {
|
|
58
|
+
export let a: number;
|
|
59
|
+
export let e: number;
|
|
60
|
+
export let i: number;
|
|
61
|
+
export let H: number;
|
|
62
|
+
export let Ref: string;
|
|
63
|
+
export let name: string;
|
|
64
|
+
export let Principal_desig: string;
|
|
65
|
+
export let Translated_desig_key: string;
|
|
66
|
+
import orbitColor_8 = orbitColor;
|
|
67
|
+
export { orbitColor_8 as orbitColor };
|
|
68
|
+
import objectColor_9 = objectColor;
|
|
69
|
+
export { objectColor_9 as objectColor };
|
|
70
|
+
export let objectRadius: number;
|
|
71
|
+
}
|
|
72
|
+
export namespace atira {
|
|
73
|
+
let a_1: number;
|
|
74
|
+
export { a_1 as a };
|
|
75
|
+
let e_1: number;
|
|
76
|
+
export { e_1 as e };
|
|
77
|
+
let i_1: number;
|
|
78
|
+
export { i_1 as i };
|
|
79
|
+
let H_1: number;
|
|
80
|
+
export { H_1 as H };
|
|
81
|
+
let Ref_1: string;
|
|
82
|
+
export { Ref_1 as Ref };
|
|
83
|
+
let Principal_desig_1: string;
|
|
84
|
+
export { Principal_desig_1 as Principal_desig };
|
|
85
|
+
let Translated_desig_key_1: string;
|
|
86
|
+
export { Translated_desig_key_1 as Translated_desig_key };
|
|
87
|
+
import orbitColor_9 = orbitColor;
|
|
88
|
+
export { orbitColor_9 as orbitColor };
|
|
89
|
+
import objectColor_10 = objectColor;
|
|
90
|
+
export { objectColor_10 as objectColor };
|
|
91
|
+
let objectRadius_1: number;
|
|
92
|
+
export { objectRadius_1 as objectRadius };
|
|
93
|
+
}
|
|
94
|
+
export namespace amor {
|
|
95
|
+
let a_2: number;
|
|
96
|
+
export { a_2 as a };
|
|
97
|
+
let e_2: number;
|
|
98
|
+
export { e_2 as e };
|
|
99
|
+
let i_2: number;
|
|
100
|
+
export { i_2 as i };
|
|
101
|
+
let H_2: number;
|
|
102
|
+
export { H_2 as H };
|
|
103
|
+
let Ref_2: string;
|
|
104
|
+
export { Ref_2 as Ref };
|
|
105
|
+
let Principal_desig_2: string;
|
|
106
|
+
export { Principal_desig_2 as Principal_desig };
|
|
107
|
+
let Translated_desig_key_2: string;
|
|
108
|
+
export { Translated_desig_key_2 as Translated_desig_key };
|
|
109
|
+
import orbitColor_10 = orbitColor;
|
|
110
|
+
export { orbitColor_10 as orbitColor };
|
|
111
|
+
import objectColor_11 = objectColor;
|
|
112
|
+
export { objectColor_11 as objectColor };
|
|
113
|
+
let objectRadius_2: number;
|
|
114
|
+
export { objectRadius_2 as objectRadius };
|
|
50
115
|
}
|
|
51
116
|
export function getRefObjProps(id: any): any;
|
|
52
117
|
export function formatValue(number: any, decimalPlaces: any): number;
|