@rubin-epo/epo-widget-lib 2.0.2 → 2.0.4
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/localeStrings/en/epo-widget-lib.json +12 -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/Context/OrbitalSimContext.types.d.ts +57 -0
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
- package/dist/widgets/OrbitalSim/Context/index.d.ts +2 -38
- package/dist/widgets/OrbitalSim/Context/index.js +61 -39
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.cjs +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.js +53 -68
- package/dist/widgets/OrbitalSim/Controls/styles.cjs +38 -32
- package/dist/widgets/OrbitalSim/Controls/styles.d.ts +1 -0
- package/dist/widgets/OrbitalSim/Controls/styles.js +53 -46
- package/dist/widgets/OrbitalSim/Observations/Observation.cjs +1 -1
- package/dist/widgets/OrbitalSim/Observations/Observation.js +11 -10
- package/dist/widgets/OrbitalSim/Observations/styles.cjs +11 -0
- package/dist/widgets/OrbitalSim/Observations/styles.d.ts +1 -0
- package/dist/widgets/OrbitalSim/Observations/styles.js +16 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +94 -77
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.js +2 -4
- 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 +19 -17
- 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/Orbitals/styles.cjs +15 -8
- package/dist/widgets/OrbitalSim/Orbitals/styles.js +17 -10
- package/dist/widgets/OrbitalSim/Sun.cjs +1 -1
- package/dist/widgets/OrbitalSim/Sun.js +13 -14
- 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 +47 -12
- package/dist/widgets/OrbitalSim/styles.d.ts +3 -0
- package/dist/widgets/OrbitalSim/styles.js +52 -14
- 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/package.json +2 -1
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.d.ts +0 -0
- 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
|
@@ -1,64 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { GlobalStyles as
|
|
12
|
-
import { useOrbitalSimContext as
|
|
13
|
-
function
|
|
14
|
-
const { orbits:
|
|
15
|
-
paused:
|
|
16
|
-
pov:
|
|
17
|
-
defaultZoom:
|
|
18
|
-
potentialOrbits:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
import { jsxs as s, Fragment as h, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useState as i, useEffect as B } from "react";
|
|
4
|
+
import G from "./Orbitals/OrbitalDetails.js";
|
|
5
|
+
import N from "./Camera/CameraController.js";
|
|
6
|
+
import q from "./Camera/Camera.js";
|
|
7
|
+
import A from "./Orbitals/Orbitals.js";
|
|
8
|
+
import H from "./Sun.js";
|
|
9
|
+
import I from "./Controls/PlaybackSpeed.js";
|
|
10
|
+
import J from "./Controls/PlaybackControls.js";
|
|
11
|
+
import { GlobalStyles as K, OrbitalSimWrapper as M, SwappableOrbitsContainer as Q, SwappableOrbitButton as U, CanvasWrapper as X } from "./styles.js";
|
|
12
|
+
import { useOrbitalSimContext as Y } from "./Context/index.js";
|
|
13
|
+
function ce() {
|
|
14
|
+
const { orbits: a, showDetailsTable: P, allowOrbitRotation: D, showTimeControls: S, swappableOrbits: O } = Y(), {
|
|
15
|
+
paused: C,
|
|
16
|
+
pov: x,
|
|
17
|
+
defaultZoom: p,
|
|
18
|
+
potentialOrbits: k,
|
|
19
|
+
detailsRows: R
|
|
20
|
+
} = a, m = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [l, o] = i(!C), [Z, n] = i(1), [T, g] = i(0), [w, c] = i(C ? 0 : m.initial), [v, d] = i(0), [r, f] = i(0), [y, j] = i(1), [b, z] = i({ neos: [{ Principal_desig: "" }] });
|
|
21
|
+
B(() => {
|
|
22
|
+
S || (o(!1), c(0)), r > 0 ? (c(m.initial), n(1), d(0), f(-1)) : r < 0 && (d(0), o(!0), f(0));
|
|
23
|
+
}, [r]);
|
|
24
|
+
const L = (e) => {
|
|
25
|
+
c(+e);
|
|
26
|
+
}, _ = () => {
|
|
27
|
+
l || n(1), o(!l);
|
|
28
|
+
}, E = () => {
|
|
29
|
+
o((e) => !1), f((e) => e + 1);
|
|
30
|
+
}, F = (e) => {
|
|
31
|
+
o(!1), n(1), g((u) => u + 1);
|
|
32
|
+
}, V = (e) => {
|
|
33
|
+
o(!1), n(-1), g((u) => u + 1);
|
|
34
|
+
}, W = (e) => {
|
|
35
|
+
z({
|
|
36
|
+
neos: [e]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ s(h, { children: [
|
|
40
|
+
/* @__PURE__ */ t(K, {}),
|
|
41
|
+
/* @__PURE__ */ s(M, { children: [
|
|
42
|
+
O ? /* @__PURE__ */ t(Q, { children: a && a.neos && a.neos.map((e) => /* @__PURE__ */ t(
|
|
43
|
+
U,
|
|
30
44
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
sliderOnChangeCallback: (o) => {
|
|
35
|
-
b(+o);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
!x && /* @__PURE__ */ e(
|
|
40
|
-
T,
|
|
41
|
-
{
|
|
42
|
-
playing: a,
|
|
43
|
-
handleStartStop: () => {
|
|
44
|
-
a || s(1), i(!a);
|
|
45
|
-
},
|
|
46
|
-
handleNext: (o) => {
|
|
47
|
-
i(!1), s(1), S((f) => f + 1);
|
|
48
|
-
},
|
|
49
|
-
handlePrevious: (o) => {
|
|
50
|
-
i(!1), s(-1), S((f) => f + 1);
|
|
51
|
-
},
|
|
52
|
-
isDisabled: !1,
|
|
53
|
-
handleReset: () => {
|
|
54
|
-
i((o) => !1), c((o) => o + 1);
|
|
55
|
-
}
|
|
45
|
+
onClick: () => W(e),
|
|
46
|
+
"data-active": Object.keys(b).length ? e.Principal_desig === b.neos[0].Principal_desig : !1,
|
|
47
|
+
children: e.Ref
|
|
56
48
|
}
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
)) }) : /* @__PURE__ */ s(h, { children: [
|
|
50
|
+
R && P && /* @__PURE__ */ t(G, {}),
|
|
51
|
+
S && /* @__PURE__ */ s(h, { children: [
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
I,
|
|
54
|
+
{
|
|
55
|
+
elapsedTime: v,
|
|
56
|
+
dayPerVizSec: w,
|
|
57
|
+
speeds: m,
|
|
58
|
+
sliderOnChangeCallback: L
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
J,
|
|
63
|
+
{
|
|
64
|
+
playing: l,
|
|
65
|
+
handleStartStop: _,
|
|
66
|
+
handleNext: F,
|
|
67
|
+
handlePrevious: V,
|
|
68
|
+
isDisabled: !1,
|
|
69
|
+
handleReset: E
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ s(X, { orthographic: !0, children: [
|
|
75
|
+
/* @__PURE__ */ t(N, { pov: D ? null : x ?? "top", reset: r }),
|
|
76
|
+
/* @__PURE__ */ t(
|
|
77
|
+
q,
|
|
62
78
|
{
|
|
63
79
|
left: 5e3,
|
|
64
80
|
right: 15e3,
|
|
@@ -67,31 +83,32 @@ function ie() {
|
|
|
67
83
|
near: 0.1,
|
|
68
84
|
far: 3e4,
|
|
69
85
|
position: [0, 0, 8e3],
|
|
70
|
-
defaultZoom:
|
|
86
|
+
defaultZoom: p || 1
|
|
71
87
|
}
|
|
72
88
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
89
|
+
/* @__PURE__ */ t("ambientLight", { intensity: 0.9 }),
|
|
90
|
+
/* @__PURE__ */ t(
|
|
91
|
+
A,
|
|
76
92
|
{
|
|
77
|
-
defaultZoom:
|
|
78
|
-
playing:
|
|
79
|
-
stepDirection:
|
|
80
|
-
dayPerVizSec:
|
|
81
|
-
frameOverride:
|
|
82
|
-
potentialOrbits:
|
|
83
|
-
elapsedTime:
|
|
84
|
-
setElapsedTime:
|
|
93
|
+
defaultZoom: p || 1,
|
|
94
|
+
playing: l,
|
|
95
|
+
stepDirection: Z,
|
|
96
|
+
dayPerVizSec: w,
|
|
97
|
+
frameOverride: T,
|
|
98
|
+
potentialOrbits: k,
|
|
99
|
+
elapsedTime: v,
|
|
100
|
+
setElapsedTime: d,
|
|
85
101
|
reset: r,
|
|
86
|
-
zoomLevel:
|
|
87
|
-
setZoomLevel:
|
|
102
|
+
zoomLevel: y,
|
|
103
|
+
setZoomLevel: j,
|
|
104
|
+
orbits: O ? b : a
|
|
88
105
|
}
|
|
89
106
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
H,
|
|
92
109
|
{
|
|
93
|
-
zoomLevel:
|
|
94
|
-
defaultZoom:
|
|
110
|
+
zoomLevel: y,
|
|
111
|
+
defaultZoom: p || 1
|
|
95
112
|
}
|
|
96
113
|
)
|
|
97
114
|
] })
|
|
@@ -99,5 +116,5 @@ function ie() {
|
|
|
99
116
|
] });
|
|
100
117
|
}
|
|
101
118
|
export {
|
|
102
|
-
|
|
119
|
+
ce as default
|
|
103
120
|
};
|
|
@@ -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={"obs-mesh":"_obs-mesh_8ubzd_238","obs-label":"_obs-label_8ubzd_242"};exports.default=e;
|
|
@@ -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"),m=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 O=ye(ge),_=({data:i,selectionCallback:f,active:a,playing:j,dayPerVizSec:
|
|
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"),m=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 O=ye(ge),_=({data:i,selectionCallback:f,active:a,playing:j,dayPerVizSec:G,stepDirection:k,frameOverride:R,orbitColor:w,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:B,e:W,i:X,M:ee,Node:V,Peri:q,Principal_desig:te,Translated_desig_key:H,name:oe}=i||{},[se]=r.useState(()=>[0,t.degsToRads(X),V?t.degsToRads(V):0]),[n]=r.useState(()=>t.auToUnit(B)),[y]=r.useState(()=>t.getMinorAxis(B,W)),[re]=r.useState(()=>t.getFocus(n,y)),[s]=r.useState(new O.Vector3(re,0,0)),[d]=r.useState(new O.Vector3(0,0,0)),[ie,ae]=r.useState(!1),[u]=r.useState(()=>t.getCurve(n,y,s.x,s.y)),[ne]=r.useState(()=>t.getLineGeometry(u.getPoints(360))),b=t.getPosFromArcLength(0,u),[x,T]=r.useState({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(d),n),period:0});r.useEffect(()=>{z>0&&T({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(d),n),period:0})},[z]);function le(h){let l=0,c=t.getPosFromArcLength(l,u);if(h){const P=h>180,M=P?h-180:h;let p=t.getAngleFromPos(c,d);for(;p<M;)l+=.01,c=t.getPosFromArcLength(l,u),p=t.getAngleFromPos(c,d);P&&(l+=.5,c=t.getPosFromArcLength(l,u))}return v?v():ae(!0),{position:c,rotation:[0,0,0],progress:l,velocity:t.getVelocity(c.distanceTo(d),n),period:0}}function E(h,L){const{progress:l,position:c,velocity:P,period:M}=x,p=h?0:L*(G||t.DAY_PER_VIZ_SEC),ce=P*p*k,S=l+ce/u.getLength(),F=S>1?1-S:S,{x:de,y:ue}=u.getPoint(F),he=new O.Vector3(de,ue,0),me=t.getVelocity(c.distanceTo(d),n);let I=p+M;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((h,L)=>{(N||ie)&&E(!j,L)}),e.jsx("group",{rotation:se,children:e.jsxs("group",{rotation:[0,0,q?t.degsToRads(q+90):0],children:[e.jsx("line",{ref:Q,geometry:ne,children:e.jsx("lineBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.orbitHighlight:w||t.ORBITAL_COLORS.asteroid.orbitColor})}),e.jsxs("mesh",{position:x.position,onClick:()=>f(i,"neo"),children:[(A==="planet"||A==="neo"||a)&&e.jsx(m.Html,{children:e.jsx(g.Label,{children:e.jsx("button",{type:"button",style:{fontSize:t.getLabelSize(U,K)},onClick:()=>f(i,"neo"),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(m.Html,{children:e.jsx(g.Label,{children:"center"})})]}),e.jsxs("mesh",{position:d,children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:C||"blue"}),e.jsx(m.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(m.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(m.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(m.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(m.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=_;
|
|
@@ -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=t=>t&&t.__esModule?t:{default:t},a
|
|
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,30 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as o, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { useState as c
|
|
3
|
+
import { useState as c } from "react";
|
|
4
4
|
import a from "@rubin-epo/epo-react-lib/Button";
|
|
5
|
-
import { useOrbitalSimContext as
|
|
6
|
-
import { ButtonWrapper as
|
|
7
|
-
|
|
8
|
-
|
|
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(), {
|
|
9
10
|
detailsRows: t
|
|
10
|
-
} =
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
}, [t]), /* @__PURE__ */ o(s, { children: [
|
|
11
|
+
} = n, [i, r] = c(!1);
|
|
12
|
+
return /* @__PURE__ */ o(s, { children: [
|
|
13
|
+
/* @__PURE__ */ e(C, {}),
|
|
14
14
|
/* @__PURE__ */ e(
|
|
15
|
-
|
|
15
|
+
m,
|
|
16
16
|
{
|
|
17
17
|
styleAs: "secondary",
|
|
18
|
-
isInactive: t,
|
|
19
|
-
onClick: () =>
|
|
18
|
+
isInactive: !t,
|
|
19
|
+
onClick: () => {
|
|
20
|
+
r(!i), console.error("click!");
|
|
21
|
+
},
|
|
20
22
|
children: "Show Details"
|
|
21
23
|
}
|
|
22
24
|
),
|
|
23
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(p, { slideFrom: "left", isOpen: i, children: /* @__PURE__ */ o(h, { children: [
|
|
24
26
|
/* @__PURE__ */ e("h3", { children: "Orbital Details" }),
|
|
25
|
-
t && t.map((
|
|
26
|
-
/* @__PURE__ */ e(
|
|
27
|
-
/* @__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 }) })
|
|
28
30
|
] })),
|
|
29
31
|
/* @__PURE__ */ e(
|
|
30
32
|
a,
|
|
@@ -38,5 +40,5 @@ function v() {
|
|
|
38
40
|
] });
|
|
39
41
|
}
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
y as default
|
|
42
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 {
|