@rubin-epo/epo-widget-lib 0.9.0 → 0.9.1
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/SourceSelector.cjs +1 -1
- package/dist/SourceSelector.d.ts +2 -0
- package/dist/SourceSelector.js +8 -8
- package/dist/charts/Base/index.cjs +1 -1
- package/dist/charts/Base/index.d.ts +3 -5
- package/dist/charts/Base/index.js +21 -19
- package/dist/charts/Base/styles.cjs +15 -7
- package/dist/charts/Base/styles.d.ts +272 -0
- package/dist/charts/Base/styles.js +17 -8
- package/dist/charts/Tooltip/index.cjs +1 -1
- package/dist/charts/Tooltip/index.js +13 -14
- package/dist/charts/Tooltip/styles.cjs +5 -3
- package/dist/charts/Tooltip/styles.d.ts +7 -0
- package/dist/charts/Tooltip/styles.js +9 -5
- package/dist/localeStrings/en/epo-widget-lib.json +1 -1
- package/dist/widgets/ColorTool/hooks/useFilteredImages.cjs +1 -1
- package/dist/widgets/ColorTool/hooks/useFilteredImages.js +16 -19
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/index.d.ts +1 -0
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/index.js +25 -23
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/styles.cjs +21 -16
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/styles.js +24 -19
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.d.ts +7 -6
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +55 -53
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.d.ts +2 -8
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.d.ts +3 -5
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.js +148 -153
- package/dist/widgets/LightCurvePlot/ScatterPlot/styles.cjs +7 -8
- package/dist/widgets/LightCurvePlot/ScatterPlot/styles.d.ts +7 -276
- package/dist/widgets/LightCurvePlot/ScatterPlot/styles.js +10 -12
- package/dist/widgets/LightCurvePlot/defaults.cjs +1 -1
- package/dist/widgets/LightCurvePlot/defaults.d.ts +2 -0
- package/dist/widgets/LightCurvePlot/defaults.js +2 -0
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.d.ts +2 -2
- package/dist/widgets/SourceSelector/SourceSelector.js +28 -28
- package/dist/widgets/SourceSelector/index.d.ts +2 -1
- package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Histogram/index.js +35 -35
- package/package.json +1 -1
- package/dist/lib/helpers.cjs +0 -1
- package/dist/lib/helpers.js +0 -4
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import e from "styled-components";
|
|
3
3
|
import { token as i } from "@rubin-epo/epo-react-lib/styles";
|
|
4
|
-
import
|
|
5
|
-
const a =
|
|
4
|
+
import o from "../../../charts/Base/index.js";
|
|
5
|
+
const a = e.div`
|
|
6
6
|
display: flex;
|
|
7
|
-
|
|
7
|
+
aspect-ratio: 1;
|
|
8
|
+
color: var(--neutral95, #1f2121);
|
|
8
9
|
container-type: inline-size;
|
|
9
10
|
background-color: var(--white, #fff);
|
|
10
11
|
border: 1px solid var(--turquoise55, #009fa1);
|
|
11
12
|
gap: var(--light-curve-padding);
|
|
12
|
-
|
|
13
|
-
`, d = n(e)`
|
|
13
|
+
`, s = e(o)`
|
|
14
14
|
font-size: 2.25em;
|
|
15
|
+
overflow: visible;
|
|
16
|
+
|
|
15
17
|
@container (
|
|
16
18
|
min-width: ${i("BREAK_MOBILE")}
|
|
17
19
|
) {
|
|
@@ -29,12 +31,8 @@ const a = n.div`
|
|
|
29
31
|
) {
|
|
30
32
|
font-size: 1em;
|
|
31
33
|
}
|
|
32
|
-
`, l = n.h3`
|
|
33
|
-
padding-inline: var(--light-curve-padding, var(--PADDING_SMALL, 20px));
|
|
34
|
-
margin: 0;
|
|
35
34
|
`;
|
|
36
35
|
export {
|
|
37
|
-
|
|
38
|
-
a as PlotContainer
|
|
39
|
-
l as PlotTitle
|
|
36
|
+
s as Chart,
|
|
37
|
+
a as PlotContainer
|
|
40
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={xStep:10,yStep:.5,yMin:14,yMax:20,width:600,height:600,gaussianMin:-4,gaussianMax:4,gaussianStep:.01,gaussianWidth:-2,yOffsetMin:-50,yOffsetMax:50,yOffsetStep:.1,yOffset:-2},t=e;exports.default=t;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={xMin:-10,xMax:50,xStep:10,yStep:.5,yMin:14,yMax:20,width:600,height:600,gaussianMin:-4,gaussianMax:4,gaussianStep:.01,gaussianWidth:-2,yOffsetMin:-50,yOffsetMax:50,yOffsetStep:.1,yOffset:-2},t=e;exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),l=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),l=require("react"),B=require("react-i18next"),L=require("@rubin-epo/epo-react-lib/IconComposer"),u=require("./styles.cjs"),T=require("./PointSelector/index.cjs"),W=require("./Message/Message.cjs"),y=s=>s&&s.__esModule?s:{default:s},E=y(L),M=({width:s=600,height:i=600,selectedSource:r=[],sources:h,alerts:t=[],activeAlertIndex:a=0,alertChangeCallback:b,selectionCallback:d,blinkConfig:j,isDisplayOnly:c=!1,className:k})=>{const[x,C]=l.useState(!1),[_,g]=l.useState(),[q,n]=l.useState(!1),{t:f}=B.useTranslation(),S="sourceSelectorWidget",p=o=>{x&&!c&&(o?r.includes(o)||(d&&d(r.concat(o)),g(e.jsxs(e.Fragment,{children:[e.jsx(E.default,{icon:"checkmark"}),f("source_selector.messages.success")]})),n(!0)):(g(f("source_selector.messages.failure")),n(!0)))},I=()=>{n(!1)},m=t[a].date-t[0].date,V=Math.round(m),v=Math.round(24/m%24)||0,A=c?[t[a].image]:t.map(({image:o})=>o);return e.jsxs(u.SourceSelectorContainer,{width:s,height:i,className:k,children:[!c&&e.jsx(W.default,{onMessageChangeCallback:I,isVisible:q,forIds:[S],children:_}),e.jsxs(u.BackgroundBlinker,{images:A,activeIndex:a,blinkCallback:b,loadedCallback:()=>C(!0),...j,children:[t.length>0&&!c&&e.jsx(u.ElapsedDisplay,{day:V,hour:v}),e.jsx(T.default,{id:S,onSelectCallback:p,width:s,height:i,sources:h,selectedSource:r})]})]})};M.displayName="Widgets.SourceSelector";const F=M;exports.default=F;
|
|
@@ -12,8 +12,8 @@ interface SourceSelectorProps {
|
|
|
12
12
|
alerts: Alert[];
|
|
13
13
|
selectedSource?: string[];
|
|
14
14
|
activeAlertIndex?: number;
|
|
15
|
-
alertChangeCallback
|
|
16
|
-
selectionCallback
|
|
15
|
+
alertChangeCallback?: (index: number) => void;
|
|
16
|
+
selectionCallback?: (data: string[]) => void;
|
|
17
17
|
blinkConfig?: BlinkConfig;
|
|
18
18
|
isDisplayOnly?: boolean;
|
|
19
19
|
className?: string;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as n, jsx as
|
|
2
|
+
import { jsxs as n, jsx as r, Fragment as _ } from "react/jsx-runtime";
|
|
3
3
|
import { useState as l } from "react";
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import
|
|
6
|
-
import { SourceSelectorContainer as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
4
|
+
import { useTranslation as E } from "react-i18next";
|
|
5
|
+
import F from "@rubin-epo/epo-react-lib/IconComposer";
|
|
6
|
+
import { SourceSelectorContainer as N, BackgroundBlinker as P, ElapsedDisplay as T } from "./styles.js";
|
|
7
|
+
import $ from "./PointSelector/index.js";
|
|
8
|
+
import q from "./Message/Message.js";
|
|
9
|
+
const h = ({
|
|
10
10
|
width: i = 600,
|
|
11
11
|
height: d = 600,
|
|
12
|
-
selectedSource:
|
|
13
|
-
sources:
|
|
12
|
+
selectedSource: t = [],
|
|
13
|
+
sources: p,
|
|
14
14
|
alerts: e = [],
|
|
15
|
-
activeAlertIndex:
|
|
15
|
+
activeAlertIndex: c = 0,
|
|
16
16
|
alertChangeCallback: k,
|
|
17
17
|
selectionCallback: m,
|
|
18
18
|
blinkConfig: C,
|
|
19
|
-
isDisplayOnly:
|
|
19
|
+
isDisplayOnly: o = !1,
|
|
20
20
|
className: M
|
|
21
21
|
}) => {
|
|
22
|
-
const [b, V] = l(!1), [j, u] = l(), [x, a] = l(!1), { t: f } =
|
|
23
|
-
b && !
|
|
22
|
+
const [b, V] = l(!1), [j, u] = l(), [x, a] = l(!1), { t: f } = E(), g = "sourceSelectorWidget", A = (s) => {
|
|
23
|
+
b && !o && (s ? t.includes(s) || (m && m(t.concat(s)), u(
|
|
24
24
|
/* @__PURE__ */ n(_, { children: [
|
|
25
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ r(F, { icon: "checkmark" }),
|
|
26
26
|
f("source_selector.messages.success")
|
|
27
27
|
] })
|
|
28
28
|
), a(!0)) : (u(f("source_selector.messages.failure")), a(!0)));
|
|
29
29
|
}, B = () => {
|
|
30
30
|
a(!1);
|
|
31
|
-
}, S = e[
|
|
32
|
-
return /* @__PURE__ */ n(
|
|
33
|
-
!
|
|
34
|
-
|
|
31
|
+
}, S = e[c].date - e[0].date, I = Math.round(S), L = Math.round(24 / S % 24) || 0, W = o ? [e[c].image] : e.map(({ image: s }) => s);
|
|
32
|
+
return /* @__PURE__ */ n(N, { width: i, height: d, className: M, children: [
|
|
33
|
+
!o && /* @__PURE__ */ r(
|
|
34
|
+
q,
|
|
35
35
|
{
|
|
36
36
|
onMessageChangeCallback: B,
|
|
37
37
|
isVisible: x,
|
|
@@ -40,24 +40,24 @@ const p = ({
|
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
42
|
/* @__PURE__ */ n(
|
|
43
|
-
|
|
43
|
+
P,
|
|
44
44
|
{
|
|
45
45
|
images: W,
|
|
46
|
-
activeIndex:
|
|
46
|
+
activeIndex: c,
|
|
47
47
|
blinkCallback: k,
|
|
48
48
|
loadedCallback: () => V(!0),
|
|
49
49
|
...C,
|
|
50
50
|
children: [
|
|
51
|
-
e.length > 0 && /* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
51
|
+
e.length > 0 && !o && /* @__PURE__ */ r(T, { day: I, hour: L }),
|
|
52
|
+
/* @__PURE__ */ r(
|
|
53
|
+
$,
|
|
54
54
|
{
|
|
55
55
|
id: g,
|
|
56
56
|
onSelectCallback: A,
|
|
57
57
|
width: i,
|
|
58
58
|
height: d,
|
|
59
|
-
sources:
|
|
60
|
-
selectedSource:
|
|
59
|
+
sources: p,
|
|
60
|
+
selectedSource: t
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
]
|
|
@@ -65,8 +65,8 @@ const p = ({
|
|
|
65
65
|
)
|
|
66
66
|
] });
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
const
|
|
68
|
+
h.displayName = "Widgets.SourceSelector";
|
|
69
|
+
const X = h;
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
X as default
|
|
72
72
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import SourceSelector from "./SourceSelector";
|
|
1
2
|
export { default as PointSelector } from "./PointSelector";
|
|
2
3
|
export { default as Message } from "./Message";
|
|
3
4
|
export { default as SelectionList } from "./SelectionList";
|
|
4
|
-
export
|
|
5
|
+
export default SourceSelector;
|
|
@@ -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"),g=require("react"),I=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"),A=require("../../../charts/styles.cjs"),B=require("../../../lib/utils.cjs"),E=require("./styles.cjs"),T=({data:c,margin:x,activeRange:b,xDomain:r,yDomain:n,xScale:o,yScale:i,yTicks:h,xTicks:j,step:p,width:M,height:_,className:L})=>{const{t:v}=I.useTranslation(),[u,q]=g.useState(),$=i(n[0]),f="xAxisLabel",d=typeof u=="number",a=c.map(({value:s,bin:e},l)=>({x:e,value:s,width:12,fill:B.between(e,b[0],b[1])?void 0:"#30E0E3",props:{"aria-label":v("supernova_three_vector.histogram.bar_label",{count:s,binMin:e,binMax:e+p}),onMouseOver:()=>q(l),onMouseOut:()=>q(void 0)}}));return t.jsxs(w.default,{xMin:r[0],yMin:n[0],width:M,height:_,className:L,horizontalLabel:v("supernova_three_vector.histogram.x_label")||void 0,horizontalLabelId:f,children:[t.jsx(R.default,{showBaseline:!1,x:o(r[0])-10,ticks:h,tickLength:0,labelRender:(s,e,l)=>t.jsx(E.YLabel,{x:e,y:l,children:s}),yDomain:n,yScale:i}),t.jsx(O.default,{guides:h,xDomain:r,xScale:o,yDomain:n,yScale:i,margin:x}),t.jsx(k.default,{data:a,xDomain:r,yDomain:n,xScale:o,yScale:i}),t.jsx(H.default,{ticks:j,y:$,labelledById:f,labelRender:(s,e,l)=>t.jsx(A.XLabel,{x:e,y:l+5,children:s}),xDomain:r,xScale:o,margin:x}),t.jsx(z.default,{x:d?o(c[u].bin):0,y:d?i(a[u].value):0,visible:d,children:d?a[u].value:null})]})},y=T;exports.default=y;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsxs as A, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as B } from "react";
|
|
4
4
|
import { useTranslation as w } from "react-i18next";
|
|
5
5
|
import H from "../../../charts/Base/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { XLabel as
|
|
12
|
-
import { between as
|
|
13
|
-
import { YLabel as
|
|
14
|
-
const
|
|
6
|
+
import j from "../../../charts/XAxis/index.js";
|
|
7
|
+
import k from "../../../charts/Guidelines/index.js";
|
|
8
|
+
import z from "../../../charts/YAxis/index.js";
|
|
9
|
+
import E from "../../../charts/Bars/index.js";
|
|
10
|
+
import O from "../../../charts/Tooltip/index.js";
|
|
11
|
+
import { XLabel as R } from "../../../charts/styles.js";
|
|
12
|
+
import { between as T } from "../../../lib/utils.js";
|
|
13
|
+
import { YLabel as X } from "./styles.js";
|
|
14
|
+
const Y = ({
|
|
15
15
|
data: a,
|
|
16
16
|
margin: b,
|
|
17
17
|
activeRange: u,
|
|
@@ -22,15 +22,15 @@ const T = ({
|
|
|
22
22
|
yTicks: f,
|
|
23
23
|
xTicks: x,
|
|
24
24
|
step: L,
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
className:
|
|
25
|
+
width: M,
|
|
26
|
+
height: _,
|
|
27
|
+
className: I
|
|
28
28
|
}) => {
|
|
29
|
-
const { t: h } = w(), [
|
|
29
|
+
const { t: h } = w(), [d, c] = B(), g = l(s[0]), v = "xAxisLabel", 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: T(o, u[0], u[1]) ? void 0 : "#30E0E3",
|
|
34
34
|
props: {
|
|
35
35
|
"aria-label": h("supernova_three_vector.histogram.bar_label", {
|
|
36
36
|
count: e,
|
|
@@ -41,31 +41,31 @@ const T = ({
|
|
|
41
41
|
onMouseOut: () => c(void 0)
|
|
42
42
|
}
|
|
43
43
|
}));
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ A(
|
|
45
45
|
H,
|
|
46
46
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
51
|
-
className:
|
|
47
|
+
xMin: t[0],
|
|
48
|
+
yMin: s[0],
|
|
49
|
+
width: M,
|
|
50
|
+
height: _,
|
|
51
|
+
className: I,
|
|
52
52
|
horizontalLabel: h("supernova_three_vector.histogram.x_label") || void 0,
|
|
53
53
|
horizontalLabelId: v,
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ r(
|
|
56
|
-
|
|
56
|
+
z,
|
|
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(X, { x: o, y: n, children: e }),
|
|
63
63
|
yDomain: s,
|
|
64
64
|
yScale: l
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ r(
|
|
68
|
-
|
|
68
|
+
k,
|
|
69
69
|
{
|
|
70
70
|
guides: f,
|
|
71
71
|
xDomain: t,
|
|
@@ -75,32 +75,32 @@ const T = ({
|
|
|
75
75
|
margin: b
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
|
-
/* @__PURE__ */ r(
|
|
78
|
+
/* @__PURE__ */ r(E, { data: p, xDomain: t, yDomain: s, xScale: i, yScale: l }),
|
|
79
79
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
80
|
+
j,
|
|
81
81
|
{
|
|
82
82
|
ticks: x,
|
|
83
|
-
y:
|
|
83
|
+
y: g,
|
|
84
84
|
labelledById: v,
|
|
85
|
-
labelRender: (e, o, n) => /* @__PURE__ */ r(
|
|
85
|
+
labelRender: (e, o, n) => /* @__PURE__ */ r(R, { x: o, y: n + 5, children: e }),
|
|
86
86
|
xDomain: t,
|
|
87
87
|
xScale: i,
|
|
88
88
|
margin: b
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
91
|
/* @__PURE__ */ r(
|
|
92
|
-
|
|
92
|
+
O,
|
|
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
|
-
}, W =
|
|
103
|
+
}, W = Y;
|
|
104
104
|
export {
|
|
105
105
|
W as default
|
|
106
106
|
};
|
package/package.json
CHANGED
package/dist/lib/helpers.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>(t-40587)*864e5;exports.timestampFromMJD=e;
|
package/dist/lib/helpers.js
DELETED