@rubin-epo/epo-widget-lib 2.0.10 → 2.0.13
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 +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 +3 -2
- package/dist/localeStrings/es/epo-widget-lib.json +3 -2
- package/dist/localeStrings/fr/epo-widget-lib.json +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.cjs +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.js +5 -5
- package/dist/widgets/OrbitalSim/Controls/styles.cjs +7 -3
- package/dist/widgets/OrbitalSim/Controls/styles.d.ts +1 -1
- package/dist/widgets/OrbitalSim/Controls/styles.js +9 -5
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +79 -79
- package/dist/widgets/OrbitalSim/Orbitals/styles.cjs +2 -2
- package/dist/widgets/OrbitalSim/Orbitals/styles.js +2 -2
- 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 +6 -3
- package/dist/widgets/OrbitalSim/styles.js +10 -7
- 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 +39 -45
- package/package.json +2 -3
|
@@ -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
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
7
7
|
`,c=t.default.div`
|
|
8
|
-
padding:
|
|
8
|
+
padding: 0px 4px;
|
|
9
9
|
margin-top: 4px;
|
|
10
10
|
font-weight: var(--medium);
|
|
11
11
|
color: var(--black);
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
gap: 1em;
|
|
33
33
|
padding: 1em;
|
|
34
34
|
font-size: 0.75rem;
|
|
35
|
-
width:
|
|
35
|
+
width: 50ch;
|
|
36
36
|
|
|
37
37
|
& > * + * {
|
|
38
38
|
margin-block-start: 1em;
|
|
@@ -9,7 +9,7 @@ const a = o(t)`
|
|
|
9
9
|
display: none;
|
|
10
10
|
}
|
|
11
11
|
`, d = o.div`
|
|
12
|
-
padding:
|
|
12
|
+
padding: 0px 4px;
|
|
13
13
|
margin-top: 4px;
|
|
14
14
|
font-weight: var(--medium);
|
|
15
15
|
color: var(--black);
|
|
@@ -36,7 +36,7 @@ const a = o(t)`
|
|
|
36
36
|
gap: 1em;
|
|
37
37
|
padding: 1em;
|
|
38
38
|
font-size: 0.75rem;
|
|
39
|
-
width:
|
|
39
|
+
width: 50ch;
|
|
40
40
|
|
|
41
41
|
& > * + * {
|
|
42
42
|
margin-block-start: 1em;
|
|
@@ -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 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three");function p(o){if(o&&o.__esModule)return o;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const s=p(f),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"}},u={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=o=>({neptune:R,earth:_,mars:m,jupiter:A,atira:d,apollo:u,amor:g})[o]||null,P=function(o,e){return Number.parseFloat(Number.parseFloat(o).toFixed(e))},y=(o,e,t=0,n=0)=>new s.EllipseCurve(t,n,o,e,0,2*Math.PI,!1,0),h=(o,e)=>{const t=o.distanceTo(e),{x:n,y:i}=o;return Math.acos((t**2+n**2-i**2)/(2*t*n))*180/Math.PI},S=(o,e)=>{const{x:t,y:n}=e.getPoint(o);return new s.Vector3(t,n,0)},C=o=>o*c,O=o=>o/c,M=(o,e)=>C(o*Math.sqrt(1-e**2)),x=o=>1496e8*o,a=o=>o*(Math.PI/180),E=(o,e)=>{const t=.000296005155*c**3;return Math.sqrt(t*(2/o-1/e))},z=(o,e)=>Math.sqrt(o**2-e**2),H=(o,e)=>{const{i:t,Peri:n,Node:i}=e,l=new s.Vector3(0,1,0),b=new s.Vector3(0,0,1);return new s.Vector3(o.x,o.y,0).applyAxisAngle(b,n?a(n+90):0).applyAxisAngle(l,a(t)).applyAxisAngle(b,i?a(i):0)},V=(o,e)=>{const i=15*(o/e);return i<=12?12: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=u;exports.atira=d;exports.auToMeters=x;exports.auToUnit=C;exports.convert2dTo3d=H;exports.degsToRads=a;exports.formatValue=P;exports.getAngleFromPos=h;exports.getCurve=y;exports.getFocus=z;exports.getLabelSize=V;exports.getMinorAxis=M;exports.getPosFromArcLength=S;exports.getRefObjProps=T;exports.getVelocity=E;exports.unitToAu=O;
|
|
@@ -63,7 +63,7 @@ const l = 100, m = 1, t = {
|
|
|
63
63
|
orbitColor: t.neos.orbitColor,
|
|
64
64
|
objectColor: t.neos.objectColor,
|
|
65
65
|
objectRadius: 5
|
|
66
|
-
},
|
|
66
|
+
}, p = {
|
|
67
67
|
a: 1,
|
|
68
68
|
e: 0.01671022,
|
|
69
69
|
i: 0,
|
|
@@ -74,7 +74,7 @@ const l = 100, m = 1, t = {
|
|
|
74
74
|
orbitColor: t.earth.orbitColor,
|
|
75
75
|
objectColor: t.earth.objectColor,
|
|
76
76
|
objectRadius: 5
|
|
77
|
-
},
|
|
77
|
+
}, f = {
|
|
78
78
|
a: 1.52366231,
|
|
79
79
|
e: 0.09341233,
|
|
80
80
|
i: 1.85061,
|
|
@@ -85,7 +85,7 @@ const l = 100, m = 1, t = {
|
|
|
85
85
|
orbitColor: t.mars.orbitColor,
|
|
86
86
|
objectColor: t.mars.objectColor,
|
|
87
87
|
objectRadius: 4
|
|
88
|
-
},
|
|
88
|
+
}, j = {
|
|
89
89
|
a: 5.2028,
|
|
90
90
|
e: 0.048,
|
|
91
91
|
i: 1.31,
|
|
@@ -97,7 +97,7 @@ const l = 100, m = 1, t = {
|
|
|
97
97
|
objectColor: t.jupiter.objectColor,
|
|
98
98
|
// objectRadius: 69911000,
|
|
99
99
|
objectRadius: 7
|
|
100
|
-
},
|
|
100
|
+
}, g = {
|
|
101
101
|
a: 30.06896348,
|
|
102
102
|
e: 858587e-8,
|
|
103
103
|
i: 1.76917,
|
|
@@ -110,10 +110,10 @@ const l = 100, m = 1, t = {
|
|
|
110
110
|
// objectRadius: 24622000,
|
|
111
111
|
objectRadius: 6
|
|
112
112
|
}, R = (o) => ({
|
|
113
|
-
neptune:
|
|
114
|
-
earth:
|
|
115
|
-
mars:
|
|
116
|
-
jupiter:
|
|
113
|
+
neptune: g,
|
|
114
|
+
earth: p,
|
|
115
|
+
mars: f,
|
|
116
|
+
jupiter: j,
|
|
117
117
|
atira: C,
|
|
118
118
|
apollo: u,
|
|
119
119
|
amor: d
|
|
@@ -136,24 +136,24 @@ const l = 100, m = 1, t = {
|
|
|
136
136
|
// aClockwise
|
|
137
137
|
0
|
|
138
138
|
// aRotation
|
|
139
|
-
), P = (o
|
|
139
|
+
), P = (o, e) => {
|
|
140
140
|
const r = o.distanceTo(e), { x: n, y: i } = o;
|
|
141
141
|
return Math.acos((r ** 2 + n ** 2 - i ** 2) / (2 * r * n)) * 180 / Math.PI;
|
|
142
142
|
}, T = (o, e) => {
|
|
143
143
|
const { x: r, y: n } = e.getPoint(o);
|
|
144
144
|
return new s.Vector3(r, n, 0);
|
|
145
|
-
}, _ = (o) => o * l, x = (o) => o / l,
|
|
145
|
+
}, _ = (o) => o * l, x = (o) => o / l, y = (o, e) => _(o * Math.sqrt(1 - e ** 2)), M = (o) => 1496e8 * o, a = (o) => o * (Math.PI / 180), S = (o, e) => {
|
|
146
146
|
const r = 296005155e-12 * l ** 3;
|
|
147
147
|
return Math.sqrt(r * (2 / o - 1 / e));
|
|
148
|
-
},
|
|
148
|
+
}, z = (o, e) => Math.sqrt(o ** 2 - e ** 2), H = (o, e) => {
|
|
149
149
|
const { i: r, Peri: n, Node: i } = e, c = new s.Vector3(0, 1, 0), b = new s.Vector3(0, 0, 1);
|
|
150
150
|
return new s.Vector3(o.x, o.y, 0).applyAxisAngle(b, n ? a(n + 90) : 0).applyAxisAngle(c, a(r)).applyAxisAngle(
|
|
151
151
|
b,
|
|
152
152
|
i ? a(i) : 0
|
|
153
153
|
);
|
|
154
|
-
},
|
|
154
|
+
}, E = (o, e) => {
|
|
155
155
|
const i = 15 * (o / e);
|
|
156
|
-
return i <=
|
|
156
|
+
return i <= 12 ? 12 : i >= 15 ? 15 : i;
|
|
157
157
|
};
|
|
158
158
|
export {
|
|
159
159
|
l as AU_TO_VIZ_SCALER,
|
|
@@ -162,19 +162,18 @@ export {
|
|
|
162
162
|
d as amor,
|
|
163
163
|
u as apollo,
|
|
164
164
|
C as atira,
|
|
165
|
-
|
|
165
|
+
M as auToMeters,
|
|
166
166
|
_ as auToUnit,
|
|
167
|
-
|
|
167
|
+
H as convert2dTo3d,
|
|
168
168
|
a as degsToRads,
|
|
169
169
|
A as formatValue,
|
|
170
|
-
|
|
170
|
+
P as getAngleFromPos,
|
|
171
171
|
h as getCurve,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
M as getMinorAxis,
|
|
172
|
+
z as getFocus,
|
|
173
|
+
E as getLabelSize,
|
|
174
|
+
y as getMinorAxis,
|
|
176
175
|
T as getPosFromArcLength,
|
|
177
176
|
R as getRefObjProps,
|
|
178
|
-
|
|
177
|
+
S as getVelocity,
|
|
179
178
|
x as unitToAu
|
|
180
179
|
};
|
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
min-height: 500px;
|
|
40
40
|
background-color: #000000;
|
|
41
41
|
color-adjust: exact;
|
|
42
|
+
container-type: size;
|
|
43
|
+
container-name: orbital-sim-context;
|
|
42
44
|
`,n=e.default(r.Canvas)`
|
|
43
45
|
position: relative;
|
|
44
46
|
z-index: 1;
|
|
45
47
|
`,d=e.default.div`
|
|
46
|
-
padding:
|
|
48
|
+
padding: 0px 4px;
|
|
47
49
|
margin-top: 4px;
|
|
48
50
|
font-weight: var(--medium);
|
|
49
51
|
color: var(--black);
|
|
@@ -61,10 +63,11 @@
|
|
|
61
63
|
z-index: 10;
|
|
62
64
|
background-color: #fff;
|
|
63
65
|
width: 10%;
|
|
66
|
+
min-width: fit-content;
|
|
64
67
|
height: 100%;
|
|
65
68
|
display: flex;
|
|
66
69
|
flex-direction: column;
|
|
67
|
-
`,
|
|
70
|
+
`,c=e.default.button`
|
|
68
71
|
width: 100%;
|
|
69
72
|
padding: 12px 16px;
|
|
70
73
|
text-align: left;
|
|
@@ -81,4 +84,4 @@
|
|
|
81
84
|
background-color: #017F80;
|
|
82
85
|
color: #fff;
|
|
83
86
|
}
|
|
84
|
-
`;exports.CanvasWrapper=n;exports.GlobalStyles=o;exports.OrbitalSimWrapper=l;exports.SunLabel=d;exports.SwappableOrbitButton=
|
|
87
|
+
`;exports.CanvasWrapper=n;exports.GlobalStyles=o;exports.OrbitalSimWrapper=l;exports.SunLabel=d;exports.SwappableOrbitButton=c;exports.SwappableOrbitsContainer=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e, { createGlobalStyle as t } from "styled-components";
|
|
3
3
|
import { Canvas as a } from "@react-three/fiber";
|
|
4
|
-
const
|
|
4
|
+
const o = t`
|
|
5
5
|
:root {
|
|
6
6
|
--white: #ffffff;
|
|
7
7
|
--black: #000000;
|
|
@@ -35,18 +35,20 @@ const i = t`
|
|
|
35
35
|
--headingWithSpaceHeight: 90px;
|
|
36
36
|
--tallestSquareWidget: calc(100vh - var(--pageNavHeight) - var(--siteHeaderHeight) - var(--headingWithSpaceHeight) - var(--minPadding));
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`, n = e.div`
|
|
39
39
|
position: relative;
|
|
40
40
|
overflow: hidden;
|
|
41
41
|
height: var(--tallestSquareWidget);
|
|
42
42
|
min-height: 500px;
|
|
43
43
|
background-color: #000000;
|
|
44
44
|
color-adjust: exact;
|
|
45
|
-
|
|
45
|
+
container-type: size;
|
|
46
|
+
container-name: orbital-sim-context;
|
|
47
|
+
`, l = e(a)`
|
|
46
48
|
position: relative;
|
|
47
49
|
z-index: 1;
|
|
48
50
|
`, d = e.div`
|
|
49
|
-
padding:
|
|
51
|
+
padding: 0px 4px;
|
|
50
52
|
margin-top: 4px;
|
|
51
53
|
font-weight: var(--medium);
|
|
52
54
|
color: var(--black);
|
|
@@ -64,6 +66,7 @@ const i = t`
|
|
|
64
66
|
z-index: 10;
|
|
65
67
|
background-color: #fff;
|
|
66
68
|
width: 10%;
|
|
69
|
+
min-width: fit-content;
|
|
67
70
|
height: 100%;
|
|
68
71
|
display: flex;
|
|
69
72
|
flex-direction: column;
|
|
@@ -86,9 +89,9 @@ const i = t`
|
|
|
86
89
|
}
|
|
87
90
|
`;
|
|
88
91
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
l as CanvasWrapper,
|
|
93
|
+
o as GlobalStyles,
|
|
94
|
+
n as OrbitalSimWrapper,
|
|
92
95
|
d as SunLabel,
|
|
93
96
|
p as SwappableOrbitButton,
|
|
94
97
|
c as SwappableOrbitsContainer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),h=require("react"),Y=require("react-i18next"),G=require("../../layout/AspectRatio/index.cjs"),J=require("../../atomic/Loader/index.cjs"),K=require("@rubin-epo/epo-react-lib/IconComposer"),Q=require("./MovingSourceMap/index.cjs"),C=require("./utils.cjs"),U=require("./styles.cjs"),Z=require("./Message/Message.cjs"),v=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),A=e=>e&&e.__esModule?e:{default:e},O=A(K),ee=(e,n)=>{var u;const t={day:0,hour:0},s=e[n];if(!s)return t;const o=(s==null?void 0:s.date)-((u=e[0])==null?void 0:u.date);return o?{day:Math.round(o)||0,hour:Math.round(24/o%24)||0}:t},te=(e,n,t)=>Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)<=Math.pow(t,2),se=(e,n,t)=>t?e[n]?[e[n].image]:[]:e.map(({image:s})=>s),S=({width:e=600,height:n=600,selectedSource:t=[],alerts:s=[],activeAlertIndex:o=0,alertChangeCallback:u,selectionCallback:k,blinkConfig:j,isDisplayOnly:a=!1,isLoading:y,className:_,movingSources:l=[]})=>{const[P,I]=h.useState(!0),[w,F]=h.useState(!a),[L,b]=h.useState(),[B,m]=h.useState(!1),{t:p}=Y.useTranslation(),q=!P&&!y,R=(i,d,f)=>{if(l)for(let c of l){const g=c.sources[o];if(te(i,{x:C.toDecimalPercent(g.x)*d,y:C.toDecimalPercent(g.y)*f},C.getRadius(c.type,c.radius)*d))return c.id}},T=()=>{b(p("source_selector.messages.failure")),m(!0)},V=()=>{F(i=>!i)},N=()=>{b(r.jsxs(r.Fragment,{children:[r.jsx(O.default,{icon:"checkmark"}),p("source_selector.messages.success")]})),m(!0)},W=({clientX:i,clientY:d,target:f})=>{if(!q||a)return;const{tagName:c,clientWidth:g,clientHeight:x}=f;if(c.toLowerCase()!=="img")return;const{left:H,top:X}=f.getBoundingClientRect(),M=R({x:i-H,y:x-d+X},g,x);if(M){if(t.includes(M))return;k&&k(t.concat(M)),N()}else T()},$=()=>{m(!1)},{day:z,hour:D}=ee(s,o),E=se(s,o,a);return r.jsxs(G.default,{ratio:1,className:_,children:[!a&&r.jsx(Z.default,{onMessageChangeCallback:$,isVisible:B,children:L}),l&&r.jsx(U.BackgroundBlinker,{images:E,activeIndex:o,blinkCallback:u,loadedCallback:()=>I(!1),onClickCallback:W,extraControls:s.length>0&&!a&&r.jsx(v.default,{day:z,hour:D}),interval:400,pauseCallback:V,...j,children:r.jsx(Q.default,{width:e,height:n,isPlaying:w,currentIndex:o,movingSources:l,selectedSource:t})}),!q&&r.jsx(J.default,{})]})};S.displayName="Widgets.MovingSourceSelector";exports.default=S;
|