@rubin-epo/epo-widget-lib 0.9.3 → 0.9.4
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/Base/index.cjs +1 -1
- package/dist/charts/Base/index.js +30 -34
- package/dist/charts/Base/styles.cjs +36 -17
- package/dist/charts/Base/styles.d.ts +2035 -675
- package/dist/charts/Base/styles.js +45 -20
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/index.js +22 -31
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/styles.cjs +7 -8
- package/dist/widgets/LightCurvePlot/MagnitudeSlider/styles.js +8 -9
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +14 -14
- package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.cjs +4 -3
- package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.js +2 -1
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.d.ts +2 -1
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.js +161 -145
- package/dist/widgets/LightCurvePlot/ScatterPlot/styles.cjs +25 -11
- package/dist/widgets/LightCurvePlot/ScatterPlot/styles.d.ts +544 -0
- package/dist/widgets/LightCurvePlot/ScatterPlot/styles.js +25 -9
- package/package.json +1 -1
|
@@ -1,44 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e from "styled-components";
|
|
3
|
-
const
|
|
3
|
+
const i = e.div`
|
|
4
4
|
--label-height: 3em;
|
|
5
5
|
--label-gutter: calc(var(--label-height) / 2);
|
|
6
6
|
|
|
7
7
|
display: grid;
|
|
8
|
-
grid-template-columns:
|
|
9
|
-
grid-template-rows:
|
|
8
|
+
grid-template-columns: min-content 1fr min-content;
|
|
9
|
+
grid-template-rows: min-content 1fr min-content;
|
|
10
10
|
grid-template-areas:
|
|
11
|
-
"title title
|
|
12
|
-
"vertical-label chart
|
|
13
|
-
". horizontal-label
|
|
11
|
+
"title title title"
|
|
12
|
+
"vertical-label chart filler"
|
|
13
|
+
". horizontal-label filler";
|
|
14
|
+
/* for Safari */
|
|
15
|
+
align-items: center;
|
|
14
16
|
width: 100%;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
grid-area: horizontal-label;
|
|
17
|
+
`;
|
|
18
|
+
e.div`
|
|
18
19
|
place-self: center;
|
|
19
20
|
align-self: center;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
`;
|
|
22
|
+
e.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
23
25
|
place-self: center;
|
|
24
26
|
align-self: center;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
`;
|
|
28
|
+
const a = e.div`
|
|
29
|
+
grid-area: filler;
|
|
30
|
+
width: var(--label-height);
|
|
31
|
+
`, l = e.svg`
|
|
28
32
|
grid-area: chart;
|
|
29
33
|
max-width: 100%;
|
|
34
|
+
max-height: 100%;
|
|
30
35
|
aspect-ratio: var(--aspect-ratio);
|
|
31
|
-
`,
|
|
36
|
+
`, r = e.div`
|
|
32
37
|
display: flex;
|
|
33
38
|
align-items: center;
|
|
34
39
|
grid-area: title;
|
|
40
|
+
height: var(--label-height);
|
|
35
41
|
padding-inline: var(--label-gutter);
|
|
42
|
+
`, n = e.h3`
|
|
36
43
|
margin: 0;
|
|
44
|
+
`, c = e.div`
|
|
45
|
+
width: var(--label-height);
|
|
46
|
+
writing-mode: vertical-rl;
|
|
47
|
+
transform: rotate(180deg);
|
|
48
|
+
grid-area: vertical-label;
|
|
49
|
+
`, g = e.div`
|
|
50
|
+
height: var(--label-height);
|
|
51
|
+
grid-area: horizontal-label;
|
|
52
|
+
`, o = e.span`
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
height: 100%;
|
|
57
|
+
width: 100%;
|
|
58
|
+
font-size: 80%;
|
|
37
59
|
`;
|
|
38
60
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
61
|
+
i as ChartContainer,
|
|
62
|
+
a as Filler,
|
|
63
|
+
g as HorizontalLabelWrapper,
|
|
64
|
+
o as Label,
|
|
65
|
+
l as SVG,
|
|
42
66
|
n as Title,
|
|
43
|
-
r as
|
|
67
|
+
r as TitleWrapper,
|
|
68
|
+
c as VerticalLabelWrapper
|
|
44
69
|
};
|
|
@@ -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-i18next"),a=require("./styles.cjs"),x=(t,n,s)=>{const i=Number(Math.abs(n-t).toFixed(1)),u=i.toLocaleString(s,{minimumFractionDigits:1,maximumFractionDigits:1});let e;return i<=.05?(e="equal",{distance:i,context:e}):(t<n?e="above":e="below",{distance:u,context:e})},c=({magnitude:t,yMin:n,yMax:s,onMagnitudeChangeCallback:i,estimatedPeak:u,disabled:e,width:v,height:S})=>{const{t:l,i18n:{language:o}}=h.useTranslation();return r.jsx(a.Slider,{ariaLabel:l("light_curve.magnitude_slider.label")||void 0,orientation:"vertical",value:t,min:n,max:s,step:.1,disabled:e,ariaValuetext:()=>l("light_curve.magnitude_slider.value",{...x(u,t,o),magnitude:t.toLocaleString(o,{minimumFractionDigits:1,maximumFractionDigits:1})}),onChange:i,renderThumb:({key:d,style:m,...g})=>r.jsxs(a.ThumbContainer,{...g,style:m,children:[r.jsx(a.ThumbBar,{}),r.jsx(a.ThumbHandle,{})]},d)})};c.displayName="Widgets.LightCurve.MagnitudeSlider";const b=c;exports.default=b;
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import f from "
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const e = Number(Math.abs(n - t).toFixed(1)), o = e.toLocaleString(a, {
|
|
2
|
+
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as h } from "react-i18next";
|
|
4
|
+
import { Slider as b, ThumbContainer as x, ThumbBar as v, ThumbHandle as f } from "./styles.js";
|
|
5
|
+
const p = (t, n, a) => {
|
|
6
|
+
const e = Number(Math.abs(n - t).toFixed(1)), r = e.toLocaleString(a, {
|
|
8
7
|
minimumFractionDigits: 1,
|
|
9
8
|
maximumFractionDigits: 1
|
|
10
9
|
});
|
|
11
10
|
let i;
|
|
12
|
-
return e <= 0.05 ? (i = "equal", { distance: e, context: i }) : (t < n ? i = "above" : i = "below", { distance:
|
|
13
|
-
},
|
|
11
|
+
return e <= 0.05 ? (i = "equal", { distance: e, context: i }) : (t < n ? i = "above" : i = "below", { distance: r, context: i });
|
|
12
|
+
}, u = ({
|
|
14
13
|
magnitude: t,
|
|
15
14
|
yMin: n,
|
|
16
15
|
yMax: a,
|
|
17
16
|
onMagnitudeChangeCallback: e,
|
|
18
|
-
estimatedPeak:
|
|
17
|
+
estimatedPeak: r,
|
|
19
18
|
disabled: i,
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
19
|
+
width: S,
|
|
20
|
+
height: D
|
|
22
21
|
}) => {
|
|
23
22
|
const {
|
|
24
23
|
t: l,
|
|
25
24
|
i18n: { language: m }
|
|
26
|
-
} =
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
25
|
+
} = h();
|
|
26
|
+
return /* @__PURE__ */ o(
|
|
27
|
+
b,
|
|
29
28
|
{
|
|
30
29
|
ariaLabel: l("light_curve.magnitude_slider.label") || void 0,
|
|
31
30
|
orientation: "vertical",
|
|
@@ -35,30 +34,22 @@ const D = (t, n, a) => {
|
|
|
35
34
|
step: 0.1,
|
|
36
35
|
disabled: i,
|
|
37
36
|
ariaValuetext: () => l("light_curve.magnitude_slider.value", {
|
|
38
|
-
...
|
|
37
|
+
...p(r, t, m),
|
|
39
38
|
magnitude: t.toLocaleString(m, {
|
|
40
39
|
minimumFractionDigits: 1,
|
|
41
40
|
maximumFractionDigits: 1
|
|
42
41
|
})
|
|
43
42
|
}),
|
|
44
43
|
onChange: e,
|
|
45
|
-
renderThumb: ({ key:
|
|
46
|
-
v,
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
style: { ...g, position: "fixed" },
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ r(F, {}),
|
|
52
|
-
/* @__PURE__ */ r(S, {})
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
d
|
|
56
|
-
)
|
|
44
|
+
renderThumb: ({ key: s, style: c, ...d }) => /* @__PURE__ */ g(x, { ...d, style: c, children: [
|
|
45
|
+
/* @__PURE__ */ o(v, {}),
|
|
46
|
+
/* @__PURE__ */ o(f, {})
|
|
47
|
+
] }, s)
|
|
57
48
|
}
|
|
58
|
-
)
|
|
49
|
+
);
|
|
59
50
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
51
|
+
u.displayName = "Widgets.LightCurve.MagnitudeSlider";
|
|
52
|
+
const L = u;
|
|
62
53
|
export {
|
|
63
|
-
|
|
54
|
+
L as default
|
|
64
55
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),i=require("react-slider"),r=e=>e&&e.__esModule?e:{default:e},t=r(o),d=r(i),a=t.default(d.default)`
|
|
2
2
|
--thumb-size: 20px;
|
|
3
3
|
--thumb-border-width: 2px;
|
|
4
4
|
|
|
5
5
|
width: 100%;
|
|
6
6
|
height: 100%;
|
|
7
|
-
`,
|
|
7
|
+
`,b=t.default.div`
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
border: none;
|
|
10
10
|
border-bottom: var(--thumb-border-width) dashed var(--black, #000);
|
|
11
11
|
flex-grow: 1;
|
|
12
|
-
`,
|
|
12
|
+
`,n=t.default.div`
|
|
13
13
|
aspect-ratio: 1;
|
|
14
14
|
box-sizing: border-box;
|
|
15
15
|
background-color: var(--white, #fff);
|
|
@@ -17,26 +17,25 @@
|
|
|
17
17
|
border-radius: 50%;
|
|
18
18
|
pointer-events: auto;
|
|
19
19
|
width: var(--thumb-size);
|
|
20
|
-
`,
|
|
20
|
+
`,u=t.default.div`
|
|
21
21
|
box-sizing: border-box;
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
height: 0px;
|
|
25
25
|
width: 100%;
|
|
26
26
|
overflow: visible;
|
|
27
|
+
pointer-events: auto;
|
|
27
28
|
|
|
28
29
|
&:focus {
|
|
29
30
|
outline: none;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
&:not([aria-disabled="true"]) {
|
|
33
|
-
|
|
34
|
-
cursor: grab;
|
|
35
|
-
}
|
|
34
|
+
cursor: grab;
|
|
36
35
|
|
|
37
36
|
&:active,
|
|
38
37
|
&.active {
|
|
39
38
|
cursor: grabbing;
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
`;exports.Slider=
|
|
41
|
+
`;exports.Slider=a;exports.ThumbBar=b;exports.ThumbContainer=u;exports.ThumbHandle=n;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import r from "styled-components";
|
|
3
3
|
import o from "react-slider";
|
|
4
|
-
const
|
|
4
|
+
const t = r(o)`
|
|
5
5
|
--thumb-size: 20px;
|
|
6
6
|
--thumb-border-width: 2px;
|
|
7
7
|
|
|
8
8
|
width: 100%;
|
|
9
9
|
height: 100%;
|
|
10
|
-
`,
|
|
10
|
+
`, b = r.div`
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
border: none;
|
|
13
13
|
border-bottom: var(--thumb-border-width) dashed var(--black, #000);
|
|
14
14
|
flex-grow: 1;
|
|
15
|
-
`,
|
|
15
|
+
`, d = r.div`
|
|
16
16
|
aspect-ratio: 1;
|
|
17
17
|
box-sizing: border-box;
|
|
18
18
|
background-color: var(--white, #fff);
|
|
@@ -27,15 +27,14 @@ const b = r(o)`
|
|
|
27
27
|
height: 0px;
|
|
28
28
|
width: 100%;
|
|
29
29
|
overflow: visible;
|
|
30
|
+
pointer-events: auto;
|
|
30
31
|
|
|
31
32
|
&:focus {
|
|
32
33
|
outline: none;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
&:not([aria-disabled="true"]) {
|
|
36
|
-
|
|
37
|
-
cursor: grab;
|
|
38
|
-
}
|
|
37
|
+
cursor: grab;
|
|
39
38
|
|
|
40
39
|
&:active,
|
|
41
40
|
&.active {
|
|
@@ -44,8 +43,8 @@ const b = r(o)`
|
|
|
44
43
|
}
|
|
45
44
|
`;
|
|
46
45
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
t as Slider,
|
|
47
|
+
b as ThumbBar,
|
|
49
48
|
a as ThumbContainer,
|
|
50
|
-
|
|
49
|
+
d as ThumbHandle
|
|
51
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),F=require("react-i18next"),g=require("d3-array"),H=require("@rubin-epo/epo-react-lib/HorizontalSlider"),_=require("../../../charts/hooks/useAxis.cjs"),t=require("../defaults.cjs"),B=require("../ScatterPlot/index.cjs"),N=require("../LightCurve/index.cjs"),w=require("../A11Y/LightCurveLabel/index.cjs"),S=require("../helpers.cjs"),E=require("../../../atomic/Button/patterns/Reset.cjs"),J=require("../MagnitudeSlider/index.cjs"),i=require("./styles.cjs"),K=l=>l&&l.__esModule?l:{default:l},y=K(H),L=({gaussianWidth:l=t.default.gaussianWidth,yOffset:a=t.default.yOffset,alerts:I,peakMjd:D,yMin:r=t.default.yMin,yMax:d=t.default.yMax,width:f=t.default.width,height:x=t.default.height,userMagnitude:P=(d-r)/2+r,onUserMagnitudeChangeCallback:o,onGaussianChangeCallback:n,onYOffsetChangeCallback:c,className:M,isDisplayOnly:m,...R})=>{const{t:j}=F.useTranslation(),p="lightCurveControls",q="gaussianWidthLabel",h="yOffsetLabel",u=S.formatMagnitudePoints(I,D),T=g.min(u,({x:s})=>s)||Math.min(...u.map(({x:s})=>s)),W=g.max(u,({x:s})=>s)||Math.max(...u.map(({x:s})=>s)),$=()=>{o&&o((d-r)/2+r),c&&c(t.default.yOffset),n&&n(t.default.gaussianWidth)},[O,V,z]=_.default({min:T,max:W,step:t.default.xStep,range:[0,f]}),[A,X,v]=_.default({min:r,max:d,step:t.default.yStep,range:[0,x]}),b=S.estimateMagnitudeWithOffset(0,l,a);return e.jsxs(i.Container,{className:M,children:[e.jsx(B.default,{
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),F=require("react-i18next"),g=require("d3-array"),H=require("@rubin-epo/epo-react-lib/HorizontalSlider"),_=require("../../../charts/hooks/useAxis.cjs"),t=require("../defaults.cjs"),B=require("../ScatterPlot/index.cjs"),N=require("../LightCurve/index.cjs"),w=require("../A11Y/LightCurveLabel/index.cjs"),S=require("../helpers.cjs"),E=require("../../../atomic/Button/patterns/Reset.cjs"),J=require("../MagnitudeSlider/index.cjs"),i=require("./styles.cjs"),K=l=>l&&l.__esModule?l:{default:l},y=K(H),L=({gaussianWidth:l=t.default.gaussianWidth,yOffset:a=t.default.yOffset,alerts:I,peakMjd:D,yMin:r=t.default.yMin,yMax:d=t.default.yMax,width:f=t.default.width,height:x=t.default.height,userMagnitude:P=(d-r)/2+r,onUserMagnitudeChangeCallback:o,onGaussianChangeCallback:n,onYOffsetChangeCallback:c,className:M,isDisplayOnly:m,...R})=>{const{t:j}=F.useTranslation(),p="lightCurveControls",q="gaussianWidthLabel",h="yOffsetLabel",u=S.formatMagnitudePoints(I,D),T=g.min(u,({x:s})=>s)||Math.min(...u.map(({x:s})=>s)),W=g.max(u,({x:s})=>s)||Math.max(...u.map(({x:s})=>s)),$=()=>{o&&o((d-r)/2+r),c&&c(t.default.yOffset),n&&n(t.default.gaussianWidth)},[O,V,z]=_.default({min:T,max:W,step:t.default.xStep,range:[0,f]}),[A,X,v]=_.default({min:r,max:d,step:t.default.yStep,range:[0,x]}),b=S.estimateMagnitudeWithOffset(0,l,a);return e.jsxs(i.Container,{className:M,children:[e.jsx(B.default,{slider:e.jsx(J.default,{magnitude:P,onMagnitudeChangeCallback:s=>o&&o(s),disabled:m,yMin:r,yMax:d,yScale:v,estimatedPeak:b,width:f,height:x}),...R,data:u,width:f,height:x,yMin:r,yMax:d,children:u.length>0?e.jsxs(e.Fragment,{children:[e.jsx(N.default,{gaussianWidth:l,yOffset:a,xDomain:O,xScale:z,yScale:v,yDomain:A}),e.jsx(i.DM15Display,{gaussianWidth:l})]}):null}),!m&&e.jsxs(i.Controls,{id:p,children:[e.jsxs("div",{children:[e.jsx(i.ControlLabel,{id:q,children:j("light_curve.curve.controls.gaussian_width")}),e.jsx(y.default,{label:"Gaussian Width",labelledbyId:q,color:"var(--turquoise85, #12726D)",min:t.default.gaussianMin,max:t.default.gaussianMax,step:t.default.gaussianStep,value:l,onChangeCallback:s=>typeof s=="number"&&n&&n(s)})]}),e.jsxs("div",{children:[e.jsx(i.ControlLabel,{id:h,children:j("light_curve.curve.controls.y_offset")}),e.jsx(y.default,{label:"Y Offset",labelledbyId:h,color:"var(--turquoise85, #12726D)",min:t.default.yOffsetMin,max:t.default.yOffsetMax,step:t.default.yOffsetStep,value:a,onChangeCallback:s=>typeof s=="number"&&c&&c(s)})]}),e.jsx(E.default,{onResetCallback:$})]}),e.jsx(w.default,{controlledById:p,data:u,gaussianWidth:l,yOffset:a,estimatedPeak:b})]})};L.displayName="Widgets.LightCurve";const Q=L;exports.default=Q;
|
|
@@ -46,6 +46,20 @@ const D = ({
|
|
|
46
46
|
/* @__PURE__ */ o(
|
|
47
47
|
$,
|
|
48
48
|
{
|
|
49
|
+
slider: /* @__PURE__ */ o(
|
|
50
|
+
V,
|
|
51
|
+
{
|
|
52
|
+
magnitude: _,
|
|
53
|
+
onMagnitudeChangeCallback: (e) => a && a(e),
|
|
54
|
+
disabled: f,
|
|
55
|
+
yMin: r,
|
|
56
|
+
yMax: s,
|
|
57
|
+
yScale: L,
|
|
58
|
+
estimatedPeak: b,
|
|
59
|
+
width: p,
|
|
60
|
+
height: u
|
|
61
|
+
}
|
|
62
|
+
),
|
|
49
63
|
...T,
|
|
50
64
|
data: i,
|
|
51
65
|
width: p,
|
|
@@ -64,20 +78,6 @@ const D = ({
|
|
|
64
78
|
yDomain: z
|
|
65
79
|
}
|
|
66
80
|
),
|
|
67
|
-
/* @__PURE__ */ o(
|
|
68
|
-
V,
|
|
69
|
-
{
|
|
70
|
-
magnitude: _,
|
|
71
|
-
onMagnitudeChangeCallback: (e) => a && a(e),
|
|
72
|
-
disabled: f,
|
|
73
|
-
yMin: r,
|
|
74
|
-
yMax: s,
|
|
75
|
-
yScale: L,
|
|
76
|
-
estimatedPeak: b,
|
|
77
|
-
width: p,
|
|
78
|
-
height: u
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
81
|
/* @__PURE__ */ o(Z, { gaussianWidth: m })
|
|
82
82
|
] }) : null
|
|
83
83
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),a=require("../DM15Display/index.cjs"),l=t=>t&&t.__esModule?t:{default:t},e=l(i),r=e.default.div`
|
|
2
2
|
--light-curve-padding: var(--PADDING_SMALL, 20px);
|
|
3
3
|
|
|
4
4
|
display: grid;
|
|
5
5
|
gap: var(--light-curve-padding);
|
|
6
6
|
grid-template-rows: 1fr min-content;
|
|
7
|
-
|
|
7
|
+
position: relative;
|
|
8
8
|
`;e.default.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
border: 1px solid var(--turquoise55, #009fa1);
|
|
14
14
|
gap: var(--light-curve-padding);
|
|
15
15
|
padding: var(--light-curve-padding);
|
|
16
|
+
grid-template-columns: 1fr;
|
|
16
17
|
`;e.default.h3`
|
|
17
18
|
margin: 0;
|
|
18
|
-
`;const n=e.default(
|
|
19
|
+
`;const n=e.default(a.default)`
|
|
19
20
|
background-color: var(--white, #fff);
|
|
20
21
|
margin: 2px 1em;
|
|
21
22
|
padding: 2px;
|
|
@@ -7,7 +7,7 @@ const e = i.div`
|
|
|
7
7
|
display: grid;
|
|
8
8
|
gap: var(--light-curve-padding);
|
|
9
9
|
grid-template-rows: 1fr min-content;
|
|
10
|
-
|
|
10
|
+
position: relative;
|
|
11
11
|
`;
|
|
12
12
|
i.div`
|
|
13
13
|
display: flex;
|
|
@@ -17,6 +17,7 @@ i.div`
|
|
|
17
17
|
border: 1px solid var(--turquoise55, #009fa1);
|
|
18
18
|
gap: var(--light-curve-padding);
|
|
19
19
|
padding: var(--light-curve-padding);
|
|
20
|
+
grid-template-columns: 1fr;
|
|
20
21
|
`;
|
|
21
22
|
i.h3`
|
|
22
23
|
margin: 0;
|
|
@@ -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 e=require("react/jsx-runtime"),w=require("react"),G=require("react-i18next"),k=require("d3-array"),F=require("../../../charts/hooks/useAxis.cjs"),J=require("../../../charts/XAxis/index.cjs"),K=require("../../../charts/YAxis/index.cjs"),Q=require("../../../charts/Tooltip/index.cjs"),V=require("../../../charts/ClippingContainer/index.cjs"),X=require("../../../charts/Viewport/index.cjs"),s=require("../defaults.cjs"),Y=require("../Point/index.cjs"),p=require("./styles.cjs"),Z=(i,h,b)=>{const d={};return Object.keys(i).forEach(l=>{const a=l==="top"||l==="bottom"?b:h,c=`${l.charAt(0).toUpperCase()}${l.slice(1)}`;d[`padding${c}`]=`${i[l]/a*100}%`}),console.log({styles:d}),d},O=({data:i,activeAlertId:h,xMin:b,xMax:d,yMin:j=s.default.yMin,yMax:l=s.default.yMax,width:a=s.default.width,height:c=s.default.height,name:P,children:R,slider:q,className:W})=>{const{t:x,i18n:{language:C}}=G.useTranslation(),[L,S]=w.useState(),D=x("light_curve.plot.x_label"),M="xAxisLabel",T=x("light_curve.plot.y_label"),_="yAxisLabel",o=typeof L<"u"?i[L]:i.find(({id:n})=>n===h),f={top:10,right:10,bottom:25,left:40},y=[0+f.left,a-f.right],[A,z,r]=F.default({min:b||k.min(i,({x:n})=>n)||s.default.xMin,max:d||k.max(i,({x:n})=>n)||s.default.xMax,step:s.default.xStep,range:y}),m=r(A[0]),g=[0+f.top,c-f.bottom],[u,H,t]=F.default({min:j,max:l,step:s.default.yStep,range:g}),$=t(u[1]);return e.jsxs(p.PlotContainer,{className:W,children:[e.jsxs(p.Chart,{width:a,height:c,horizontalLabel:D,horizontalLabelId:M,verticalLabel:T,verticalLabelId:_,title:P,children:[e.jsx("rect",{x:r(0),y:t(u[0]),width:r(15)-r(0),height:$-t(u[0]),fill:"#F5F5F5"}),e.jsx(J.default,{ticks:z,y:$,labelledById:M,xDomain:A,xScale:r}),e.jsx(K.default,{ticks:H,x:m,labelledById:_,yDomain:u,yScale:t}),e.jsx(V.default,{x:m,y:t(u[0]),width:y[1]-y[0],height:g[1]-g[0],children:e.jsx("g",{role:"list","aria-label":x("light_curve.plot.plot_label")||void 0,children:i.map(({x:n,y:I,error:B,id:N},E)=>{const v=Math.round(n),U=v>0?"after":v===0?"peak":"before";return e.jsx(Y.default,{x:r(n),y:t(I),error:t(B)-t(0),onMouseOver:()=>S(E),onMouseOut:()=>S(void 0),description:x("light_curve.plot.point_label",{magnitude:I,count:Math.abs(v),context:U})||void 0},N)})})}),e.jsx(X.default,{x:m,y:t(u[0]),outerWidth:y[1]-y[0],outerHeight:g[1]-g[0],innerWidth:a,innerHeight:c,children:R}),e.jsx(Q.default,{x:o?r(o.x):void 0,y:o?t(o.y):void 0,visible:!!o,offset:6,children:x("light_curve.plot.tooltip",{magnitude:o==null?void 0:o.y.toLocaleString(C,{minimumFractionDigits:2,maximumFractionDigits:2})})})]}),q&&e.jsx(p.SliderOuterWrapper,{children:e.jsx(p.SliderInnerWrapper,{style:{...Z(f,a,c)},children:q})})]})};O.displayName="Widgets.LightCurve.ScatterPlot";const ee=O;exports.default=ee;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent, PropsWithChildren } from "react";
|
|
1
|
+
import { FunctionComponent, PropsWithChildren, ReactNode } from "react";
|
|
2
2
|
import { Bounds } from '../../../charts/types';
|
|
3
3
|
import { formatMagnitudePoints } from "../helpers";
|
|
4
4
|
export interface ScatterPlotProps extends Partial<Bounds> {
|
|
@@ -6,6 +6,7 @@ export interface ScatterPlotProps extends Partial<Bounds> {
|
|
|
6
6
|
name?: string;
|
|
7
7
|
activeAlertId?: number;
|
|
8
8
|
className?: string;
|
|
9
|
+
slider?: ReactNode;
|
|
9
10
|
}
|
|
10
11
|
declare const ScatterPlot: FunctionComponent<PropsWithChildren<ScatterPlotProps>>;
|
|
11
12
|
export default ScatterPlot;
|