@rubin-epo/epo-widget-lib 2.0.11 → 2.1.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/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +25 -18
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +53 -50
- package/dist/mock-data/OrbitalSim/index.d.ts +19 -10
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +5 -2
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
- package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
- package/dist/widgets/OrbitalSim/Context/index.js +36 -34
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +29 -29
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +79 -79
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +25 -24
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +60 -59
- package/dist/widgets/OrbitalSim/Orbitals/styles.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/styles.js +1 -1
- package/dist/widgets/OrbitalSim/Sun.cjs +1 -1
- package/dist/widgets/OrbitalSim/Sun.js +6 -6
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +20 -21
- package/dist/widgets/OrbitalSim/styles.cjs +1 -1
- package/dist/widgets/OrbitalSim/styles.js +1 -1
- package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/MovingSourceSelector.js +82 -85
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +45 -39
- package/package.json +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three");function p(o){if(o&&o.__esModule)return o;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const s=p(f),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"}},u={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=o=>({neptune:R,earth:_,mars:m,jupiter:A,atira:d,apollo:u,amor:g})[o]||null,P=function(o,e){return Number.parseFloat(Number.parseFloat(o).toFixed(e))},y=(o,e,t=0,n=0)=>new s.EllipseCurve(t,n,o,e,0,2*Math.PI,!1,0),h=(o,e)=>{const t=o.distanceTo(e),{x:n,y:i}=o;return Math.acos((t**2+n**2-i**2)/(2*t*n))*180/Math.PI},S=(o,e)=>{const{x:t,y:n}=e.getPoint(o);return new s.Vector3(t,n,0)},C=o=>o*c,O=o=>o/c,M=(o,e)=>C(o*Math.sqrt(1-e**2)),x=o=>1496e8*o,a=o=>o*(Math.PI/180),E=(o,e)=>{const t=.000296005155*c**3;return Math.sqrt(t*(2/o-1/e))},z=(o,e)=>Math.sqrt(o**2-e**2),H=(o,e)=>{const{i:t,Peri:n,Node:i}=e,l=new s.Vector3(0,1,0),b=new s.Vector3(0,0,1);return new s.Vector3(o.x,o.y,0).applyAxisAngle(b,n?a(n+90):0).applyAxisAngle(l,a(t)).applyAxisAngle(b,i?a(i):0)},V=(o,e)=>{const i=15*(o/e);return i<=12?12: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=u;exports.atira=d;exports.auToMeters=x;exports.auToUnit=C;exports.convert2dTo3d=H;exports.degsToRads=a;exports.formatValue=P;exports.getAngleFromPos=h;exports.getCurve=y;exports.getFocus=z;exports.getLabelSize=V;exports.getMinorAxis=M;exports.getPosFromArcLength=S;exports.getRefObjProps=T;exports.getVelocity=E;exports.unitToAu=O;
|
|
@@ -63,7 +63,7 @@ const l = 100, m = 1, t = {
|
|
|
63
63
|
orbitColor: t.neos.orbitColor,
|
|
64
64
|
objectColor: t.neos.objectColor,
|
|
65
65
|
objectRadius: 5
|
|
66
|
-
},
|
|
66
|
+
}, p = {
|
|
67
67
|
a: 1,
|
|
68
68
|
e: 0.01671022,
|
|
69
69
|
i: 0,
|
|
@@ -74,7 +74,7 @@ const l = 100, m = 1, t = {
|
|
|
74
74
|
orbitColor: t.earth.orbitColor,
|
|
75
75
|
objectColor: t.earth.objectColor,
|
|
76
76
|
objectRadius: 5
|
|
77
|
-
},
|
|
77
|
+
}, f = {
|
|
78
78
|
a: 1.52366231,
|
|
79
79
|
e: 0.09341233,
|
|
80
80
|
i: 1.85061,
|
|
@@ -85,7 +85,7 @@ const l = 100, m = 1, t = {
|
|
|
85
85
|
orbitColor: t.mars.orbitColor,
|
|
86
86
|
objectColor: t.mars.objectColor,
|
|
87
87
|
objectRadius: 4
|
|
88
|
-
},
|
|
88
|
+
}, j = {
|
|
89
89
|
a: 5.2028,
|
|
90
90
|
e: 0.048,
|
|
91
91
|
i: 1.31,
|
|
@@ -97,7 +97,7 @@ const l = 100, m = 1, t = {
|
|
|
97
97
|
objectColor: t.jupiter.objectColor,
|
|
98
98
|
// objectRadius: 69911000,
|
|
99
99
|
objectRadius: 7
|
|
100
|
-
},
|
|
100
|
+
}, g = {
|
|
101
101
|
a: 30.06896348,
|
|
102
102
|
e: 858587e-8,
|
|
103
103
|
i: 1.76917,
|
|
@@ -110,10 +110,10 @@ const l = 100, m = 1, t = {
|
|
|
110
110
|
// objectRadius: 24622000,
|
|
111
111
|
objectRadius: 6
|
|
112
112
|
}, R = (o) => ({
|
|
113
|
-
neptune:
|
|
114
|
-
earth:
|
|
115
|
-
mars:
|
|
116
|
-
jupiter:
|
|
113
|
+
neptune: g,
|
|
114
|
+
earth: p,
|
|
115
|
+
mars: f,
|
|
116
|
+
jupiter: j,
|
|
117
117
|
atira: C,
|
|
118
118
|
apollo: u,
|
|
119
119
|
amor: d
|
|
@@ -136,24 +136,24 @@ const l = 100, m = 1, t = {
|
|
|
136
136
|
// aClockwise
|
|
137
137
|
0
|
|
138
138
|
// aRotation
|
|
139
|
-
), P = (o
|
|
139
|
+
), P = (o, e) => {
|
|
140
140
|
const r = o.distanceTo(e), { x: n, y: i } = o;
|
|
141
141
|
return Math.acos((r ** 2 + n ** 2 - i ** 2) / (2 * r * n)) * 180 / Math.PI;
|
|
142
142
|
}, T = (o, e) => {
|
|
143
143
|
const { x: r, y: n } = e.getPoint(o);
|
|
144
144
|
return new s.Vector3(r, n, 0);
|
|
145
|
-
}, _ = (o) => o * l, x = (o) => o / l,
|
|
145
|
+
}, _ = (o) => o * l, x = (o) => o / l, y = (o, e) => _(o * Math.sqrt(1 - e ** 2)), M = (o) => 1496e8 * o, a = (o) => o * (Math.PI / 180), S = (o, e) => {
|
|
146
146
|
const r = 296005155e-12 * l ** 3;
|
|
147
147
|
return Math.sqrt(r * (2 / o - 1 / e));
|
|
148
|
-
},
|
|
148
|
+
}, z = (o, e) => Math.sqrt(o ** 2 - e ** 2), H = (o, e) => {
|
|
149
149
|
const { i: r, Peri: n, Node: i } = e, c = new s.Vector3(0, 1, 0), b = new s.Vector3(0, 0, 1);
|
|
150
150
|
return new s.Vector3(o.x, o.y, 0).applyAxisAngle(b, n ? a(n + 90) : 0).applyAxisAngle(c, a(r)).applyAxisAngle(
|
|
151
151
|
b,
|
|
152
152
|
i ? a(i) : 0
|
|
153
153
|
);
|
|
154
|
-
},
|
|
154
|
+
}, E = (o, e) => {
|
|
155
155
|
const i = 15 * (o / e);
|
|
156
|
-
return i <=
|
|
156
|
+
return i <= 12 ? 12 : i >= 15 ? 15 : i;
|
|
157
157
|
};
|
|
158
158
|
export {
|
|
159
159
|
l as AU_TO_VIZ_SCALER,
|
|
@@ -162,19 +162,18 @@ export {
|
|
|
162
162
|
d as amor,
|
|
163
163
|
u as apollo,
|
|
164
164
|
C as atira,
|
|
165
|
-
|
|
165
|
+
M as auToMeters,
|
|
166
166
|
_ as auToUnit,
|
|
167
|
-
|
|
167
|
+
H as convert2dTo3d,
|
|
168
168
|
a as degsToRads,
|
|
169
169
|
A as formatValue,
|
|
170
|
-
|
|
170
|
+
P as getAngleFromPos,
|
|
171
171
|
h as getCurve,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
M as getMinorAxis,
|
|
172
|
+
z as getFocus,
|
|
173
|
+
E as getLabelSize,
|
|
174
|
+
y as getMinorAxis,
|
|
176
175
|
T as getPosFromArcLength,
|
|
177
176
|
R as getRefObjProps,
|
|
178
|
-
|
|
177
|
+
S as getVelocity,
|
|
179
178
|
x as unitToAu
|
|
180
179
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),h=require("react"),Y=require("react-i18next"),G=require("../../layout/AspectRatio/index.cjs"),J=require("../../atomic/Loader/index.cjs"),K=require("@rubin-epo/epo-react-lib/IconComposer"),Q=require("./MovingSourceMap/index.cjs"),C=require("./utils.cjs"),U=require("./styles.cjs"),Z=require("./Message/Message.cjs"),v=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),A=e=>e&&e.__esModule?e:{default:e},O=A(K),ee=(e,n)=>{var u;const t={day:0,hour:0},s=e[n];if(!s)return t;const o=(s==null?void 0:s.date)-((u=e[0])==null?void 0:u.date);return o?{day:Math.round(o)||0,hour:Math.round(24/o%24)||0}:t},te=(e,n,t)=>Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)<=Math.pow(t,2),se=(e,n,t)=>t?e[n]?[e[n].image]:[]:e.map(({image:s})=>s),S=({width:e=600,height:n=600,selectedSource:t=[],alerts:s=[],activeAlertIndex:o=0,alertChangeCallback:u,selectionCallback:k,blinkConfig:j,isDisplayOnly:a=!1,isLoading:y,className:_,movingSources:l=[]})=>{const[P,I]=h.useState(!0),[w,F]=h.useState(!a),[L,b]=h.useState(),[B,m]=h.useState(!1),{t:p}=Y.useTranslation(),q=!P&&!y,R=(i,d,f)=>{if(l)for(let c of l){const g=c.sources[o];if(te(i,{x:C.toDecimalPercent(g.x)*d,y:C.toDecimalPercent(g.y)*f},C.getRadius(c.type,c.radius)*d))return c.id}},T=()=>{b(p("source_selector.messages.failure")),m(!0)},V=()=>{F(i=>!i)},N=()=>{b(r.jsxs(r.Fragment,{children:[r.jsx(O.default,{icon:"checkmark"}),p("source_selector.messages.success")]})),m(!0)},W=({clientX:i,clientY:d,target:f})=>{if(!q||a)return;const{tagName:c,clientWidth:g,clientHeight:x}=f;if(c.toLowerCase()!=="img")return;const{left:H,top:X}=f.getBoundingClientRect(),M=R({x:i-H,y:x-d+X},g,x);if(M){if(t.includes(M))return;k&&k(t.concat(M)),N()}else T()},$=()=>{m(!1)},{day:z,hour:D}=ee(s,o),E=se(s,o,a);return r.jsxs(G.default,{ratio:1,className:_,children:[!a&&r.jsx(Z.default,{onMessageChangeCallback:$,isVisible:B,children:L}),l&&r.jsx(U.BackgroundBlinker,{images:E,activeIndex:o,blinkCallback:u,loadedCallback:()=>I(!1),onClickCallback:W,extraControls:s.length>0&&!a&&r.jsx(v.default,{day:z,hour:D}),interval:400,pauseCallback:V,...j,children:r.jsx(Q.default,{width:e,height:n,isPlaying:w,currentIndex:o,movingSources:l,selectedSource:t})}),!q&&r.jsx(J.default,{})]})};S.displayName="Widgets.MovingSourceSelector";exports.default=S;
|
|
@@ -1,129 +1,126 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as S, jsx as i, Fragment as J } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g } from "react";
|
|
4
4
|
import { useTranslation as K } from "react-i18next";
|
|
5
5
|
import Q from "../../layout/AspectRatio/index.js";
|
|
6
6
|
import U from "../../atomic/Loader/index.js";
|
|
7
7
|
import Z from "@rubin-epo/epo-react-lib/IconComposer";
|
|
8
8
|
import $ from "./MovingSourceMap/index.js";
|
|
9
|
-
import { getRadius as D, toDecimalPercent as
|
|
10
|
-
import { BackgroundBlinker as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const r = (o == null ? void 0 : o.date) - ((d = e[0]) == null ? void 0 : d.date);
|
|
9
|
+
import { getRadius as D, toDecimalPercent as x } from "./utils.js";
|
|
10
|
+
import { BackgroundBlinker as v } from "./styles.js";
|
|
11
|
+
import A from "./Message/Message.js";
|
|
12
|
+
import O from "../../atomic/ElapsedTime/ElapsedTime.js";
|
|
13
|
+
const ee = (e, s) => {
|
|
14
|
+
var u;
|
|
15
|
+
const o = { day: 0, hour: 0 }, t = e[s];
|
|
16
|
+
if (!t) return o;
|
|
17
|
+
const r = (t == null ? void 0 : t.date) - ((u = e[0]) == null ? void 0 : u.date);
|
|
19
18
|
return r ? {
|
|
20
19
|
day: Math.round(r) || 0,
|
|
21
20
|
hour: Math.round(24 / r % 24) || 0
|
|
22
|
-
} :
|
|
23
|
-
},
|
|
21
|
+
} : o;
|
|
22
|
+
}, oe = (e, s, o) => Math.pow(e.x - s.x, 2) + Math.pow(e.y - s.y, 2) <= Math.pow(o, 2), te = (e, s, o) => o ? e[s] ? [e[s].image] : [] : e.map(({ image: t }) => t), se = ({
|
|
24
23
|
width: e = 600,
|
|
25
|
-
height:
|
|
26
|
-
selectedSource:
|
|
27
|
-
alerts:
|
|
24
|
+
height: s = 600,
|
|
25
|
+
selectedSource: o = [],
|
|
26
|
+
alerts: t = [],
|
|
28
27
|
activeAlertIndex: r = 0,
|
|
29
|
-
alertChangeCallback:
|
|
30
|
-
selectionCallback:
|
|
31
|
-
blinkConfig:
|
|
32
|
-
isDisplayOnly:
|
|
33
|
-
isLoading:
|
|
34
|
-
className:
|
|
28
|
+
alertChangeCallback: u,
|
|
29
|
+
selectionCallback: C,
|
|
30
|
+
blinkConfig: L,
|
|
31
|
+
isDisplayOnly: a = !1,
|
|
32
|
+
isLoading: P,
|
|
33
|
+
className: w,
|
|
35
34
|
movingSources: l = []
|
|
36
35
|
}) => {
|
|
37
|
-
const [
|
|
36
|
+
const [F, I] = g(!0), [B, R] = g(!a), [V, k] = g(), [j, h] = g(!1), { t: b } = K(), y = !F && !P, N = (c, d, f) => {
|
|
38
37
|
if (l)
|
|
39
|
-
for (let
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
|
|
38
|
+
for (let n of l) {
|
|
39
|
+
const m = n.sources[r];
|
|
40
|
+
if (oe(
|
|
41
|
+
c,
|
|
43
42
|
{
|
|
44
|
-
x:
|
|
45
|
-
y:
|
|
43
|
+
x: x(m.x) * d,
|
|
44
|
+
y: x(m.y) * f
|
|
46
45
|
},
|
|
47
|
-
D(
|
|
46
|
+
D(n.type, n.radius) * d
|
|
48
47
|
))
|
|
49
|
-
return
|
|
48
|
+
return n.id;
|
|
50
49
|
}
|
|
50
|
+
}, T = () => {
|
|
51
|
+
k(b("source_selector.messages.failure")), h(!0);
|
|
52
|
+
}, W = () => {
|
|
53
|
+
R((c) => !c);
|
|
51
54
|
}, _ = () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
I(
|
|
57
|
-
/* @__PURE__ */ B(J, { children: [
|
|
58
|
-
/* @__PURE__ */ a(Z, { icon: "checkmark" }),
|
|
59
|
-
y("source_selector.messages.success")
|
|
55
|
+
k(
|
|
56
|
+
/* @__PURE__ */ S(J, { children: [
|
|
57
|
+
/* @__PURE__ */ i(Z, { icon: "checkmark" }),
|
|
58
|
+
b("source_selector.messages.success")
|
|
60
59
|
] })
|
|
61
|
-
),
|
|
62
|
-
},
|
|
63
|
-
clientX:
|
|
64
|
-
clientY:
|
|
65
|
-
target:
|
|
60
|
+
), h(!0);
|
|
61
|
+
}, z = ({
|
|
62
|
+
clientX: c,
|
|
63
|
+
clientY: d,
|
|
64
|
+
target: f
|
|
66
65
|
}) => {
|
|
67
|
-
if (!
|
|
66
|
+
if (!y || a) return;
|
|
68
67
|
const {
|
|
69
|
-
tagName:
|
|
70
|
-
clientWidth:
|
|
71
|
-
clientHeight:
|
|
72
|
-
} =
|
|
73
|
-
if (
|
|
74
|
-
const { left: q, top: G } =
|
|
75
|
-
{ x:
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
tagName: n,
|
|
69
|
+
clientWidth: m,
|
|
70
|
+
clientHeight: p
|
|
71
|
+
} = f;
|
|
72
|
+
if (n.toLowerCase() !== "img") return;
|
|
73
|
+
const { left: q, top: G } = f.getBoundingClientRect(), M = N(
|
|
74
|
+
{ x: c - q, y: p - d + G },
|
|
75
|
+
m,
|
|
76
|
+
p
|
|
78
77
|
);
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
|
|
78
|
+
if (M) {
|
|
79
|
+
if (o.includes(M)) return;
|
|
80
|
+
C && C(o.concat(M)), _();
|
|
82
81
|
} else
|
|
83
|
-
|
|
82
|
+
T();
|
|
84
83
|
}, E = () => {
|
|
85
|
-
|
|
86
|
-
}, { day: H, hour: X } =
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
!c && /* @__PURE__ */ a(
|
|
91
|
-
te,
|
|
84
|
+
h(!1);
|
|
85
|
+
}, { day: H, hour: X } = ee(t, r), Y = te(t, r, a);
|
|
86
|
+
return /* @__PURE__ */ S(Q, { ratio: 1, className: w, children: [
|
|
87
|
+
!a && /* @__PURE__ */ i(
|
|
88
|
+
A,
|
|
92
89
|
{
|
|
93
90
|
onMessageChangeCallback: E,
|
|
94
|
-
isVisible:
|
|
95
|
-
children:
|
|
91
|
+
isVisible: j,
|
|
92
|
+
children: V
|
|
96
93
|
}
|
|
97
94
|
),
|
|
98
|
-
l && /* @__PURE__ */
|
|
99
|
-
|
|
95
|
+
l && /* @__PURE__ */ i(
|
|
96
|
+
v,
|
|
100
97
|
{
|
|
101
98
|
images: Y,
|
|
102
|
-
activeIndex:
|
|
103
|
-
blinkCallback:
|
|
104
|
-
loadedCallback: () =>
|
|
105
|
-
onClickCallback:
|
|
106
|
-
extraControls:
|
|
99
|
+
activeIndex: r,
|
|
100
|
+
blinkCallback: u,
|
|
101
|
+
loadedCallback: () => I(!1),
|
|
102
|
+
onClickCallback: z,
|
|
103
|
+
extraControls: t.length > 0 && !a && /* @__PURE__ */ i(O, { day: H, hour: X }),
|
|
107
104
|
interval: 400,
|
|
108
|
-
pauseCallback:
|
|
109
|
-
...
|
|
110
|
-
children: /* @__PURE__ */
|
|
105
|
+
pauseCallback: W,
|
|
106
|
+
...L,
|
|
107
|
+
children: /* @__PURE__ */ i(
|
|
111
108
|
$,
|
|
112
109
|
{
|
|
113
110
|
width: e,
|
|
114
|
-
height:
|
|
115
|
-
isPlaying:
|
|
116
|
-
currentIndex:
|
|
111
|
+
height: s,
|
|
112
|
+
isPlaying: B,
|
|
113
|
+
currentIndex: r,
|
|
117
114
|
movingSources: l,
|
|
118
|
-
selectedSource:
|
|
115
|
+
selectedSource: o
|
|
119
116
|
}
|
|
120
117
|
)
|
|
121
118
|
}
|
|
122
119
|
),
|
|
123
|
-
!
|
|
120
|
+
!y && /* @__PURE__ */ i(U, {})
|
|
124
121
|
] });
|
|
125
122
|
};
|
|
126
|
-
|
|
123
|
+
se.displayName = "Widgets.MovingSourceSelector";
|
|
127
124
|
export {
|
|
128
|
-
|
|
125
|
+
se as default
|
|
129
126
|
};
|
|
@@ -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"),b=require("react"),_=require("d3-geo-projection"),S=require("d3-geo"),M=require("d3-array"),E=require("../../../charts/Base/index.cjs");require("../../../charts/XAxis/index.cjs");require("../../../charts/YAxis/index.cjs");require("../../../charts/Guidelines/index.cjs");const N=require("../../../charts/Tooltip/index.cjs");require("../../../charts/Bars/index.cjs");require("../../../charts/Viewport/index.cjs");require("../../../charts/ScatterPlot/index.cjs");const U=require("../../../atomic/ImageStack/index.cjs"),r=require("./styles.cjs"),y=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,P]=b.useState(!1),[x,f]=b.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,q=180,h=2,i=_.geoAitoff(),s=S.geoGraticule();s.step([u,d]),s.extent([[g,j],[q,m]]),i.fitExtent([[n.left,n.top],[n.left+l-h,n.top+c]],s.outline());const B=M.range(j+d,m,d),A=M.range(g+u,q,u),C=S.geoPath(i).pointRadius(6),a=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,k=(o?i([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(E.default,{width:W,height:$,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:a(s.outline()),fill:"white"})}),e.jsx(r.Background,{d:a(s.outline())}),e.jsx(r.Graticule,{d:a(s())}),e.jsx(r.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:n.left,y:n.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(U.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(r.UserObject,{d:a({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(r.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(r.LongLabel,{transform:`translate(${i([t,0])})`,children:[t,"°"]},t))}),e.jsx(r.Outline,{strokeWidth:h,d:a(s.outline())}),e.jsx(N.default,{visible:!!o,x:k[0],y:k[1],children:o==null?void 0:o.id})]})};y.displayName="Widgets.SupernovaThreeVector.Skymap";exports.default=y;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as h, jsx as
|
|
2
|
+
import { jsxs as h, jsx as o } 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
|
|
10
|
-
import
|
|
7
|
+
import U from "../../../charts/Base/index.js";
|
|
8
|
+
import "../../../charts/XAxis/index.js";
|
|
9
|
+
import "../../../charts/YAxis/index.js";
|
|
10
|
+
import "../../../charts/Guidelines/index.js";
|
|
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";
|
|
11
17
|
const Y = ({
|
|
12
18
|
className: y,
|
|
13
19
|
objects: g = [],
|
|
@@ -15,38 +21,38 @@ const Y = ({
|
|
|
15
21
|
visibleImages: w = [],
|
|
16
22
|
describedById: B
|
|
17
23
|
}) => {
|
|
18
|
-
const [O, W] = L(!1), [f, u] = L(), s = 600, l = 300,
|
|
24
|
+
const [O, W] = L(!1), [f, u] = L(), s = 600, l = 300, i = {
|
|
19
25
|
top: 20,
|
|
20
26
|
right: 0,
|
|
21
27
|
bottom: 20,
|
|
22
28
|
left: 20
|
|
23
|
-
}, j = s +
|
|
24
|
-
|
|
29
|
+
}, j = s + i.right + i.left, C = l + i.top + i.bottom, c = 15, d = 30, k = -90, x = 90, p = -180, b = 180, m = 2, a = E(), r = N();
|
|
30
|
+
r.step([d, c]), r.extent([
|
|
25
31
|
[p, k],
|
|
26
32
|
[b, x]
|
|
27
|
-
]),
|
|
33
|
+
]), a.fitExtent(
|
|
28
34
|
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
35
|
+
[i.left, i.top],
|
|
36
|
+
[i.left + s - m, i.top + l]
|
|
31
37
|
],
|
|
32
|
-
|
|
38
|
+
r.outline()
|
|
33
39
|
);
|
|
34
|
-
const G = M(k + c, x, c), H = M(p + d, b, d), P = R(
|
|
35
|
-
return /* @__PURE__ */ h(
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
40
|
+
const G = M(k + c, x, c), H = M(p + d, b, d), P = R(a).pointRadius(6), n = (t) => P(t) || void 0, e = typeof f < "u" ? g[f] : void 0, S = (e ? a([e == null ? void 0 : e.long, e == null ? void 0 : e.lat]) : [0, 0]) || [0, 0];
|
|
41
|
+
return /* @__PURE__ */ h(U, { width: j, height: C, className: y, children: [
|
|
42
|
+
/* @__PURE__ */ o("mask", { id: "imageMask", children: /* @__PURE__ */ o("path", { d: n(r.outline()), fill: "white" }) }),
|
|
43
|
+
/* @__PURE__ */ o(z, { d: n(r.outline()) }),
|
|
44
|
+
/* @__PURE__ */ o(D, { d: n(r()) }),
|
|
45
|
+
/* @__PURE__ */ o(
|
|
46
|
+
F,
|
|
41
47
|
{
|
|
42
48
|
style: { "--image-stack-opacity": O && 1 },
|
|
43
|
-
x:
|
|
44
|
-
y:
|
|
49
|
+
x: i.left,
|
|
50
|
+
y: i.top,
|
|
45
51
|
width: s - m,
|
|
46
52
|
height: l,
|
|
47
53
|
mask: "url(#imageMask)",
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
|
|
54
|
+
children: /* @__PURE__ */ o(
|
|
55
|
+
q,
|
|
50
56
|
{
|
|
51
57
|
images: v,
|
|
52
58
|
describedById: B,
|
|
@@ -58,10 +64,10 @@ const Y = ({
|
|
|
58
64
|
)
|
|
59
65
|
}
|
|
60
66
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
67
|
+
/* @__PURE__ */ o("g", { children: g.map(({ id: t, lat: T, long: $ }, A) => /* @__PURE__ */ o(
|
|
68
|
+
J,
|
|
63
69
|
{
|
|
64
|
-
d:
|
|
70
|
+
d: n({
|
|
65
71
|
type: "Point",
|
|
66
72
|
coordinates: [$, T]
|
|
67
73
|
}),
|
|
@@ -70,14 +76,14 @@ const Y = ({
|
|
|
70
76
|
},
|
|
71
77
|
t
|
|
72
78
|
)) }),
|
|
73
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ o("g", { "aria-hidden": "true", children: G.map(
|
|
74
80
|
(t) => t === 0 ? null : /* @__PURE__ */ h(
|
|
75
|
-
|
|
81
|
+
K,
|
|
76
82
|
{
|
|
77
83
|
style: {
|
|
78
84
|
dominantBaseline: t > 0 ? "text-after-edge" : "text-before-edge"
|
|
79
85
|
},
|
|
80
|
-
transform: `translate(${
|
|
86
|
+
transform: `translate(${a([p, t])})`,
|
|
81
87
|
children: [
|
|
82
88
|
t,
|
|
83
89
|
"°"
|
|
@@ -86,10 +92,10 @@ const Y = ({
|
|
|
86
92
|
t
|
|
87
93
|
)
|
|
88
94
|
) }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
95
|
+
/* @__PURE__ */ o("g", { "aria-hidden": "true", children: H.map((t) => /* @__PURE__ */ h(
|
|
96
|
+
Q,
|
|
91
97
|
{
|
|
92
|
-
transform: `translate(${
|
|
98
|
+
transform: `translate(${a([t, 0])})`,
|
|
93
99
|
children: [
|
|
94
100
|
t,
|
|
95
101
|
"°"
|
|
@@ -97,20 +103,20 @@ const Y = ({
|
|
|
97
103
|
},
|
|
98
104
|
t
|
|
99
105
|
)) }),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
106
|
+
/* @__PURE__ */ o(
|
|
107
|
+
X,
|
|
102
108
|
{
|
|
103
109
|
strokeWidth: m,
|
|
104
|
-
d: r
|
|
110
|
+
d: n(r.outline())
|
|
105
111
|
}
|
|
106
112
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
113
|
+
/* @__PURE__ */ o(
|
|
114
|
+
V,
|
|
109
115
|
{
|
|
110
|
-
visible: !!
|
|
116
|
+
visible: !!e,
|
|
111
117
|
x: S[0],
|
|
112
118
|
y: S[1],
|
|
113
|
-
children:
|
|
119
|
+
children: e == null ? void 0 : e.id
|
|
114
120
|
}
|
|
115
121
|
)
|
|
116
122
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubin-epo/epo-widget-lib",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Rubin Observatory Education & Public Outreach team React scientific and educational widgets.",
|
|
5
5
|
"author": "Rubin EPO",
|
|
6
6
|
"license": "MIT",
|
|
@@ -102,8 +102,7 @@
|
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@react-three/drei": "^10.7.6",
|
|
104
104
|
"@react-three/fiber": "9",
|
|
105
|
-
"@rubin-epo/epo-react-lib": "3.0.
|
|
106
|
-
"@rubin-epo/epo-widget-lib": "2.0.2",
|
|
105
|
+
"@rubin-epo/epo-react-lib": "3.0.3",
|
|
107
106
|
"context-filter-polyfill": "^0.3.6",
|
|
108
107
|
"d3-array": "^3.2.4",
|
|
109
108
|
"d3-geo": "^3.1.1",
|