@rubin-epo/epo-widget-lib 2.0.3 → 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.
Files changed (60) 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/localeStrings/en/epo-widget-lib.json +11 -3
  13. package/dist/localeStrings/es/epo-widget-lib.json +8 -5
  14. package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
  15. package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
  16. package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
  17. package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
  18. package/dist/widgets/OrbitalSim/Context/index.js +58 -32
  19. package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
  20. package/dist/widgets/OrbitalSim/OrbitalSim.js +94 -77
  21. package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
  22. package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
  23. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
  24. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
  25. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
  26. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
  27. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
  28. package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
  29. package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
  30. package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
  31. package/dist/widgets/OrbitalSim/styles.cjs +33 -5
  32. package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
  33. package/dist/widgets/OrbitalSim/styles.js +36 -6
  34. package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
  35. package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
  36. package/dist/widgets/SortableTable/SortableTable.js +41 -0
  37. package/dist/widgets/SortableTable/index.d.ts +1 -0
  38. package/dist/widgets/SortableTable/styles.cjs +8 -0
  39. package/dist/widgets/SortableTable/styles.d.ts +1 -0
  40. package/dist/widgets/SortableTable/styles.js +13 -0
  41. package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
  42. package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
  43. package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
  44. package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
  45. package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
  46. package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
  47. package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
  48. package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
  49. package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
  50. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  51. package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
  52. package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
  53. package/dist/widgets/SourceSelector/index.d.ts +2 -1
  54. package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
  55. package/package.json +1 -1
  56. package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
  57. package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
  58. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
  59. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
  60. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.js +0 -0
@@ -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;
@@ -1,5 +1,5 @@
1
- import * as i from "three";
2
- const c = 100, g = 1, s = {
1
+ import * as s from "three";
2
+ const l = 100, m = 1, t = {
3
3
  sun: {
4
4
  objectColor: "#f8da86"
5
5
  },
@@ -24,8 +24,46 @@ const c = 100, g = 1, s = {
24
24
  orbitColor: "#6a6e6e",
25
25
  objectHighlight: "#00ffff",
26
26
  orbitHighlight: "#ffffff"
27
+ },
28
+ neos: {
29
+ objectColor: "#0ff",
30
+ orbitColor: "#b2ffff"
27
31
  }
28
- }, b = {
32
+ }, u = {
33
+ a: 1.4700451,
34
+ e: 0.5598234,
35
+ i: 6.35515,
36
+ H: 16.25,
37
+ Ref: "Apollo",
38
+ name: "Apollo",
39
+ Principal_desig: "1932 HA",
40
+ Translated_desig_key: "neo.apollo",
41
+ orbitColor: t.neos.orbitColor,
42
+ objectColor: t.neos.objectColor,
43
+ objectRadius: 5
44
+ }, C = {
45
+ a: 0.740919,
46
+ e: 0.3221221,
47
+ i: 25.62023,
48
+ H: 16.3,
49
+ Ref: "Atira",
50
+ Principal_desig: "2003 CP20",
51
+ Translated_desig_key: "neo.atira",
52
+ orbitColor: t.neos.orbitColor,
53
+ objectColor: t.neos.objectColor,
54
+ objectRadius: 5
55
+ }, d = {
56
+ a: 1.9194158,
57
+ e: 0.4353207,
58
+ i: 11.87658,
59
+ H: 17.7,
60
+ Ref: "Amor",
61
+ Principal_desig: "1932 EA1",
62
+ Translated_desig_key: "neo.amor",
63
+ orbitColor: t.neos.orbitColor,
64
+ objectColor: t.neos.objectColor,
65
+ objectRadius: 5
66
+ }, f = {
29
67
  a: 1,
30
68
  e: 0.01671022,
31
69
  i: 0,
@@ -33,9 +71,8 @@ const c = 100, g = 1, s = {
33
71
  Ref: "Earth",
34
72
  Principal_desig: "Earth",
35
73
  Translated_desig_key: "planets.earth",
36
- orbitColor: s.earth.orbitColor,
37
- objectColor: s.earth.objectColor,
38
- // objectRadius: 6371000,
74
+ orbitColor: t.earth.orbitColor,
75
+ objectColor: t.earth.objectColor,
39
76
  objectRadius: 5
40
77
  }, p = {
41
78
  a: 1.52366231,
@@ -45,10 +82,10 @@ const c = 100, g = 1, s = {
45
82
  Ref: "Mars",
46
83
  Principal_desig: "Mars",
47
84
  Translated_desig_key: "planets.mars",
48
- orbitColor: s.mars.orbitColor,
49
- objectColor: s.mars.objectColor,
85
+ orbitColor: t.mars.orbitColor,
86
+ objectColor: t.mars.objectColor,
50
87
  objectRadius: 4
51
- }, f = {
88
+ }, g = {
52
89
  a: 5.2028,
53
90
  e: 0.048,
54
91
  i: 1.31,
@@ -56,11 +93,11 @@ const c = 100, g = 1, s = {
56
93
  Ref: "Jupiter",
57
94
  Principal_desig: "Jupiter",
58
95
  Translated_desig_key: "planets.jupiter",
59
- orbitColor: s.jupiter.orbitColor,
60
- objectColor: s.jupiter.objectColor,
96
+ orbitColor: t.jupiter.orbitColor,
97
+ objectColor: t.jupiter.objectColor,
61
98
  // objectRadius: 69911000,
62
99
  objectRadius: 7
63
- }, C = {
100
+ }, j = {
64
101
  a: 30.06896348,
65
102
  e: 858587e-8,
66
103
  i: 1.76917,
@@ -68,25 +105,28 @@ const c = 100, g = 1, s = {
68
105
  Ref: "Neptune",
69
106
  Principal_desig: "Neptune",
70
107
  Translated_desig_key: "planets.neptune",
71
- orbitColor: s.neptune.orbitColor,
72
- objectColor: s.neptune.objectColor,
108
+ orbitColor: t.neptune.orbitColor,
109
+ objectColor: t.neptune.objectColor,
73
110
  // objectRadius: 24622000,
74
111
  objectRadius: 6
75
- }, j = (e) => ({
76
- neptune: C,
77
- earth: b,
112
+ }, R = (o) => ({
113
+ neptune: j,
114
+ earth: f,
78
115
  mars: p,
79
- jupiter: f
80
- })[e] || null, m = function(e, t) {
81
- return Number.parseFloat(Number.parseFloat(e).toFixed(t));
82
- }, h = (e, t, o = 0, r = 0) => new i.EllipseCurve(
83
- o,
84
- // aX
116
+ jupiter: g,
117
+ atira: C,
118
+ apollo: u,
119
+ amor: d
120
+ })[o] || null, A = function(o, e) {
121
+ return Number.parseFloat(Number.parseFloat(o).toFixed(e));
122
+ }, h = (o, e, r = 0, n = 0) => new s.EllipseCurve(
85
123
  r,
124
+ // aX
125
+ n,
86
126
  // aY
87
- e,
127
+ o,
88
128
  // xRadius
89
- t,
129
+ e,
90
130
  // yRadius
91
131
  0,
92
132
  // aStartAngle
@@ -96,42 +136,45 @@ const c = 100, g = 1, s = {
96
136
  // aClockwise
97
137
  0
98
138
  // aRotation
99
- ), _ = (e) => new i.BufferGeometry().setFromPoints(e), R = (e, t) => {
100
- const o = e.distanceTo(t), { x: r, y: n } = e;
101
- return Math.acos((o ** 2 + r ** 2 - n ** 2) / (2 * o * r)) * 180 / Math.PI;
102
- }, A = (e, t) => {
103
- const { x: o, y: r } = t.getPoint(e);
104
- return new i.Vector3(o, r, 0);
105
- }, d = (e) => e * c, x = (e) => e / c, y = (e, t) => d(e * Math.sqrt(1 - t ** 2)), P = (e) => 1496e8 * e, a = (e) => e * (Math.PI / 180), T = (e, t) => {
106
- const o = 296005155e-12 * c ** 3;
107
- return Math.sqrt(o * (2 / e - 1 / t));
108
- }, M = (e, t) => Math.sqrt(e ** 2 - t ** 2), S = (e, t) => {
109
- const { i: o, Peri: r, Node: n } = t, l = new i.Vector3(0, 1, 0), u = new i.Vector3(0, 0, 1);
110
- return new i.Vector3(e.x, e.y, 0).applyAxisAngle(u, r ? a(r + 90) : 0).applyAxisAngle(l, a(o)).applyAxisAngle(
111
- u,
112
- n ? a(n) : 0
139
+ ), P = (o) => new s.BufferGeometry().setFromPoints(o), y = (o, e) => {
140
+ const r = o.distanceTo(e), { x: n, y: i } = o;
141
+ return Math.acos((r ** 2 + n ** 2 - i ** 2) / (2 * r * n)) * 180 / Math.PI;
142
+ }, T = (o, e) => {
143
+ const { x: r, y: n } = e.getPoint(o);
144
+ return new s.Vector3(r, n, 0);
145
+ }, _ = (o) => o * l, x = (o) => o / l, M = (o, e) => _(o * Math.sqrt(1 - e ** 2)), S = (o) => 1496e8 * o, a = (o) => o * (Math.PI / 180), z = (o, e) => {
146
+ const r = 296005155e-12 * l ** 3;
147
+ return Math.sqrt(r * (2 / o - 1 / e));
148
+ }, H = (o, e) => Math.sqrt(o ** 2 - e ** 2), E = (o, e) => {
149
+ const { i: r, Peri: n, Node: i } = e, c = new s.Vector3(0, 1, 0), b = new s.Vector3(0, 0, 1);
150
+ return new s.Vector3(o.x, o.y, 0).applyAxisAngle(b, n ? a(n + 90) : 0).applyAxisAngle(c, a(r)).applyAxisAngle(
151
+ b,
152
+ i ? a(i) : 0
113
153
  );
114
- }, z = (e, t) => {
115
- const n = 15 * (e / t);
116
- return n <= 4 ? 4 : n >= 15 ? 15 : n;
154
+ }, V = (o, e) => {
155
+ const i = 15 * (o / e);
156
+ return i <= 4 ? 4 : i >= 15 ? 15 : i;
117
157
  };
118
158
  export {
119
- c as AU_TO_VIZ_SCALER,
120
- g as DAY_PER_VIZ_SEC,
121
- s as ORBITAL_COLORS,
122
- P as auToMeters,
123
- d as auToUnit,
124
- S as convert2dTo3d,
159
+ l as AU_TO_VIZ_SCALER,
160
+ m as DAY_PER_VIZ_SEC,
161
+ t as ORBITAL_COLORS,
162
+ d as amor,
163
+ u as apollo,
164
+ C as atira,
165
+ S as auToMeters,
166
+ _ as auToUnit,
167
+ E as convert2dTo3d,
125
168
  a as degsToRads,
126
- m as formatValue,
127
- R as getAngleFromPos,
169
+ A as formatValue,
170
+ y as getAngleFromPos,
128
171
  h as getCurve,
129
- M as getFocus,
130
- z as getLabelSize,
131
- _ as getLineGeometry,
132
- y as getMinorAxis,
133
- A as getPosFromArcLength,
134
- j as getRefObjProps,
135
- T as getVelocity,
172
+ H as getFocus,
173
+ V as getLabelSize,
174
+ P as getLineGeometry,
175
+ M as getMinorAxis,
176
+ T as getPosFromArcLength,
177
+ R as getRefObjProps,
178
+ z as getVelocity,
136
179
  x as unitToAu
137
180
  };
@@ -1,4 +1,4 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),r=require("@react-three/fiber"),i=e=>e&&e.__esModule?e:{default:e},a=i(t),o=t.createGlobalStyle`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("styled-components"),r=require("@react-three/fiber"),i=t=>t&&t.__esModule?t:{default:t},e=i(a),o=a.createGlobalStyle`
2
2
  :root {
3
3
  --white: #ffffff;
4
4
  --black: #000000;
@@ -32,16 +32,16 @@
32
32
  --headingWithSpaceHeight: 90px;
33
33
  --tallestSquareWidget: calc(100vh - var(--pageNavHeight) - var(--siteHeaderHeight) - var(--headingWithSpaceHeight) - var(--minPadding));
34
34
  }
35
- `,l=a.default.div`
35
+ `,l=e.default.div`
36
36
  position: relative;
37
37
  height: var(--tallestSquareWidget);
38
38
  min-height: 500px;
39
39
  background-color: #000000;
40
40
  color-adjust: exact;
41
- `,n=a.default(r.Canvas)`
41
+ `,n=e.default(r.Canvas)`
42
42
  position: relative;
43
43
  z-index: 1;
44
- `,s=a.default.div`
44
+ `,d=e.default.div`
45
45
  padding: 2px 4px;
46
46
  margin-top: 4px;
47
47
  font-weight: var(--medium);
@@ -52,4 +52,32 @@
52
52
  color-adjust: exact;
53
53
  z-index: 10000;
54
54
  height: fit-content;
55
- `;exports.CanvasWrapper=n;exports.GlobalStyles=o;exports.OrbitalSimWrapper=l;exports.SunLabel=s;
55
+ `,s=e.default.aside`
56
+ position: absolute;
57
+ top: 0px;
58
+ left: 0px;
59
+ bottom: 0px;
60
+ z-index: 10;
61
+ background-color: #fff;
62
+ width: 10%;
63
+ height: 100%;
64
+ display: flex;
65
+ flex-direction: column;
66
+ `,p=e.default.button`
67
+ width: 100%;
68
+ padding: 12px 16px;
69
+ text-align: left;
70
+ background-color: #F3F3F3;
71
+ color: #017F80;
72
+ text-align: center;
73
+
74
+ &:hover {
75
+ background-color: #017F80;
76
+ color: #fff;
77
+ }
78
+
79
+ &[data-active="true"] {
80
+ background-color: #017F80;
81
+ color: #fff;
82
+ }
83
+ `;exports.CanvasWrapper=n;exports.GlobalStyles=o;exports.OrbitalSimWrapper=l;exports.SunLabel=d;exports.SwappableOrbitButton=p;exports.SwappableOrbitsContainer=s;
@@ -4,3 +4,5 @@ export declare const GlobalStyles: import('react').NamedExoticComponent<import('
4
4
  export declare const OrbitalSimWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
5
  export declare const CanvasWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('@react-three/fiber').CanvasProps, never>> & string & Omit<typeof Canvas, keyof import('react').Component<any, {}, any>>;
6
6
  export declare const SunLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const SwappableOrbitsContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
8
+ export declare const SwappableOrbitButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import e, { createGlobalStyle as a } from "styled-components";
3
- import { Canvas as r } from "@react-three/fiber";
4
- const o = a`
2
+ import e, { createGlobalStyle as t } from "styled-components";
3
+ import { Canvas as a } from "@react-three/fiber";
4
+ const o = t`
5
5
  :root {
6
6
  --white: #ffffff;
7
7
  --black: #000000;
@@ -41,10 +41,10 @@ const o = a`
41
41
  min-height: 500px;
42
42
  background-color: #000000;
43
43
  color-adjust: exact;
44
- `, n = e(r)`
44
+ `, n = e(a)`
45
45
  position: relative;
46
46
  z-index: 1;
47
- `, s = e.div`
47
+ `, d = e.div`
48
48
  padding: 2px 4px;
49
49
  margin-top: 4px;
50
50
  font-weight: var(--medium);
@@ -55,10 +55,40 @@ const o = a`
55
55
  color-adjust: exact;
56
56
  z-index: 10000;
57
57
  height: fit-content;
58
+ `, c = e.aside`
59
+ position: absolute;
60
+ top: 0px;
61
+ left: 0px;
62
+ bottom: 0px;
63
+ z-index: 10;
64
+ background-color: #fff;
65
+ width: 10%;
66
+ height: 100%;
67
+ display: flex;
68
+ flex-direction: column;
69
+ `, p = e.button`
70
+ width: 100%;
71
+ padding: 12px 16px;
72
+ text-align: left;
73
+ background-color: #F3F3F3;
74
+ color: #017F80;
75
+ text-align: center;
76
+
77
+ &:hover {
78
+ background-color: #017F80;
79
+ color: #fff;
80
+ }
81
+
82
+ &[data-active="true"] {
83
+ background-color: #017F80;
84
+ color: #fff;
85
+ }
58
86
  `;
59
87
  export {
60
88
  n as CanvasWrapper,
61
89
  o as GlobalStyles,
62
90
  l as OrbitalSimWrapper,
63
- s as SunLabel
91
+ d as SunLabel,
92
+ p as SwappableOrbitButton,
93
+ c as SwappableOrbitsContainer
64
94
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),C=require("./styles.cjs"),r="asc",w="desc",j=({tableData:a})=>{const[i]=d.useState(a),o=a?Object.keys(i[0]):null,[s,f]=d.useState(o?o[0]:""),[c,S]=d.useState(r);function p(e){if(s===e){S(n=>n===r?w:r);return}f(e),S(r)}const m=d.useMemo(()=>{if(i)return[...i].sort((n,g)=>{const u=n[s],l=g[s];if(typeof u=="number"&&typeof l=="number")return c===r?u-l:l-u;const b=String(u).toLowerCase(),h=String(l).toLowerCase();return c===r?b.localeCompare(h):h.localeCompare(b)})},[i,s,c]);function x(e){return s!==e?"":c===r?"↑":"↓"}return t.jsx(t.Fragment,{children:a&&t.jsxs(C.Table,{children:[t.jsx("thead",{children:t.jsx("tr",{children:o&&o.map(e=>t.jsx("th",{scope:"col","aria-sort":s===e?c===r?"ascending":"descending":"none",children:t.jsxs("button",{type:"button",onClick:()=>p(e),children:[e," ",x(e)]})},e))})}),t.jsx("tbody",{children:m&&m.map(e=>t.jsx("tr",{children:o&&o.map(n=>t.jsx("td",{children:e[n]},n))}))})]})})};j.displayName="Widgets.SortableTable";exports.default=j;
@@ -0,0 +1,19 @@
1
+ type TableDataProps<T extends Record<string, string | number | null>> = {
2
+ tableData: T[];
3
+ };
4
+ /**
5
+ * This widget will take an array of uniform (same properties across all elements)
6
+ * objects and render a table from the values. The table headers will be created
7
+ * based on the property names. The table can be sorted ascending or descending
8
+ * by one column at a time. If non-uniform objects are contained in the array,
9
+ * the widget will only build out the columns specific by the properties on the
10
+ * first element of the array.
11
+ *
12
+ * @param tabledata: an array of objects that will be used to build the table
13
+ * @returns the sortable table
14
+ */
15
+ declare const SortableTable: {
16
+ <T extends Record<string, string | number | null>>({ tableData }: TableDataProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ };
19
+ export default SortableTable;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx as o, Fragment as j, jsxs as h } from "react/jsx-runtime";
3
+ import { useState as u, useMemo as x } from "react";
4
+ import { Table as N } from "./styles.js";
5
+ const r = "asc", T = "desc", y = ({
6
+ tableData: a
7
+ }) => {
8
+ const [i] = u(a), e = a ? Object.keys(i[0]) : null, [n, b] = u(e ? e[0] : ""), [c, m] = u(r);
9
+ function g(t) {
10
+ if (n === t) {
11
+ m((s) => s === r ? T : r);
12
+ return;
13
+ }
14
+ b(t), m(r);
15
+ }
16
+ const p = x(() => {
17
+ if (i)
18
+ return [...i].sort((s, w) => {
19
+ const l = s[n], d = w[n];
20
+ if (typeof l == "number" && typeof d == "number")
21
+ return c === r ? l - d : d - l;
22
+ const f = String(l).toLowerCase(), S = String(d).toLowerCase();
23
+ return c === r ? f.localeCompare(S) : S.localeCompare(f);
24
+ });
25
+ }, [i, n, c]);
26
+ function C(t) {
27
+ return n !== t ? "" : c === r ? "↑" : "↓";
28
+ }
29
+ return /* @__PURE__ */ o(j, { children: a && /* @__PURE__ */ h(N, { children: [
30
+ /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ o("tr", { children: e && e.map((t) => /* @__PURE__ */ o("th", { scope: "col", "aria-sort": n === t ? c === r ? "ascending" : "descending" : "none", children: /* @__PURE__ */ h("button", { type: "button", onClick: () => g(t), children: [
31
+ t,
32
+ " ",
33
+ C(t)
34
+ ] }) }, t)) }) }),
35
+ /* @__PURE__ */ o("tbody", { children: p && p.map((t) => /* @__PURE__ */ o("tr", { children: e && e.map((s) => /* @__PURE__ */ o("td", { children: t[s] }, s)) })) })
36
+ ] }) });
37
+ };
38
+ y.displayName = "Widgets.SortableTable";
39
+ export {
40
+ y as default
41
+ };