@rubin-epo/epo-widget-lib 2.0.10 → 2.0.13
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/localeStrings/en/epo-widget-lib.json +3 -2
- package/dist/localeStrings/es/epo-widget-lib.json +3 -2
- package/dist/localeStrings/fr/epo-widget-lib.json +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.cjs +1 -1
- package/dist/widgets/OrbitalSim/Controls/PlaybackSpeed.js +5 -5
- package/dist/widgets/OrbitalSim/Controls/styles.cjs +7 -3
- package/dist/widgets/OrbitalSim/Controls/styles.d.ts +1 -1
- package/dist/widgets/OrbitalSim/Controls/styles.js +9 -5
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +79 -79
- package/dist/widgets/OrbitalSim/Orbitals/styles.cjs +2 -2
- package/dist/widgets/OrbitalSim/Orbitals/styles.js +2 -2
- 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 +6 -3
- package/dist/widgets/OrbitalSim/styles.js +10 -7
- 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 +39 -45
- package/package.json +2 -3
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"blinker": {
|
|
3
3
|
"controls": {
|
|
4
|
-
"backward": "
|
|
4
|
+
"backward": "Backward",
|
|
5
5
|
"forward": "Forward",
|
|
6
6
|
"reset": "Reset",
|
|
7
7
|
"play": "Play",
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
"sources": {
|
|
67
67
|
"galaxy": "Galaxy",
|
|
68
68
|
"supernova": "Supernova",
|
|
69
|
-
"observation": "Observation"
|
|
69
|
+
"observation": "Observation",
|
|
70
|
+
"asteroid": "Asteroid"
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
"source_selector": {
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"sources": {
|
|
54
54
|
"galaxy": "Galaxia",
|
|
55
55
|
"supernova": "Supernova",
|
|
56
|
-
"observation": "Observación"
|
|
56
|
+
"observation": "Observación",
|
|
57
|
+
"asteroid": "Asteroide"
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
60
|
"source_selector": {
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
},
|
|
78
79
|
"blinker": {
|
|
79
80
|
"controls": {
|
|
80
|
-
"backward": "
|
|
81
|
+
"backward": "Hacia atrás",
|
|
81
82
|
"forward": "Adelantar",
|
|
82
83
|
"pause": "Pausar",
|
|
83
84
|
"play": "Reproducir",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime");require("react");const s=require("../../../node_modules/prop-types/index.cjs"),f=require("react-i18next"),h=require("../orbitalUtilities.cjs"),_=require("@rubin-epo/epo-react-lib/HorizontalSlider"),a=require("./styles.cjs"),k=r=>r&&r.__esModule?r:{default:r},S=k(_);function x({dayPerVizSec:r,elapsedTime:
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime");require("react");const s=require("../../../node_modules/prop-types/index.cjs"),f=require("react-i18next"),h=require("../orbitalUtilities.cjs"),_=require("@rubin-epo/epo-react-lib/HorizontalSlider"),a=require("./styles.cjs"),k=r=>r&&r.__esModule?r:{default:r},S=k(_);function x({dayPerVizSec:r,elapsedTime:c,sliderOnChangeCallback:j,speeds:n}){const{t}=f.useTranslation();function l(o,u){const b=c<0,m=Math.abs(c)/365.256,i=Math.floor(m),d=Math.floor(365.256*(m-i));let p={},y={};return p={number:h.formatValue(b?-i:i),string:t("elapsed_time.interval.year",{count:i})},y={number:h.formatValue(b?-d:d),string:t("elapsed_time.interval.day",{count:d})},o==="days"?y[u]:o==="years"?p[u]:null}return e.jsx(e.Fragment,{children:e.jsxs(a.PlaybackSpeedContainer,{children:[e.jsxs(a.PlaybackSpeedSliderHeader,{children:[e.jsx(a.PlaybackSpeedTitle,{children:t("orbital_sim.playback.time_step")}),e.jsx(a.PlaybackSpeedSliderLabel,{children:t("orbital_sim.playback.sec_with_count",{count:Math.round(r)})})]}),e.jsx(a.PlaybackSpeedSliderLabelTop,{children:t("orbital_sim.playback.time_equivalence",{firstTime:t("orbit_viewer.playback.interval.secWithCount",{count:1}),secondTime:t("orbit_viewer.playback.interval.yearWithCount",{count:1}),context:"verbose"})}),e.jsx(a.PlaybackSpeedSliderLabelBottom,{children:t("orbital_sim.playback.normal_time")}),e.jsx(a.PlaybackSpeedSliderWrapper,{children:e.jsx(S.default,{isVertical:!0,min:n.min,invert:!0,max:n.max,step:n.step,value:r,onChangeCallback:j})}),e.jsxs(a.ElapsedTimeContainer,{children:[e.jsx(a.ElapsedTimeTitle,{children:t("elapsed_time.title")}),e.jsxs(a.ElapsedTimeInner,{children:[e.jsxs(a.ElapsedTimeBlock,{children:[e.jsx(a.ElapsedVal,{children:l("years","number")}),e.jsx("div",{children:l("years","string")})]}),e.jsx(a.ElapsedTimeDivider,{}),e.jsxs(a.ElapsedTimeBlock,{children:[e.jsx(a.ElapsedVal,{children:l("days","number")}),e.jsx(a.ElapsedLabel,{children:l("days","string")})]})]})]})]})})}x.propTypes={dayPerVizSec:s.default.number,elapsedTime:s.default.number,speeds:s.default.object,sliderOnChangeCallback:s.default.func};exports.default=x;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, Fragment as
|
|
2
|
+
import { jsx as e, Fragment as _, jsxs as a } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import l from "../../../node_modules/prop-types/index.js";
|
|
5
5
|
import { useTranslation as T } from "react-i18next";
|
|
6
6
|
import { formatValue as h } from "../orbitalUtilities.js";
|
|
7
7
|
import v from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
8
|
-
import {
|
|
8
|
+
import { PlaybackSpeedContainer as P, PlaybackSpeedSliderHeader as g, PlaybackSpeedTitle as C, PlaybackSpeedSliderLabel as E, PlaybackSpeedSliderLabelTop as x, PlaybackSpeedSliderLabelBottom as j, PlaybackSpeedSliderWrapper as L, ElapsedTimeContainer as M, ElapsedTimeTitle as w, ElapsedTimeInner as D, ElapsedTimeBlock as f, ElapsedVal as k, ElapsedTimeDivider as V, ElapsedLabel as W } from "./styles.js";
|
|
9
9
|
function B({
|
|
10
10
|
dayPerVizSec: c,
|
|
11
11
|
elapsedTime: s,
|
|
12
|
-
sliderOnChangeCallback:
|
|
12
|
+
sliderOnChangeCallback: S,
|
|
13
13
|
speeds: n
|
|
14
14
|
}) {
|
|
15
15
|
const { t: r } = T();
|
|
@@ -24,7 +24,7 @@ function B({
|
|
|
24
24
|
string: r("elapsed_time.interval.day", { count: o })
|
|
25
25
|
}, d === "days" ? y[m] : d === "years" ? u[m] : null;
|
|
26
26
|
}
|
|
27
|
-
return /* @__PURE__ */ e(
|
|
27
|
+
return /* @__PURE__ */ e(_, { children: /* @__PURE__ */ a(P, { children: [
|
|
28
28
|
/* @__PURE__ */ a(g, { children: [
|
|
29
29
|
/* @__PURE__ */ e(C, { children: r("orbital_sim.playback.time_step") }),
|
|
30
30
|
/* @__PURE__ */ e(E, { children: r("orbital_sim.playback.sec_with_count", {
|
|
@@ -50,7 +50,7 @@ function B({
|
|
|
50
50
|
max: n.max,
|
|
51
51
|
step: n.step,
|
|
52
52
|
value: c,
|
|
53
|
-
onChangeCallback:
|
|
53
|
+
onChangeCallback: S
|
|
54
54
|
}
|
|
55
55
|
) }),
|
|
56
56
|
/* @__PURE__ */ a(M, { children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),i=a=>a&&a.__esModule?a:{default:a},e=i(t),l=e.default.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: repeat(2, 1fr);
|
|
4
4
|
grid-template-rows: repeat(5, 1fr);
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
right: 20px;
|
|
10
10
|
top: 10px;
|
|
11
11
|
height: 95%;
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
@container orbital-sim-context (width < 650px) {
|
|
14
|
+
height: 85%;
|
|
15
|
+
}
|
|
16
|
+
`,r=e.default.div`
|
|
13
17
|
width: auto;
|
|
14
18
|
display: flex;
|
|
15
19
|
position: absolute;
|
|
@@ -117,4 +121,4 @@
|
|
|
117
121
|
line-height: 1.333;
|
|
118
122
|
color: var(--black);
|
|
119
123
|
color: var(--black);
|
|
120
|
-
`;exports.ElapsedLabel=u;exports.ElapsedTimeBlock=x;exports.ElapsedTimeContainer=b;exports.ElapsedTimeDivider=k;exports.ElapsedTimeInner=f;exports.ElapsedTimeTitle=g;exports.ElapsedVal=h;exports.
|
|
124
|
+
`;exports.ElapsedLabel=u;exports.ElapsedTimeBlock=x;exports.ElapsedTimeContainer=b;exports.ElapsedTimeDivider=k;exports.ElapsedTimeInner=f;exports.ElapsedTimeTitle=g;exports.ElapsedVal=h;exports.PlaybackControlsContainer=r;exports.PlaybackSpeedContainer=l;exports.PlaybackSpeedSliderHeader=o;exports.PlaybackSpeedSliderLabel=n;exports.PlaybackSpeedSliderLabelBottom=p;exports.PlaybackSpeedSliderLabelTop=c;exports.PlaybackSpeedSliderWrapper=s;exports.PlaybackSpeedTitle=d;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const PlaybackSpeedContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
2
|
export declare const PlaybackControlsContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
3
|
export declare const PlaybackSpeedSliderHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
4
|
export declare const PlaybackSpeedTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
@@ -11,6 +11,10 @@ const i = e.div`
|
|
|
11
11
|
right: 20px;
|
|
12
12
|
top: 10px;
|
|
13
13
|
height: 95%;
|
|
14
|
+
|
|
15
|
+
@container orbital-sim-context (width < 650px) {
|
|
16
|
+
height: 85%;
|
|
17
|
+
}
|
|
14
18
|
`, a = e.div`
|
|
15
19
|
width: auto;
|
|
16
20
|
display: flex;
|
|
@@ -20,7 +24,7 @@ const i = e.div`
|
|
|
20
24
|
transform: translateX(-50%);
|
|
21
25
|
z-index: 2;
|
|
22
26
|
font-size: 17px;
|
|
23
|
-
`,
|
|
27
|
+
`, t = e.div`
|
|
24
28
|
z-index: 2;
|
|
25
29
|
padding: 5px;
|
|
26
30
|
text-align: center;
|
|
@@ -29,7 +33,7 @@ const i = e.div`
|
|
|
29
33
|
border-radius: 10px;
|
|
30
34
|
grid-area: 1 / 1 / 2 / 3;
|
|
31
35
|
height: fit-content;
|
|
32
|
-
`,
|
|
36
|
+
`, o = e.h4`
|
|
33
37
|
font-size: 18px;
|
|
34
38
|
font-weight: var(--regular);
|
|
35
39
|
line-height: 1.5;
|
|
@@ -128,12 +132,12 @@ export {
|
|
|
128
132
|
b as ElapsedTimeInner,
|
|
129
133
|
s as ElapsedTimeTitle,
|
|
130
134
|
x as ElapsedVal,
|
|
131
|
-
i as PlaybackContainer,
|
|
132
135
|
a as PlaybackControlsContainer,
|
|
133
|
-
|
|
136
|
+
i as PlaybackSpeedContainer,
|
|
137
|
+
t as PlaybackSpeedSliderHeader,
|
|
134
138
|
l as PlaybackSpeedSliderLabel,
|
|
135
139
|
d as PlaybackSpeedSliderLabelBottom,
|
|
136
140
|
n as PlaybackSpeedSliderLabelTop,
|
|
137
141
|
c as PlaybackSpeedSliderWrapper,
|
|
138
|
-
|
|
142
|
+
o as PlaybackSpeedTitle
|
|
139
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),r=require("react"),o=require("../../../node_modules/prop-types/index.cjs"),ge=require("three"),fe=require("@react-three/fiber"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),r=require("react"),o=require("../../../node_modules/prop-types/index.cjs"),ge=require("three"),fe=require("@react-three/fiber"),d=require("@react-three/drei"),t=require("../orbitalUtilities.cjs"),xe=require("../chartColors.module.css.cjs"),pe=require("../Context/index.cjs"),je=require("react-i18next"),g=require("./styles.cjs");function ye(i){if(i&&i.__esModule)return i;const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const a in i)if(a!=="default"){const j=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(f,a,j.get?j:{enumerable:!0,get:()=>i[a]})}}return f.default=i,Object.freeze(f)}const M=ye(ge),_=({data:i,selectionCallback:f,active:a,playing:j,dayPerVizSec:w,stepDirection:G,frameOverride:R,orbitColor:k,objectColor:C,objectRadius:D,initialized:N,initCallback:v,devMode:Z,zoomMod:U,defaultZoom:K,type:A,reset:z})=>{const{t:Y}=je.useTranslation(),{orbits:$}=pe.useOrbitalSimContext(),{activeVelocityCallback:J}=$,Q=r.useRef(),{a:V,e:W,i:X,M:ee,Node:q,Peri:B,Principal_desig:te,Translated_desig_key:H,name:oe}=i||{},[se]=r.useState(()=>[0,t.degsToRads(X),q?t.degsToRads(q):0]),[n]=r.useState(()=>t.auToUnit(V)),[y]=r.useState(()=>t.getMinorAxis(V,W)),[re]=r.useState(()=>t.getFocus(n,y)),[s]=r.useState(new M.Vector3(re,0,0)),[u]=r.useState(new M.Vector3(0,0,0)),[ie,ae]=r.useState(!1),[h]=r.useState(()=>t.getCurve(n,y,s.x,s.y)),[ne]=r.useState(h.getPoints(360)),b=t.getPosFromArcLength(0,h),[x,T]=r.useState({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(u),n),period:0});r.useEffect(()=>{z>0&&T({position:b,rotation:[0,0,0],progress:0,velocity:t.getVelocity(b.distanceTo(u),n),period:0})},[z]);function le(m){let l=0,c=t.getPosFromArcLength(l,h);if(m){const P=m>180,O=P?m-180:m;let p=t.getAngleFromPos(c,u);for(;p<O;)l+=.01,c=t.getPosFromArcLength(l,h),p=t.getAngleFromPos(c,u);P&&(l+=.5,c=t.getPosFromArcLength(l,h))}return v?v():ae(!0),{position:c,rotation:[0,0,0],progress:l,velocity:t.getVelocity(c.distanceTo(u),n),period:0}}function E(m,L){const{progress:l,position:c,velocity:P,period:O}=x,p=m?0:L*(w||t.DAY_PER_VIZ_SEC),ce=P*p*G,S=l+ce/h.getLength(),F=S>1?1-S:S,{x:de,y:ue}=h.getPoint(F),he=new M.Vector3(de,ue,0),me=t.getVelocity(c.distanceTo(u),n);let I=p+O;S>1&&(I=0),T({...x,position:he,progress:F,velocity:me,period:I})}return r.useEffect(()=>{T(le(ee||Math.floor(Math.random()*Math.floor(180))))},[]),r.useEffect(()=>{R&&E(!1,1/60)},[R]),r.useEffect(()=>{a&&J(t.auToMeters(t.unitToAu(x.velocity/1e5)))},[x]),fe.useFrame((m,L)=>{(N||ie)&&E(!j,L)}),e.jsx("group",{rotation:se,children:e.jsxs("group",{rotation:[0,0,B?t.degsToRads(B+90):0],children:[e.jsx(d.Line,{ref:Q,points:ne,linewidth:2,color:a?t.ORBITAL_COLORS.asteroid.orbitHighlight:k||t.ORBITAL_COLORS.asteroid.orbitColor}),e.jsxs("mesh",{position:x.position,onClick:()=>f(i,"neo"),children:[(A==="planet"||A==="neo"||a)&&e.jsx(d.Html,{children:e.jsx(g.Label,{style:{fontSize:t.getLabelSize(U,K)},children:H?Y(H):oe||te})}),e.jsx("sphereGeometry",{attach:"geometry",args:[D||4,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:a?t.ORBITAL_COLORS.asteroid.objectHighlight:C||t.ORBITAL_COLORS.asteroid.objectColor})]}),Z&&e.jsxs(e.Fragment,{children:[e.jsxs("mesh",{position:s,children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:xe.default.chart1}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"center"})})]}),e.jsxs("mesh",{position:u,children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:C||"blue"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"sun"})})]}),e.jsxs("mesh",{position:[s.x,-y+s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"minor axis vertex"})})]}),e.jsxs("mesh",{position:[s.x,y+s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"minor axis vertex"})})]}),e.jsxs("mesh",{position:[n+s.x,s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"major axis vertex"})})]}),e.jsxs("mesh",{position:[-n+s.x,s.y,s.z],children:[e.jsx("sphereGeometry",{attach:"geometry",args:[2,10,10]}),e.jsx("meshBasicMaterial",{attach:"material",color:"green"}),e.jsx(d.Html,{children:e.jsx(g.Label,{children:"major axis vertex"})})]})]})]})})};_.defaultProps={type:"object"};_.propTypes={data:o.default.object,selectionCallback:o.default.func,active:o.default.bool,playing:o.default.bool,dayPerVizSec:o.default.number,stepDirection:o.default.number,frameOverride:o.default.number,orbitColor:o.default.string,objectColor:o.default.string,objectRadius:o.default.number,initCallback:o.default.func,initialized:o.default.bool,devMode:o.default.bool,activeVelocityCallback:o.default.func,zoomMod:o.default.number,defaultZoom:o.default.number,type:o.default.string,reset:o.default.number};exports.default=_;
|