@rubin-epo/epo-widget-lib 2.0.4 → 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.
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +18 -25
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +50 -53
- package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -1
- package/dist/widgets/OrbitalSim/Camera/Camera.js +9 -8
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
- package/dist/widgets/OrbitalSim/Context/index.js +6 -6
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),u=require("@rubin-epo/epo-react-lib/styles"),o=require("./styles.cjs"),d=require("../ForeignObject/index.cjs"),y=require("../Viewport/index.cjs"),j=(n="")=>{const r=["top","right"],a=["center","center"],s=n?[...n.split(" "),...a].slice(0,2):r,e={justifyContent:null,alignItems:null};return s.forEach(i=>{switch(i){case"center":e.alignItems=e.alignItems??"center",e.justifyContent=e.justifyContent??"center";break;case"top":e.alignItems="start";break;case"right":e.justifyContent="end";break;case"bottom":e.alignItems="end";break;case"left":e.justifyContent="start";break}}),e},c=({className:n,children:r,position:a,viewport:s,forIds:e,forScreenreaders:i})=>{const l=t.jsx(d.default,{children:t.jsx(o.DisplayContainer,{style:j(a),children:t.jsxs(o.Display,{form:Array.isArray(e)?e.join(" "):e,className:n,children:[t.jsx("span",{"aria-hidden":!!i,children:r}),t.jsx(u.ScreenreaderText,{children:i})]})})});return s?t.jsx(y.default,{...s,children:l}):l};c.displayName="Charts.Readout";exports.default=c;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { ScreenreaderText as c } from "@rubin-epo/epo-react-lib/styles";
|
|
3
|
-
import "
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "../Bars/index.js";
|
|
9
|
-
import m from "../Viewport/index.js";
|
|
10
|
-
import p from "../ForeignObject/index.js";
|
|
11
|
-
import "../ScatterPlot/index.js";
|
|
12
|
-
import { DisplayContainer as f, Display as u } from "./styles.js";
|
|
13
|
-
const d = (i = "") => {
|
|
14
|
-
const o = ["top", "right"], s = ["center", "center"], r = i ? [...i.split(" "), ...s].slice(0, 2) : o, t = {
|
|
3
|
+
import { DisplayContainer as m, Display as f } from "./styles.js";
|
|
4
|
+
import u from "../ForeignObject/index.js";
|
|
5
|
+
import d from "../Viewport/index.js";
|
|
6
|
+
const p = (n = "") => {
|
|
7
|
+
const s = ["top", "right"], o = ["center", "center"], i = n ? [...n.split(" "), ...o].slice(0, 2) : s, t = {
|
|
15
8
|
justifyContent: null,
|
|
16
9
|
alignItems: null
|
|
17
10
|
};
|
|
18
|
-
return
|
|
19
|
-
switch (
|
|
11
|
+
return i.forEach((r) => {
|
|
12
|
+
switch (r) {
|
|
20
13
|
case "center":
|
|
21
14
|
t.alignItems = t.alignItems ?? "center", t.justifyContent = t.justifyContent ?? "center";
|
|
22
15
|
break;
|
|
@@ -35,25 +28,25 @@ const d = (i = "") => {
|
|
|
35
28
|
}
|
|
36
29
|
}), t;
|
|
37
30
|
}, y = ({
|
|
38
|
-
className:
|
|
39
|
-
children:
|
|
40
|
-
position:
|
|
41
|
-
viewport:
|
|
31
|
+
className: n,
|
|
32
|
+
children: s,
|
|
33
|
+
position: o,
|
|
34
|
+
viewport: i,
|
|
42
35
|
forIds: t,
|
|
43
|
-
forScreenreaders:
|
|
36
|
+
forScreenreaders: r
|
|
44
37
|
}) => {
|
|
45
|
-
const a = /* @__PURE__ */ e(
|
|
46
|
-
|
|
38
|
+
const a = /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(m, { style: p(o), children: /* @__PURE__ */ l(
|
|
39
|
+
f,
|
|
47
40
|
{
|
|
48
41
|
form: Array.isArray(t) ? t.join(" ") : t,
|
|
49
|
-
className:
|
|
42
|
+
className: n,
|
|
50
43
|
children: [
|
|
51
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !!
|
|
52
|
-
/* @__PURE__ */ e(c, { children:
|
|
44
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children: s }),
|
|
45
|
+
/* @__PURE__ */ e(c, { children: r })
|
|
53
46
|
]
|
|
54
47
|
}
|
|
55
48
|
) }) });
|
|
56
|
-
return
|
|
49
|
+
return i ? /* @__PURE__ */ e(d, { ...i, children: a }) : a;
|
|
57
50
|
};
|
|
58
51
|
y.displayName = "Charts.Readout";
|
|
59
52
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react")
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react"),$=require("../hooks/useAxis.cjs"),K=require("./styles.cjs"),R=require("../defaults.cjs"),Q=require("../canvas/Points/index.cjs"),U=require("../YAxis/index.cjs"),V=require("../ClippingContainer/index.cjs"),H=require("../Guidelines/index.cjs"),X=require("../XAxis/index.cjs"),Y=require("../Tooltip/index.cjs"),Z=require("../Points/index.cjs"),w={svg:Z.default,canvas:Q.default},M=({data:C,className:D,xAxis:l,yAxis:c,width:d,height:u,title:T,activePointId:p,margins:z,tooltip:a,onLoadedCallback:B,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=C,o={...R.default.margins,...z},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===p),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,j,t]=$.default({...l,range:f}),[i,m,s]=$.default({...c,range:b}),S=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),k="x-axis-label",L="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[E],P=n.jsx(F,{data:x,onHoverCallback:a?v=>h(v):void 0,onHoverOutCallback:a?()=>h(void 0):void 0,width:d,height:u,xScale:t,yScale:s,label:O,onLoadedCallback:B}),G={Data:P,xScale:t,yScale:s,yStart:S,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(K.Chart,{verticalLabel:c.label,verticalLabelId:L,horizontalLabel:l.label,horizontalLabelId:k,className:D,width:d,height:u,title:T,children:[n.jsx(U.default,{ticks:m,x:g,labelledById:L,yDomain:i,yScale:s}),n.jsxs(V.default,{x:g,y:I,width:N,height:W,children:[l.guidelines&&n.jsx(H.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),c.guidelines&&n.jsx(H.default,{guides:m.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(X.default,{ticks:j,y:S,labelledById:k,xDomain:r,xScale:t}),a&&n.jsxs(Y.default,{x:e?t(e.x):void 0,y:e?s(e.y):void 0,visible:!!e,offset:R.default.pointRadius,children:[e&&typeof a=="function"&&a(e),e&&typeof a=="string"&&a]})]})};M.displayName="Charts.ScatterPlot";exports.default=M;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as u, jsx as
|
|
2
|
+
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import { useState as F } from "react";
|
|
4
|
-
import "../
|
|
5
|
-
import J from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import Q from "../
|
|
9
|
-
import U from "../
|
|
10
|
-
import
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
14
|
-
import { Chart as Z } from "./styles.js";
|
|
15
|
-
import T from "../defaults.js";
|
|
16
|
-
import _ from "../canvas/Points/index.js";
|
|
4
|
+
import R from "../hooks/useAxis.js";
|
|
5
|
+
import { Chart as J } from "./styles.js";
|
|
6
|
+
import D from "../defaults.js";
|
|
7
|
+
import K from "../canvas/Points/index.js";
|
|
8
|
+
import Q from "../YAxis/index.js";
|
|
9
|
+
import U from "../ClippingContainer/index.js";
|
|
10
|
+
import T from "../Guidelines/index.js";
|
|
11
|
+
import V from "../XAxis/index.js";
|
|
12
|
+
import Z from "../Tooltip/index.js";
|
|
13
|
+
import _ from "../Points/index.js";
|
|
17
14
|
const $ = {
|
|
18
|
-
svg:
|
|
19
|
-
canvas:
|
|
15
|
+
svg: _,
|
|
16
|
+
canvas: K
|
|
20
17
|
}, w = ({
|
|
21
18
|
data: j,
|
|
22
19
|
className: z,
|
|
@@ -32,32 +29,32 @@ const $ = {
|
|
|
32
29
|
renderer: G = "svg",
|
|
33
30
|
plotChildren: x
|
|
34
31
|
}) => {
|
|
35
|
-
const [y, h] = F(), { label: N, points: f } = j,
|
|
32
|
+
const [y, h] = F(), { label: N, points: f } = j, r = { ...D.margins, ...M }, t = typeof y < "u" ? f[y] : f.find(({ id: p }) => p === E), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [s, I, e] = R({ ...l, range: b }), [a, P, o] = R({ ...c, range: g }), S = o(a[0]), v = e(s[0]), k = o(a[1]), O = e(s[1]), C = "x-axis-label", L = "y-axis-label", W = Math.abs(b[1] - b[0]), X = Math.abs(g[1] - g[0]), Y = $[G], H = /* @__PURE__ */ i(
|
|
36
33
|
Y,
|
|
37
34
|
{
|
|
38
35
|
data: f,
|
|
39
|
-
onHoverCallback: n ? (
|
|
36
|
+
onHoverCallback: n ? (p) => h(p) : void 0,
|
|
40
37
|
onHoverOutCallback: n ? () => h(void 0) : void 0,
|
|
41
38
|
width: d,
|
|
42
39
|
height: m,
|
|
43
|
-
xScale:
|
|
44
|
-
yScale:
|
|
40
|
+
xScale: e,
|
|
41
|
+
yScale: o,
|
|
45
42
|
label: N,
|
|
46
43
|
onLoadedCallback: A
|
|
47
44
|
}
|
|
48
45
|
), q = {
|
|
49
46
|
Data: H,
|
|
50
|
-
xScale:
|
|
51
|
-
yScale:
|
|
47
|
+
xScale: e,
|
|
48
|
+
yScale: o,
|
|
52
49
|
yStart: S,
|
|
53
50
|
yEnd: k,
|
|
54
|
-
xStart:
|
|
51
|
+
xStart: v,
|
|
55
52
|
xEnd: O,
|
|
56
|
-
yDomain:
|
|
57
|
-
xDomain:
|
|
53
|
+
yDomain: a,
|
|
54
|
+
xDomain: s
|
|
58
55
|
};
|
|
59
56
|
return /* @__PURE__ */ u(
|
|
60
|
-
|
|
57
|
+
J,
|
|
61
58
|
{
|
|
62
59
|
verticalLabel: c.label,
|
|
63
60
|
verticalLabelId: L,
|
|
@@ -68,66 +65,66 @@ const $ = {
|
|
|
68
65
|
height: m,
|
|
69
66
|
title: B,
|
|
70
67
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
68
|
+
/* @__PURE__ */ i(
|
|
69
|
+
Q,
|
|
73
70
|
{
|
|
74
71
|
ticks: P,
|
|
75
|
-
x:
|
|
72
|
+
x: v,
|
|
76
73
|
labelledById: L,
|
|
77
|
-
yDomain:
|
|
78
|
-
yScale:
|
|
74
|
+
yDomain: a,
|
|
75
|
+
yScale: o
|
|
79
76
|
}
|
|
80
77
|
),
|
|
81
78
|
/* @__PURE__ */ u(
|
|
82
|
-
|
|
79
|
+
U,
|
|
83
80
|
{
|
|
84
|
-
x:
|
|
81
|
+
x: v,
|
|
85
82
|
y: k,
|
|
86
83
|
width: W,
|
|
87
84
|
height: X,
|
|
88
85
|
children: [
|
|
89
|
-
l.guidelines && /* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
l.guidelines && /* @__PURE__ */ i(
|
|
87
|
+
T,
|
|
91
88
|
{
|
|
92
89
|
guides: I.length,
|
|
93
90
|
direction: "vertical",
|
|
94
|
-
xDomain:
|
|
95
|
-
yDomain:
|
|
96
|
-
xScale:
|
|
97
|
-
yScale:
|
|
91
|
+
xDomain: s,
|
|
92
|
+
yDomain: a,
|
|
93
|
+
xScale: e,
|
|
94
|
+
yScale: o
|
|
98
95
|
}
|
|
99
96
|
),
|
|
100
|
-
c.guidelines && /* @__PURE__ */
|
|
101
|
-
|
|
97
|
+
c.guidelines && /* @__PURE__ */ i(
|
|
98
|
+
T,
|
|
102
99
|
{
|
|
103
100
|
guides: P.length,
|
|
104
|
-
xDomain:
|
|
105
|
-
yDomain:
|
|
106
|
-
xScale:
|
|
107
|
-
yScale:
|
|
101
|
+
xDomain: s,
|
|
102
|
+
yDomain: a,
|
|
103
|
+
xScale: e,
|
|
104
|
+
yScale: o
|
|
108
105
|
}
|
|
109
106
|
),
|
|
110
107
|
x ? x(q) : H
|
|
111
108
|
]
|
|
112
109
|
}
|
|
113
110
|
),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
111
|
+
/* @__PURE__ */ i(
|
|
112
|
+
V,
|
|
116
113
|
{
|
|
117
114
|
ticks: I,
|
|
118
115
|
y: S,
|
|
119
116
|
labelledById: C,
|
|
120
|
-
xDomain:
|
|
121
|
-
xScale:
|
|
117
|
+
xDomain: s,
|
|
118
|
+
xScale: e
|
|
122
119
|
}
|
|
123
120
|
),
|
|
124
121
|
n && /* @__PURE__ */ u(
|
|
125
|
-
|
|
122
|
+
Z,
|
|
126
123
|
{
|
|
127
|
-
x: t ?
|
|
128
|
-
y: t ?
|
|
124
|
+
x: t ? e(t.x) : void 0,
|
|
125
|
+
y: t ? o(t.y) : void 0,
|
|
129
126
|
visible: !!t,
|
|
130
|
-
offset:
|
|
127
|
+
offset: D.pointRadius,
|
|
131
128
|
children: [
|
|
132
129
|
t && typeof n == "function" && n(t),
|
|
133
130
|
t && typeof n == "string" && n
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("react"),i=require("../../../node_modules/prop-types/index.cjs"),n=require("@react-three/fiber"),c=require("@react-three/drei");function o({...r}){const e=u.useRef();return u.useEffect(()=>{const t=e.current;t.zoom=r.defaultZoom,t.updateProjectionMatrix()},[]),n.useFrame(()=>{e.current.updateMatrixWorld()}),a.jsx(c.OrthographicCamera,{ref:e,...r,makeDefault:!0})}o.propTypes={defaultZoom:i.default.number};exports.default=o;
|
|
@@ -3,18 +3,19 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
3
3
|
import { useRef as m, useEffect as a } from "react";
|
|
4
4
|
import u from "../../../node_modules/prop-types/index.js";
|
|
5
5
|
import { useFrame as f } from "@react-three/fiber";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { OrthographicCamera as p } from "@react-three/drei";
|
|
7
|
+
function i({ ...e }) {
|
|
8
|
+
const r = m();
|
|
8
9
|
return a(() => {
|
|
9
|
-
const o =
|
|
10
|
-
o.zoom =
|
|
10
|
+
const o = r.current;
|
|
11
|
+
o.zoom = e.defaultZoom, o.updateProjectionMatrix();
|
|
11
12
|
}, []), f(() => {
|
|
12
|
-
|
|
13
|
-
}), /* @__PURE__ */ t(
|
|
13
|
+
r.current.updateMatrixWorld();
|
|
14
|
+
}), /* @__PURE__ */ t(p, { ref: r, ...e, makeDefault: !0 });
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
i.propTypes = {
|
|
16
17
|
defaultZoom: u.number
|
|
17
18
|
};
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
i as default
|
|
20
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),t=require("react"),b=t.createContext(null);function P(){const o=t.useContext(b);if(!o)throw new Error("OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component.");return o}function g({children:o,orbitData:u,showDetailsTable:v=!1,allowOrbitRotation:m=!1,showTimeControls:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),t=require("react"),b=t.createContext(null);function P(){const o=t.useContext(b);if(!o)throw new Error("OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component.");return o}function g({children:o,orbitData:u,showDetailsTable:v=!1,allowOrbitRotation:m=!1,showTimeControls:O=!1,selectedAnswer:i,updateSelectedAnswer:x,swappableOrbits:d=!1}){const[a,c]=t.useState({neos:null,activeNeo:null,observations:[],paused:!1,pov:null,defaultZoom:null,potentialOrbits:!1,noDetails:!1,detailsRows:null,refObjs:null,noControls:!1}),[e,n]=t.useState(()=>a.observations??[]);t.useEffect(()=>{c(u),n(u.observations)},[u]),t.useEffect(()=>{if(e&&e.length>0){let l=e.map(r=>({...r,isActive:r.label===i}));n(l)}},[i]);const S=l=>{if(e&&e.length>0){let r=e.map(s=>s.id==l?{...s,isActive:!0}:{...s,isActive:!1});n(r);const f=e.find(s=>s.id===l);x((f==null?void 0:f.label)||null)}},p=t.useMemo(()=>({orbits:a,showDetailsTable:v,allowOrbitRotation:m,showTimeControls:O,setOrbits:c,observations:e,setObservations:n,updateActiveObservation:S,selectedAnswer:i,swappableOrbits:d}),[a,v,m,O,c,e,n,S,i,d]);return C.jsx(b.Provider,{value:p,children:o})}exports.OrbitalSimContext=b;exports.OrbitalSimProvider=g;exports.useOrbitalSimContext=P;
|
|
@@ -39,15 +39,15 @@ function N({
|
|
|
39
39
|
a(r), e(r.observations);
|
|
40
40
|
}, [r]), O(() => {
|
|
41
41
|
if (t && t.length > 0) {
|
|
42
|
-
let
|
|
43
|
-
e(
|
|
42
|
+
let l = t.map((i) => ({ ...i, isActive: i.label === s }));
|
|
43
|
+
e(l);
|
|
44
44
|
}
|
|
45
45
|
}, [s]);
|
|
46
|
-
const d = (
|
|
46
|
+
const d = (l) => {
|
|
47
47
|
if (t && t.length > 0) {
|
|
48
|
-
let
|
|
49
|
-
e(
|
|
50
|
-
const f = t.find((n) => n.id ===
|
|
48
|
+
let i = t.map((n) => n.id == l ? { ...n, isActive: !0 } : { ...n, isActive: !1 });
|
|
49
|
+
e(i);
|
|
50
|
+
const f = t.find((n) => n.id === l);
|
|
51
51
|
S((f == null ? void 0 : f.label) || null);
|
|
52
52
|
}
|
|
53
53
|
}, C = h(() => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),M=require("./Orbitals/OrbitalDetails.cjs"),V=require("./Camera/CameraController.cjs"),W=require("./Camera/Camera.cjs"),B=require("./Orbitals/Orbitals.cjs"),G=require("./Sun.cjs"),N=require("./Controls/PlaybackSpeed.cjs"),A=require("./Controls/PlaybackControls.cjs"),l=require("./styles.cjs"),H=require("./Context/index.cjs");function I(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x}=H.useOrbitalSimContext(),{paused:h,pov:y,defaultZoom:c,potentialOrbits:w,detailsRows:P}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=s.useState(!h),[D,o]=s.useState(1),[R,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,k]=s.useState(1),[f,T]=s.useState({neos:[{Principal_desig:""}]});s.useEffect(()=>{m||(a(!1),d(0)),r>0?(d(u.initial),o(1),p(0),b(-1)):r<0&&(p(0),a(!0),b(0))},[r]);const Z=t=>{d(+t)},_=()=>{n||o(1),a(!n)},F=()=>{a(t=>!1),b(t=>t+1)},z=t=>{a(!1),o(1),j(S=>S+1)},L=t=>{a(!1),o(-1),j(S=>S+1)},E=t=>{T({neos:[t]})};return e.jsxs(e.Fragment,{children:[e.jsx(l.GlobalStyles,{}),e.jsxs(l.OrbitalSimWrapper,{children:[x?e.jsx(l.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(l.SwappableOrbitButton,{onClick:()=>E(t),"data-active":Object.keys(f).length?t.Principal_desig===f.neos[0].Principal_desig:!1,children:t.Ref}))}):e.jsxs(e.Fragment,{children:[P&&q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(N.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(A.default,{playing:n,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(l.CanvasWrapper,{orthographic:!0,children:[e.jsx(V.default,{pov:v?null:y??"top",reset:r}),e.jsx(W.default,{left
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),M=require("./Orbitals/OrbitalDetails.cjs"),V=require("./Camera/CameraController.cjs"),W=require("./Camera/Camera.cjs"),B=require("./Orbitals/Orbitals.cjs"),G=require("./Sun.cjs"),N=require("./Controls/PlaybackSpeed.cjs"),A=require("./Controls/PlaybackControls.cjs"),l=require("./styles.cjs"),H=require("./Context/index.cjs");function I(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x}=H.useOrbitalSimContext(),{paused:h,pov:y,defaultZoom:c,potentialOrbits:w,detailsRows:P}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=s.useState(!h),[D,o]=s.useState(1),[R,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,k]=s.useState(1),[f,T]=s.useState({neos:[{Principal_desig:""}]});s.useEffect(()=>{m||(a(!1),d(0)),r>0?(d(u.initial),o(1),p(0),b(-1)):r<0&&(p(0),a(!0),b(0))},[r]);const Z=t=>{d(+t)},_=()=>{n||o(1),a(!n)},F=()=>{a(t=>!1),b(t=>t+1)},z=t=>{a(!1),o(1),j(S=>S+1)},L=t=>{a(!1),o(-1),j(S=>S+1)},E=t=>{T({neos:[t]})};return e.jsxs(e.Fragment,{children:[e.jsx(l.GlobalStyles,{}),e.jsxs(l.OrbitalSimWrapper,{children:[x?e.jsx(l.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(l.SwappableOrbitButton,{onClick:()=>E(t),"data-active":Object.keys(f).length?t.Principal_desig===f.neos[0].Principal_desig:!1,children:t.Ref}))}):e.jsxs(e.Fragment,{children:[P&&q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(N.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(A.default,{playing:n,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(l.CanvasWrapper,{orthographic:!0,children:[e.jsx(V.default,{pov:v?null:y??"top",reset:r}),e.jsx(W.default,{left:-15e3,right:15e3,top:15e3,bottom:-15e3,near:.1,far:3e4,position:[0,0,8e3],defaultZoom:c||1}),e.jsx("ambientLight",{intensity:.9}),e.jsx(B.default,{defaultZoom:c||1,playing:n,stepDirection:D,dayPerVizSec:O,frameOverride:R,potentialOrbits:w,elapsedTime:g,setElapsedTime:p,reset:r,zoomLevel:C,setZoomLevel:k,orbits:x?f:i}),e.jsx(G.default,{zoomLevel:C,defaultZoom:c||1})]})]})]})}exports.default=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),_=require("d3-geo-projection"),M=require("d3-geo"),q=require("d3-array"),E=require("../../../atomic/ImageStack/index.cjs"),a=require("./styles.cjs"),N=require("../../../charts/Base/index.cjs"),U=require("../../../charts/Tooltip/index.cjs"),y=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,P]=S.useState(!1),[x,f]=S.useState(),l=600,c=300,n={top:20,right:0,bottom:20,left:20},W=l+n.right+n.left,$=c+n.top+n.bottom,d=15,u=30,j=-90,m=90,g=-180,k=180,h=2,i=_.geoAitoff(),s=M.geoGraticule();s.step([u,d]),s.extent([[g,j],[k,m]]),i.fitExtent([[n.left,n.top],[n.left+l-h,n.top+c]],s.outline());const B=q.range(j+d,m,d),A=q.range(g+u,k,u),C=M.geoPath(i).pointRadius(6),r=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,b=(o?i([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(N.default,{width:W,height:$,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:r(s.outline()),fill:"white"})}),e.jsx(a.Background,{d:r(s.outline())}),e.jsx(a.Graticule,{d:r(s())}),e.jsx(a.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:n.left,y:n.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(E.default,{images:v,describedById:G,visible:w,loadCallback:()=>P(!0),showBackdrop:!1,showLoader:!1})}),e.jsx("g",{children:p.map(({id:t,lat:H,long:R},T)=>e.jsx(a.UserObject,{d:r({type:"Point",coordinates:[R,H]}),onMouseOver:()=>f(T),onMouseOut:()=>f(void 0)},t))}),e.jsx("g",{"aria-hidden":"true",children:B.map(t=>t===0?null:e.jsxs(a.LatLabel,{style:{dominantBaseline:t>0?"text-after-edge":"text-before-edge"},transform:`translate(${i([g,t])})`,children:[t,"°"]},t))}),e.jsx("g",{"aria-hidden":"true",children:A.map(t=>e.jsxs(a.LongLabel,{transform:`translate(${i([t,0])})`,children:[t,"°"]},t))}),e.jsx(a.Outline,{strokeWidth:h,d:r(s.outline())}),e.jsx(U.default,{visible:!!o,x:b[0],y:b[1],children:o==null?void 0:o.id})]})};y.displayName="Widgets.SupernovaThreeVector.Skymap";exports.default=y;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as h, jsx as
|
|
2
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useState as L } from "react";
|
|
4
4
|
import { geoAitoff as E } from "d3-geo-projection";
|
|
5
5
|
import { geoGraticule as N, geoPath as R } from "d3-geo";
|
|
6
6
|
import { range as M } from "d3-array";
|
|
7
|
-
import U from "../../../
|
|
8
|
-
import "
|
|
9
|
-
import "../../../charts/
|
|
10
|
-
import "../../../charts/
|
|
11
|
-
import V from "../../../charts/Tooltip/index.js";
|
|
12
|
-
import "../../../charts/Bars/index.js";
|
|
13
|
-
import "../../../charts/Viewport/index.js";
|
|
14
|
-
import "../../../charts/ScatterPlot/index.js";
|
|
15
|
-
import q from "../../../atomic/ImageStack/index.js";
|
|
16
|
-
import { Background as z, Graticule as D, ImageStackerWrapper as F, UserObject as J, LatLabel as K, LongLabel as Q, Outline as X } from "./styles.js";
|
|
7
|
+
import U from "../../../atomic/ImageStack/index.js";
|
|
8
|
+
import { Background as V, Graticule as q, ImageStackerWrapper as z, UserObject as D, LatLabel as F, LongLabel as J, Outline as K } from "./styles.js";
|
|
9
|
+
import Q from "../../../charts/Base/index.js";
|
|
10
|
+
import X from "../../../charts/Tooltip/index.js";
|
|
17
11
|
const Y = ({
|
|
18
12
|
className: y,
|
|
19
13
|
objects: g = [],
|
|
@@ -21,38 +15,38 @@ const Y = ({
|
|
|
21
15
|
visibleImages: w = [],
|
|
22
16
|
describedById: B
|
|
23
17
|
}) => {
|
|
24
|
-
const [O, W] = L(!1), [f, u] = L(), s = 600, l = 300,
|
|
18
|
+
const [O, W] = L(!1), [f, u] = L(), s = 600, l = 300, a = {
|
|
25
19
|
top: 20,
|
|
26
20
|
right: 0,
|
|
27
21
|
bottom: 20,
|
|
28
22
|
left: 20
|
|
29
|
-
}, j = s +
|
|
30
|
-
|
|
23
|
+
}, j = s + a.right + a.left, C = l + a.top + a.bottom, c = 15, d = 30, k = -90, x = 90, p = -180, b = 180, m = 2, i = E(), n = N();
|
|
24
|
+
n.step([d, c]), n.extent([
|
|
31
25
|
[p, k],
|
|
32
26
|
[b, x]
|
|
33
|
-
]),
|
|
27
|
+
]), i.fitExtent(
|
|
34
28
|
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
29
|
+
[a.left, a.top],
|
|
30
|
+
[a.left + s - m, a.top + l]
|
|
37
31
|
],
|
|
38
|
-
|
|
32
|
+
n.outline()
|
|
39
33
|
);
|
|
40
|
-
const G = M(k + c, x, c), H = M(p + d, b, d), P = R(
|
|
41
|
-
return /* @__PURE__ */ h(
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
34
|
+
const G = M(k + c, x, c), H = M(p + d, b, d), P = R(i).pointRadius(6), r = (t) => P(t) || void 0, o = typeof f < "u" ? g[f] : void 0, S = (o ? i([o == null ? void 0 : o.long, o == null ? void 0 : o.lat]) : [0, 0]) || [0, 0];
|
|
35
|
+
return /* @__PURE__ */ h(Q, { width: j, height: C, className: y, children: [
|
|
36
|
+
/* @__PURE__ */ e("mask", { id: "imageMask", children: /* @__PURE__ */ e("path", { d: r(n.outline()), fill: "white" }) }),
|
|
37
|
+
/* @__PURE__ */ e(V, { d: r(n.outline()) }),
|
|
38
|
+
/* @__PURE__ */ e(q, { d: r(n()) }),
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
z,
|
|
47
41
|
{
|
|
48
42
|
style: { "--image-stack-opacity": O && 1 },
|
|
49
|
-
x:
|
|
50
|
-
y:
|
|
43
|
+
x: a.left,
|
|
44
|
+
y: a.top,
|
|
51
45
|
width: s - m,
|
|
52
46
|
height: l,
|
|
53
47
|
mask: "url(#imageMask)",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
|
|
48
|
+
children: /* @__PURE__ */ e(
|
|
49
|
+
U,
|
|
56
50
|
{
|
|
57
51
|
images: v,
|
|
58
52
|
describedById: B,
|
|
@@ -64,10 +58,10 @@ const Y = ({
|
|
|
64
58
|
)
|
|
65
59
|
}
|
|
66
60
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
61
|
+
/* @__PURE__ */ e("g", { children: g.map(({ id: t, lat: T, long: $ }, A) => /* @__PURE__ */ e(
|
|
62
|
+
D,
|
|
69
63
|
{
|
|
70
|
-
d:
|
|
64
|
+
d: r({
|
|
71
65
|
type: "Point",
|
|
72
66
|
coordinates: [$, T]
|
|
73
67
|
}),
|
|
@@ -76,14 +70,14 @@ const Y = ({
|
|
|
76
70
|
},
|
|
77
71
|
t
|
|
78
72
|
)) }),
|
|
79
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ e("g", { "aria-hidden": "true", children: G.map(
|
|
80
74
|
(t) => t === 0 ? null : /* @__PURE__ */ h(
|
|
81
|
-
|
|
75
|
+
F,
|
|
82
76
|
{
|
|
83
77
|
style: {
|
|
84
78
|
dominantBaseline: t > 0 ? "text-after-edge" : "text-before-edge"
|
|
85
79
|
},
|
|
86
|
-
transform: `translate(${
|
|
80
|
+
transform: `translate(${i([p, t])})`,
|
|
87
81
|
children: [
|
|
88
82
|
t,
|
|
89
83
|
"°"
|
|
@@ -92,10 +86,10 @@ const Y = ({
|
|
|
92
86
|
t
|
|
93
87
|
)
|
|
94
88
|
) }),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
89
|
+
/* @__PURE__ */ e("g", { "aria-hidden": "true", children: H.map((t) => /* @__PURE__ */ h(
|
|
90
|
+
J,
|
|
97
91
|
{
|
|
98
|
-
transform: `translate(${
|
|
92
|
+
transform: `translate(${i([t, 0])})`,
|
|
99
93
|
children: [
|
|
100
94
|
t,
|
|
101
95
|
"°"
|
|
@@ -103,20 +97,20 @@ const Y = ({
|
|
|
103
97
|
},
|
|
104
98
|
t
|
|
105
99
|
)) }),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
100
|
+
/* @__PURE__ */ e(
|
|
101
|
+
K,
|
|
108
102
|
{
|
|
109
103
|
strokeWidth: m,
|
|
110
|
-
d: n
|
|
104
|
+
d: r(n.outline())
|
|
111
105
|
}
|
|
112
106
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
107
|
+
/* @__PURE__ */ e(
|
|
108
|
+
X,
|
|
115
109
|
{
|
|
116
|
-
visible: !!
|
|
110
|
+
visible: !!o,
|
|
117
111
|
x: S[0],
|
|
118
112
|
y: S[1],
|
|
119
|
-
children:
|
|
113
|
+
children: o == null ? void 0 : o.id
|
|
120
114
|
}
|
|
121
115
|
)
|
|
122
116
|
] });
|
package/package.json
CHANGED