@rubin-epo/epo-widget-lib 1.2.3 → 1.3.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/OrbitalSim.cjs +1 -1
- package/dist/OrbitalSim.d.ts +0 -2
- package/dist/OrbitalSim.js +6 -144
- package/dist/atomic/PlaybackControl/PlaybackControl.cjs +1 -1
- package/dist/atomic/PlaybackControl/PlaybackControl.js +5 -5
- package/dist/atomic/PlaybackControl/styles.cjs +8 -5
- package/dist/atomic/PlaybackControl/styles.d.ts +4 -0
- package/dist/atomic/PlaybackControl/styles.js +12 -8
- package/dist/localeStrings/es/epo-widget-lib.json +1 -1
- package/dist/style.css +1 -1
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.d.ts +0 -0
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -0
- package/dist/widgets/OrbitalSim/Context/index.d.ts +66 -0
- package/dist/widgets/OrbitalSim/Context/index.js +61 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.cjs +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.js +1 -1
- package/dist/widgets/OrbitalSim/Observation.cjs +1 -1
- package/dist/widgets/OrbitalSim/Observation.d.ts +1 -5
- package/dist/widgets/OrbitalSim/Observation.js +29 -39
- package/dist/widgets/OrbitalSim/Observations.cjs +1 -1
- package/dist/widgets/OrbitalSim/Observations.d.ts +1 -5
- package/dist/widgets/OrbitalSim/Observations.js +19 -23
- package/dist/widgets/OrbitalSim/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbital.d.ts +1 -4
- package/dist/widgets/OrbitalSim/Orbital.js +69 -70
- package/dist/widgets/OrbitalSim/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalDetails.d.ts +1 -13
- package/dist/widgets/OrbitalSim/OrbitalDetails.js +12 -15
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.d.ts +2 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.js +108 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.js +42 -42
- package/dist/widgets/OrbitalSim/Orbitals.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals.d.ts +1 -16
- package/dist/widgets/OrbitalSim/Orbitals.js +85 -104
- package/dist/widgets/OrbitalSim/PlaybackSpeed.cjs +1 -1
- package/dist/widgets/OrbitalSim/PlaybackSpeed.js +35 -36
- package/dist/widgets/OrbitalSim/PotentialOrbits.cjs +1 -1
- package/dist/widgets/OrbitalSim/PotentialOrbits.d.ts +1 -9
- package/dist/widgets/OrbitalSim/PotentialOrbits.js +27 -35
- package/dist/widgets/OrbitalSim/index.d.ts +2 -23
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +2 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +37 -34
- package/package.json +1 -1
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as s, Fragment as m } from "react/jsx-runtime";
|
|
3
3
|
import { useState as x } from "react";
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { getCurve as
|
|
8
|
-
const h = ({ data:
|
|
9
|
-
const [
|
|
10
|
-
const { a:
|
|
11
|
-
return (i || []).map((
|
|
12
|
-
const { position:
|
|
13
|
-
return
|
|
4
|
+
import p from "../../node_modules/prop-types/index.js";
|
|
5
|
+
import * as b from "three";
|
|
6
|
+
import g from "./Observation.js";
|
|
7
|
+
import { getCurve as T, convert2dTo3d as l, auToUnit as y, getMinorAxis as j, getFocus as A } from "./orbitalUtilities.js";
|
|
8
|
+
const h = ({ data: n, observations: i }) => {
|
|
9
|
+
const [c] = x(() => {
|
|
10
|
+
const { a: t, e } = n, o = y(t), r = j(t, e), u = A(o, r), a = new b.Vector3(u, 0, 0), f = T(o, r, a.x, a.y);
|
|
11
|
+
return (i || []).map((v) => {
|
|
12
|
+
const { position: d } = v;
|
|
13
|
+
return l(f.getPoint(d), n);
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
16
|
+
return /* @__PURE__ */ s(m, { children: c && /* @__PURE__ */ s(m, { children: c.map((t, e) => {
|
|
17
|
+
const o = i[e], { id: r } = o;
|
|
18
|
+
return /* @__PURE__ */ s(
|
|
19
|
+
g,
|
|
20
20
|
{
|
|
21
|
-
data:
|
|
22
|
-
vector:
|
|
23
|
-
selectionCallback: f,
|
|
24
|
-
activeObs: u
|
|
21
|
+
data: o,
|
|
22
|
+
vector: t
|
|
25
23
|
},
|
|
26
24
|
r
|
|
27
25
|
);
|
|
28
26
|
}) }) });
|
|
29
27
|
};
|
|
30
28
|
h.propTypes = {
|
|
31
|
-
data:
|
|
32
|
-
observations:
|
|
33
|
-
selectionCallback: e.func,
|
|
34
|
-
activeObs: e.object
|
|
29
|
+
data: p.object,
|
|
30
|
+
observations: p.array
|
|
35
31
|
};
|
|
36
32
|
export {
|
|
37
33
|
h as default
|
|
@@ -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"),
|
|
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"),fe=require("three"),xe=require("@react-three/fiber"),h=require("@react-three/drei"),t=require("./orbitalUtilities.cjs"),g=require("./OrbitalSim.module.css.cjs"),pe=require("./chartColors.module.css.cjs"),je=require("./Context/index.cjs"),ye=require("react-i18next");function be(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=be(fe),_=({data:i,selectionCallback:f,active:a,playing:j,dayPerVizSec:F,stepDirection:I,frameOverride:L,orbitColor:G,objectColor:R,objectRadius:k,initialized:w,initCallback:C,devMode:D,zoomMod:Z,defaultZoom:U,type:K,noLabels:Y,reset:A})=>{const{t:$}=ye.useTranslation(),{orbits:J}=je.useOrbitalSimContext(),{activeVelocityCallback:Q}=J,W=r.useRef(),{a:z,e:X,i:ee,M:te,Node:B,Peri:V,Principal_desig:oe,Translated_desig_key:q,name:se}=i||{},[re]=r.useState(()=>[0,t.degsToRads(ee),B?t.degsToRads(B):0]),[n]=r.useState(()=>t.auToUnit(z)),[y]=r.useState(()=>t.getMinorAxis(z,X)),[ie]=r.useState(()=>t.getFocus(n,y)),[s]=r.useState(new M.Vector3(ie,0,0)),[d]=r.useState(new M.Vector3(0,0,0)),[ae,ne]=r.useState(!1),[u]=r.useState(()=>t.getCurve(n,y,s.x,s.y)),[le]=r.useState(()=>t.getLineGeometry(u.getPoints(360))),b=t.getPosFromArcLength(0,u),[x,v]=r.useState({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(d),n),period:0});r.useEffect(()=>{A>0&&v({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(d),n),period:0})},[A]);function ce(m){let l=0,c=t.getPosFromArcLength(l,u);if(m){const S=m>180,O=S?m-180:m;let p=t.getAngleFromPos(c,d);for(;p<O;)l+=.01,c=t.getPosFromArcLength(l,u),p=t.getAngleFromPos(c,d);S&&(l+=.5,c=t.getPosFromArcLength(l,u))}return C?C():ne(!0),{position:c,rotation:[0,0,0],progress:l,velocity:t.getVelocity(c.distanceTo(d),n),period:0}}function H(m,P){const{progress:l,position:c,velocity:S,period:O}=x,p=m?0:P*(F||t.DAY_PER_VIZ_SEC),de=S*p*I,T=l+de/u.getLength(),E=T>1?1-T:T,{x:ue,y:me}=u.getPoint(E),he=new M.Vector3(ue,me,0),ge=t.getVelocity(c.distanceTo(d),n);let N=p+O;T>1&&(N=0),v({...x,position:he,progress:E,velocity:ge,period:N})}return r.useEffect(()=>{v(ce(te||Math.floor(Math.random()*Math.floor(180))))},[]),r.useEffect(()=>{L&&H(!1,1/60)},[L]),r.useEffect(()=>{a&&Q(t.auToMeters(t.unitToAu(x.velocity/1e5)))},[x]),xe.useFrame((m,P)=>{(w||ae)&&H(!j,P)}),e.jsx("group",{rotation:re,children:e.jsxs("group",{rotation:[0,0,V?t.degsToRads(V+90):0],children:[e.jsx("line",{ref:W,geometry:le,children:e.jsx("lineBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.orbitHighlight:G||t.ORBITAL_COLORS.asteroid.orbitColor})}),e.jsxs("mesh",{position:x.position,onClick:()=>f(i,"neo"),children:[(K==="planet"||!Y||a)&&e.jsx(h.Html,{children:e.jsx("button",{type:"button",className:g.default.label,style:{fontSize:t.getLabelSize(Z,U)},onClick:()=>f(i,"neo"),children:q?$(q):se||oe})}),e.jsx("sphereGeometry",{attach:"geometry",args:[k||4,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.objectHighlight:R||t.ORBITAL_COLORS.asteroid.objectColor})]}),D&&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:pe.default.chart1}),e.jsx(h.Html,{children:e.jsx("div",{className:g.default.label,children:"center"})})]}),e.jsxs("mesh",{position:d,children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:R||"blue"}),e.jsx(h.Html,{children:e.jsx("div",{className:g.default.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(h.Html,{children:e.jsx("div",{className:g.default.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(h.Html,{children:e.jsx("div",{className:g.default.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(h.Html,{children:e.jsx("div",{className:g.default.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(h.Html,{children:e.jsx("div",{className:g.default.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,noLabels:o.default.bool,reset:o.default.number};exports.default=_;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as PropTypes } from 'prop-types';
|
|
2
2
|
export default Orbital;
|
|
3
|
-
declare function Orbital({ data, selectionCallback, active, playing, dayPerVizSec, stepDirection, frameOverride, orbitColor, objectColor, objectRadius, initialized, initCallback, devMode,
|
|
3
|
+
declare function Orbital({ data, selectionCallback, active, playing, dayPerVizSec, stepDirection, frameOverride, orbitColor, objectColor, objectRadius, initialized, initCallback, devMode, zoomMod, defaultZoom, type, noLabels, reset }: {
|
|
4
4
|
data: any;
|
|
5
5
|
selectionCallback: any;
|
|
6
6
|
active: any;
|
|
@@ -14,13 +14,11 @@ declare function Orbital({ data, selectionCallback, active, playing, dayPerVizSe
|
|
|
14
14
|
initialized: any;
|
|
15
15
|
initCallback: any;
|
|
16
16
|
devMode: any;
|
|
17
|
-
activeVelocityCallback: any;
|
|
18
17
|
zoomMod: any;
|
|
19
18
|
defaultZoom: any;
|
|
20
19
|
type: any;
|
|
21
20
|
noLabels: any;
|
|
22
21
|
reset: any;
|
|
23
|
-
t: any;
|
|
24
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
declare namespace Orbital {
|
|
26
24
|
namespace defaultProps {
|
|
@@ -47,6 +45,5 @@ declare namespace Orbital {
|
|
|
47
45
|
export { type_1 as type };
|
|
48
46
|
export let noLabels: PropTypes.Requireable<boolean>;
|
|
49
47
|
export let reset: PropTypes.Requireable<number>;
|
|
50
|
-
export let t: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as r, Fragment as Pe } from "react/jsx-runtime";
|
|
3
|
-
import { useRef as
|
|
3
|
+
import { useRef as Me, useState as i, useEffect as P } from "react";
|
|
4
4
|
import t from "../../node_modules/prop-types/index.js";
|
|
5
5
|
import * as L from "three";
|
|
6
|
-
import { useFrame as
|
|
6
|
+
import { useFrame as Te } from "@react-three/fiber";
|
|
7
7
|
import { Html as h } from "@react-three/drei";
|
|
8
|
-
import { degsToRads as N, auToUnit as
|
|
8
|
+
import { degsToRads as N, auToUnit as Ce, getMinorAxis as ze, getFocus as je, getCurve as Be, getLineGeometry as Le, getPosFromArcLength as M, getVelocity as T, auToMeters as Ne, unitToAu as Ve, ORBITAL_COLORS as C, getLabelSize as Ge, getAngleFromPos as D, DAY_PER_VIZ_SEC as Re } from "./orbitalUtilities.js";
|
|
9
9
|
import d from "./OrbitalSim.module.css.js";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import Se from "./chartColors.module.css.js";
|
|
11
|
+
import { useOrbitalSimContext as _e } from "./Context/index.js";
|
|
12
|
+
import { useTranslation as Ae } from "react-i18next";
|
|
13
|
+
const H = ({
|
|
14
|
+
data: z,
|
|
15
|
+
selectionCallback: V,
|
|
14
16
|
active: y,
|
|
15
17
|
playing: Z,
|
|
16
18
|
dayPerVizSec: K,
|
|
17
19
|
stepDirection: U,
|
|
18
|
-
frameOverride:
|
|
20
|
+
frameOverride: G,
|
|
19
21
|
orbitColor: Y,
|
|
20
22
|
objectColor: R,
|
|
21
23
|
objectRadius: q,
|
|
22
24
|
initialized: J,
|
|
23
|
-
initCallback:
|
|
25
|
+
initCallback: S,
|
|
24
26
|
devMode: Q,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
reset: A,
|
|
31
|
-
t: oe
|
|
27
|
+
zoomMod: W,
|
|
28
|
+
defaultZoom: X,
|
|
29
|
+
type: $,
|
|
30
|
+
noLabels: ee,
|
|
31
|
+
reset: _
|
|
32
32
|
}) => {
|
|
33
|
-
const ie =
|
|
34
|
-
a:
|
|
35
|
-
e:
|
|
36
|
-
i:
|
|
37
|
-
M:
|
|
38
|
-
Node:
|
|
39
|
-
Peri:
|
|
40
|
-
Principal_desig:
|
|
41
|
-
Translated_desig_key:
|
|
42
|
-
name:
|
|
43
|
-
} =
|
|
33
|
+
const { t: te } = Ae(), { orbits: oe } = _e(), { activeVelocityCallback: ie } = oe, re = Me(), {
|
|
34
|
+
a: A,
|
|
35
|
+
e: se,
|
|
36
|
+
i: ae,
|
|
37
|
+
M: ne,
|
|
38
|
+
Node: k,
|
|
39
|
+
Peri: w,
|
|
40
|
+
Principal_desig: le,
|
|
41
|
+
Translated_desig_key: E,
|
|
42
|
+
name: ce
|
|
43
|
+
} = z || {}, [me] = i(() => [
|
|
44
44
|
0,
|
|
45
|
-
N(
|
|
46
|
-
|
|
47
|
-
]), [s] = i(() =>
|
|
48
|
-
() =>
|
|
49
|
-
), [
|
|
45
|
+
N(ae),
|
|
46
|
+
k ? N(k) : 0
|
|
47
|
+
]), [s] = i(() => Ce(A)), [u] = i(() => ze(A, se)), [he] = i(() => je(s, u)), [o] = i(new L.Vector3(he, 0, 0)), [l] = i(new L.Vector3(0, 0, 0)), [de, pe] = i(!1), [c] = i(
|
|
48
|
+
() => Be(s, u, o.x, o.y)
|
|
49
|
+
), [ge] = i(() => Le(c.getPoints(360))), f = M(0, c), [p, j] = i({
|
|
50
50
|
position: f,
|
|
51
51
|
rotation: [0, 0, 0],
|
|
52
52
|
progress: 0,
|
|
53
53
|
velocity: T(f.distanceTo(l), s),
|
|
54
54
|
period: 0
|
|
55
55
|
});
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
P(() => {
|
|
57
|
+
_ > 0 && j({
|
|
58
58
|
position: f,
|
|
59
59
|
rotation: [0, 0, 0],
|
|
60
60
|
progress: 0,
|
|
61
61
|
velocity: T(f.distanceTo(l), s),
|
|
62
62
|
period: 0
|
|
63
63
|
});
|
|
64
|
-
}, [
|
|
65
|
-
function
|
|
64
|
+
}, [_]);
|
|
65
|
+
function ye(m) {
|
|
66
66
|
let a = 0, n = M(a, c);
|
|
67
67
|
if (m) {
|
|
68
68
|
const x = m > 180, B = x ? m - 180 : m;
|
|
69
|
-
let g =
|
|
69
|
+
let g = D(n, l);
|
|
70
70
|
for (; g < B; )
|
|
71
|
-
a += 0.01, n = M(a, c), g =
|
|
71
|
+
a += 0.01, n = M(a, c), g = D(n, l);
|
|
72
72
|
x && (a += 0.5, n = M(a, c));
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return S ? S() : pe(!0), {
|
|
75
75
|
position: n,
|
|
76
76
|
rotation: [0, 0, 0],
|
|
77
77
|
progress: a,
|
|
@@ -79,54 +79,54 @@ const O = ({
|
|
|
79
79
|
period: 0
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function F(m, b) {
|
|
83
83
|
const {
|
|
84
84
|
progress: a,
|
|
85
85
|
position: n,
|
|
86
86
|
velocity: x,
|
|
87
87
|
period: B
|
|
88
|
-
} = p, g = m ? 0 : b * (K ||
|
|
89
|
-
let
|
|
90
|
-
|
|
88
|
+
} = p, g = m ? 0 : b * (K || Re), ue = x * g * U, v = a + ue / c.getLength(), I = v > 1 ? 1 - v : v, { x: fe, y: be } = c.getPoint(I), xe = new L.Vector3(fe, be, 0), ve = T(n.distanceTo(l), s);
|
|
89
|
+
let O = g + B;
|
|
90
|
+
v > 1 && (O = 0), j({
|
|
91
91
|
...p,
|
|
92
|
-
position:
|
|
93
|
-
progress:
|
|
94
|
-
velocity:
|
|
95
|
-
period:
|
|
92
|
+
position: xe,
|
|
93
|
+
progress: I,
|
|
94
|
+
velocity: ve,
|
|
95
|
+
period: O
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
return
|
|
99
|
-
j(
|
|
100
|
-
}, []),
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
y &&
|
|
104
|
-
}, [p]),
|
|
105
|
-
(J ||
|
|
106
|
-
}), /* @__PURE__ */ e("group", { rotation:
|
|
107
|
-
/* @__PURE__ */ e("line", { ref:
|
|
98
|
+
return P(() => {
|
|
99
|
+
j(ye(ne || Math.floor(Math.random() * Math.floor(180))));
|
|
100
|
+
}, []), P(() => {
|
|
101
|
+
G && F(!1, 1 / 60);
|
|
102
|
+
}, [G]), P(() => {
|
|
103
|
+
y && ie(Ne(Ve(p.velocity / 1e5)));
|
|
104
|
+
}, [p]), Te((m, b) => {
|
|
105
|
+
(J || de) && F(!Z, b);
|
|
106
|
+
}), /* @__PURE__ */ e("group", { rotation: me, children: /* @__PURE__ */ r("group", { rotation: [0, 0, w ? N(w + 90) : 0], children: [
|
|
107
|
+
/* @__PURE__ */ e("line", { ref: re, geometry: ge, children: /* @__PURE__ */ e(
|
|
108
108
|
"lineBasicMaterial",
|
|
109
109
|
{
|
|
110
110
|
attach: "material",
|
|
111
|
-
color: y ?
|
|
111
|
+
color: y ? C.asteroid.orbitHighlight : Y || C.asteroid.orbitColor
|
|
112
112
|
}
|
|
113
113
|
) }),
|
|
114
114
|
/* @__PURE__ */ r(
|
|
115
115
|
"mesh",
|
|
116
116
|
{
|
|
117
117
|
position: p.position,
|
|
118
|
-
onClick: () =>
|
|
118
|
+
onClick: () => V(z, "neo"),
|
|
119
119
|
children: [
|
|
120
|
-
(
|
|
120
|
+
($ === "planet" || !ee || y) && /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(
|
|
121
121
|
"button",
|
|
122
122
|
{
|
|
123
123
|
type: "button",
|
|
124
124
|
className: d.label,
|
|
125
125
|
style: {
|
|
126
|
-
fontSize: Ge(
|
|
126
|
+
fontSize: Ge(W, X)
|
|
127
127
|
},
|
|
128
|
-
onClick: () =>
|
|
129
|
-
children:
|
|
128
|
+
onClick: () => V(z, "neo"),
|
|
129
|
+
children: E ? te(E) : ce || le
|
|
130
130
|
}
|
|
131
131
|
) }),
|
|
132
132
|
/* @__PURE__ */ e(
|
|
@@ -140,7 +140,7 @@ const O = ({
|
|
|
140
140
|
"meshBasicMaterial",
|
|
141
141
|
{
|
|
142
142
|
attach: "material",
|
|
143
|
-
color: y ?
|
|
143
|
+
color: y ? C.asteroid.objectHighlight : R || C.asteroid.objectColor
|
|
144
144
|
}
|
|
145
145
|
)
|
|
146
146
|
]
|
|
@@ -149,7 +149,7 @@ const O = ({
|
|
|
149
149
|
Q && /* @__PURE__ */ r(Pe, { children: [
|
|
150
150
|
/* @__PURE__ */ r("mesh", { position: o, children: [
|
|
151
151
|
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
152
|
-
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color:
|
|
152
|
+
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: Se.chart1 }),
|
|
153
153
|
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e("div", { className: d.label, children: "center" }) })
|
|
154
154
|
] }),
|
|
155
155
|
/* @__PURE__ */ r("mesh", { position: l, children: [
|
|
@@ -226,10 +226,10 @@ const O = ({
|
|
|
226
226
|
] })
|
|
227
227
|
] }) });
|
|
228
228
|
};
|
|
229
|
-
|
|
229
|
+
H.defaultProps = {
|
|
230
230
|
type: "object"
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
H.propTypes = {
|
|
233
233
|
data: t.object,
|
|
234
234
|
selectionCallback: t.func,
|
|
235
235
|
active: t.bool,
|
|
@@ -248,9 +248,8 @@ O.propTypes = {
|
|
|
248
248
|
defaultZoom: t.number,
|
|
249
249
|
type: t.string,
|
|
250
250
|
noLabels: t.bool,
|
|
251
|
-
reset: t.number
|
|
252
|
-
t: t.func
|
|
251
|
+
reset: t.number
|
|
253
252
|
};
|
|
254
253
|
export {
|
|
255
|
-
|
|
254
|
+
H as default
|
|
256
255
|
};
|
|
@@ -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"),d=require("react"),l=require("./OrbitalSim.module.css.cjs"),r=require("@rubin-epo/epo-react-lib/Slideout"),c=require("@rubin-epo/epo-react-lib/Button"),f=require("./Context/index.cjs"),u=t=>t&&t.__esModule?t:{default:t},h=u(r),n=u(c);function m(){const{orbits:t}=f.useOrbitalSimContext(),{detailsRows:s}=t,[i,a]=d.useState(!1);return d.useEffect(()=>{s&&a(!0)},[s]),e.jsxs(e.Fragment,{children:[e.jsx(n.default,{styleAs:"secondary",className:l.default["details-toggle"],isInactive:s,onClick:()=>a(!i),children:"Show Details"}),e.jsx(h.default,{className:l.default.slideout,slideFrom:"left",isOpen:!i,children:e.jsxs("div",{className:l.default.slideoutPanel,style:{width:"50ch"},children:[e.jsx("h3",{children:"Orbital Details"}),s&&s.map(o=>e.jsxs("div",{className:l.default.slideoutRow,children:[e.jsx("div",{className:l.default.slideoutCol,"data-align":"left",children:e.jsx("p",{children:o.rowTitle})}),e.jsx("div",{className:l.default.slideoutCol,"data-align":"right",dangerouslySetInnerHTML:{__html:o.rowContent}})]})),e.jsx(n.default,{isBlock:!0,onClick:()=>a(!i),children:"Close"})]})})]})}exports.default=m;
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
import { default as PropTypes } from 'prop-types';
|
|
2
1
|
export default OrbitalDetails;
|
|
3
|
-
declare function OrbitalDetails(
|
|
4
|
-
rows: any;
|
|
5
|
-
velocity: any;
|
|
6
|
-
type: any;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare namespace OrbitalDetails {
|
|
9
|
-
namespace propTypes {
|
|
10
|
-
let data: PropTypes.Requireable<object>;
|
|
11
|
-
let velocity: PropTypes.Requireable<number>;
|
|
12
|
-
let type: PropTypes.Requireable<string>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
2
|
+
declare function OrbitalDetails(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as o, Fragment as c, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useState as d, useEffect as m } from "react";
|
|
4
|
-
import a from "../../node_modules/prop-types/index.js";
|
|
5
4
|
import t from "./OrbitalSim.module.css.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import u from "@rubin-epo/epo-react-lib/Slideout";
|
|
6
|
+
import a from "@rubin-epo/epo-react-lib/Button";
|
|
7
|
+
import { useOrbitalSimContext as h } from "./Context/index.js";
|
|
8
|
+
function N() {
|
|
9
|
+
const { orbits: n } = h(), {
|
|
10
|
+
detailsRows: i
|
|
11
|
+
} = n, [l, s] = d(!1);
|
|
10
12
|
return m(() => {
|
|
11
13
|
i && s(!0);
|
|
12
14
|
}, [i]), /* @__PURE__ */ o(c, { children: [
|
|
13
15
|
/* @__PURE__ */ e(
|
|
14
|
-
|
|
16
|
+
a,
|
|
15
17
|
{
|
|
16
18
|
styleAs: "secondary",
|
|
17
19
|
className: t["details-toggle"],
|
|
@@ -20,7 +22,7 @@ function u({ rows: i, velocity: h, type: f }) {
|
|
|
20
22
|
children: "Show Details"
|
|
21
23
|
}
|
|
22
24
|
),
|
|
23
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(u, { className: t.slideout, slideFrom: "left", isOpen: !l, children: /* @__PURE__ */ o(
|
|
24
26
|
"div",
|
|
25
27
|
{
|
|
26
28
|
className: t.slideoutPanel,
|
|
@@ -29,12 +31,12 @@ function u({ rows: i, velocity: h, type: f }) {
|
|
|
29
31
|
},
|
|
30
32
|
children: [
|
|
31
33
|
/* @__PURE__ */ e("h3", { children: "Orbital Details" }),
|
|
32
|
-
i.map((r) => /* @__PURE__ */ o("div", { className: t.slideoutRow, children: [
|
|
34
|
+
i && i.map((r) => /* @__PURE__ */ o("div", { className: t.slideoutRow, children: [
|
|
33
35
|
/* @__PURE__ */ e("div", { className: t.slideoutCol, "data-align": "left", children: /* @__PURE__ */ e("p", { children: r.rowTitle }) }),
|
|
34
36
|
/* @__PURE__ */ e("div", { className: t.slideoutCol, "data-align": "right", dangerouslySetInnerHTML: { __html: r.rowContent } })
|
|
35
37
|
] })),
|
|
36
38
|
/* @__PURE__ */ e(
|
|
37
|
-
|
|
39
|
+
a,
|
|
38
40
|
{
|
|
39
41
|
isBlock: !0,
|
|
40
42
|
onClick: () => s(!l),
|
|
@@ -46,11 +48,6 @@ function u({ rows: i, velocity: h, type: f }) {
|
|
|
46
48
|
) })
|
|
47
49
|
] });
|
|
48
50
|
}
|
|
49
|
-
u.propTypes = {
|
|
50
|
-
data: a.object,
|
|
51
|
-
velocity: a.number,
|
|
52
|
-
type: a.string
|
|
53
|
-
};
|
|
54
51
|
export {
|
|
55
|
-
|
|
52
|
+
N as default
|
|
56
53
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),t=require("react"),N=require("@react-three/fiber"),R=require("react-i18next"),_=require("./OrbitalDetails.cjs"),E=require("./CameraController.cjs"),F=require("./Camera.cjs"),I=require("./Orbitals.cjs"),M=require("./Sun.cjs"),V=require("./PlaybackSpeed.cjs"),w=require("./Controls/PlaybackControls.cjs"),q=require("./OrbitalSim.module.css.cjs"),A=require("./Context/index.cjs");function B(){console.info("Inside orbital sim!");const{orbits:h}=A.useOrbitalSimContext(),{paused:r,pov:v,defaultZoom:l,potentialOrbits:m,noDetails:O,noControls:C=!1}=h,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=t.useState(!r);t.useState(null);const[g,o]=t.useState(1),[y,S]=t.useState(0),[b,x]=t.useState(r?0:u.initial),[p,c]=t.useState(0),[i,d]=t.useState(0),[j,D]=t.useState(1),{t:P}=R.useTranslation();t.useEffect(()=>{i>0?(x(u.initial),o(1),c(0),d(-1)):i<0&&(c(0),a(!0),d(0))},[i]);const Z=s=>{x(+s)},T=()=>{n||o(1),a(!n)},k=()=>{a(s=>!1),d(s=>s+1)},z=s=>{a(!1),o(1),S(f=>f+1)},L=s=>{a(!1),o(-1),S(f=>f+1)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:q.default.container,children:[!m&&!O&&e.jsx(_.default,{}),!r&&e.jsx(V.default,{elapsedTime:p,dayPerVizSec:b,speeds:u,sliderOnChangeCallback:Z}),!C&&e.jsx(w.default,{playing:n,handleStartStop:T,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:k}),e.jsxs(N.Canvas,{className:q.default["orbital-canvas"],children:[e.jsx(E.default,{pov:v,reset:i}),e.jsx(F.default,{left:5e3,right:15e3,top:15e3,bottom:-15e3,near:.1,far:3e4,position:[0,0,8e3],defaultZoom:l||1}),e.jsx("ambientLight",{intensity:.9}),e.jsx(I.default,{defaultZoom:l||1,playing:n,stepDirection:g,dayPerVizSec:b,frameOverride:y,potentialOrbits:m,elapsedTime:p,setElapsedTime:c,reset:i,zoomLevel:j,setZoomLevel:D}),e.jsx(M.default,{zoomLevel:j,defaultZoom:l||1,t:P})]})]})})}exports.default=B;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, Fragment as F, jsxs as C } from "react/jsx-runtime";
|
|
3
|
+
import { useState as t, useEffect as R } from "react";
|
|
4
|
+
import { Canvas as V } from "@react-three/fiber";
|
|
5
|
+
import { useTranslation as I } from "react-i18next";
|
|
6
|
+
import q from "./OrbitalDetails.js";
|
|
7
|
+
import w from "./CameraController.js";
|
|
8
|
+
import A from "./Camera.js";
|
|
9
|
+
import B from "./Orbitals.js";
|
|
10
|
+
import G from "./Sun.js";
|
|
11
|
+
import H from "./PlaybackSpeed.js";
|
|
12
|
+
import J from "./Controls/PlaybackControls.js";
|
|
13
|
+
import y from "./OrbitalSim.module.css.js";
|
|
14
|
+
import { useOrbitalSimContext as K } from "./Context/index.js";
|
|
15
|
+
function re() {
|
|
16
|
+
console.info("Inside orbital sim!");
|
|
17
|
+
const { orbits: O } = K(), {
|
|
18
|
+
paused: n,
|
|
19
|
+
pov: D,
|
|
20
|
+
defaultZoom: l,
|
|
21
|
+
potentialOrbits: d,
|
|
22
|
+
noDetails: g,
|
|
23
|
+
noControls: x = !1
|
|
24
|
+
} = O, m = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [a, i] = t(!n);
|
|
25
|
+
t(null);
|
|
26
|
+
const [P, r] = t(1), [Z, u] = t(0), [b, S] = t(n ? 0 : m.initial), [h, c] = t(0), [s, f] = t(0), [v, k] = t(1), { t: z } = I();
|
|
27
|
+
R(() => {
|
|
28
|
+
s > 0 ? (S(m.initial), r(1), c(0), f(-1)) : s < 0 && (c(0), i(!0), f(0));
|
|
29
|
+
}, [s]);
|
|
30
|
+
const L = (o) => {
|
|
31
|
+
S(+o);
|
|
32
|
+
}, N = () => {
|
|
33
|
+
a || r(1), i(!a);
|
|
34
|
+
}, T = () => {
|
|
35
|
+
i((o) => !1), f((o) => o + 1);
|
|
36
|
+
}, j = (o) => {
|
|
37
|
+
i(!1), r(1), u((p) => p + 1);
|
|
38
|
+
}, E = (o) => {
|
|
39
|
+
i(!1), r(-1), u((p) => p + 1);
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ e(F, { children: /* @__PURE__ */ C("div", { className: y.container, children: [
|
|
42
|
+
!d && !g && /* @__PURE__ */ e(q, {}),
|
|
43
|
+
!n && /* @__PURE__ */ e(
|
|
44
|
+
H,
|
|
45
|
+
{
|
|
46
|
+
elapsedTime: h,
|
|
47
|
+
dayPerVizSec: b,
|
|
48
|
+
speeds: m,
|
|
49
|
+
sliderOnChangeCallback: L
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
!x && /* @__PURE__ */ e(
|
|
53
|
+
J,
|
|
54
|
+
{
|
|
55
|
+
playing: a,
|
|
56
|
+
handleStartStop: N,
|
|
57
|
+
handleNext: j,
|
|
58
|
+
handlePrevious: E,
|
|
59
|
+
isDisabled: !1,
|
|
60
|
+
handleReset: T
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ C(V, { className: y["orbital-canvas"], children: [
|
|
64
|
+
/* @__PURE__ */ e(w, { pov: D, reset: s }),
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
A,
|
|
67
|
+
{
|
|
68
|
+
left: 5e3,
|
|
69
|
+
right: 15e3,
|
|
70
|
+
top: 15e3,
|
|
71
|
+
bottom: -15e3,
|
|
72
|
+
near: 0.1,
|
|
73
|
+
far: 3e4,
|
|
74
|
+
position: [0, 0, 8e3],
|
|
75
|
+
defaultZoom: l || 1
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ e("ambientLight", { intensity: 0.9 }),
|
|
79
|
+
/* @__PURE__ */ e(
|
|
80
|
+
B,
|
|
81
|
+
{
|
|
82
|
+
defaultZoom: l || 1,
|
|
83
|
+
playing: a,
|
|
84
|
+
stepDirection: P,
|
|
85
|
+
dayPerVizSec: b,
|
|
86
|
+
frameOverride: Z,
|
|
87
|
+
potentialOrbits: d,
|
|
88
|
+
elapsedTime: h,
|
|
89
|
+
setElapsedTime: c,
|
|
90
|
+
reset: s,
|
|
91
|
+
zoomLevel: v,
|
|
92
|
+
setZoomLevel: k
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ e(
|
|
96
|
+
G,
|
|
97
|
+
{
|
|
98
|
+
zoomLevel: v,
|
|
99
|
+
defaultZoom: l || 1,
|
|
100
|
+
t: z
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] })
|
|
104
|
+
] }) });
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
re as default
|
|
108
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_container_8ubzd_35",d="_label_8ubzd_227",l="_details_8ubzd_266",_="_disabled_8ubzd_308",a="_slideoutPanel_8ubzd_312",t="_slideoutRow_8ubzd_325",s="_slideoutCol_8ubzd_330",i="_slideout_8ubzd_312",b={container:e,"orbital-canvas":"_orbital-canvas_8ubzd_43","playback-speed-slider-header":"_playback-speed-slider-header_8ubzd_48","playback-speed-title":"_playback-speed-title_8ubzd_61","playback-speed-slider-label":"_playback-speed-slider-label_8ubzd_70","playback-speed-slider-label-bottom":"_playback-speed-slider-label-bottom_8ubzd_78","playback-speed-slider-label-top":"_playback-speed-slider-label-top_8ubzd_79","playback-speed-slider":"_playback-speed-slider_8ubzd_48","elapsed-time-container":"_elapsed-time-container_8ubzd_115","elapsed-time-title":"_elapsed-time-title_8ubzd_131","elapsed-time-inner":"_elapsed-time-inner_8ubzd_139","elapsed-time-divider":"_elapsed-time-divider_8ubzd_148","elapsed-time-block":"_elapsed-time-block_8ubzd_155","elapsed-val":"_elapsed-val_8ubzd_159","elapsed-label":"_elapsed-label_8ubzd_168","padded-drawer-inner":"_padded-drawer-inner_8ubzd_176","nav-item":"_nav-item_8ubzd_187","md-list-tile":"_md-list-tile_8ubzd_187","md-tile-addon":"_md-tile-addon_8ubzd_192","md-tile-text--primary":"_md-tile-text--primary_8ubzd_205","md-text--theme-primary":"_md-text--theme-primary_8ubzd_206","md-text":"_md-text_8ubzd_206","active-item":"_active-item_8ubzd_211",label:d,"obs-mesh":"_obs-mesh_8ubzd_238","obs-label":"_obs-label_8ubzd_242","obs-answer":"_obs-answer_8ubzd_249","obs-hover":"_obs-hover_8ubzd_250","obs-active":"_obs-active_8ubzd_255",details:l,"details-table":"_details-table_8ubzd_277","active-details":"_active-details_8ubzd_287","details-toggle":"_details-toggle_8ubzd_297",disabled:_,slideoutPanel:a,slideoutRow:t,slideoutCol:s,slideout:i};exports.container=e;exports.default=b;exports.details=l;exports.disabled=_;exports.label=d;exports.slideout=i;exports.slideoutCol=s;exports.slideoutPanel=a;exports.slideoutRow=t;
|