@rubin-epo/epo-widget-lib 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OrbitalSim.cjs +1 -1
- package/dist/OrbitalSim.d.ts +0 -2
- package/dist/OrbitalSim.js +6 -144
- package/dist/atomic/PlaybackControl/PlaybackControl.cjs +1 -1
- package/dist/atomic/PlaybackControl/PlaybackControl.js +5 -5
- package/dist/atomic/PlaybackControl/styles.cjs +8 -5
- package/dist/atomic/PlaybackControl/styles.d.ts +4 -0
- package/dist/atomic/PlaybackControl/styles.js +12 -8
- package/dist/localeStrings/es/epo-widget-lib.json +1 -1
- package/dist/style.css +1 -1
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.d.ts +0 -0
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -0
- package/dist/widgets/OrbitalSim/Context/index.d.ts +66 -0
- package/dist/widgets/OrbitalSim/Context/index.js +61 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.cjs +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.js +1 -1
- package/dist/widgets/OrbitalSim/Observation.cjs +1 -1
- package/dist/widgets/OrbitalSim/Observation.d.ts +1 -5
- package/dist/widgets/OrbitalSim/Observation.js +29 -39
- package/dist/widgets/OrbitalSim/Observations.cjs +1 -1
- package/dist/widgets/OrbitalSim/Observations.d.ts +1 -5
- package/dist/widgets/OrbitalSim/Observations.js +19 -23
- package/dist/widgets/OrbitalSim/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbital.d.ts +1 -4
- package/dist/widgets/OrbitalSim/Orbital.js +69 -70
- package/dist/widgets/OrbitalSim/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalDetails.d.ts +1 -13
- package/dist/widgets/OrbitalSim/OrbitalDetails.js +12 -15
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.d.ts +2 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.js +108 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.js +42 -42
- package/dist/widgets/OrbitalSim/Orbitals.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals.d.ts +1 -16
- package/dist/widgets/OrbitalSim/Orbitals.js +85 -104
- package/dist/widgets/OrbitalSim/PlaybackSpeed.cjs +1 -1
- package/dist/widgets/OrbitalSim/PlaybackSpeed.js +35 -36
- package/dist/widgets/OrbitalSim/PotentialOrbits.cjs +1 -1
- package/dist/widgets/OrbitalSim/PotentialOrbits.d.ts +1 -9
- package/dist/widgets/OrbitalSim/PotentialOrbits.js +27 -35
- package/dist/widgets/OrbitalSim/index.d.ts +2 -23
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +2 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +37 -34
- package/package.json +1 -1
|
@@ -1,59 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
2
|
+
import { jsxs as y, Fragment as b, jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { useState as C } from "react";
|
|
4
|
+
import v from "../../node_modules/prop-types/index.js";
|
|
5
5
|
import * as p from "three";
|
|
6
|
-
import
|
|
7
|
-
import { getCurve as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
observations: l
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function y(o, t, e) {
|
|
15
|
-
const n = P(o, t), s = new p.Vector3(n, 0, 0);
|
|
16
|
-
return E(o, t, s.x, s.y).getPoints(100).map((r) => I(r, e)).flat();
|
|
6
|
+
import B from "./Observations.js";
|
|
7
|
+
import { getCurve as T, convert2dTo3d as E, getFocus as I, auToUnit as P, getMinorAxis as w } from "./orbitalUtilities.js";
|
|
8
|
+
import { useOrbitalSimContext as A } from "./Context/index.js";
|
|
9
|
+
const F = () => {
|
|
10
|
+
const { orbits: l, observations: f } = A(), { neos: a } = l;
|
|
11
|
+
function g(o, t, e) {
|
|
12
|
+
const n = I(o, t), s = new p.Vector3(n, 0, 0);
|
|
13
|
+
return T(o, t, s.x, s.y).getPoints(100).map((r) => E(r, e)).flat();
|
|
17
14
|
}
|
|
18
|
-
function
|
|
15
|
+
function h(o) {
|
|
19
16
|
return o.map((t) => {
|
|
20
|
-
const { a: e, e: n } = t, s =
|
|
21
|
-
return
|
|
17
|
+
const { a: e, e: n } = t, s = P(e), r = w(e, n);
|
|
18
|
+
return g(s, r, t);
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
|
-
const [
|
|
21
|
+
const [d] = C(() => {
|
|
25
22
|
let o = 0;
|
|
26
23
|
const t = [], e = [];
|
|
27
|
-
|
|
28
|
-
const
|
|
24
|
+
h(a).forEach((r) => {
|
|
25
|
+
const x = r.length - 1;
|
|
29
26
|
for (let i = 0; i < r.length; i++) {
|
|
30
|
-
const
|
|
31
|
-
e.push(
|
|
27
|
+
const c = r[i], m = i + o;
|
|
28
|
+
e.push(c.x), e.push(c.y), e.push(c.z), t.push(m), t.push(i === x ? o : m + 1);
|
|
32
29
|
}
|
|
33
30
|
o += r.length;
|
|
34
31
|
});
|
|
35
32
|
const n = new p.BufferGeometry(), s = new p.Float32BufferAttribute(e, 3);
|
|
36
33
|
return n.setAttribute("position", s), n.setIndex(t), n;
|
|
37
34
|
});
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
return /* @__PURE__ */ y(b, { children: [
|
|
36
|
+
/* @__PURE__ */ u("lineSegments", { position: [0, 0, 0], geometry: d, children: /* @__PURE__ */ u("lineBasicMaterial", { attach: "material", color: "#CEB3DB" }) }),
|
|
37
|
+
f && a && /* @__PURE__ */ u(
|
|
38
|
+
B,
|
|
42
39
|
{
|
|
43
40
|
data: a[0],
|
|
44
|
-
observations:
|
|
45
|
-
selectionCallback: h,
|
|
46
|
-
activeObs: g
|
|
41
|
+
observations: f
|
|
47
42
|
}
|
|
48
43
|
)
|
|
49
44
|
] });
|
|
50
45
|
};
|
|
51
|
-
|
|
52
|
-
data:
|
|
53
|
-
observations: c.array,
|
|
54
|
-
selectionCallback: c.func,
|
|
55
|
-
activeObs: c.object
|
|
46
|
+
F.propTypes = {
|
|
47
|
+
data: v.array
|
|
56
48
|
};
|
|
57
49
|
export {
|
|
58
|
-
|
|
50
|
+
F as default
|
|
59
51
|
};
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare function OrbitalSim({ neos, activeNeo, activeObs, selectionCallback, paused, pov, defaultZoom, potentialOrbits, observations, noDetails, detailsSet, detailsRows, refObjs, noLabels, noControls }: any): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare namespace OrbitalSim {
|
|
5
|
-
var propTypes: {
|
|
6
|
-
neos: PropTypes.Requireable<any[]>;
|
|
7
|
-
activeNeo: PropTypes.Requireable<object>;
|
|
8
|
-
activeObs: PropTypes.Requireable<object>;
|
|
9
|
-
selectionCallback: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
-
paused: PropTypes.Requireable<boolean>;
|
|
11
|
-
pov: PropTypes.Requireable<string>;
|
|
12
|
-
defaultZoom: PropTypes.Requireable<number>;
|
|
13
|
-
potentialOrbits: PropTypes.Requireable<boolean>;
|
|
14
|
-
observations: PropTypes.Requireable<any[]>;
|
|
15
|
-
noDetails: PropTypes.Requireable<boolean>;
|
|
16
|
-
noLabels: PropTypes.Requireable<boolean>;
|
|
17
|
-
detailsSet: PropTypes.Requireable<string>;
|
|
18
|
-
detailsRows: PropTypes.Requireable<any[]>;
|
|
19
|
-
refObjs: PropTypes.Requireable<any[]>;
|
|
20
|
-
noControls: PropTypes.Requireable<boolean>;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export default OrbitalSim;
|
|
1
|
+
export { default as OrbitalSim } from './OrbitalSim';
|
|
2
|
+
export { OrbitalSimContext, OrbitalSimProvider, useOrbitalSimContext } from './Context';
|
|
@@ -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 s=d(g),
|
|
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 s=d(g),c=100,f=1,n={sun:{objectColor:"#f8da86"},mercury:{objectColor:"#dce0e3",orbitColor:"#a6a9ab"},venus:{objectColor:"#cd84ec",orbitColor:"#9c65b4"},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 s.EllipseCurve(o,r,e,t,0,2*Math.PI,!1,0),T=e=>new s.BufferGeometry().setFromPoints(e),y=(e,t)=>{const o=e.distanceTo(t),{x:r,y:i}=e;return Math.acos((o**2+r**2-i**2)/(2*o*r))*180/Math.PI},P=(e,t)=>{const{x:o,y:r}=t.getPoint(e);return new s.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:i}=t,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,r?a(r+90):0).applyAxisAngle(l,a(o)).applyAxisAngle(u,i?a(i):0)},E=(e,t)=>{const i=15*(e/t);return i<=4?4:i>=15?15:i};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;
|
|
@@ -49,6 +49,8 @@ export namespace ORBITAL_COLORS {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
export function getRefObjProps(id: any): any;
|
|
52
|
+
export function formatValue(number: any, decimalPlaces: any): number;
|
|
53
|
+
export function randomIntFromInterval(min: any, max: any): number;
|
|
52
54
|
export function getCurve(xRadius: any, yRadius: any, aX?: number, aY?: number): THREE.EllipseCurve;
|
|
53
55
|
export function getLineGeometry(points: any): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
|
|
54
56
|
export function getAngleFromPos(pos: any, sunPos: any): number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const c = 100, g = 1,
|
|
1
|
+
import * as i from "three";
|
|
2
|
+
const c = 100, g = 1, s = {
|
|
3
3
|
sun: {
|
|
4
4
|
objectColor: "#f8da86"
|
|
5
5
|
},
|
|
@@ -41,8 +41,8 @@ const c = 100, g = 1, i = {
|
|
|
41
41
|
Ref: "Earth",
|
|
42
42
|
Principal_desig: "Earth",
|
|
43
43
|
Translated_desig_key: "planets.earth",
|
|
44
|
-
orbitColor:
|
|
45
|
-
objectColor:
|
|
44
|
+
orbitColor: s.earth.orbitColor,
|
|
45
|
+
objectColor: s.earth.objectColor,
|
|
46
46
|
// objectRadius: 6371000,
|
|
47
47
|
objectRadius: 5
|
|
48
48
|
}, C = {
|
|
@@ -53,10 +53,10 @@ const c = 100, g = 1, i = {
|
|
|
53
53
|
Ref: "Mars",
|
|
54
54
|
Principal_desig: "Mars",
|
|
55
55
|
Translated_desig_key: "planets.mars",
|
|
56
|
-
orbitColor:
|
|
57
|
-
objectColor:
|
|
56
|
+
orbitColor: s.mars.orbitColor,
|
|
57
|
+
objectColor: s.mars.objectColor,
|
|
58
58
|
objectRadius: 4
|
|
59
|
-
},
|
|
59
|
+
}, p = {
|
|
60
60
|
a: 5.2028,
|
|
61
61
|
e: 0.048,
|
|
62
62
|
i: 1.31,
|
|
@@ -64,11 +64,11 @@ const c = 100, g = 1, i = {
|
|
|
64
64
|
Ref: "Jupiter",
|
|
65
65
|
Principal_desig: "Jupiter",
|
|
66
66
|
Translated_desig_key: "planets.jupiter",
|
|
67
|
-
orbitColor:
|
|
68
|
-
objectColor:
|
|
67
|
+
orbitColor: s.jupiter.orbitColor,
|
|
68
|
+
objectColor: s.jupiter.objectColor,
|
|
69
69
|
// objectRadius: 69911000,
|
|
70
70
|
objectRadius: 7
|
|
71
|
-
},
|
|
71
|
+
}, d = {
|
|
72
72
|
a: 30.06896348,
|
|
73
73
|
e: 858587e-8,
|
|
74
74
|
i: 1.76917,
|
|
@@ -76,16 +76,18 @@ const c = 100, g = 1, i = {
|
|
|
76
76
|
Ref: "Neptune",
|
|
77
77
|
Principal_desig: "Neptune",
|
|
78
78
|
Translated_desig_key: "planets.neptune",
|
|
79
|
-
orbitColor:
|
|
80
|
-
objectColor:
|
|
79
|
+
orbitColor: s.neptune.orbitColor,
|
|
80
|
+
objectColor: s.neptune.objectColor,
|
|
81
81
|
// objectRadius: 24622000,
|
|
82
82
|
objectRadius: 6
|
|
83
83
|
}, j = (e) => ({
|
|
84
|
-
neptune:
|
|
84
|
+
neptune: d,
|
|
85
85
|
earth: u,
|
|
86
86
|
mars: C,
|
|
87
|
-
jupiter:
|
|
88
|
-
})[e] || null, m = (e, o
|
|
87
|
+
jupiter: p
|
|
88
|
+
})[e] || null, m = function(e, o) {
|
|
89
|
+
return Number.parseFloat(Number.parseFloat(e).toFixed(o));
|
|
90
|
+
}, h = (e, o, t = 0, r = 0) => new i.EllipseCurve(
|
|
89
91
|
t,
|
|
90
92
|
// aX
|
|
91
93
|
r,
|
|
@@ -102,41 +104,42 @@ const c = 100, g = 1, i = {
|
|
|
102
104
|
// aClockwise
|
|
103
105
|
0
|
|
104
106
|
// aRotation
|
|
105
|
-
),
|
|
107
|
+
), _ = (e) => new i.BufferGeometry().setFromPoints(e), R = (e, o) => {
|
|
106
108
|
const t = e.distanceTo(o), { x: r, y: n } = e;
|
|
107
109
|
return Math.acos((t ** 2 + r ** 2 - n ** 2) / (2 * t * r)) * 180 / Math.PI;
|
|
108
|
-
},
|
|
110
|
+
}, A = (e, o) => {
|
|
109
111
|
const { x: t, y: r } = o.getPoint(e);
|
|
110
|
-
return new
|
|
111
|
-
}, f = (e) => e * c,
|
|
112
|
+
return new i.Vector3(t, r, 0);
|
|
113
|
+
}, f = (e) => e * c, x = (e) => e / c, y = (e, o) => f(e * Math.sqrt(1 - o ** 2)), P = (e) => 1496e8 * e, a = (e) => e * (Math.PI / 180), T = (e, o) => {
|
|
112
114
|
const t = 296005155e-12 * c ** 3;
|
|
113
115
|
return Math.sqrt(t * (2 / e - 1 / o));
|
|
114
|
-
},
|
|
115
|
-
const { i: t, Peri: r, Node: n } = o, l = new
|
|
116
|
-
return new
|
|
116
|
+
}, M = (e, o) => Math.sqrt(e ** 2 - o ** 2), S = (e, o) => {
|
|
117
|
+
const { i: t, Peri: r, Node: n } = o, l = new i.Vector3(0, 1, 0), b = new i.Vector3(0, 0, 1);
|
|
118
|
+
return new i.Vector3(e.x, e.y, 0).applyAxisAngle(b, r ? a(r + 90) : 0).applyAxisAngle(l, a(t)).applyAxisAngle(
|
|
117
119
|
b,
|
|
118
120
|
n ? a(n) : 0
|
|
119
121
|
);
|
|
120
|
-
},
|
|
122
|
+
}, z = (e, o) => {
|
|
121
123
|
const n = 15 * (e / o);
|
|
122
124
|
return n <= 4 ? 4 : n >= 15 ? 15 : n;
|
|
123
125
|
};
|
|
124
126
|
export {
|
|
125
127
|
c as AU_TO_VIZ_SCALER,
|
|
126
128
|
g as DAY_PER_VIZ_SEC,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
s as ORBITAL_COLORS,
|
|
130
|
+
P as auToMeters,
|
|
129
131
|
f as auToUnit,
|
|
130
|
-
|
|
132
|
+
S as convert2dTo3d,
|
|
131
133
|
a as degsToRads,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
m as formatValue,
|
|
135
|
+
R as getAngleFromPos,
|
|
136
|
+
h as getCurve,
|
|
137
|
+
M as getFocus,
|
|
138
|
+
z as getLabelSize,
|
|
139
|
+
_ as getLineGeometry,
|
|
137
140
|
y as getMinorAxis,
|
|
138
|
-
|
|
141
|
+
A as getPosFromArcLength,
|
|
139
142
|
j as getRefObjProps,
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
T as getVelocity,
|
|
144
|
+
x as unitToAu
|
|
142
145
|
};
|
package/package.json
CHANGED