@rubin-epo/epo-widget-lib 1.2.3 → 2.0.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/ColorTool.js +3 -3
- package/dist/IsochronePlot.js +3 -3
- package/dist/OrbitalSim.cjs +1 -1
- package/dist/OrbitalSim.d.ts +0 -2
- package/dist/OrbitalSim.js +6 -144
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.js +35 -36
- package/dist/atomic/Blinker/Controls/styles.d.ts +0 -1
- package/dist/atomic/Blinker/styles.d.ts +0 -1
- package/dist/atomic/ElapsedTime/ElapsedTime.cjs +1 -1
- package/dist/atomic/ElapsedTime/ElapsedTime.js +18 -19
- package/dist/atomic/ElapsedTime/styles.d.ts +0 -1
- package/dist/atomic/ImageStack/index.cjs +1 -1
- package/dist/atomic/ImageStack/index.js +25 -26
- package/dist/atomic/ImageStack/styles.d.ts +0 -1
- package/dist/atomic/LiveRegion/styles.d.ts +0 -1
- package/dist/atomic/Loader/styles.d.ts +0 -1
- package/dist/atomic/PlaybackControl/PlaybackControl.cjs +1 -1
- package/dist/atomic/PlaybackControl/PlaybackControl.js +13 -14
- package/dist/atomic/PlaybackControl/styles.cjs +8 -5
- package/dist/atomic/PlaybackControl/styles.d.ts +4 -1
- package/dist/atomic/PlaybackControl/styles.js +12 -8
- package/dist/atomic/PlotWrapper/styles.d.ts +0 -1
- package/dist/charts/Base/styles.d.ts +0 -1
- package/dist/charts/Points/ErrorBar.cjs +1 -1
- package/dist/charts/Points/ErrorBar.js +33 -33
- package/dist/charts/Readout/styles.d.ts +0 -1
- package/dist/charts/ScatterPlot/styles.d.ts +1 -2
- package/dist/charts/Tooltip/styles.d.ts +7 -8
- package/dist/charts/Unit/Span.d.ts +1 -2
- package/dist/charts/Unit/StandardUnit.d.ts +2 -3
- package/dist/charts/Unit/StellarUnit.d.ts +2 -3
- package/dist/charts/Unit/Sub.d.ts +1 -2
- package/dist/charts/Unit/SvgSub.d.ts +1 -2
- package/dist/charts/Unit/TSpan.d.ts +1 -2
- package/dist/charts/Unit/index.d.ts +2 -3
- package/dist/charts/styles.d.ts +0 -1
- package/dist/hooks/useInterval.cjs +1 -1
- package/dist/hooks/useInterval.js +3 -3
- package/dist/hooks/usePrevious.cjs +1 -1
- package/dist/hooks/usePrevious.d.ts +1 -1
- package/dist/hooks/usePrevious.js +3 -3
- package/dist/layout/AspectRatio/styles.d.ts +0 -1
- package/dist/layout/Controls/styles.d.ts +2 -3
- package/dist/localeStrings/es/epo-widget-lib.json +1 -1
- package/dist/node_modules/classnames/index.cjs +2 -2
- package/dist/node_modules/classnames/index.js +30 -30
- package/dist/node_modules/three/examples/jsm/controls/OrbitControls.js +3 -3
- package/dist/style.css +1 -1
- package/dist/styles/svg.d.ts +0 -1
- package/dist/widgets/CameraFilter/CameraFilter.cjs +1 -1
- package/dist/widgets/CameraFilter/CameraFilter.js +30 -31
- package/dist/widgets/CameraFilter/styles.d.ts +1 -2
- package/dist/widgets/ColorTool/FilterControls/styles.d.ts +1 -4
- package/dist/widgets/ColorTool/ImageComposite/ImageComposite.d.ts +1 -1
- package/dist/widgets/ColorTool/ImageComposite/styles.d.ts +0 -1
- package/dist/widgets/ColorTool/lib/canvas.d.ts +1 -1
- package/dist/widgets/ColorTool/lib/utils.d.ts +2 -2
- package/dist/widgets/ColorTool/styles.d.ts +0 -1
- package/dist/widgets/FilterTool/styles.d.ts +1 -2
- package/dist/widgets/LightCurvePlot/Plot/index.js +3 -3
- package/dist/widgets/LightCurvePlot/Plot/styles.d.ts +0 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/A11Y/LightCurveLabel/styles.d.ts +0 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +45 -46
- package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.d.ts +0 -1
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.js +5 -5
- package/dist/widgets/LightCurvePlot/helpers.cjs +1 -1
- package/dist/widgets/LightCurvePlot/helpers.js +4 -4
- package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -0
- package/dist/widgets/OrbitalSim/{Camera.d.ts → Camera/Camera.d.ts} +1 -2
- package/dist/widgets/OrbitalSim/{Camera.js → Camera/Camera.js} +1 -1
- package/dist/widgets/OrbitalSim/Camera/CameraController.cjs +1 -0
- package/dist/widgets/OrbitalSim/{CameraController.d.ts → Camera/CameraController.d.ts} +2 -3
- package/dist/widgets/OrbitalSim/{CameraController.js → Camera/CameraController.js} +2 -2
- 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 +60 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.cjs +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.js +20 -20
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.cjs +1 -0
- package/dist/widgets/OrbitalSim/{PlaybackSpeed.d.ts → Controls/PlaybackSpeed.d.ts} +4 -5
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.js +95 -0
- package/dist/widgets/OrbitalSim/Controls/styles.cjs +97 -0
- package/dist/widgets/OrbitalSim/Controls/styles.d.ts +13 -0
- package/dist/widgets/OrbitalSim/Controls/styles.js +114 -0
- package/dist/widgets/OrbitalSim/Observations/Observation.cjs +1 -0
- package/dist/widgets/OrbitalSim/Observations/Observation.d.ts +11 -0
- package/dist/widgets/OrbitalSim/Observations/Observation.js +50 -0
- package/dist/widgets/OrbitalSim/Observations/Observations.cjs +1 -0
- package/dist/widgets/OrbitalSim/Observations/Observations.d.ts +11 -0
- package/dist/widgets/OrbitalSim/Observations/Observations.js +34 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.d.ts +2 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.js +103 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.js +6 -48
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -0
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.d.ts +46 -0
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +254 -0
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -0
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.d.ts +2 -0
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +42 -0
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -0
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +30 -0
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +125 -0
- package/dist/widgets/OrbitalSim/Orbitals/PotentialOrbits.cjs +1 -0
- package/dist/widgets/OrbitalSim/Orbitals/PotentialOrbits.d.ts +7 -0
- package/dist/widgets/OrbitalSim/Orbitals/PotentialOrbits.js +51 -0
- package/dist/widgets/OrbitalSim/Orbitals/styles.cjs +53 -0
- package/dist/widgets/OrbitalSim/Orbitals/styles.d.ts +9 -0
- package/dist/widgets/OrbitalSim/Orbitals/styles.js +66 -0
- package/dist/widgets/OrbitalSim/Sun.cjs +1 -1
- package/dist/widgets/OrbitalSim/Sun.d.ts +6 -9
- package/dist/widgets/OrbitalSim/Sun.js +11 -14
- 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 +51 -56
- package/dist/widgets/OrbitalSim/styles.cjs +48 -0
- package/dist/widgets/OrbitalSim/styles.d.ts +5 -0
- package/dist/widgets/OrbitalSim/styles.js +56 -0
- package/dist/widgets/SourceSelector/Message/Message.cjs +1 -1
- package/dist/widgets/SourceSelector/Message/Message.js +10 -11
- package/dist/widgets/SourceSelector/Message/styles.d.ts +1 -2
- package/dist/widgets/SourceSelector/SelectionList/index.cjs +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.js +12 -13
- package/dist/widgets/SourceSelector/SelectionList/styles.d.ts +0 -1
- package/dist/widgets/SourceSelector/SourceMap/styles.d.ts +0 -1
- package/dist/widgets/SourceSelector/styles.d.ts +1 -2
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.d.ts +0 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.d.ts +0 -1
- package/dist/widgets/SupernovaThreeVector/styles.d.ts +0 -1
- package/dist/widgets/ViewIndicator/styles.d.ts +0 -1
- package/package.json +15 -13
- package/dist/widgets/OrbitalSim/Camera.cjs +0 -1
- package/dist/widgets/OrbitalSim/CameraController.cjs +0 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.cjs +0 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.js +0 -7
- package/dist/widgets/OrbitalSim/Observation.cjs +0 -1
- package/dist/widgets/OrbitalSim/Observation.d.ts +0 -16
- package/dist/widgets/OrbitalSim/Observation.js +0 -60
- package/dist/widgets/OrbitalSim/Observations.cjs +0 -1
- package/dist/widgets/OrbitalSim/Observations.d.ts +0 -16
- package/dist/widgets/OrbitalSim/Observations.js +0 -38
- package/dist/widgets/OrbitalSim/Orbital.cjs +0 -1
- package/dist/widgets/OrbitalSim/Orbital.d.ts +0 -52
- package/dist/widgets/OrbitalSim/Orbital.js +0 -256
- package/dist/widgets/OrbitalSim/OrbitalDetails.cjs +0 -1
- package/dist/widgets/OrbitalSim/OrbitalDetails.d.ts +0 -14
- package/dist/widgets/OrbitalSim/OrbitalDetails.js +0 -56
- package/dist/widgets/OrbitalSim/Orbitals.cjs +0 -1
- package/dist/widgets/OrbitalSim/Orbitals.d.ts +0 -48
- package/dist/widgets/OrbitalSim/Orbitals.js +0 -147
- package/dist/widgets/OrbitalSim/PlaybackSpeed.cjs +0 -1
- package/dist/widgets/OrbitalSim/PlaybackSpeed.js +0 -97
- package/dist/widgets/OrbitalSim/PotentialOrbits.cjs +0 -1
- package/dist/widgets/OrbitalSim/PotentialOrbits.d.ts +0 -16
- package/dist/widgets/OrbitalSim/PotentialOrbits.js +0 -59
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s, Fragment as m } from "react/jsx-runtime";
|
|
3
|
+
import { useState as x } from "react";
|
|
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, getFocus as y, getMinorAxis as j, auToUnit as A } from "../orbitalUtilities.js";
|
|
8
|
+
const h = ({ data: n, observations: i }) => {
|
|
9
|
+
const [c] = x(() => {
|
|
10
|
+
const { a: t, e } = n, o = A(t), r = j(t, e), u = y(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
|
+
});
|
|
15
|
+
});
|
|
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
|
+
{
|
|
21
|
+
data: o,
|
|
22
|
+
vector: t
|
|
23
|
+
},
|
|
24
|
+
r
|
|
25
|
+
);
|
|
26
|
+
}) }) });
|
|
27
|
+
};
|
|
28
|
+
h.propTypes = {
|
|
29
|
+
data: p.object,
|
|
30
|
+
observations: p.array
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
h as default
|
|
34
|
+
};
|
|
@@ -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"),R=require("./Orbitals/OrbitalDetails.cjs"),T=require("./Camera/CameraController.cjs"),E=require("./Camera/Camera.cjs"),F=require("./Orbitals/Orbitals.cjs"),M=require("./Sun.cjs"),V=require("./Controls/PlaybackSpeed.cjs"),W=require("./Controls/PlaybackControls.cjs"),m=require("./styles.cjs"),_=require("./Context/index.cjs");function G(){const{orbits:q}=_.useOrbitalSimContext(),{paused:l,pov:y,defaultZoom:n,potentialOrbits:S,noDetails:O,noControls:g=!1}=q,u={min:1157e-8,max:365.25,initial:11.574,step:1},[r,a]=t.useState(!l),[v,o]=t.useState(1),[C,p]=t.useState(0),[b,x]=t.useState(l?0:u.initial),[j,c]=t.useState(0),[i,d]=t.useState(0),[h,D]=t.useState(1);t.useEffect(()=>{i>0?(x(u.initial),o(1),c(0),d(-1)):i<0&&(c(0),a(!0),d(0))},[i]);const P=s=>{x(+s)},Z=()=>{r||o(1),a(!r)},k=()=>{a(s=>!1),d(s=>s+1)},z=s=>{a(!1),o(1),p(f=>f+1)},L=s=>{a(!1),o(-1),p(f=>f+1)};return e.jsxs(e.Fragment,{children:[e.jsx(m.GlobalStyles,{}),e.jsxs(m.OrbitalSimWrapper,{children:[!S&&!O&&e.jsx(R.default,{}),!l&&e.jsx(V.default,{elapsedTime:j,dayPerVizSec:b,speeds:u,sliderOnChangeCallback:P}),!g&&e.jsx(W.default,{playing:r,handleStartStop:Z,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:k}),e.jsxs(m.CanvasWrapper,{orthographic:!0,children:[e.jsx(T.default,{pov:y,reset:i}),e.jsx(E.default,{left:5e3,right:15e3,top:15e3,bottom:-15e3,near:.1,far:3e4,position:[0,0,8e3],defaultZoom:n||1}),e.jsx("ambientLight",{intensity:.9}),e.jsx(F.default,{defaultZoom:n||1,playing:r,stepDirection:v,dayPerVizSec:b,frameOverride:C,potentialOrbits:S,elapsedTime:j,setElapsedTime:c,reset:i,zoomLevel:h,setZoomLevel:D}),e.jsx(M.default,{zoomLevel:h,defaultZoom:n||1})]})]})]})}exports.default=G;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, Fragment as k, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as t, useEffect as z } from "react";
|
|
4
|
+
import L from "./Orbitals/OrbitalDetails.js";
|
|
5
|
+
import R from "./Camera/CameraController.js";
|
|
6
|
+
import j from "./Camera/Camera.js";
|
|
7
|
+
import E from "./Orbitals/Orbitals.js";
|
|
8
|
+
import F from "./Sun.js";
|
|
9
|
+
import N from "./Controls/PlaybackSpeed.js";
|
|
10
|
+
import T from "./Controls/PlaybackControls.js";
|
|
11
|
+
import { GlobalStyles as V, OrbitalSimWrapper as W, CanvasWrapper as G } from "./styles.js";
|
|
12
|
+
import { useOrbitalSimContext as q } from "./Context/index.js";
|
|
13
|
+
function ie() {
|
|
14
|
+
const { orbits: v } = q(), {
|
|
15
|
+
paused: l,
|
|
16
|
+
pov: y,
|
|
17
|
+
defaultZoom: n,
|
|
18
|
+
potentialOrbits: h,
|
|
19
|
+
noDetails: g,
|
|
20
|
+
noControls: x = !1
|
|
21
|
+
} = v, m = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [a, i] = t(!l), [D, s] = t(1), [P, S] = t(0), [u, b] = t(l ? 0 : m.initial), [C, p] = t(0), [r, c] = t(0), [O, Z] = t(1);
|
|
22
|
+
return z(() => {
|
|
23
|
+
r > 0 ? (b(m.initial), s(1), p(0), c(-1)) : r < 0 && (p(0), i(!0), c(0));
|
|
24
|
+
}, [r]), /* @__PURE__ */ d(k, { children: [
|
|
25
|
+
/* @__PURE__ */ e(V, {}),
|
|
26
|
+
/* @__PURE__ */ d(W, { children: [
|
|
27
|
+
!h && !g && /* @__PURE__ */ e(L, {}),
|
|
28
|
+
!l && /* @__PURE__ */ e(
|
|
29
|
+
N,
|
|
30
|
+
{
|
|
31
|
+
elapsedTime: C,
|
|
32
|
+
dayPerVizSec: u,
|
|
33
|
+
speeds: m,
|
|
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
|
+
}
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ d(G, { orthographic: !0, children: [
|
|
59
|
+
/* @__PURE__ */ e(R, { pov: y, reset: r }),
|
|
60
|
+
/* @__PURE__ */ e(
|
|
61
|
+
j,
|
|
62
|
+
{
|
|
63
|
+
left: 5e3,
|
|
64
|
+
right: 15e3,
|
|
65
|
+
top: 15e3,
|
|
66
|
+
bottom: -15e3,
|
|
67
|
+
near: 0.1,
|
|
68
|
+
far: 3e4,
|
|
69
|
+
position: [0, 0, 8e3],
|
|
70
|
+
defaultZoom: n || 1
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ e("ambientLight", { intensity: 0.9 }),
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
E,
|
|
76
|
+
{
|
|
77
|
+
defaultZoom: n || 1,
|
|
78
|
+
playing: a,
|
|
79
|
+
stepDirection: D,
|
|
80
|
+
dayPerVizSec: u,
|
|
81
|
+
frameOverride: P,
|
|
82
|
+
potentialOrbits: h,
|
|
83
|
+
elapsedTime: C,
|
|
84
|
+
setElapsedTime: p,
|
|
85
|
+
reset: r,
|
|
86
|
+
zoomLevel: O,
|
|
87
|
+
setZoomLevel: Z
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ e(
|
|
91
|
+
F,
|
|
92
|
+
{
|
|
93
|
+
zoomLevel: O,
|
|
94
|
+
defaultZoom: n || 1
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] })
|
|
98
|
+
] })
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
ie as default
|
|
103
|
+
};
|
|
@@ -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="_label_8ubzd_227",l={label:e,"obs-mesh":"_obs-mesh_8ubzd_238","obs-label":"_obs-label_8ubzd_242"};exports.default=l;exports.label=e;
|
|
@@ -1,51 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"playback-speed-title": "_playback-speed-title_13gyh_61",
|
|
6
|
-
"playback-speed-slider-label": "_playback-speed-slider-label_13gyh_72",
|
|
7
|
-
"playback-speed-slider-label-bottom": "_playback-speed-slider-label-bottom_13gyh_83",
|
|
8
|
-
"playback-speed-slider-label-top": "_playback-speed-slider-label-top_13gyh_84",
|
|
9
|
-
"playback-speed-slider": "_playback-speed-slider_13gyh_48",
|
|
10
|
-
"elapsed-time-container": "_elapsed-time-container_13gyh_126",
|
|
11
|
-
"elapsed-time-title": "_elapsed-time-title_13gyh_145",
|
|
12
|
-
"elapsed-time-inner": "_elapsed-time-inner_13gyh_156",
|
|
13
|
-
"elapsed-time-divider": "_elapsed-time-divider_13gyh_165",
|
|
14
|
-
"elapsed-time-block": "_elapsed-time-block_13gyh_172",
|
|
15
|
-
"elapsed-val": "_elapsed-val_13gyh_176",
|
|
16
|
-
"elapsed-label": "_elapsed-label_13gyh_187",
|
|
17
|
-
"padded-drawer-inner": "_padded-drawer-inner_13gyh_198",
|
|
18
|
-
"nav-item": "_nav-item_13gyh_209",
|
|
19
|
-
"md-list-tile": "_md-list-tile_13gyh_209",
|
|
20
|
-
"md-tile-addon": "_md-tile-addon_13gyh_214",
|
|
21
|
-
"md-tile-text--primary": "_md-tile-text--primary_13gyh_227",
|
|
22
|
-
"md-text--theme-primary": "_md-text--theme-primary_13gyh_228",
|
|
23
|
-
"md-text": "_md-text_13gyh_228",
|
|
24
|
-
"active-item": "_active-item_13gyh_233",
|
|
25
|
-
label: l,
|
|
26
|
-
"obs-mesh": "_obs-mesh_13gyh_260",
|
|
27
|
-
"obs-label": "_obs-label_13gyh_264",
|
|
28
|
-
"obs-answer": "_obs-answer_13gyh_271",
|
|
29
|
-
"obs-hover": "_obs-hover_13gyh_272",
|
|
30
|
-
"obs-active": "_obs-active_13gyh_277",
|
|
31
|
-
details: _,
|
|
32
|
-
"details-table": "_details-table_13gyh_299",
|
|
33
|
-
"active-details": "_active-details_13gyh_309",
|
|
34
|
-
"details-toggle": "_details-toggle_13gyh_319",
|
|
35
|
-
disabled: a,
|
|
36
|
-
slideoutPanel: t,
|
|
37
|
-
slideoutRow: d,
|
|
38
|
-
slideoutCol: s,
|
|
39
|
-
slideout: i
|
|
1
|
+
const b = "_label_8ubzd_227", l = {
|
|
2
|
+
label: b,
|
|
3
|
+
"obs-mesh": "_obs-mesh_8ubzd_238",
|
|
4
|
+
"obs-label": "_obs-label_8ubzd_242"
|
|
40
5
|
};
|
|
41
6
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_ as details,
|
|
45
|
-
a as disabled,
|
|
46
|
-
l as label,
|
|
47
|
-
i as slideout,
|
|
48
|
-
s as slideoutCol,
|
|
49
|
-
t as slideoutPanel,
|
|
50
|
-
d as slideoutRow
|
|
7
|
+
l as default,
|
|
8
|
+
b as label
|
|
51
9
|
};
|
|
@@ -0,0 +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:I,stepDirection:G,frameOverride:R,orbitColor:k,objectColor:C,objectRadius:w,initialized:D,initCallback:v,devMode:N,zoomMod:Z,defaultZoom:U,type:K,reset:A})=>{const{t:Y}=je.useTranslation(),{orbits:$}=pe.useOrbitalSimContext(),{activeVelocityCallback:J}=$,Q=r.useRef(),{a:z,e:W,i:X,M:ee,Node:B,Peri:V,Principal_desig:te,Translated_desig_key:q,name:oe}=i||{},[se]=r.useState(()=>[0,t.degsToRads(X),B?t.degsToRads(B):0]),[n]=r.useState(()=>t.auToUnit(z)),[y]=r.useState(()=>t.getMinorAxis(z,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(()=>{A>0&&T({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(d),n),period:0})},[A]);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 H(h,L){const{progress:l,position:c,velocity:P,period:M}=x,p=h?0:L*(I||t.DAY_PER_VIZ_SEC),ce=P*p*G,S=l+ce/u.getLength(),E=S>1?1-S:S,{x:de,y:ue}=u.getPoint(E),he=new O.Vector3(de,ue,0),me=t.getVelocity(c.distanceTo(d),n);let F=p+M;S>1&&(F=0),T({...x,position:he,progress:E,velocity:me,period:F})}return r.useEffect(()=>{T(le(ee||Math.floor(Math.random()*Math.floor(180))))},[]),r.useEffect(()=>{R&&H(!1,1/60)},[R]),r.useEffect(()=>{a&&J(t.auToMeters(t.unitToAu(x.velocity/1e5)))},[x]),fe.useFrame((h,L)=>{(D||ie)&&H(!j,L)}),e.jsx("group",{rotation:se,children:e.jsxs("group",{rotation:[0,0,V?t.degsToRads(V+90):0],children:[e.jsx("line",{ref:Q,geometry:ne,children:e.jsx("lineBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.orbitHighlight:k||t.ORBITAL_COLORS.asteroid.orbitColor})}),e.jsxs("mesh",{position:x.position,onClick:()=>f(i,"neo"),children:[(K==="planet"||a)&&e.jsx(m.Html,{children:e.jsx(g.Label,{children:e.jsx("button",{type:"button",style:{fontSize:t.getLabelSize(Z,U)},onClick:()=>f(i,"neo"),children:q?Y(q):oe||te})})}),e.jsx("sphereGeometry",{attach:"geometry",args:[w||4,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.objectHighlight:C||t.ORBITAL_COLORS.asteroid.objectColor})]}),N&&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=_;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export default Orbital;
|
|
2
|
+
declare function Orbital({ data, selectionCallback, active, playing, dayPerVizSec, stepDirection, frameOverride, orbitColor, objectColor, objectRadius, initialized, initCallback, devMode, zoomMod, defaultZoom, type, reset }: {
|
|
3
|
+
data: any;
|
|
4
|
+
selectionCallback: any;
|
|
5
|
+
active: any;
|
|
6
|
+
playing: any;
|
|
7
|
+
dayPerVizSec: any;
|
|
8
|
+
stepDirection: any;
|
|
9
|
+
frameOverride: any;
|
|
10
|
+
orbitColor: any;
|
|
11
|
+
objectColor: any;
|
|
12
|
+
objectRadius: any;
|
|
13
|
+
initialized: any;
|
|
14
|
+
initCallback: any;
|
|
15
|
+
devMode: any;
|
|
16
|
+
zoomMod: any;
|
|
17
|
+
defaultZoom: any;
|
|
18
|
+
type: any;
|
|
19
|
+
reset: any;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare namespace Orbital {
|
|
22
|
+
namespace defaultProps {
|
|
23
|
+
let type: string;
|
|
24
|
+
}
|
|
25
|
+
namespace propTypes {
|
|
26
|
+
export let data: any;
|
|
27
|
+
export let selectionCallback: any;
|
|
28
|
+
export let active: any;
|
|
29
|
+
export let playing: any;
|
|
30
|
+
export let dayPerVizSec: any;
|
|
31
|
+
export let stepDirection: any;
|
|
32
|
+
export let frameOverride: any;
|
|
33
|
+
export let orbitColor: any;
|
|
34
|
+
export let objectColor: any;
|
|
35
|
+
export let objectRadius: any;
|
|
36
|
+
export let initCallback: any;
|
|
37
|
+
export let initialized: any;
|
|
38
|
+
export let devMode: any;
|
|
39
|
+
export let activeVelocityCallback: any;
|
|
40
|
+
export let zoomMod: any;
|
|
41
|
+
export let defaultZoom: any;
|
|
42
|
+
let type_1: any;
|
|
43
|
+
export { type_1 as type };
|
|
44
|
+
export let reset: any;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as i, Fragment as Pe } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as Me, useState as r, useEffect as M } from "react";
|
|
4
|
+
import t from "../../../node_modules/prop-types/index.js";
|
|
5
|
+
import * as L from "three";
|
|
6
|
+
import { useFrame as Te } from "@react-three/fiber";
|
|
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 H, DAY_PER_VIZ_SEC as Re } from "../orbitalUtilities.js";
|
|
9
|
+
import Se from "../chartColors.module.css.js";
|
|
10
|
+
import { useOrbitalSimContext as _e } from "../Context/index.js";
|
|
11
|
+
import { useTranslation as Ae } from "react-i18next";
|
|
12
|
+
import { Label as d } from "./styles.js";
|
|
13
|
+
const Z = ({
|
|
14
|
+
data: z,
|
|
15
|
+
selectionCallback: G,
|
|
16
|
+
active: y,
|
|
17
|
+
playing: N,
|
|
18
|
+
dayPerVizSec: K,
|
|
19
|
+
stepDirection: U,
|
|
20
|
+
frameOverride: R,
|
|
21
|
+
orbitColor: Y,
|
|
22
|
+
objectColor: S,
|
|
23
|
+
objectRadius: q,
|
|
24
|
+
initialized: J,
|
|
25
|
+
initCallback: _,
|
|
26
|
+
devMode: Q,
|
|
27
|
+
zoomMod: W,
|
|
28
|
+
defaultZoom: X,
|
|
29
|
+
type: $,
|
|
30
|
+
// noLabels,
|
|
31
|
+
reset: A
|
|
32
|
+
}) => {
|
|
33
|
+
const { t: ee } = Ae(), { orbits: te } = _e(), { activeVelocityCallback: oe } = te, re = Me(), {
|
|
34
|
+
a: k,
|
|
35
|
+
e: ie,
|
|
36
|
+
i: ne,
|
|
37
|
+
M: se,
|
|
38
|
+
Node: w,
|
|
39
|
+
Peri: E,
|
|
40
|
+
Principal_desig: ae,
|
|
41
|
+
Translated_desig_key: F,
|
|
42
|
+
name: ce
|
|
43
|
+
} = z || {}, [le] = r(() => [
|
|
44
|
+
0,
|
|
45
|
+
V(ne),
|
|
46
|
+
w ? V(w) : 0
|
|
47
|
+
]), [n] = r(() => Ce(k)), [u] = r(() => ve(k, 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
|
+
() => je(n, u, o.x, o.y)
|
|
49
|
+
), [pe] = r(() => Be(l.getPoints(360))), f = T(0, l), [p, j] = r({
|
|
50
|
+
position: f,
|
|
51
|
+
rotation: [0, 0, 0],
|
|
52
|
+
progress: 0,
|
|
53
|
+
velocity: C(f.distanceTo(c), n),
|
|
54
|
+
period: 0
|
|
55
|
+
});
|
|
56
|
+
M(() => {
|
|
57
|
+
A > 0 && j({
|
|
58
|
+
position: f,
|
|
59
|
+
rotation: [0, 0, 0],
|
|
60
|
+
progress: 0,
|
|
61
|
+
velocity: C(f.distanceTo(c), n),
|
|
62
|
+
period: 0
|
|
63
|
+
});
|
|
64
|
+
}, [A]);
|
|
65
|
+
function ge(m) {
|
|
66
|
+
let s = 0, a = T(s, l);
|
|
67
|
+
if (m) {
|
|
68
|
+
const x = m > 180, B = x ? m - 180 : m;
|
|
69
|
+
let g = H(a, c);
|
|
70
|
+
for (; g < B; )
|
|
71
|
+
s += 0.01, a = T(s, l), g = H(a, c);
|
|
72
|
+
x && (s += 0.5, a = T(s, l));
|
|
73
|
+
}
|
|
74
|
+
return _ ? _() : de(!0), {
|
|
75
|
+
position: a,
|
|
76
|
+
rotation: [0, 0, 0],
|
|
77
|
+
progress: s,
|
|
78
|
+
velocity: C(a.distanceTo(c), n),
|
|
79
|
+
period: 0
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function I(m, b) {
|
|
83
|
+
const {
|
|
84
|
+
progress: s,
|
|
85
|
+
position: a,
|
|
86
|
+
velocity: x,
|
|
87
|
+
period: B
|
|
88
|
+
} = p, g = m ? 0 : b * (K || Re), ye = x * g * U, P = s + ye / l.getLength(), O = P > 1 ? 1 - P : P, { x: ue, y: fe } = l.getPoint(O), be = new L.Vector3(ue, fe, 0), xe = C(a.distanceTo(c), n);
|
|
89
|
+
let D = g + B;
|
|
90
|
+
P > 1 && (D = 0), j({
|
|
91
|
+
...p,
|
|
92
|
+
position: be,
|
|
93
|
+
progress: O,
|
|
94
|
+
velocity: xe,
|
|
95
|
+
period: D
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return M(() => {
|
|
99
|
+
j(ge(se || Math.floor(Math.random() * Math.floor(180))));
|
|
100
|
+
}, []), M(() => {
|
|
101
|
+
R && I(!1, 1 / 60);
|
|
102
|
+
}, [R]), M(() => {
|
|
103
|
+
y && oe(Le(Ve(p.velocity / 1e5)));
|
|
104
|
+
}, [p]), Te((m, b) => {
|
|
105
|
+
(J || he) && I(!N, b);
|
|
106
|
+
}), /* @__PURE__ */ e("group", { rotation: le, children: /* @__PURE__ */ i("group", { rotation: [0, 0, E ? V(E + 90) : 0], children: [
|
|
107
|
+
/* @__PURE__ */ e("line", { ref: re, geometry: pe, children: /* @__PURE__ */ e(
|
|
108
|
+
"lineBasicMaterial",
|
|
109
|
+
{
|
|
110
|
+
attach: "material",
|
|
111
|
+
color: y ? v.asteroid.orbitHighlight : Y || v.asteroid.orbitColor
|
|
112
|
+
}
|
|
113
|
+
) }),
|
|
114
|
+
/* @__PURE__ */ i(
|
|
115
|
+
"mesh",
|
|
116
|
+
{
|
|
117
|
+
position: p.position,
|
|
118
|
+
onClick: () => G(z, "neo"),
|
|
119
|
+
children: [
|
|
120
|
+
($ === "planet" || y) && /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
style: {
|
|
125
|
+
fontSize: Ge(W, X)
|
|
126
|
+
},
|
|
127
|
+
onClick: () => G(z, "neo"),
|
|
128
|
+
children: F ? ee(F) : ce || ae
|
|
129
|
+
}
|
|
130
|
+
) }) }),
|
|
131
|
+
/* @__PURE__ */ e(
|
|
132
|
+
"sphereGeometry",
|
|
133
|
+
{
|
|
134
|
+
attach: "geometry",
|
|
135
|
+
args: [q || 4, 10, 10]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ e(
|
|
139
|
+
"meshBasicMaterial",
|
|
140
|
+
{
|
|
141
|
+
attach: "material",
|
|
142
|
+
color: y ? v.asteroid.objectHighlight : S || v.asteroid.objectColor
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
Q && /* @__PURE__ */ i(Pe, { children: [
|
|
149
|
+
/* @__PURE__ */ i("mesh", { position: o, children: [
|
|
150
|
+
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
151
|
+
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: Se.chart1 }),
|
|
152
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "center" }) })
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ i("mesh", { position: c, children: [
|
|
155
|
+
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
156
|
+
/* @__PURE__ */ e(
|
|
157
|
+
"meshBasicMaterial",
|
|
158
|
+
{
|
|
159
|
+
attach: "material",
|
|
160
|
+
color: S || "blue"
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "sun" }) })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ i(
|
|
166
|
+
"mesh",
|
|
167
|
+
{
|
|
168
|
+
position: [
|
|
169
|
+
o.x,
|
|
170
|
+
-u + o.y,
|
|
171
|
+
o.z
|
|
172
|
+
],
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
175
|
+
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: "green" }),
|
|
176
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "minor axis vertex" }) })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ i(
|
|
181
|
+
"mesh",
|
|
182
|
+
{
|
|
183
|
+
position: [
|
|
184
|
+
o.x,
|
|
185
|
+
u + o.y,
|
|
186
|
+
o.z
|
|
187
|
+
],
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
190
|
+
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: "green" }),
|
|
191
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "minor axis vertex" }) })
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ i(
|
|
196
|
+
"mesh",
|
|
197
|
+
{
|
|
198
|
+
position: [
|
|
199
|
+
n + o.x,
|
|
200
|
+
o.y,
|
|
201
|
+
o.z
|
|
202
|
+
],
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
205
|
+
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: "green" }),
|
|
206
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "major axis vertex" }) })
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ i(
|
|
211
|
+
"mesh",
|
|
212
|
+
{
|
|
213
|
+
position: [
|
|
214
|
+
-n + o.x,
|
|
215
|
+
o.y,
|
|
216
|
+
o.z
|
|
217
|
+
],
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ e("sphereGeometry", { attach: "geometry", args: [2, 10, 10] }),
|
|
220
|
+
/* @__PURE__ */ e("meshBasicMaterial", { attach: "material", color: "green" }),
|
|
221
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: "major axis vertex" }) })
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] })
|
|
226
|
+
] }) });
|
|
227
|
+
};
|
|
228
|
+
Z.defaultProps = {
|
|
229
|
+
type: "object"
|
|
230
|
+
};
|
|
231
|
+
Z.propTypes = {
|
|
232
|
+
data: t.object,
|
|
233
|
+
selectionCallback: t.func,
|
|
234
|
+
active: t.bool,
|
|
235
|
+
playing: t.bool,
|
|
236
|
+
dayPerVizSec: t.number,
|
|
237
|
+
stepDirection: t.number,
|
|
238
|
+
frameOverride: t.number,
|
|
239
|
+
orbitColor: t.string,
|
|
240
|
+
objectColor: t.string,
|
|
241
|
+
objectRadius: t.number,
|
|
242
|
+
initCallback: t.func,
|
|
243
|
+
initialized: t.bool,
|
|
244
|
+
devMode: t.bool,
|
|
245
|
+
activeVelocityCallback: t.func,
|
|
246
|
+
zoomMod: t.number,
|
|
247
|
+
defaultZoom: t.number,
|
|
248
|
+
type: t.string,
|
|
249
|
+
// noLabels: PropTypes.bool,
|
|
250
|
+
reset: t.number
|
|
251
|
+
};
|
|
252
|
+
export {
|
|
253
|
+
Z as default
|
|
254
|
+
};
|
|
@@ -0,0 +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=d(c);function h(){const{orbits:t}=u.useOrbitalSimContext(),{detailsRows:i}=t,[l,r]=n.useState(!1);return n.useEffect(()=>{i&&r(!0)},[i]),e.jsxs(e.Fragment,{children:[e.jsx(s.ButtonWrapper,{styleAs:"secondary",isInactive:i,onClick:()=>r(!l),children:"Show Details"}),e.jsx(s.SlideoutWrapper,{slideFrom:"left",isOpen:!l,children:e.jsxs(s.SlideoutPanel,{children:[e.jsx("h3",{children:"Orbital Details"}),i&&i.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:"e.rowContent"})})]})),e.jsx(a.default,{isBlock:!0,onClick:()=>r(!l),children:"Close"})]})})]})}exports.default=h;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as o, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useState as c, useEffect as d } from "react";
|
|
4
|
+
import a from "@rubin-epo/epo-react-lib/Button";
|
|
5
|
+
import { useOrbitalSimContext as u } from "../Context/index.js";
|
|
6
|
+
import { ButtonWrapper as h, SlideoutWrapper as m, SlideoutPanel as p, SlideoutRow as f, SlideoutColLeft as S, SlideoutColRight as C } from "./styles.js";
|
|
7
|
+
function v() {
|
|
8
|
+
const { orbits: l } = u(), {
|
|
9
|
+
detailsRows: t
|
|
10
|
+
} = l, [i, r] = c(!1);
|
|
11
|
+
return d(() => {
|
|
12
|
+
t && r(!0);
|
|
13
|
+
}, [t]), /* @__PURE__ */ o(s, { children: [
|
|
14
|
+
/* @__PURE__ */ e(
|
|
15
|
+
h,
|
|
16
|
+
{
|
|
17
|
+
styleAs: "secondary",
|
|
18
|
+
isInactive: t,
|
|
19
|
+
onClick: () => r(!i),
|
|
20
|
+
children: "Show Details"
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ e(m, { slideFrom: "left", isOpen: !i, children: /* @__PURE__ */ o(p, { children: [
|
|
24
|
+
/* @__PURE__ */ e("h3", { children: "Orbital Details" }),
|
|
25
|
+
t && t.map((n) => /* @__PURE__ */ o(f, { children: [
|
|
26
|
+
/* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("p", { children: n.rowTitle }) }),
|
|
27
|
+
/* @__PURE__ */ e(C, { children: /* @__PURE__ */ e("p", { children: "e.rowContent" }) })
|
|
28
|
+
] })),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
a,
|
|
31
|
+
{
|
|
32
|
+
isBlock: !0,
|
|
33
|
+
onClick: () => r(!i),
|
|
34
|
+
children: "Close"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] }) })
|
|
38
|
+
] });
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
v as default
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),x=require("react"),e=require("../../../node_modules/prop-types/index.cjs"),O=require("@react-three/fiber"),R=require("./Orbital.cjs"),v=require("./PotentialOrbits.cjs"),y=require("../orbitalUtilities.cjs"),E=require("../Context/index.cjs");function C({playing:s,dayPerVizSec:n,stepDirection:u,frameOverride:a,defaultZoom:b,potentialOrbits:$,elapsedTime:m,setElapsedTime:p,reset:j,zoomLevel:l,setZoomLevel:h}){const{orbits:M}=E.useOrbitalSimContext(),{neos:i,refObjs:I,activeNeo:P}=M;function _(r){const{remainingInits:t}=r;return{remainingInits:t-1}}const{camera:g}=O.useThree(),[k,q]=x.useReducer(_,{remainingInits:i&&Array.isArray(i)?i.length:0});function T(){return(I||["earth","jupiter","mars","neptune"]).map(y.getRefObjProps).map(t=>{const{orbitColor:c,objectColor:f,objectRadius:d,Ref:z,Principal_desig:A,name:F}=t;return o.jsx(R.default,{type:"planet",data:t,position:[0,0,0],zoomMod:l,defaultZoom:b,playing:s,stepDirection:u,dayPerVizSec:n,frameOverride:a,orbitColor:c,objectColor:f,objectRadius:d,reset:j},`${z}-${A||F}`)})}return O.useFrame((r,t)=>{g.zoom!==l&&h(g.zoom),s&&p(m+u*t*n)}),x.useEffect(()=>{a&&p(m+u*(1/60)*n)},[a]),o.jsxs(o.Fragment,{children:[T(),$?o.jsx(v.default,{data:i,position:[0,0,0],initialized:!0,zoomMod:l,defaultZoom:b,playing:s,stepDirection:u,dayPerVizSec:n,frameOverride:a,initCallback:q}):i?i.map((r,t)=>{const{Ref:c,Principal_desig:f,name:d}=r;return o.jsx(R.default,{data:r,position:[0,0,0],active:r===P,initialized:k.remainingInits<=0,zoomMod:l,defaultZoom:b,playing:s,stepDirection:u,dayPerVizSec:n,frameOverride:a,reset:j,initCallback:q},c&&(f||d)?`${c}-${f||d}`:`orbit-${t}`)}):null]})}C.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=C;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default Orbitals;
|
|
2
|
+
declare function Orbitals({ playing, dayPerVizSec, stepDirection, frameOverride, defaultZoom, potentialOrbits, elapsedTime, setElapsedTime, reset, zoomLevel, setZoomLevel }: {
|
|
3
|
+
playing: any;
|
|
4
|
+
dayPerVizSec: any;
|
|
5
|
+
stepDirection: any;
|
|
6
|
+
frameOverride: any;
|
|
7
|
+
defaultZoom: any;
|
|
8
|
+
potentialOrbits: any;
|
|
9
|
+
elapsedTime: any;
|
|
10
|
+
setElapsedTime: any;
|
|
11
|
+
reset: any;
|
|
12
|
+
zoomLevel: any;
|
|
13
|
+
setZoomLevel: any;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace Orbitals {
|
|
16
|
+
namespace propTypes {
|
|
17
|
+
let playing: any;
|
|
18
|
+
let dayPerVizSec: any;
|
|
19
|
+
let stepDirection: any;
|
|
20
|
+
let frameOverride: any;
|
|
21
|
+
let activeVelocityCallback: any;
|
|
22
|
+
let defaultZoom: any;
|
|
23
|
+
let zoomLevel: any;
|
|
24
|
+
let setZoomLevel: any;
|
|
25
|
+
let potentialOrbits: any;
|
|
26
|
+
let elapsedTime: any;
|
|
27
|
+
let setElapsedTime: any;
|
|
28
|
+
let reset: any;
|
|
29
|
+
}
|
|
30
|
+
}
|