@rubin-epo/epo-widget-lib 0.10.4 → 1.0.0-beta.2
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/IsochronePlot.js +7 -7
- package/dist/SupernovaThreeVector.cjs +1 -1
- package/dist/SupernovaThreeVector.js +66 -66
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.d.ts +2 -1
- package/dist/atomic/Blinker/Blinker.js +43 -41
- package/dist/charts/Base/styles.cjs +5 -3
- package/dist/charts/Base/styles.js +12 -10
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +6 -5
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +77 -77
- package/dist/charts/ScatterPlot/styles.cjs +3 -4
- package/dist/charts/ScatterPlot/styles.js +5 -6
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +18 -16
- package/dist/localeStrings/en/epo-widget-lib.json +6 -6
- package/dist/widgets/LightCurvePlot/Plot/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/Plot/index.js +53 -68
- package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.js +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +94 -80
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +37 -39
- package/dist/widgets/SourceSelector/styles.d.ts +1 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Histogram/index.js +43 -43
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +3 -2
- package/dist/widgets/SupernovaThreeVector/styles.cjs +6 -7
- package/dist/widgets/SupernovaThreeVector/styles.js +11 -12
- package/package.json +1 -1
|
@@ -1,120 +1,134 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { range as
|
|
6
|
-
import
|
|
2
|
+
import { jsx as t, jsxs as A, Fragment as d } from "react/jsx-runtime";
|
|
3
|
+
import { useId as T } from "react";
|
|
4
|
+
import { useTranslation as V } from "react-i18next";
|
|
5
|
+
import { range as J } from "d3-array";
|
|
6
|
+
import D from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
7
7
|
import r from "../defaults.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useAlertsAsPoints as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { DM15Display as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { mergeWithDefaults as
|
|
19
|
-
const
|
|
20
|
-
gaussianWidth:
|
|
8
|
+
import K from "../Plot/index.js";
|
|
9
|
+
import Q from "./A11Y/LightCurveLabel/index.js";
|
|
10
|
+
import { useAlertsAsPoints as X, estimateMagnitudeWithOffset as Z, estimateMagnitude as O } from "../helpers.js";
|
|
11
|
+
import k from "../../../atomic/Button/patterns/Reset.js";
|
|
12
|
+
import S from "./MagnitudeSlider/index.js";
|
|
13
|
+
import { DM15Display as C } from "./styles.js";
|
|
14
|
+
import G from "../../../charts/Viewport/index.js";
|
|
15
|
+
import U from "../../../layout/Controls/index.js";
|
|
16
|
+
import I from "../../../atomic/ControlLabel/index.js";
|
|
17
|
+
import Y from "../../../charts/PathFromPoints/index.js";
|
|
18
|
+
import { mergeWithDefaults as tt } from "../../../lib/utils.js";
|
|
19
|
+
const w = ({
|
|
20
|
+
gaussianWidth: m = r.gaussianWidth,
|
|
21
21
|
yOffset: s = r.yOffset,
|
|
22
|
-
alerts:
|
|
23
|
-
peakMjd:
|
|
24
|
-
yMin:
|
|
22
|
+
alerts: B,
|
|
23
|
+
peakMjd: _,
|
|
24
|
+
yMin: a,
|
|
25
25
|
yMax: f,
|
|
26
|
-
width:
|
|
27
|
-
height:
|
|
28
|
-
userMagnitude:
|
|
26
|
+
width: c = r.width,
|
|
27
|
+
height: h = r.height,
|
|
28
|
+
userMagnitude: F,
|
|
29
29
|
onUserMagnitudeChangeCallback: n,
|
|
30
30
|
onGaussianChangeCallback: l,
|
|
31
31
|
onYOffsetChangeCallback: u,
|
|
32
|
-
className:
|
|
32
|
+
className: H,
|
|
33
33
|
isDisplayOnly: g,
|
|
34
|
-
...
|
|
34
|
+
...R
|
|
35
35
|
}) => {
|
|
36
|
-
const { t:
|
|
37
|
-
{ min:
|
|
36
|
+
const { t: v } = V(), i = tt(
|
|
37
|
+
{ min: a, max: f },
|
|
38
38
|
r.yAxis
|
|
39
|
-
), y = (
|
|
39
|
+
), y = (i.max - i.min) / 2 + i.min, x = X(B, _), j = T(), q = () => {
|
|
40
40
|
n && n(y), u && u(r.yOffset), l && l(r.gaussianWidth);
|
|
41
|
-
},
|
|
42
|
-
|
|
41
|
+
}, b = Z(0, m, s), $ = /* @__PURE__ */ t(
|
|
42
|
+
K,
|
|
43
43
|
{
|
|
44
44
|
slider: /* @__PURE__ */ t(
|
|
45
|
-
|
|
45
|
+
S,
|
|
46
46
|
{
|
|
47
|
-
magnitude:
|
|
47
|
+
magnitude: F || y,
|
|
48
48
|
onMagnitudeChangeCallback: (e) => n && n(e),
|
|
49
49
|
disabled: g,
|
|
50
|
-
yMin:
|
|
51
|
-
yMax:
|
|
52
|
-
estimatedPeak:
|
|
50
|
+
yMin: i.min - i.step / 2,
|
|
51
|
+
yMax: i.max + i.step / 2,
|
|
52
|
+
estimatedPeak: b
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
55
|
plotChildren: ({
|
|
56
56
|
xScale: e,
|
|
57
57
|
yScale: o,
|
|
58
|
-
xDomain:
|
|
59
|
-
yDomain:
|
|
60
|
-
xStart:
|
|
61
|
-
xEnd:
|
|
62
|
-
yStart:
|
|
63
|
-
yEnd:
|
|
64
|
-
|
|
58
|
+
xDomain: P,
|
|
59
|
+
yDomain: z,
|
|
60
|
+
xStart: M,
|
|
61
|
+
xEnd: E,
|
|
62
|
+
yStart: W,
|
|
63
|
+
yEnd: p,
|
|
64
|
+
Data: N
|
|
65
|
+
}) => /* @__PURE__ */ A(d, { children: [
|
|
65
66
|
/* @__PURE__ */ t(
|
|
66
|
-
|
|
67
|
+
"rect",
|
|
67
68
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
x: e(0),
|
|
70
|
+
y: p,
|
|
71
|
+
width: e(15) - e(0),
|
|
72
|
+
height: W - p,
|
|
73
|
+
stroke: "var(--neutral60,##6A6E6E)",
|
|
74
|
+
strokeDasharray: 6,
|
|
75
|
+
fill: "var(--neutral20,#DCE0E3)"
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
N,
|
|
79
|
+
/* @__PURE__ */ t(
|
|
80
|
+
Y,
|
|
81
|
+
{
|
|
82
|
+
points: J(P[0], P[1], 0.5).map((L) => ({
|
|
83
|
+
x: e(L),
|
|
84
|
+
y: o(O(L, m))
|
|
71
85
|
})),
|
|
72
86
|
svgProps: {
|
|
73
|
-
transform: `translate(0,${o(
|
|
87
|
+
transform: `translate(0,${o(z[1] - s)})`
|
|
74
88
|
}
|
|
75
89
|
}
|
|
76
90
|
),
|
|
77
91
|
/* @__PURE__ */ t(
|
|
78
|
-
|
|
92
|
+
G,
|
|
79
93
|
{
|
|
80
|
-
x:
|
|
81
|
-
y:
|
|
82
|
-
outerHeight:
|
|
83
|
-
outerWidth:
|
|
84
|
-
innerWidth:
|
|
85
|
-
innerHeight:
|
|
86
|
-
children: /* @__PURE__ */ t(
|
|
94
|
+
x: M,
|
|
95
|
+
y: p,
|
|
96
|
+
outerHeight: W - p,
|
|
97
|
+
outerWidth: E - M,
|
|
98
|
+
innerWidth: c,
|
|
99
|
+
innerHeight: h,
|
|
100
|
+
children: /* @__PURE__ */ t(C, { gaussianWidth: m })
|
|
87
101
|
}
|
|
88
102
|
)
|
|
89
103
|
] }),
|
|
90
|
-
...
|
|
91
|
-
data:
|
|
92
|
-
width:
|
|
93
|
-
height:
|
|
94
|
-
yMin:
|
|
104
|
+
...R,
|
|
105
|
+
data: x,
|
|
106
|
+
width: c,
|
|
107
|
+
height: h,
|
|
108
|
+
yMin: a,
|
|
95
109
|
yMax: f
|
|
96
110
|
}
|
|
97
111
|
);
|
|
98
112
|
return /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(
|
|
99
|
-
|
|
113
|
+
U,
|
|
100
114
|
{
|
|
101
|
-
className:
|
|
115
|
+
className: H,
|
|
102
116
|
isDisplayOnly: g,
|
|
103
|
-
widget:
|
|
104
|
-
controls: /* @__PURE__ */
|
|
117
|
+
widget: $,
|
|
118
|
+
controls: /* @__PURE__ */ A(d, { children: [
|
|
105
119
|
/* @__PURE__ */ t(
|
|
106
|
-
|
|
120
|
+
I,
|
|
107
121
|
{
|
|
108
|
-
label:
|
|
122
|
+
label: v("light_curve.curve.controls.gaussian_width"),
|
|
109
123
|
input: (e) => /* @__PURE__ */ t(
|
|
110
|
-
|
|
124
|
+
D,
|
|
111
125
|
{
|
|
112
126
|
labelledbyId: e,
|
|
113
127
|
color: "var(--turquoise85, #12726D)",
|
|
114
128
|
min: r.gaussianMin,
|
|
115
129
|
max: r.gaussianMax,
|
|
116
130
|
step: r.gaussianStep,
|
|
117
|
-
value:
|
|
131
|
+
value: m,
|
|
118
132
|
onChangeCallback: (o) => typeof o == "number" && l && l(o)
|
|
119
133
|
}
|
|
120
134
|
),
|
|
@@ -122,11 +136,11 @@ const B = ({
|
|
|
122
136
|
}
|
|
123
137
|
),
|
|
124
138
|
/* @__PURE__ */ t(
|
|
125
|
-
|
|
139
|
+
I,
|
|
126
140
|
{
|
|
127
|
-
label:
|
|
141
|
+
label: v("light_curve.curve.controls.y_offset"),
|
|
128
142
|
input: (e) => /* @__PURE__ */ t(
|
|
129
|
-
|
|
143
|
+
D,
|
|
130
144
|
{
|
|
131
145
|
labelledbyId: e,
|
|
132
146
|
color: "var(--turquoise85, #12726D)",
|
|
@@ -141,22 +155,22 @@ const B = ({
|
|
|
141
155
|
}
|
|
142
156
|
),
|
|
143
157
|
/* @__PURE__ */ t(
|
|
144
|
-
|
|
158
|
+
Q,
|
|
145
159
|
{
|
|
146
|
-
controlledById:
|
|
147
|
-
data:
|
|
148
|
-
gaussianWidth:
|
|
160
|
+
controlledById: j,
|
|
161
|
+
data: x,
|
|
162
|
+
gaussianWidth: m,
|
|
149
163
|
yOffset: s,
|
|
150
|
-
estimatedPeak:
|
|
164
|
+
estimatedPeak: b
|
|
151
165
|
}
|
|
152
166
|
)
|
|
153
167
|
] }),
|
|
154
|
-
actions: /* @__PURE__ */ t(
|
|
168
|
+
actions: /* @__PURE__ */ t(k, { onResetCallback: q })
|
|
155
169
|
}
|
|
156
170
|
) });
|
|
157
171
|
};
|
|
158
|
-
|
|
159
|
-
const yt =
|
|
172
|
+
w.displayName = "Widgets.LightCurve";
|
|
173
|
+
const yt = w;
|
|
160
174
|
export {
|
|
161
175
|
yt as default
|
|
162
176
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),l=require("react"),y=require("react-i18next"),z=require("@rubin-epo/epo-react-lib/IconComposer"),E=require("../../layout/AspectRatio/index.cjs"),I=require("
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),l=require("react"),y=require("react-i18next"),z=require("@rubin-epo/epo-react-lib/IconComposer"),E=require("../../layout/AspectRatio/index.cjs"),I=require("../../atomic/Loader/index.cjs"),N=require("./PointSelector/index.cjs"),R=require("./styles.cjs"),U=require("./Message/Message.cjs"),w=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),D=e=>e&&e.__esModule?e:{default:e},G=D(z),H=(e,u)=>{var r;const n={day:0,hour:0},o=e[u];if(!o)return n;const t=(o==null?void 0:o.date)-((r=e[0])==null?void 0:r.date);return t?{day:Math.round(t)||0,hour:Math.round(24/t%24)||0}:n},q=({width:e=600,height:u=600,selectedSource:n=[],sources:o,alerts:t=[],activeAlertIndex:r=0,alertChangeCallback:M,selectionCallback:d,blinkConfig:j,isDisplayOnly:c=!1,isLoading:b,className:C})=>{var S;const[_,k]=l.useState(!0),[p,f]=l.useState(),[V,i]=l.useState(!1),{t:g}=y.useTranslation(),h="sourceSelectorWidget",m=!_&&!b,x=()=>{f(g("source_selector.messages.failure")),i(!0)},L=a=>{if(!(!m||c))if(a){const F=!!o.find(({id:W})=>W===a),P=!n.includes(a);F&&P?(d&&d(n.concat(a)),f(s.jsxs(s.Fragment,{children:[s.jsx(G.default,{icon:"checkmark"}),g("source_selector.messages.success")]})),i(!0)):x()}else x()},T=()=>{i(!1)},{day:$,hour:v}=H(t,r),B=c?[(S=t[r])==null?void 0:S.image]:t.map(({image:a})=>a);return s.jsxs(E.default,{ratio:"square",className:C,children:[!c&&s.jsx(U.default,{onMessageChangeCallback:T,isVisible:V,forIds:[h],children:p}),s.jsx(R.BackgroundBlinker,{images:B,activeIndex:r,blinkCallback:M,loadedCallback:()=>k(!1),extraControls:t.length>0&&!c&&s.jsx(w.default,{day:$,hour:v}),...j,children:s.jsx(N.default,{id:h,onSelectCallback:L,width:e,height:u,sources:o,selectedSource:n})}),!m&&s.jsx(I.default,{})]})};q.displayName="Widgets.SourceSelector";const J=q;exports.default=J;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as C, jsx as a, Fragment as R } from "react/jsx-runtime";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
4
|
import { useTranslation as U } from "react-i18next";
|
|
5
5
|
import $ from "@rubin-epo/epo-react-lib/IconComposer";
|
|
6
6
|
import v from "../../layout/AspectRatio/index.js";
|
|
7
|
-
import w from "
|
|
8
|
-
import G from "
|
|
7
|
+
import w from "../../atomic/Loader/index.js";
|
|
8
|
+
import G from "./PointSelector/index.js";
|
|
9
9
|
import { BackgroundBlinker as H } from "./styles.js";
|
|
10
10
|
import J from "./Message/Message.js";
|
|
11
11
|
import K from "../../atomic/ElapsedTime/ElapsedTime.js";
|
|
@@ -19,77 +19,75 @@ const Q = (n, c) => {
|
|
|
19
19
|
day: Math.round(e) || 0,
|
|
20
20
|
hour: Math.round(24 / e % 24) || 0
|
|
21
21
|
} : s;
|
|
22
|
-
},
|
|
22
|
+
}, M = ({
|
|
23
23
|
width: n = 600,
|
|
24
24
|
height: c = 600,
|
|
25
25
|
selectedSource: s = [],
|
|
26
26
|
sources: o,
|
|
27
27
|
alerts: e = [],
|
|
28
28
|
activeAlertIndex: r = 0,
|
|
29
|
-
alertChangeCallback:
|
|
30
|
-
selectionCallback:
|
|
29
|
+
alertChangeCallback: b,
|
|
30
|
+
selectionCallback: l,
|
|
31
31
|
blinkConfig: k,
|
|
32
32
|
isDisplayOnly: i = !1,
|
|
33
33
|
isLoading: L,
|
|
34
34
|
className: V
|
|
35
35
|
}) => {
|
|
36
|
-
var
|
|
37
|
-
const [
|
|
38
|
-
|
|
36
|
+
var S;
|
|
37
|
+
const [x, j] = f(!0), [B, u] = f(), [F, m] = f(!1), { t: d } = U(), g = "sourceSelectorWidget", h = !x && !L, p = () => {
|
|
38
|
+
u(d("source_selector.messages.failure")), m(!0);
|
|
39
39
|
}, P = (t) => {
|
|
40
|
-
if (!(!
|
|
40
|
+
if (!(!h || i))
|
|
41
41
|
if (t) {
|
|
42
42
|
const z = !!o.find(({ id: N }) => N === t), E = !s.includes(t);
|
|
43
|
-
z && E ? (
|
|
44
|
-
/* @__PURE__ */
|
|
43
|
+
z && E ? (l && l(s.concat(t)), u(
|
|
44
|
+
/* @__PURE__ */ C(R, { children: [
|
|
45
45
|
/* @__PURE__ */ a($, { icon: "checkmark" }),
|
|
46
|
-
|
|
46
|
+
d("source_selector.messages.success")
|
|
47
47
|
] })
|
|
48
|
-
), m(!0)) :
|
|
48
|
+
), m(!0)) : p();
|
|
49
49
|
} else
|
|
50
|
-
|
|
50
|
+
p();
|
|
51
51
|
}, T = () => {
|
|
52
52
|
m(!1);
|
|
53
|
-
}, { day: W, hour: _ } = Q(e, r), q = i ? [(
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
}, { day: W, hour: _ } = Q(e, r), q = i ? [(S = e[r]) == null ? void 0 : S.image] : e.map(({ image: t }) => t);
|
|
54
|
+
return /* @__PURE__ */ C(v, { ratio: "square", className: V, children: [
|
|
55
55
|
!i && /* @__PURE__ */ a(
|
|
56
56
|
J,
|
|
57
57
|
{
|
|
58
58
|
onMessageChangeCallback: T,
|
|
59
59
|
isVisible: F,
|
|
60
|
-
forIds: [
|
|
60
|
+
forIds: [g],
|
|
61
61
|
children: B
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ a(
|
|
65
65
|
H,
|
|
66
66
|
{
|
|
67
67
|
images: q,
|
|
68
68
|
activeIndex: r,
|
|
69
|
-
blinkCallback:
|
|
70
|
-
loadedCallback: () =>
|
|
69
|
+
blinkCallback: b,
|
|
70
|
+
loadedCallback: () => j(!1),
|
|
71
|
+
extraControls: e.length > 0 && !i && /* @__PURE__ */ a(K, { day: W, hour: _ }),
|
|
71
72
|
...k,
|
|
72
|
-
children:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
]
|
|
73
|
+
children: /* @__PURE__ */ a(
|
|
74
|
+
G,
|
|
75
|
+
{
|
|
76
|
+
id: g,
|
|
77
|
+
onSelectCallback: P,
|
|
78
|
+
width: n,
|
|
79
|
+
height: c,
|
|
80
|
+
sources: o,
|
|
81
|
+
selectedSource: s
|
|
82
|
+
}
|
|
83
|
+
)
|
|
86
84
|
}
|
|
87
85
|
),
|
|
88
|
-
!
|
|
86
|
+
!h && /* @__PURE__ */ a(w, {})
|
|
89
87
|
] });
|
|
90
88
|
};
|
|
91
|
-
|
|
92
|
-
const se =
|
|
89
|
+
M.displayName = "Widgets.SourceSelector";
|
|
90
|
+
const se = M;
|
|
93
91
|
export {
|
|
94
92
|
se as default
|
|
95
93
|
};
|
|
@@ -492,5 +492,6 @@ export declare const BackgroundBlinker: import('styled-components').IStyledCompo
|
|
|
492
492
|
loadedCallback?: (() => void) | undefined;
|
|
493
493
|
className?: string | undefined;
|
|
494
494
|
showControls?: boolean | undefined;
|
|
495
|
+
extraControls?: import('react').ReactNode;
|
|
495
496
|
children?: import('react').ReactNode;
|
|
496
497
|
}> & import('react').FunctionComponent<import('react').PropsWithChildren<import('../../atomic/Blinker/Blinker').BlinkerProps>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),j=require("react"),L=require("react-i18next"),w=require("../../../charts/Base/index.cjs"),H=require("../../../charts/XAxis/index.cjs"),O=require("../../../charts/Guidelines/index.cjs"),R=require("../../../charts/YAxis/index.cjs"),k=require("../../../charts/Bars/index.cjs"),z=require("../../../charts/Tooltip/index.cjs"),B=require("../../../charts/styles.cjs"),E=require("../../../lib/utils.cjs"),T=require("./styles.cjs"),y=({data:c,margin:b,activeRange:x,xDomain:r,yDomain:n,xScale:o,yScale:i,yTicks:h,xTicks:p,step:M,width:_,height:I,className:$})=>{const{t:q}=L.useTranslation(),[l,v]=j.useState(),g=i(n[0]),f=j.useId(),d=typeof l=="number",a=c.map(({value:s,bin:e},u)=>({x:e,value:s,width:12,fill:E.between(e,x[0],x[1])?void 0:"#30E0E3",props:{"aria-label":q("supernova_three_vector.histogram.bar_label",{count:s,binMin:e,binMax:e+M}),onMouseOver:()=>v(u),onMouseOut:()=>v(void 0)}}));return t.jsxs(w.default,{xMin:r[0],yMin:n[0],width:_,height:I,className:$,horizontalLabel:q("supernova_three_vector.histogram.x_label"),horizontalLabelId:f,children:[t.jsx(R.default,{showBaseline:!1,x:o(r[0])-10,ticks:h,tickLength:0,labelRender:(s,e,u)=>t.jsx(T.YLabel,{x:e,y:u,children:s}),yDomain:n,yScale:i}),t.jsx(O.default,{guides:h,xDomain:r,xScale:o,yDomain:n,yScale:i,margin:b}),t.jsx(k.default,{data:a,xDomain:r,yDomain:n,xScale:o,yScale:i}),t.jsx(H.default,{ticks:p,y:g,labelledById:f,labelRender:(s,e,u)=>t.jsx(B.XLabel,{x:e,y:u+5,children:s}),xDomain:r,xScale:o,margin:b}),t.jsx(z.default,{x:d?o(c[l].bin):0,y:d?i(a[l].value):0,visible:d,children:d?a[l].value:null})]})},A=y;exports.default=A;
|
|
@@ -1,106 +1,106 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { XLabel as
|
|
12
|
-
import { between as
|
|
13
|
-
import { YLabel as
|
|
14
|
-
const
|
|
15
|
-
data:
|
|
16
|
-
margin:
|
|
17
|
-
activeRange:
|
|
2
|
+
import { jsxs as B, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as w, useId as A } from "react";
|
|
4
|
+
import { useTranslation as H } from "react-i18next";
|
|
5
|
+
import j from "../../../charts/Base/index.js";
|
|
6
|
+
import k from "../../../charts/XAxis/index.js";
|
|
7
|
+
import z from "../../../charts/Guidelines/index.js";
|
|
8
|
+
import E from "../../../charts/YAxis/index.js";
|
|
9
|
+
import O from "../../../charts/Bars/index.js";
|
|
10
|
+
import R from "../../../charts/Tooltip/index.js";
|
|
11
|
+
import { XLabel as T } from "../../../charts/styles.js";
|
|
12
|
+
import { between as X } from "../../../lib/utils.js";
|
|
13
|
+
import { YLabel as Y } from "./styles.js";
|
|
14
|
+
const G = ({
|
|
15
|
+
data: a,
|
|
16
|
+
margin: u,
|
|
17
|
+
activeRange: b,
|
|
18
18
|
xDomain: t,
|
|
19
19
|
yDomain: s,
|
|
20
20
|
xScale: i,
|
|
21
21
|
yScale: l,
|
|
22
22
|
yTicks: f,
|
|
23
23
|
xTicks: x,
|
|
24
|
-
step:
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
className:
|
|
24
|
+
step: I,
|
|
25
|
+
width: L,
|
|
26
|
+
height: M,
|
|
27
|
+
className: _
|
|
28
28
|
}) => {
|
|
29
|
-
const { t: h } =
|
|
29
|
+
const { t: h } = H(), [d, c] = w(), g = l(s[0]), v = A(), m = typeof d == "number", p = a.map(({ value: e, bin: o }, n) => ({
|
|
30
30
|
x: o,
|
|
31
31
|
value: e,
|
|
32
32
|
width: 12,
|
|
33
|
-
fill:
|
|
33
|
+
fill: X(o, b[0], b[1]) ? void 0 : "#30E0E3",
|
|
34
34
|
props: {
|
|
35
35
|
"aria-label": h("supernova_three_vector.histogram.bar_label", {
|
|
36
36
|
count: e,
|
|
37
37
|
binMin: o,
|
|
38
|
-
binMax: o +
|
|
38
|
+
binMax: o + I
|
|
39
39
|
}),
|
|
40
40
|
onMouseOver: () => c(n),
|
|
41
41
|
onMouseOut: () => c(void 0)
|
|
42
42
|
}
|
|
43
43
|
}));
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
return /* @__PURE__ */ B(
|
|
45
|
+
j,
|
|
46
46
|
{
|
|
47
47
|
xMin: t[0],
|
|
48
48
|
yMin: s[0],
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
51
|
-
className:
|
|
49
|
+
width: L,
|
|
50
|
+
height: M,
|
|
51
|
+
className: _,
|
|
52
52
|
horizontalLabel: h("supernova_three_vector.histogram.x_label"),
|
|
53
53
|
horizontalLabelId: v,
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ r(
|
|
56
|
-
|
|
56
|
+
E,
|
|
57
57
|
{
|
|
58
58
|
showBaseline: !1,
|
|
59
59
|
x: i(t[0]) - 10,
|
|
60
60
|
ticks: f,
|
|
61
61
|
tickLength: 0,
|
|
62
|
-
labelRender: (e, o, n) => /* @__PURE__ */ r(
|
|
62
|
+
labelRender: (e, o, n) => /* @__PURE__ */ r(Y, { x: o, y: n, children: e }),
|
|
63
63
|
yDomain: s,
|
|
64
64
|
yScale: l
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ r(
|
|
68
|
-
|
|
68
|
+
z,
|
|
69
69
|
{
|
|
70
70
|
guides: f,
|
|
71
71
|
xDomain: t,
|
|
72
72
|
xScale: i,
|
|
73
73
|
yDomain: s,
|
|
74
74
|
yScale: l,
|
|
75
|
-
margin:
|
|
75
|
+
margin: u
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
|
-
/* @__PURE__ */ r(
|
|
78
|
+
/* @__PURE__ */ r(O, { data: p, xDomain: t, yDomain: s, xScale: i, yScale: l }),
|
|
79
79
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
80
|
+
k,
|
|
81
81
|
{
|
|
82
82
|
ticks: x,
|
|
83
83
|
y: g,
|
|
84
84
|
labelledById: v,
|
|
85
|
-
labelRender: (e, o, n) => /* @__PURE__ */ r(
|
|
85
|
+
labelRender: (e, o, n) => /* @__PURE__ */ r(T, { x: o, y: n + 5, children: e }),
|
|
86
86
|
xDomain: t,
|
|
87
87
|
xScale: i,
|
|
88
|
-
margin:
|
|
88
|
+
margin: u
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
91
|
/* @__PURE__ */ r(
|
|
92
|
-
|
|
92
|
+
R,
|
|
93
93
|
{
|
|
94
|
-
x:
|
|
95
|
-
y:
|
|
96
|
-
visible:
|
|
97
|
-
children:
|
|
94
|
+
x: m ? i(a[d].bin) : 0,
|
|
95
|
+
y: m ? l(p[d].value) : 0,
|
|
96
|
+
visible: m,
|
|
97
|
+
children: m ? p[d].value : null
|
|
98
98
|
}
|
|
99
99
|
)
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
|
-
},
|
|
103
|
+
}, Z = G;
|
|
104
104
|
export {
|
|
105
|
-
|
|
105
|
+
Z as default
|
|
106
106
|
};
|
|
@@ -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"),_=require("d3-geo-projection"),
|
|
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"),q=require("d3-geo"),y=require("d3-array"),E=require("../../../charts/Base/index.cjs"),N=require("../../../charts/Tooltip/index.cjs");require("../../../charts/ScatterPlot/index.cjs");const U=require("../../../atomic/ImageStack/index.cjs"),a=require("./styles.cjs"),M=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,B]=S.useState(!1),[x,f]=S.useState(),l=600,c=300,s={top:20,right:0,bottom:20,left:20},P=l+s.right+s.left,W=c+s.top+s.bottom,d=15,u=30,j=-90,m=90,g=-180,k=180,h=2,r=_.geoAitoff(),n=q.geoGraticule();n.step([u,d]),n.extent([[g,j],[k,m]]),r.fitExtent([[s.left,s.top],[s.left+l-h,s.top+c]],n.outline());const $=y.range(j+d,m,d),A=y.range(g+u,k,u),C=q.geoPath(r).pointRadius(6),i=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,b=(o?r([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(E.default,{width:P,height:W,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:i(n.outline()),fill:"white"})}),e.jsx(a.Background,{d:i(n.outline())}),e.jsx(a.Graticule,{d:i(n())}),e.jsx(a.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:s.left,y:s.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(U.default,{images:v,describedById:G,visible:w,loadCallback:()=>B(!0),showBackdrop:!1,showLoader:!1})}),e.jsx("g",{children:p.map(({id:t,lat:H,long:R},T)=>e.jsx(a.UserObject,{d:i({type:"Point",coordinates:[R,H]}),onMouseOver:()=>f(T),onMouseOut:()=>f(void 0)},t))}),e.jsx("g",{"aria-hidden":"true",children:$.map(t=>t===0?null:e.jsxs(a.LatLabel,{style:{dominantBaseline:t>0?"text-after-edge":"text-before-edge"},transform:`translate(${r([g,t])})`,children:[t,"°"]},t))}),e.jsx("g",{"aria-hidden":"true",children:A.map(t=>e.jsxs(a.LongLabel,{transform:`translate(${r([t,0])})`,children:[t,"°"]},t))}),e.jsx(a.Outline,{strokeWidth:h,d:i(n.outline())}),e.jsx(N.default,{visible:!!o,x:b[0],y:b[1],children:o==null?void 0:o.id})]})};M.displayName="Widgets.SupernovaThreeVector.Skymap";const V=M;exports.default=V;
|
|
@@ -6,6 +6,7 @@ import { geoGraticule as R, geoPath as U } from "d3-geo";
|
|
|
6
6
|
import { range as M } from "d3-array";
|
|
7
7
|
import V from "../../../charts/Base/index.js";
|
|
8
8
|
import q from "../../../charts/Tooltip/index.js";
|
|
9
|
+
import "../../../charts/ScatterPlot/index.js";
|
|
9
10
|
import z from "../../../atomic/ImageStack/index.js";
|
|
10
11
|
import { Background as D, Graticule as F, ImageStackerWrapper as J, UserObject as K, LatLabel as Q, LongLabel as X, Outline as Y } from "./styles.js";
|
|
11
12
|
const y = ({
|
|
@@ -116,7 +117,7 @@ const y = ({
|
|
|
116
117
|
] });
|
|
117
118
|
};
|
|
118
119
|
y.displayName = "Widgets.SupernovaThreeVector.Skymap";
|
|
119
|
-
const
|
|
120
|
+
const st = y;
|
|
120
121
|
export {
|
|
121
|
-
|
|
122
|
+
st as default
|
|
122
123
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),t=require("@rubin-epo/epo-react-lib/styles"),i=require("../../layout/AspectRatio/index.cjs"),a=require("../../atomic/Button/patterns/Reset.cjs"),o=require("./Histogram/index.cjs"),s=require("./Skymap/index.cjs"),d=n=>n&&n.__esModule?n:{default:n},e=d(r),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),t=require("@rubin-epo/epo-react-lib/styles"),i=require("../../layout/AspectRatio/index.cjs"),a=require("../../atomic/Button/patterns/Reset.cjs"),o=require("./Histogram/index.cjs"),s=require("./Skymap/index.cjs"),d=n=>n&&n.__esModule?n:{default:n},e=d(r),c=e.default(i.default)`
|
|
2
2
|
container-type: inline-size;
|
|
3
|
-
`,
|
|
3
|
+
`,l=e.default.div`
|
|
4
4
|
--three-vector-gap: calc(var(--PADDING_SMALL, 20px) / 2);
|
|
5
5
|
|
|
6
6
|
display: grid;
|
|
@@ -33,17 +33,16 @@
|
|
|
33
33
|
container-type: inline-size;
|
|
34
34
|
grid-area: histogram;
|
|
35
35
|
`,u=e.default(o.default)`
|
|
36
|
-
font-size: 0.
|
|
37
|
-
overflow: visible;
|
|
36
|
+
font-size: 0.75em;
|
|
38
37
|
|
|
39
38
|
@container (
|
|
40
39
|
min-width: ${t.token("BREAK_PHABLET_MIN")}
|
|
41
40
|
) {
|
|
42
41
|
font-size: 1em;
|
|
43
42
|
}
|
|
44
|
-
`,
|
|
43
|
+
`,p=e.default.div`
|
|
45
44
|
grid-area: slider;
|
|
46
|
-
`,
|
|
45
|
+
`,f=e.default(a.default)`
|
|
47
46
|
grid-area: reset;
|
|
48
47
|
`,g=e.default.div`
|
|
49
48
|
display: flex;
|
|
@@ -74,4 +73,4 @@
|
|
|
74
73
|
}
|
|
75
74
|
`,y=e.default.h4`
|
|
76
75
|
margin: 0;
|
|
77
|
-
`;exports.ChartTitle=y;exports.Histogram=u;exports.HistogramContainer=m;exports.ResetButton=
|
|
76
|
+
`;exports.ChartTitle=y;exports.Histogram=u;exports.HistogramContainer=m;exports.ResetButton=f;exports.Skymap=h;exports.SkymapContainer=g;exports.SliderContainer=p;exports.ThreeVectorContainer=c;exports.ThreeVectorLayout=l;
|