@rubin-epo/epo-widget-lib 2.0.3 → 2.0.5

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.
Files changed (68) hide show
  1. package/dist/SortableTable.cjs +1 -0
  2. package/dist/SortableTable.d.ts +3 -0
  3. package/dist/SortableTable.js +5 -0
  4. package/dist/SourceSelector.cjs +1 -1
  5. package/dist/SourceSelector.js +6 -4
  6. package/dist/atomic/Blinker/Blinker.cjs +1 -1
  7. package/dist/atomic/Blinker/Blinker.d.ts +1 -0
  8. package/dist/atomic/Blinker/Blinker.js +27 -25
  9. package/dist/atomic/SelectionList/index.cjs +1 -0
  10. package/dist/{widgets/SourceSelector → atomic}/SelectionList/index.d.ts +1 -1
  11. package/dist/atomic/SelectionList/index.js +31 -0
  12. package/dist/charts/Readout/index.cjs +1 -1
  13. package/dist/charts/Readout/index.js +18 -25
  14. package/dist/charts/ScatterPlot/index.cjs +1 -1
  15. package/dist/charts/ScatterPlot/index.js +50 -53
  16. package/dist/localeStrings/en/epo-widget-lib.json +11 -3
  17. package/dist/localeStrings/es/epo-widget-lib.json +8 -5
  18. package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
  19. package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -1
  20. package/dist/widgets/OrbitalSim/Camera/Camera.js +9 -8
  21. package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
  22. package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
  23. package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
  24. package/dist/widgets/OrbitalSim/Context/index.js +58 -32
  25. package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
  26. package/dist/widgets/OrbitalSim/OrbitalSim.js +95 -78
  27. package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
  28. package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
  29. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
  30. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
  31. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
  32. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
  33. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
  34. package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
  35. package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
  36. package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
  37. package/dist/widgets/OrbitalSim/styles.cjs +33 -5
  38. package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
  39. package/dist/widgets/OrbitalSim/styles.js +36 -6
  40. package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
  41. package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
  42. package/dist/widgets/SortableTable/SortableTable.js +41 -0
  43. package/dist/widgets/SortableTable/index.d.ts +1 -0
  44. package/dist/widgets/SortableTable/styles.cjs +8 -0
  45. package/dist/widgets/SortableTable/styles.d.ts +1 -0
  46. package/dist/widgets/SortableTable/styles.js +13 -0
  47. package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
  48. package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
  49. package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
  50. package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
  51. package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
  52. package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
  53. package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
  54. package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
  55. package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
  56. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  57. package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
  58. package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
  59. package/dist/widgets/SourceSelector/index.d.ts +2 -1
  60. package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
  61. package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
  62. package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
  63. package/package.json +1 -1
  64. package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
  65. package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
  66. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
  67. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
  68. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.js +0 -0
@@ -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 H, DAY_PER_VIZ_SEC as Re } from "../orbitalUtilities.js";
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 Z = ({
13
+ const N = ({
14
14
  data: z,
15
15
  selectionCallback: G,
16
16
  active: y,
17
- playing: N,
18
- dayPerVizSec: K,
19
- stepDirection: U,
17
+ playing: K,
18
+ dayPerVizSec: U,
19
+ stepDirection: Y,
20
20
  frameOverride: R,
21
- orbitColor: Y,
21
+ orbitColor: q,
22
22
  objectColor: S,
23
- objectRadius: q,
24
- initialized: J,
23
+ objectRadius: J,
24
+ initialized: Q,
25
25
  initCallback: _,
26
- devMode: Q,
27
- zoomMod: W,
28
- defaultZoom: X,
29
- type: $,
26
+ devMode: W,
27
+ zoomMod: X,
28
+ defaultZoom: $,
29
+ type: A,
30
30
  // noLabels,
31
- reset: A
31
+ reset: k
32
32
  }) => {
33
33
  const { t: ee } = Ae(), { orbits: te } = _e(), { activeVelocityCallback: oe } = te, re = Me(), {
34
- a: k,
34
+ a: w,
35
35
  e: ie,
36
36
  i: ne,
37
37
  M: se,
38
- Node: w,
39
- Peri: E,
38
+ Node: E,
39
+ Peri: F,
40
40
  Principal_desig: ae,
41
- Translated_desig_key: F,
41
+ Translated_desig_key: I,
42
42
  name: ce
43
43
  } = z || {}, [le] = r(() => [
44
44
  0,
45
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(
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
- A > 0 && j({
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
- }, [A]);
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 = H(a, c);
69
+ let g = Z(a, c);
70
70
  for (; g < B; )
71
- s += 0.01, a = T(s, l), g = H(a, c);
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 I(m, b) {
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 * (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({
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: O,
93
+ progress: D,
94
94
  velocity: xe,
95
- period: D
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 && I(!1, 1 / 60);
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
- (J || he) && I(!N, b);
106
- }), /* @__PURE__ */ e("group", { rotation: le, children: /* @__PURE__ */ i("group", { rotation: [0, 0, E ? V(E + 90) : 0], children: [
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 : Y || v.asteroid.orbitColor
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
- ($ === "planet" || y) && /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(
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(W, X)
125
+ fontSize: Ge(X, $)
126
126
  },
127
127
  onClick: () => G(z, "neo"),
128
- children: F ? ee(F) : ce || ae
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: [q || 4, 10, 10]
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
- Q && /* @__PURE__ */ i(Pe, { children: [
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
- Z.defaultProps = {
228
+ N.defaultProps = {
229
229
  type: "object"
230
230
  };
231
- Z.propTypes = {
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
- Z as default
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=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 n.useEffect(()=>{l&&r(!0)},[l]),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
+ "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,40 +1,38 @@
1
1
  "use client";
2
- import { jsxs as r, Fragment as s, jsx as e } from "react/jsx-runtime";
3
- import { useState as c, useEffect as a } from "react";
4
- import d from "@rubin-epo/epo-react-lib/Button";
5
- import { useOrbitalSimContext as m } from "../Context/index.js";
6
- import { ButtonWrapper as u, SlideoutWrapper as p, SlideoutPanel as f, SlideoutRow as h, SlideoutColLeft as S, SlideoutColRight as C } from "./styles.js";
7
- import { GlobalStyles as w } from "../styles.js";
8
- function B() {
9
- const { orbits: n } = m(), {
2
+ import { jsxs as o, Fragment as s, jsx as e } from "react/jsx-runtime";
3
+ import { useState as c } from "react";
4
+ import a from "@rubin-epo/epo-react-lib/Button";
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(), {
10
10
  detailsRows: t
11
- } = n, [i, o] = c(!1);
12
- return a(() => {
13
- t && o(!0);
14
- }, [t]), /* @__PURE__ */ r(s, { children: [
15
- /* @__PURE__ */ e(w, {}),
11
+ } = n, [i, r] = c(!1);
12
+ return /* @__PURE__ */ o(s, { children: [
13
+ /* @__PURE__ */ e(C, {}),
16
14
  /* @__PURE__ */ e(
17
- u,
15
+ m,
18
16
  {
19
17
  styleAs: "secondary",
20
- isInactive: t,
18
+ isInactive: !t,
21
19
  onClick: () => {
22
- o(!i), console.error("click!");
20
+ r(!i), console.error("click!");
23
21
  },
24
22
  children: "Show Details"
25
23
  }
26
24
  ),
27
- /* @__PURE__ */ e(p, { slideFrom: "left", isOpen: !i, children: /* @__PURE__ */ r(f, { children: [
25
+ /* @__PURE__ */ e(p, { slideFrom: "left", isOpen: i, children: /* @__PURE__ */ o(h, { children: [
28
26
  /* @__PURE__ */ e("h3", { children: "Orbital Details" }),
29
- t && t.map((l) => /* @__PURE__ */ r(h, { children: [
30
- /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e("p", { children: l.rowTitle }) }),
31
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e("p", { children: l.rowContent }) })
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 }) })
32
30
  ] })),
33
31
  /* @__PURE__ */ e(
34
- d,
32
+ a,
35
33
  {
36
34
  isBlock: !0,
37
- onClick: () => o(!i),
35
+ onClick: () => r(!i),
38
36
  children: "Close"
39
37
  }
40
38
  )
@@ -42,5 +40,5 @@ function B() {
42
40
  ] });
43
41
  }
44
42
  export {
45
- B as default
43
+ y as default
46
44
  };
@@ -1 +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;
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 {
@@ -1,49 +1,49 @@
1
1
  "use client";
2
- import { jsxs as F, Fragment as _, jsx as f } from "react/jsx-runtime";
3
- import { useReducer as y, useEffect as E } from "react";
2
+ import { jsxs as A, Fragment as F, jsx as f } from "react/jsx-runtime";
3
+ import { useReducer as _, useEffect as E } from "react";
4
4
  import t from "../../../node_modules/prop-types/index.js";
5
5
  import { useThree as N, useFrame as q } from "@react-three/fiber";
6
- import C from "./Orbital.js";
6
+ import R from "./Orbital.js";
7
7
  import w from "./PotentialOrbits.js";
8
8
  import { getRefObjProps as B } from "../orbitalUtilities.js";
9
- import { useOrbitalSimContext as G } from "../Context/index.js";
10
- function H({
9
+ function G({
11
10
  playing: a,
12
11
  dayPerVizSec: n,
13
- stepDirection: e,
12
+ stepDirection: i,
14
13
  frameOverride: s,
15
14
  defaultZoom: c,
16
- potentialOrbits: R,
15
+ potentialOrbits: h,
17
16
  elapsedTime: l,
18
17
  setElapsedTime: d,
19
18
  reset: j,
20
19
  zoomLevel: m,
21
- setZoomLevel: h
20
+ setZoomLevel: C,
21
+ orbits: $
22
22
  }) {
23
- const { orbits: $ } = G(), {
24
- neos: i,
25
- refObjs: x,
26
- activeNeo: I
23
+ const {
24
+ neos: e,
25
+ refObjs: I,
26
+ activeNeo: P
27
27
  } = $;
28
- function P(o) {
28
+ function k(o) {
29
29
  const { remainingInits: r } = o;
30
30
  return { remainingInits: r - 1 };
31
31
  }
32
- const { camera: g } = N(), [k, O] = y(P, {
33
- remainingInits: i && Array.isArray(i) ? i.length : 0
32
+ const { camera: g } = N(), [x, O] = _(k, {
33
+ remainingInits: e && Array.isArray(e) ? e.length : 0
34
34
  });
35
35
  function M() {
36
- return (x || ["earth", "jupiter", "mars", "neptune"]).map(B).map((r) => {
36
+ return (I || ["earth", "jupiter", "mars", "neptune"]).map(B).map((r) => {
37
37
  const {
38
38
  orbitColor: u,
39
- objectColor: b,
40
- objectRadius: p,
39
+ objectColor: p,
40
+ objectRadius: b,
41
41
  Ref: T,
42
- Principal_desig: z,
43
- name: A
42
+ Principal_desig: y,
43
+ name: z
44
44
  } = r;
45
45
  return /* @__PURE__ */ f(
46
- C,
46
+ R,
47
47
  {
48
48
  type: "planet",
49
49
  data: r,
@@ -51,62 +51,63 @@ function H({
51
51
  zoomMod: m,
52
52
  defaultZoom: c,
53
53
  playing: a,
54
- stepDirection: e,
54
+ stepDirection: i,
55
55
  dayPerVizSec: n,
56
56
  frameOverride: s,
57
57
  orbitColor: u,
58
- objectColor: b,
59
- objectRadius: p,
58
+ objectColor: p,
59
+ objectRadius: b,
60
60
  reset: j
61
61
  },
62
- `${T}-${z || A}`
62
+ `${T}-${y || z}`
63
63
  );
64
64
  });
65
65
  }
66
66
  return q((o, r) => {
67
- g.zoom !== m && h(g.zoom), a && d(l + e * r * n);
67
+ g.zoom !== m && C(g.zoom), a && d(l + i * r * n);
68
68
  }), E(() => {
69
- s && d(l + e * (1 / 60) * n);
70
- }, [s]), /* @__PURE__ */ F(_, { children: [
69
+ s && d(l + i * (1 / 60) * n);
70
+ }, [s]), /* @__PURE__ */ A(F, { children: [
71
71
  M(),
72
- R ? /* @__PURE__ */ f(
72
+ h ? /* @__PURE__ */ f(
73
73
  w,
74
74
  {
75
- data: i,
75
+ data: e,
76
76
  position: [0, 0, 0],
77
77
  initialized: !0,
78
78
  zoomMod: m,
79
79
  defaultZoom: c,
80
80
  playing: a,
81
- stepDirection: e,
81
+ stepDirection: i,
82
82
  dayPerVizSec: n,
83
83
  frameOverride: s,
84
84
  initCallback: O
85
85
  }
86
- ) : i ? i.map((o, r) => {
87
- const { Ref: u, Principal_desig: b, name: p } = o;
86
+ ) : e ? e.map((o, r) => {
87
+ const { Ref: u, Principal_desig: p, name: b } = o;
88
88
  return /* @__PURE__ */ f(
89
- C,
89
+ R,
90
90
  {
91
+ type: "neo",
91
92
  data: o,
92
93
  position: [0, 0, 0],
93
- active: o === I,
94
- initialized: k.remainingInits <= 0,
94
+ active: o === P,
95
+ initialized: x.remainingInits <= 0,
95
96
  zoomMod: m,
96
97
  defaultZoom: c,
97
98
  playing: a,
98
- stepDirection: e,
99
+ stepDirection: i,
99
100
  dayPerVizSec: n,
100
101
  frameOverride: s,
101
102
  reset: j,
102
103
  initCallback: O
103
104
  },
104
- u && (b || p) ? `${u}-${b || p}` : `orbit-${r}`
105
+ u && (p || b) ? `${u}-${p || b}` : `orbit-${r}`
105
106
  );
106
107
  }) : null
107
108
  ] });
108
109
  }
109
- H.propTypes = {
110
+ G.propTypes = {
110
111
  playing: t.bool,
111
112
  dayPerVizSec: t.number,
112
113
  stepDirection: t.number,
@@ -121,5 +122,5 @@ H.propTypes = {
121
122
  reset: t.number
122
123
  };
123
124
  export {
124
- H as default
125
+ G as default
125
126
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("three");function d(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const i=d(g),c=100,f=1,n={sun:{objectColor:"#f8da86"},earth:{objectColor:"#3f9ef0",orbitColor:"#3079b8"},mars:{objectColor:"#ed4c4c",orbitColor:"#b53a3a"},jupiter:{objectColor:"#f1b571",orbitColor:"#b98b57"},neptune:{objectColor:"#3cae3f",orbitColor:"#29762b"},asteroid:{objectColor:"#b1f2ef",orbitColor:"#6a6e6e",objectHighlight:"#00ffff",orbitHighlight:"#ffffff"}},p={a:1,e:.01671022,i:0,H:-3.9,Ref:"Earth",Principal_desig:"Earth",Translated_desig_key:"planets.earth",orbitColor:n.earth.orbitColor,objectColor:n.earth.objectColor,objectRadius:5},C={a:1.52366231,e:.09341233,i:1.85061,H:-1.52,Ref:"Mars",Principal_desig:"Mars",Translated_desig_key:"planets.mars",orbitColor:n.mars.orbitColor,objectColor:n.mars.objectColor,objectRadius:4},j={a:5.2028,e:.048,i:1.31,H:-25.9,Ref:"Jupiter",Principal_desig:"Jupiter",Translated_desig_key:"planets.jupiter",orbitColor:n.jupiter.orbitColor,objectColor:n.jupiter.objectColor,objectRadius:7},_={a:30.06896348,e:.00858587,i:1.76917,H:-25.9,Ref:"Neptune",Principal_desig:"Neptune",Translated_desig_key:"planets.neptune",orbitColor:n.neptune.orbitColor,objectColor:n.neptune.objectColor,objectRadius:6},m=e=>({neptune:_,earth:p,mars:C,jupiter:j})[e]||null,A=function(e,t){return Number.parseFloat(Number.parseFloat(e).toFixed(t))},R=(e,t,o=0,r=0)=>new i.EllipseCurve(o,r,e,t,0,2*Math.PI,!1,0),T=e=>new i.BufferGeometry().setFromPoints(e),y=(e,t)=>{const o=e.distanceTo(t),{x:r,y:s}=e;return Math.acos((o**2+r**2-s**2)/(2*o*r))*180/Math.PI},P=(e,t)=>{const{x:o,y:r}=t.getPoint(e);return new i.Vector3(o,r,0)},b=e=>e*c,h=e=>e/c,S=(e,t)=>b(e*Math.sqrt(1-t**2)),O=e=>1496e8*e,a=e=>e*(Math.PI/180),M=(e,t)=>{const o=.000296005155*c**3;return Math.sqrt(o*(2/e-1/t))},x=(e,t)=>Math.sqrt(e**2-t**2),z=(e,t)=>{const{i:o,Peri:r,Node:s}=t,l=new i.Vector3(0,1,0),u=new i.Vector3(0,0,1);return new i.Vector3(e.x,e.y,0).applyAxisAngle(u,r?a(r+90):0).applyAxisAngle(l,a(o)).applyAxisAngle(u,s?a(s):0)},E=(e,t)=>{const s=15*(e/t);return s<=4?4:s>=15?15:s};exports.AU_TO_VIZ_SCALER=c;exports.DAY_PER_VIZ_SEC=f;exports.ORBITAL_COLORS=n;exports.auToMeters=O;exports.auToUnit=b;exports.convert2dTo3d=z;exports.degsToRads=a;exports.formatValue=A;exports.getAngleFromPos=y;exports.getCurve=R;exports.getFocus=x;exports.getLabelSize=E;exports.getLineGeometry=T;exports.getMinorAxis=S;exports.getPosFromArcLength=P;exports.getRefObjProps=m;exports.getVelocity=M;exports.unitToAu=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("three");function p(e){if(e&&e.__esModule)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const s=p(C),c=100,j=1,r={sun:{objectColor:"#f8da86"},earth:{objectColor:"#3f9ef0",orbitColor:"#3079b8"},mars:{objectColor:"#ed4c4c",orbitColor:"#b53a3a"},jupiter:{objectColor:"#f1b571",orbitColor:"#b98b57"},neptune:{objectColor:"#3cae3f",orbitColor:"#29762b"},asteroid:{objectColor:"#b1f2ef",orbitColor:"#6a6e6e",objectHighlight:"#00ffff",orbitHighlight:"#ffffff"},neos:{objectColor:"#0ff",orbitColor:"#b2ffff"}},b={a:1.4700451,e:.5598234,i:6.35515,H:16.25,Ref:"Apollo",name:"Apollo",Principal_desig:"1932 HA",Translated_desig_key:"neo.apollo",orbitColor:r.neos.orbitColor,objectColor:r.neos.objectColor,objectRadius:5},d={a:.740919,e:.3221221,i:25.62023,H:16.3,Ref:"Atira",Principal_desig:"2003 CP20",Translated_desig_key:"neo.atira",orbitColor:r.neos.orbitColor,objectColor:r.neos.objectColor,objectRadius:5},g={a:1.9194158,e:.4353207,i:11.87658,H:17.7,Ref:"Amor",Principal_desig:"1932 EA1",Translated_desig_key:"neo.amor",orbitColor:r.neos.orbitColor,objectColor:r.neos.objectColor,objectRadius:5},_={a:1,e:.01671022,i:0,H:-3.9,Ref:"Earth",Principal_desig:"Earth",Translated_desig_key:"planets.earth",orbitColor:r.earth.orbitColor,objectColor:r.earth.objectColor,objectRadius:5},m={a:1.52366231,e:.09341233,i:1.85061,H:-1.52,Ref:"Mars",Principal_desig:"Mars",Translated_desig_key:"planets.mars",orbitColor:r.mars.orbitColor,objectColor:r.mars.objectColor,objectRadius:4},A={a:5.2028,e:.048,i:1.31,H:-25.9,Ref:"Jupiter",Principal_desig:"Jupiter",Translated_desig_key:"planets.jupiter",orbitColor:r.jupiter.orbitColor,objectColor:r.jupiter.objectColor,objectRadius:7},R={a:30.06896348,e:.00858587,i:1.76917,H:-25.9,Ref:"Neptune",Principal_desig:"Neptune",Translated_desig_key:"planets.neptune",orbitColor:r.neptune.orbitColor,objectColor:r.neptune.objectColor,objectRadius:6},T=e=>({neptune:R,earth:_,mars:m,jupiter:A,atira:d,apollo:b,amor:g})[e]||null,P=function(e,o){return Number.parseFloat(Number.parseFloat(e).toFixed(o))},y=(e,o,t=0,n=0)=>new s.EllipseCurve(t,n,e,o,0,2*Math.PI,!1,0),h=e=>new s.BufferGeometry().setFromPoints(e),S=(e,o)=>{const t=e.distanceTo(o),{x:n,y:i}=e;return Math.acos((t**2+n**2-i**2)/(2*t*n))*180/Math.PI},O=(e,o)=>{const{x:t,y:n}=o.getPoint(e);return new s.Vector3(t,n,0)},f=e=>e*c,M=e=>e/c,x=(e,o)=>f(e*Math.sqrt(1-o**2)),E=e=>1496e8*e,a=e=>e*(Math.PI/180),z=(e,o)=>{const t=.000296005155*c**3;return Math.sqrt(t*(2/e-1/o))},L=(e,o)=>Math.sqrt(e**2-o**2),H=(e,o)=>{const{i:t,Peri:n,Node:i}=o,l=new s.Vector3(0,1,0),u=new s.Vector3(0,0,1);return new s.Vector3(e.x,e.y,0).applyAxisAngle(u,n?a(n+90):0).applyAxisAngle(l,a(t)).applyAxisAngle(u,i?a(i):0)},V=(e,o)=>{const i=15*(e/o);return i<=4?4:i>=15?15:i};exports.AU_TO_VIZ_SCALER=c;exports.DAY_PER_VIZ_SEC=j;exports.ORBITAL_COLORS=r;exports.amor=g;exports.apollo=b;exports.atira=d;exports.auToMeters=E;exports.auToUnit=f;exports.convert2dTo3d=H;exports.degsToRads=a;exports.formatValue=P;exports.getAngleFromPos=S;exports.getCurve=y;exports.getFocus=L;exports.getLabelSize=V;exports.getLineGeometry=h;exports.getMinorAxis=x;exports.getPosFromArcLength=O;exports.getRefObjProps=T;exports.getVelocity=z;exports.unitToAu=M;
@@ -47,6 +47,71 @@ export namespace ORBITAL_COLORS {
47
47
  export let objectHighlight: string;
48
48
  export let orbitHighlight: string;
49
49
  }
50
+ namespace neos {
51
+ let objectColor_8: string;
52
+ export { objectColor_8 as objectColor };
53
+ let orbitColor_7: string;
54
+ export { orbitColor_7 as orbitColor };
55
+ }
56
+ }
57
+ export namespace apollo {
58
+ export let a: number;
59
+ export let e: number;
60
+ export let i: number;
61
+ export let H: number;
62
+ export let Ref: string;
63
+ export let name: string;
64
+ export let Principal_desig: string;
65
+ export let Translated_desig_key: string;
66
+ import orbitColor_8 = orbitColor;
67
+ export { orbitColor_8 as orbitColor };
68
+ import objectColor_9 = objectColor;
69
+ export { objectColor_9 as objectColor };
70
+ export let objectRadius: number;
71
+ }
72
+ export namespace atira {
73
+ let a_1: number;
74
+ export { a_1 as a };
75
+ let e_1: number;
76
+ export { e_1 as e };
77
+ let i_1: number;
78
+ export { i_1 as i };
79
+ let H_1: number;
80
+ export { H_1 as H };
81
+ let Ref_1: string;
82
+ export { Ref_1 as Ref };
83
+ let Principal_desig_1: string;
84
+ export { Principal_desig_1 as Principal_desig };
85
+ let Translated_desig_key_1: string;
86
+ export { Translated_desig_key_1 as Translated_desig_key };
87
+ import orbitColor_9 = orbitColor;
88
+ export { orbitColor_9 as orbitColor };
89
+ import objectColor_10 = objectColor;
90
+ export { objectColor_10 as objectColor };
91
+ let objectRadius_1: number;
92
+ export { objectRadius_1 as objectRadius };
93
+ }
94
+ export namespace amor {
95
+ let a_2: number;
96
+ export { a_2 as a };
97
+ let e_2: number;
98
+ export { e_2 as e };
99
+ let i_2: number;
100
+ export { i_2 as i };
101
+ let H_2: number;
102
+ export { H_2 as H };
103
+ let Ref_2: string;
104
+ export { Ref_2 as Ref };
105
+ let Principal_desig_2: string;
106
+ export { Principal_desig_2 as Principal_desig };
107
+ let Translated_desig_key_2: string;
108
+ export { Translated_desig_key_2 as Translated_desig_key };
109
+ import orbitColor_10 = orbitColor;
110
+ export { orbitColor_10 as orbitColor };
111
+ import objectColor_11 = objectColor;
112
+ export { objectColor_11 as objectColor };
113
+ let objectRadius_2: number;
114
+ export { objectRadius_2 as objectRadius };
50
115
  }
51
116
  export function getRefObjProps(id: any): any;
52
117
  export function formatValue(number: any, decimalPlaces: any): number;