@rubin-epo/epo-widget-lib 2.0.11 → 2.1.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.
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +25 -18
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +53 -50
- package/dist/mock-data/OrbitalSim/index.d.ts +19 -10
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +5 -2
- 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 +36 -34
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +29 -29
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +79 -79
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +25 -24
- 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 +60 -59
- package/dist/widgets/OrbitalSim/Orbitals/styles.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/styles.js +1 -1
- package/dist/widgets/OrbitalSim/Sun.cjs +1 -1
- package/dist/widgets/OrbitalSim/Sun.js +6 -6
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +20 -21
- package/dist/widgets/OrbitalSim/styles.cjs +1 -1
- package/dist/widgets/OrbitalSim/styles.js +1 -1
- package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/MovingSourceSelector.js +82 -85
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +45 -39
- package/package.json +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),r=require("react"),o=require("../../../node_modules/prop-types/index.cjs"),ge=require("three"),fe=require("@react-three/fiber"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),r=require("react"),o=require("../../../node_modules/prop-types/index.cjs"),ge=require("three"),fe=require("@react-three/fiber"),d=require("@react-three/drei"),t=require("../orbitalUtilities.cjs"),xe=require("../chartColors.module.css.cjs"),pe=require("../Context/index.cjs"),je=require("react-i18next"),g=require("./styles.cjs");function ye(i){if(i&&i.__esModule)return i;const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const a in i)if(a!=="default"){const j=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(f,a,j.get?j:{enumerable:!0,get:()=>i[a]})}}return f.default=i,Object.freeze(f)}const M=ye(ge),_=({data:i,selectionCallback:f,active:a,playing:j,dayPerVizSec:w,stepDirection:G,frameOverride:R,orbitColor:k,objectColor:C,objectRadius:D,initialized:N,initCallback:v,devMode:Z,zoomMod:U,defaultZoom:K,type:A,reset:z})=>{const{t:Y}=je.useTranslation(),{orbits:$}=pe.useOrbitalSimContext(),{activeVelocityCallback:J}=$,Q=r.useRef(),{a:V,e:W,i:X,M:ee,Node:q,Peri:B,Principal_desig:te,Translated_desig_key:H,name:oe}=i||{},[se]=r.useState(()=>[0,t.degsToRads(X),q?t.degsToRads(q):0]),[n]=r.useState(()=>t.auToUnit(V)),[y]=r.useState(()=>t.getMinorAxis(V,W)),[re]=r.useState(()=>t.getFocus(n,y)),[s]=r.useState(new M.Vector3(re,0,0)),[u]=r.useState(new M.Vector3(0,0,0)),[ie,ae]=r.useState(!1),[h]=r.useState(()=>t.getCurve(n,y,s.x,s.y)),[ne]=r.useState(h.getPoints(360)),b=t.getPosFromArcLength(0,h),[x,T]=r.useState({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(u),n),period:0});r.useEffect(()=>{z>0&&T({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(u),n),period:0})},[z]);function le(m){let l=0,c=t.getPosFromArcLength(l,h);if(m){const P=m>180,O=P?m-180:m;let p=t.getAngleFromPos(c,u);for(;p<O;)l+=.01,c=t.getPosFromArcLength(l,h),p=t.getAngleFromPos(c,u);P&&(l+=.5,c=t.getPosFromArcLength(l,h))}return v?v():ae(!0),{position:c,rotation:[0,0,0],progress:l,velocity:t.getVelocity(c.distanceTo(u),n),period:0}}function E(m,L){const{progress:l,position:c,velocity:P,period:O}=x,p=m?0:L*(w||t.DAY_PER_VIZ_SEC),ce=P*p*G,S=l+ce/h.getLength(),F=S>1?1-S:S,{x:de,y:ue}=h.getPoint(F),he=new M.Vector3(de,ue,0),me=t.getVelocity(c.distanceTo(u),n);let I=p+O;S>1&&(I=0),T({...x,position:he,progress:F,velocity:me,period:I})}return r.useEffect(()=>{T(le(ee||Math.floor(Math.random()*Math.floor(180))))},[]),r.useEffect(()=>{R&&E(!1,1/60)},[R]),r.useEffect(()=>{a&&J(t.auToMeters(t.unitToAu(x.velocity/1e5)))},[x]),fe.useFrame((m,L)=>{(N||ie)&&E(!j,L)}),e.jsx("group",{rotation:se,children:e.jsxs("group",{rotation:[0,0,B?t.degsToRads(B+90):0],children:[e.jsx(d.Line,{ref:Q,points:ne,linewidth:2,color:a?t.ORBITAL_COLORS.asteroid.orbitHighlight:k||t.ORBITAL_COLORS.asteroid.orbitColor}),e.jsxs("mesh",{position:x.position,onClick:()=>f(i,"neo"),children:[(A==="planet"||A==="neo"||a)&&e.jsx(d.Html,{children:e.jsx(g.Label,{style:{fontSize:t.getLabelSize(U,K)},children:H?Y(H):oe||te})}),e.jsx("sphereGeometry",{attach:"geometry",args:[D||4,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.objectHighlight:C||t.ORBITAL_COLORS.asteroid.objectColor})]}),Z&&e.jsxs(e.Fragment,{children:[e.jsxs("mesh",{position:s,children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:xe.default.chart1}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"center"})})]}),e.jsxs("mesh",{position:u,children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:C||"blue"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"sun"})})]}),e.jsxs("mesh",{position:[s.x,-y+s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"minor axis vertex"})})]}),e.jsxs("mesh",{position:[s.x,y+s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"minor axis vertex"})})]}),e.jsxs("mesh",{position:[n+s.x,s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"major axis vertex"})})]}),e.jsxs("mesh",{position:[-n+s.x,s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"major axis vertex"})})]})]})]})})};_.defaultProps={type:"object"};_.propTypes={data:o.default.object,selectionCallback:o.default.func,active:o.default.bool,playing:o.default.bool,dayPerVizSec:o.default.number,stepDirection:o.default.number,frameOverride:o.default.number,orbitColor:o.default.string,objectColor:o.default.string,objectRadius:o.default.number,initCallback:o.default.func,initialized:o.default.bool,devMode:o.default.bool,activeVelocityCallback:o.default.func,zoomMod:o.default.number,defaultZoom:o.default.number,type:o.default.string,reset:o.default.number};exports.default=_;
|
|
@@ -1,133 +1,133 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as i, Fragment as Pe } from "react/jsx-runtime";
|
|
3
|
-
import { useRef as
|
|
3
|
+
import { useRef as Te, useState as r, useEffect as T } from "react";
|
|
4
4
|
import t from "../../../node_modules/prop-types/index.js";
|
|
5
5
|
import * as L from "three";
|
|
6
|
-
import { useFrame as
|
|
7
|
-
import { Html as h } from "@react-three/drei";
|
|
8
|
-
import { degsToRads as V, auToUnit as
|
|
6
|
+
import { useFrame as Me } from "@react-three/fiber";
|
|
7
|
+
import { Line as Ce, Html as h } from "@react-three/drei";
|
|
8
|
+
import { degsToRads as V, auToUnit as ve, getMinorAxis as ze, getFocus as je, getCurve as Le, getPosFromArcLength as M, getVelocity as C, auToMeters as Ve, unitToAu as Be, ORBITAL_COLORS as v, getLabelSize as Ge, getAngleFromPos as H, 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
|
-
import { useTranslation as
|
|
11
|
+
import { useTranslation as we } from "react-i18next";
|
|
12
12
|
import { Label as d } from "./styles.js";
|
|
13
|
-
const
|
|
14
|
-
data:
|
|
15
|
-
selectionCallback:
|
|
16
|
-
active:
|
|
13
|
+
const Z = ({
|
|
14
|
+
data: B,
|
|
15
|
+
selectionCallback: N,
|
|
16
|
+
active: f,
|
|
17
17
|
playing: K,
|
|
18
18
|
dayPerVizSec: U,
|
|
19
19
|
stepDirection: Y,
|
|
20
|
-
frameOverride:
|
|
20
|
+
frameOverride: G,
|
|
21
21
|
orbitColor: q,
|
|
22
|
-
objectColor:
|
|
22
|
+
objectColor: R,
|
|
23
23
|
objectRadius: J,
|
|
24
24
|
initialized: Q,
|
|
25
|
-
initCallback:
|
|
25
|
+
initCallback: S,
|
|
26
26
|
devMode: W,
|
|
27
27
|
zoomMod: X,
|
|
28
28
|
defaultZoom: $,
|
|
29
|
-
type:
|
|
29
|
+
type: _,
|
|
30
30
|
// noLabels,
|
|
31
|
-
reset:
|
|
31
|
+
reset: w
|
|
32
32
|
}) => {
|
|
33
|
-
const { t: ee } =
|
|
34
|
-
a:
|
|
33
|
+
const { t: ee } = we(), { orbits: te } = _e(), { activeVelocityCallback: oe } = te, re = Te(), {
|
|
34
|
+
a: A,
|
|
35
35
|
e: ie,
|
|
36
|
-
i:
|
|
37
|
-
M:
|
|
38
|
-
Node:
|
|
39
|
-
Peri:
|
|
36
|
+
i: se,
|
|
37
|
+
M: ne,
|
|
38
|
+
Node: k,
|
|
39
|
+
Peri: E,
|
|
40
40
|
Principal_desig: ae,
|
|
41
|
-
Translated_desig_key:
|
|
41
|
+
Translated_desig_key: F,
|
|
42
42
|
name: ce
|
|
43
|
-
} =
|
|
43
|
+
} = B || {}, [le] = r(() => [
|
|
44
44
|
0,
|
|
45
|
-
V(
|
|
46
|
-
|
|
47
|
-
]), [
|
|
48
|
-
() =>
|
|
49
|
-
), [pe] = r(
|
|
50
|
-
position:
|
|
45
|
+
V(se),
|
|
46
|
+
k ? V(k) : 0
|
|
47
|
+
]), [s] = r(() => ve(A)), [u] = r(() => ze(A, ie)), [me] = r(() => je(s, u)), [o] = r(new L.Vector3(me, 0, 0)), [c] = r(new L.Vector3(0, 0, 0)), [he, de] = r(!1), [l] = r(
|
|
48
|
+
() => Le(s, u, o.x, o.y)
|
|
49
|
+
), [pe] = r(l.getPoints(360)), y = M(0, l), [p, z] = r({
|
|
50
|
+
position: y,
|
|
51
51
|
rotation: [0, 0, 0],
|
|
52
52
|
progress: 0,
|
|
53
|
-
velocity: C(
|
|
53
|
+
velocity: C(y.distanceTo(c), s),
|
|
54
54
|
period: 0
|
|
55
55
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
position:
|
|
56
|
+
T(() => {
|
|
57
|
+
w > 0 && z({
|
|
58
|
+
position: y,
|
|
59
59
|
rotation: [0, 0, 0],
|
|
60
60
|
progress: 0,
|
|
61
|
-
velocity: C(
|
|
61
|
+
velocity: C(y.distanceTo(c), s),
|
|
62
62
|
period: 0
|
|
63
63
|
});
|
|
64
|
-
}, [
|
|
64
|
+
}, [w]);
|
|
65
65
|
function ge(m) {
|
|
66
|
-
let
|
|
66
|
+
let n = 0, a = M(n, l);
|
|
67
67
|
if (m) {
|
|
68
|
-
const x = m > 180,
|
|
69
|
-
let g =
|
|
70
|
-
for (; g <
|
|
71
|
-
|
|
72
|
-
x && (
|
|
68
|
+
const x = m > 180, j = x ? m - 180 : m;
|
|
69
|
+
let g = H(a, c);
|
|
70
|
+
for (; g < j; )
|
|
71
|
+
n += 0.01, a = M(n, l), g = H(a, c);
|
|
72
|
+
x && (n += 0.5, a = M(n, l));
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return S ? S() : de(!0), {
|
|
75
75
|
position: a,
|
|
76
76
|
rotation: [0, 0, 0],
|
|
77
|
-
progress:
|
|
78
|
-
velocity: C(a.distanceTo(c),
|
|
77
|
+
progress: n,
|
|
78
|
+
velocity: C(a.distanceTo(c), s),
|
|
79
79
|
period: 0
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function I(m, b) {
|
|
83
83
|
const {
|
|
84
|
-
progress:
|
|
84
|
+
progress: n,
|
|
85
85
|
position: a,
|
|
86
86
|
velocity: x,
|
|
87
|
-
period:
|
|
88
|
-
} = p, g = m ? 0 : b * (U || Re),
|
|
89
|
-
let
|
|
90
|
-
P > 1 && (
|
|
87
|
+
period: j
|
|
88
|
+
} = p, g = m ? 0 : b * (U || Re), fe = x * g * Y, P = n + fe / l.getLength(), O = P > 1 ? 1 - P : P, { x: ue, y: ye } = l.getPoint(O), be = new L.Vector3(ue, ye, 0), xe = C(a.distanceTo(c), s);
|
|
89
|
+
let D = g + j;
|
|
90
|
+
P > 1 && (D = 0), z({
|
|
91
91
|
...p,
|
|
92
92
|
position: be,
|
|
93
|
-
progress:
|
|
93
|
+
progress: O,
|
|
94
94
|
velocity: xe,
|
|
95
|
-
period:
|
|
95
|
+
period: D
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
}, []),
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
|
|
104
|
-
}, [p]),
|
|
105
|
-
(Q || he) &&
|
|
106
|
-
}), /* @__PURE__ */ e("group", { rotation: le, children: /* @__PURE__ */ i("group", { rotation: [0, 0,
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
|
|
98
|
+
return T(() => {
|
|
99
|
+
z(ge(ne || Math.floor(Math.random() * Math.floor(180))));
|
|
100
|
+
}, []), T(() => {
|
|
101
|
+
G && I(!1, 1 / 60);
|
|
102
|
+
}, [G]), T(() => {
|
|
103
|
+
f && oe(Ve(Be(p.velocity / 1e5)));
|
|
104
|
+
}, [p]), Me((m, b) => {
|
|
105
|
+
(Q || he) && I(!K, b);
|
|
106
|
+
}), /* @__PURE__ */ e("group", { rotation: le, children: /* @__PURE__ */ i("group", { rotation: [0, 0, E ? V(E + 90) : 0], children: [
|
|
107
|
+
/* @__PURE__ */ e(
|
|
108
|
+
Ce,
|
|
109
109
|
{
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
ref: re,
|
|
111
|
+
points: pe,
|
|
112
|
+
linewidth: 2,
|
|
113
|
+
color: f ? v.asteroid.orbitHighlight : q || v.asteroid.orbitColor
|
|
112
114
|
}
|
|
113
|
-
)
|
|
115
|
+
),
|
|
114
116
|
/* @__PURE__ */ i(
|
|
115
117
|
"mesh",
|
|
116
118
|
{
|
|
117
119
|
position: p.position,
|
|
118
|
-
onClick: () =>
|
|
120
|
+
onClick: () => N(B, "neo"),
|
|
119
121
|
children: [
|
|
120
|
-
(
|
|
121
|
-
|
|
122
|
+
(_ === "planet" || _ === "neo" || f) && /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(
|
|
123
|
+
d,
|
|
122
124
|
{
|
|
123
|
-
type: "button",
|
|
124
125
|
style: {
|
|
125
126
|
fontSize: Ge(X, $)
|
|
126
127
|
},
|
|
127
|
-
|
|
128
|
-
children: I ? ee(I) : ce || ae
|
|
128
|
+
children: F ? ee(F) : ce || ae
|
|
129
129
|
}
|
|
130
|
-
) })
|
|
130
|
+
) }),
|
|
131
131
|
/* @__PURE__ */ e(
|
|
132
132
|
"sphereGeometry",
|
|
133
133
|
{
|
|
@@ -139,7 +139,7 @@ const N = ({
|
|
|
139
139
|
"meshBasicMaterial",
|
|
140
140
|
{
|
|
141
141
|
attach: "material",
|
|
142
|
-
color:
|
|
142
|
+
color: f ? v.asteroid.objectHighlight : R || v.asteroid.objectColor
|
|
143
143
|
}
|
|
144
144
|
)
|
|
145
145
|
]
|
|
@@ -157,7 +157,7 @@ const N = ({
|
|
|
157
157
|
"meshBasicMaterial",
|
|
158
158
|
{
|
|
159
159
|
attach: "material",
|
|
160
|
-
color:
|
|
160
|
+
color: R || "blue"
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
163
|
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "sun" }) })
|
|
@@ -196,7 +196,7 @@ const N = ({
|
|
|
196
196
|
"mesh",
|
|
197
197
|
{
|
|
198
198
|
position: [
|
|
199
|
-
|
|
199
|
+
s + o.x,
|
|
200
200
|
o.y,
|
|
201
201
|
o.z
|
|
202
202
|
],
|
|
@@ -211,7 +211,7 @@ const N = ({
|
|
|
211
211
|
"mesh",
|
|
212
212
|
{
|
|
213
213
|
position: [
|
|
214
|
-
-
|
|
214
|
+
-s + o.x,
|
|
215
215
|
o.y,
|
|
216
216
|
o.z
|
|
217
217
|
],
|
|
@@ -225,10 +225,10 @@ const N = ({
|
|
|
225
225
|
] })
|
|
226
226
|
] }) });
|
|
227
227
|
};
|
|
228
|
-
|
|
228
|
+
Z.defaultProps = {
|
|
229
229
|
type: "object"
|
|
230
230
|
};
|
|
231
|
-
|
|
231
|
+
Z.propTypes = {
|
|
232
232
|
data: t.object,
|
|
233
233
|
selectionCallback: t.func,
|
|
234
234
|
active: t.bool,
|
|
@@ -250,5 +250,5 @@ N.propTypes = {
|
|
|
250
250
|
reset: t.number
|
|
251
251
|
};
|
|
252
252
|
export {
|
|
253
|
-
|
|
253
|
+
Z 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"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("react"),d=require("@rubin-epo/epo-react-lib/Button"),a=require("../Context/index.cjs"),s=require("./styles.cjs"),x=require("../styles.cjs"),j=t=>t&&t.__esModule?t:{default:t},h=j(d);function S(){var r;const[t,o]=u.useState(!1),{orbits:n,selectedNeoIndex:c}=a.useOrbitalSimContext(),{object_details:l}=((r=n.neos)==null?void 0:r[c])||{};return e.jsxs(e.Fragment,{children:[e.jsx(x.GlobalStyles,{}),e.jsx(s.ButtonWrapper,{styleAs:"secondary",isInactive:!l,onClick:()=>{o(!t)},children:t?"Hide Details":"Show Details"}),e.jsx(s.SlideoutWrapper,{slideFrom:"left",isOpen:t,children:e.jsxs(s.SlideoutPanel,{children:[e.jsx("h3",{children:"Orbital Details"}),l&&l.map(i=>e.jsxs(s.SlideoutRow,{children:[e.jsx(s.SlideoutColLeft,{children:e.jsx("p",{children:i.rowTitle})}),e.jsx(s.SlideoutColRight,{children:e.jsx("p",{children:i.rowContent})})]},i.rowTitle)),e.jsx(h.default,{isBlock:!0,onClick:()=>o(!t),children:"Close"})]})})]})}exports.default=S;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, Fragment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import { useOrbitalSimContext as
|
|
6
|
-
import { ButtonWrapper as
|
|
2
|
+
import { jsxs as l, Fragment as d, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as a } from "react";
|
|
4
|
+
import m from "@rubin-epo/epo-react-lib/Button";
|
|
5
|
+
import { useOrbitalSimContext as p } from "../Context/index.js";
|
|
6
|
+
import { ButtonWrapper as h, SlideoutWrapper as u, SlideoutPanel as f, SlideoutRow as S, SlideoutColLeft as C, SlideoutColRight as b } from "./styles.js";
|
|
7
7
|
import { GlobalStyles as w } from "../styles.js";
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
|
|
8
|
+
function y() {
|
|
9
|
+
var n;
|
|
10
|
+
const [t, r] = a(!1), { orbits: s, selectedNeoIndex: c } = p(), {
|
|
11
|
+
object_details: i
|
|
12
|
+
} = ((n = s.neos) == null ? void 0 : n[c]) || {};
|
|
13
|
+
return /* @__PURE__ */ l(d, { children: [
|
|
14
|
+
/* @__PURE__ */ e(w, {}),
|
|
15
|
+
/* @__PURE__ */ e(
|
|
16
|
+
h,
|
|
16
17
|
{
|
|
17
18
|
styleAs: "secondary",
|
|
18
19
|
isInactive: !i,
|
|
19
20
|
onClick: () => {
|
|
20
|
-
r(!
|
|
21
|
+
r(!t);
|
|
21
22
|
},
|
|
22
|
-
children:
|
|
23
|
+
children: t ? "Hide Details" : "Show Details"
|
|
23
24
|
}
|
|
24
25
|
),
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
i && i.map((o) => /* @__PURE__ */ l(
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ e(u, { slideFrom: "left", isOpen: t, children: /* @__PURE__ */ l(f, { children: [
|
|
27
|
+
/* @__PURE__ */ e("h3", { children: "Orbital Details" }),
|
|
28
|
+
i && i.map((o) => /* @__PURE__ */ l(S, { children: [
|
|
29
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e("p", { children: o.rowTitle }) }),
|
|
30
|
+
/* @__PURE__ */ e(b, { children: /* @__PURE__ */ e("p", { children: o.rowContent }) })
|
|
30
31
|
] }, o.rowTitle)),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
m,
|
|
33
34
|
{
|
|
34
35
|
isBlock: !0,
|
|
35
|
-
onClick: () => r(!
|
|
36
|
+
onClick: () => r(!t),
|
|
36
37
|
children: "Close"
|
|
37
38
|
}
|
|
38
39
|
)
|
|
@@ -40,5 +41,5 @@ function v() {
|
|
|
40
41
|
] });
|
|
41
42
|
}
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
y as default
|
|
44
45
|
};
|
|
@@ -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"),h=require("react"),e=require("../../../node_modules/prop-types/index.cjs"),x=require("@react-three/fiber"),C=require("./Orbital.cjs"),v=require("./PotentialOrbits.cjs"),E=require("../orbitalUtilities.cjs");function M({playing:s,dayPerVizSec:i,stepDirection:n,frameOverride:u,defaultZoom:d,potentialOrbits:$,elapsedTime:p,setElapsedTime:j,reset:g,zoomLevel:l,setZoomLevel:I,selectedNeoIndex:q,orbits:P}){const{neos:m,refObjs:_,activeNeo:k}=P,a=Number.isInteger(q)?[m[q]]:m;function T(r){const{remainingInits:t}=r;return{remainingInits:t-1}}const{camera:O}=x.useThree(),[y,R]=h.useReducer(T,{remainingInits:a&&Array.isArray(a)?a.length:0});function z(){return(_||["earth","jupiter","mars","neptune"]).map(E.getRefObjProps).map(t=>{const{orbitColor:f,objectColor:c,objectRadius:b,Ref:A,Principal_desig:F,name:N}=t;return o.jsx(C.default,{type:"planet",data:t,position:[0,0,0],zoomMod:l,defaultZoom:d,playing:s,stepDirection:n,dayPerVizSec:i,frameOverride:u,orbitColor:f,objectColor:c,objectRadius:b,reset:g},`${A}-${F||N}`)})}return x.useFrame((r,t)=>{O.zoom!==l&&I(O.zoom),s&&j(p+n*t*i)}),h.useEffect(()=>{u&&j(p+n*(1/60)*i)},[u]),o.jsxs(o.Fragment,{children:[z(),$?o.jsx(v.default,{data:m,position:[0,0,0],initialized:!0,zoomMod:l,defaultZoom:d,playing:s,stepDirection:n,dayPerVizSec:i,frameOverride:u,initCallback:R}):a?a.map((r,t)=>{const{Ref:f,Principal_desig:c,name:b}=r;return o.jsx(C.default,{type:"neo",data:r,position:[0,0,0],active:r===k,initialized:y.remainingInits<=0,zoomMod:l,defaultZoom:d,playing:s,stepDirection:n,dayPerVizSec:i,frameOverride:u,reset:g,initCallback:R},f&&(c||b)?`${f}-${c||b}`:`orbit-${t}`)}):null]})}M.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=M;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default Orbitals;
|
|
2
|
-
declare function Orbitals({ playing, dayPerVizSec, stepDirection, frameOverride, defaultZoom, potentialOrbits, elapsedTime, setElapsedTime, reset, zoomLevel, setZoomLevel, orbits }: {
|
|
2
|
+
declare function Orbitals({ playing, dayPerVizSec, stepDirection, frameOverride, defaultZoom, potentialOrbits, elapsedTime, setElapsedTime, reset, zoomLevel, setZoomLevel, selectedNeoIndex, 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
|
+
selectedNeoIndex: any;
|
|
14
15
|
orbits: any;
|
|
15
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
declare namespace Orbitals {
|
|
@@ -1,113 +1,114 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useReducer as
|
|
2
|
+
import { jsxs as N, Fragment as _, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { useReducer as E, useEffect as q } from "react";
|
|
4
4
|
import t from "../../../node_modules/prop-types/index.js";
|
|
5
|
-
import { useThree as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getRefObjProps as
|
|
9
|
-
function
|
|
5
|
+
import { useThree as w, useFrame as B } from "@react-three/fiber";
|
|
6
|
+
import C from "./Orbital.js";
|
|
7
|
+
import G from "./PotentialOrbits.js";
|
|
8
|
+
import { getRefObjProps as H } from "../orbitalUtilities.js";
|
|
9
|
+
function J({
|
|
10
10
|
playing: a,
|
|
11
|
-
dayPerVizSec:
|
|
11
|
+
dayPerVizSec: e,
|
|
12
12
|
stepDirection: i,
|
|
13
|
-
frameOverride:
|
|
14
|
-
defaultZoom:
|
|
15
|
-
potentialOrbits:
|
|
16
|
-
elapsedTime:
|
|
17
|
-
setElapsedTime:
|
|
18
|
-
reset:
|
|
13
|
+
frameOverride: n,
|
|
14
|
+
defaultZoom: f,
|
|
15
|
+
potentialOrbits: $,
|
|
16
|
+
elapsedTime: d,
|
|
17
|
+
setElapsedTime: j,
|
|
18
|
+
reset: g,
|
|
19
19
|
zoomLevel: m,
|
|
20
|
-
setZoomLevel:
|
|
21
|
-
|
|
20
|
+
setZoomLevel: I,
|
|
21
|
+
selectedNeoIndex: O,
|
|
22
|
+
orbits: P
|
|
22
23
|
}) {
|
|
23
24
|
const {
|
|
24
|
-
neos:
|
|
25
|
-
refObjs:
|
|
26
|
-
activeNeo:
|
|
27
|
-
} =
|
|
28
|
-
function
|
|
25
|
+
neos: c,
|
|
26
|
+
refObjs: k,
|
|
27
|
+
activeNeo: M
|
|
28
|
+
} = P, s = Number.isInteger(O) ? [c[O]] : c;
|
|
29
|
+
function T(o) {
|
|
29
30
|
const { remainingInits: r } = o;
|
|
30
31
|
return { remainingInits: r - 1 };
|
|
31
32
|
}
|
|
32
|
-
const { camera:
|
|
33
|
-
remainingInits:
|
|
33
|
+
const { camera: R } = w(), [x, h] = E(T, {
|
|
34
|
+
remainingInits: s && Array.isArray(s) ? s.length : 0
|
|
34
35
|
});
|
|
35
|
-
function
|
|
36
|
-
return (
|
|
36
|
+
function y() {
|
|
37
|
+
return (k || ["earth", "jupiter", "mars", "neptune"]).map(H).map((r) => {
|
|
37
38
|
const {
|
|
38
39
|
orbitColor: u,
|
|
39
40
|
objectColor: p,
|
|
40
41
|
objectRadius: b,
|
|
41
|
-
Ref:
|
|
42
|
-
Principal_desig:
|
|
43
|
-
name:
|
|
42
|
+
Ref: z,
|
|
43
|
+
Principal_desig: A,
|
|
44
|
+
name: F
|
|
44
45
|
} = r;
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
46
|
+
return /* @__PURE__ */ l(
|
|
47
|
+
C,
|
|
47
48
|
{
|
|
48
49
|
type: "planet",
|
|
49
50
|
data: r,
|
|
50
51
|
position: [0, 0, 0],
|
|
51
52
|
zoomMod: m,
|
|
52
|
-
defaultZoom:
|
|
53
|
+
defaultZoom: f,
|
|
53
54
|
playing: a,
|
|
54
55
|
stepDirection: i,
|
|
55
|
-
dayPerVizSec:
|
|
56
|
-
frameOverride:
|
|
56
|
+
dayPerVizSec: e,
|
|
57
|
+
frameOverride: n,
|
|
57
58
|
orbitColor: u,
|
|
58
59
|
objectColor: p,
|
|
59
60
|
objectRadius: b,
|
|
60
|
-
reset:
|
|
61
|
+
reset: g
|
|
61
62
|
},
|
|
62
|
-
`${
|
|
63
|
+
`${z}-${A || F}`
|
|
63
64
|
);
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
return B((o, r) => {
|
|
68
|
+
R.zoom !== m && I(R.zoom), a && j(d + i * r * e);
|
|
69
|
+
}), q(() => {
|
|
70
|
+
n && j(d + i * (1 / 60) * e);
|
|
71
|
+
}, [n]), /* @__PURE__ */ N(_, { children: [
|
|
72
|
+
y(),
|
|
73
|
+
$ ? /* @__PURE__ */ l(
|
|
74
|
+
G,
|
|
74
75
|
{
|
|
75
|
-
data:
|
|
76
|
+
data: c,
|
|
76
77
|
position: [0, 0, 0],
|
|
77
78
|
initialized: !0,
|
|
78
79
|
zoomMod: m,
|
|
79
|
-
defaultZoom:
|
|
80
|
+
defaultZoom: f,
|
|
80
81
|
playing: a,
|
|
81
82
|
stepDirection: i,
|
|
82
|
-
dayPerVizSec:
|
|
83
|
-
frameOverride:
|
|
84
|
-
initCallback:
|
|
83
|
+
dayPerVizSec: e,
|
|
84
|
+
frameOverride: n,
|
|
85
|
+
initCallback: h
|
|
85
86
|
}
|
|
86
|
-
) :
|
|
87
|
+
) : s ? s.map((o, r) => {
|
|
87
88
|
const { Ref: u, Principal_desig: p, name: b } = o;
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
|
|
89
|
+
return /* @__PURE__ */ l(
|
|
90
|
+
C,
|
|
90
91
|
{
|
|
91
92
|
type: "neo",
|
|
92
93
|
data: o,
|
|
93
94
|
position: [0, 0, 0],
|
|
94
|
-
active: o ===
|
|
95
|
+
active: o === M,
|
|
95
96
|
initialized: x.remainingInits <= 0,
|
|
96
97
|
zoomMod: m,
|
|
97
|
-
defaultZoom:
|
|
98
|
+
defaultZoom: f,
|
|
98
99
|
playing: a,
|
|
99
100
|
stepDirection: i,
|
|
100
|
-
dayPerVizSec:
|
|
101
|
-
frameOverride:
|
|
102
|
-
reset:
|
|
103
|
-
initCallback:
|
|
101
|
+
dayPerVizSec: e,
|
|
102
|
+
frameOverride: n,
|
|
103
|
+
reset: g,
|
|
104
|
+
initCallback: h
|
|
104
105
|
},
|
|
105
106
|
u && (p || b) ? `${u}-${p || b}` : `orbit-${r}`
|
|
106
107
|
);
|
|
107
108
|
}) : null
|
|
108
109
|
] });
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
+
J.propTypes = {
|
|
111
112
|
playing: t.bool,
|
|
112
113
|
dayPerVizSec: t.number,
|
|
113
114
|
stepDirection: t.number,
|
|
@@ -122,5 +123,5 @@ G.propTypes = {
|
|
|
122
123
|
reset: t.number
|
|
123
124
|
};
|
|
124
125
|
export {
|
|
125
|
-
|
|
126
|
+
J as default
|
|
126
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=require("@react-three/drei"),t=require("./orbitalUtilities.cjs"),n=require("react-i18next"),l=require("./styles.cjs"),a=({defaultZoom:s,zoomLevel:r})=>{const{t:i}=n.useTranslation();return e.jsxs("mesh",{position:[0,0,0],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[9,16,8]}),e.jsx("meshBasicMaterial",{attach:"material",color:t.ORBITAL_COLORS.sun.objectColor}),e.jsx(o.Html,{children:e.jsx(l.SunLabel,{
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),o=require("@react-three/drei"),t=require("./orbitalUtilities.cjs"),n=require("react-i18next"),l=require("./styles.cjs"),a=({defaultZoom:s,zoomLevel:r})=>{const{t:i}=n.useTranslation();return e.jsxs("mesh",{position:[0,0,0],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[9,16,8]}),e.jsx("meshBasicMaterial",{attach:"material",color:t.ORBITAL_COLORS.sun.objectColor}),e.jsx(o.Html,{children:e.jsx(l.SunLabel,{style:{fontSize:t.getLabelSize(r,s)},children:i("orbital_sim.astronomy.orbital_bodies.sun")})})]})};exports.default=a;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { Html as s } from "@react-three/drei";
|
|
4
4
|
import { ORBITAL_COLORS as a, getLabelSize as m } from "./orbitalUtilities.js";
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { SunLabel as
|
|
5
|
+
import { useTranslation as l } from "react-i18next";
|
|
6
|
+
import { SunLabel as n } from "./styles.js";
|
|
7
7
|
const b = ({ defaultZoom: o, zoomLevel: r }) => {
|
|
8
|
-
const { t: e } =
|
|
8
|
+
const { t: e } = l();
|
|
9
9
|
return /* @__PURE__ */ i("mesh", { position: [0, 0, 0], children: [
|
|
10
10
|
/* @__PURE__ */ t("sphereGeometry", { attach: "geometry", args: [9, 16, 8] }),
|
|
11
11
|
/* @__PURE__ */ t(
|
|
@@ -15,15 +15,15 @@ const b = ({ defaultZoom: o, zoomLevel: r }) => {
|
|
|
15
15
|
color: a.sun.objectColor
|
|
16
16
|
}
|
|
17
17
|
),
|
|
18
|
-
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
19
|
-
|
|
18
|
+
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
19
|
+
n,
|
|
20
20
|
{
|
|
21
21
|
style: {
|
|
22
22
|
fontSize: m(r, o)
|
|
23
23
|
},
|
|
24
24
|
children: e("orbital_sim.astronomy.orbital_bodies.sun")
|
|
25
25
|
}
|
|
26
|
-
) })
|
|
26
|
+
) })
|
|
27
27
|
] });
|
|
28
28
|
};
|
|
29
29
|
export {
|