@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
package/dist/IsochronePlot.js
CHANGED
|
@@ -17,12 +17,12 @@ import at from "./widgets/IsochronePlot/Controls/index.js";
|
|
|
17
17
|
import e from "./widgets/IsochronePlot/defaults.js";
|
|
18
18
|
import mt from "./widgets/IsochronePlot/A11Y/CurveFit.js";
|
|
19
19
|
import { PlotWrapper as lt } from "./atomic/PlotWrapper/styles.js";
|
|
20
|
-
const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md : r < parseFloat(W("BREAK_LARGE_TABLET")) ? e.pointRadius.sm : e.pointRadius.lg : e.pointRadius.lg,
|
|
20
|
+
const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md : r < parseFloat(W("BREAK_LARGE_TABLET")) ? e.pointRadius.sm : e.pointRadius.lg : e.pointRadius.lg, Bt = ({
|
|
21
21
|
data: r,
|
|
22
22
|
value: y,
|
|
23
|
-
ageLibrary:
|
|
24
|
-
isDisplayOnly:
|
|
25
|
-
isLoading:
|
|
23
|
+
ageLibrary: I,
|
|
24
|
+
isDisplayOnly: k = !1,
|
|
25
|
+
isLoading: B,
|
|
26
26
|
xAxis: D,
|
|
27
27
|
yAxis: T,
|
|
28
28
|
name: E,
|
|
@@ -31,7 +31,7 @@ const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md
|
|
|
31
31
|
const { ref: K, width: M } = Y(), {
|
|
32
32
|
t: p,
|
|
33
33
|
i18n: { language: h }
|
|
34
|
-
} = X(), [j, w] = Q(!0), x = U(), s = !
|
|
34
|
+
} = X(), [j, w] = Q(!0), x = U(), s = !B && !j, C = { top: 0, right: 0, bottom: 20, left: 20 }, { width: c, height: d } = e, { ages: b = {} } = I, t = Object.keys(b).sort(
|
|
35
35
|
(i, m) => parseFloat(i) - parseFloat(m)
|
|
36
36
|
).map(parseFloat), H = f(D, {
|
|
37
37
|
...e.xAxis,
|
|
@@ -163,11 +163,11 @@ const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md
|
|
|
163
163
|
}
|
|
164
164
|
),
|
|
165
165
|
isLoading: !s,
|
|
166
|
-
isDisplayOnly:
|
|
166
|
+
isDisplayOnly: k,
|
|
167
167
|
controlsId: x
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
170
|
};
|
|
171
171
|
export {
|
|
172
|
-
|
|
172
|
+
Bt as default
|
|
173
173
|
};
|
|
@@ -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 t=require("react/jsx-runtime"),q=require("react"),D=require("react-i18next"),l=require("d3-array"),E=require("@rubin-epo/epo-react-lib/HorizontalSlider"),d=require("./lib/utils.cjs"),N=require("./widgets/SupernovaThreeVector/LiveLabel/index.cjs"),r=require("./widgets/SupernovaThreeVector/styles.cjs"),P=n=>n&&n.__esModule?n:{default:n},U=P(E),R=({histogramData:n,userData:k,binnedImages:I,step:u=100})=>{const{t:x}=D.useTranslation(),h=q.useId(),i={top:30,bottom:30,left:50,right:0},o=600,y=o/1.6,L=[i.left,o-i.right],V=[y-i.bottom,i.top],g=6,p=7,v=n.map(({value:e})=>e),b=0,$=l.max(v)||Math.max(...v),m=n.map(({bin:e})=>e),c=l.min(m)||0,a=l.max(m)||Math.max(...m),j=l.nice(c,a,g),S=l.nice(b,$||b,p),f=d.getLinearScale(j,L),A=d.getLinearScale(S,V),[s,M]=q.useState([c,a]),_=15,H=`calc(${i.left/o*100}% - ${_}px)`,w=`calc(${(1-f(a)/o)*100}% - ${_}px)`,C=n.map(({bin:e})=>d.between(e,s[0],s[1])),T=k.filter(({distance:e})=>d.between(e,s[0],s[1]+u)),B=n.reduce((e,{value:O},z)=>C[z]?e+O:e,0);return t.jsxs(r.ThreeVectorContainer,{ratio:"landscape",smallScreenRatio:"portrait",children:[t.jsxs(r.ThreeVectorLayout,{children:[t.jsxs(r.HistogramContainer,{children:[t.jsx(r.ChartTitle,{children:x("supernova_three_vector.histogram.title")}),t.jsx(r.Histogram,{data:n,activeRange:s,xDomain:j,yDomain:S,xScale:f,yScale:A,yTicks:p,xTicks:g,step:u,margin:i,width:o,height:y})]}),t.jsx(r.SliderContainer,{style:{paddingInlineStart:H,paddingInlineEnd:w},children:t.jsx(U.default,{min:c,max:a,step:u,value:s,ariaValuetext:({valueNow:e})=>x("supernova_three_vector.slider.valueLabel",{value:e}),color:"var(--turquoise85,#12726D)",minLabel:`${c} Mlyr`,maxLabel:`${a} Mlyr`,onChangeCallback:e=>Array.isArray(e)&&M(e)})}),t.jsxs(r.SkymapContainer,{children:[t.jsx(r.ChartTitle,{children:x("supernova_three_vector.skymap.title")}),t.jsx(r.Skymap,{objects:T,images:I,describedById:h,visibleImages:C})]}),t.jsx(r.ResetButton,{onResetCallback:()=>M([c,a])})]}),t.jsx(N.default,{id:h,objects:T,min:s[0],max:s[1]+u,supernovaCount:B})]})};R.displayName="Widgets.SupernovaThreeVector";exports.default=R;
|
|
@@ -1,105 +1,105 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as l, jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { max as
|
|
6
|
-
import
|
|
7
|
-
import { getLinearScale as
|
|
8
|
-
import
|
|
9
|
-
import { ThreeVectorContainer as
|
|
10
|
-
const
|
|
11
|
-
histogramData:
|
|
2
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useId as N, useState as U } from "react";
|
|
4
|
+
import { useTranslation as W } from "react-i18next";
|
|
5
|
+
import { max as R, min as D, nice as T } from "d3-array";
|
|
6
|
+
import F from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
7
|
+
import { getLinearScale as k, between as V } from "./lib/utils.js";
|
|
8
|
+
import G from "./widgets/SupernovaThreeVector/LiveLabel/index.js";
|
|
9
|
+
import { ThreeVectorContainer as J, ThreeVectorLayout as K, HistogramContainer as P, ChartTitle as I, Histogram as Q, SliderContainer as X, SkymapContainer as Y, Skymap as Z, ResetButton as ee } from "./widgets/SupernovaThreeVector/styles.js";
|
|
10
|
+
const te = ({
|
|
11
|
+
histogramData: i,
|
|
12
12
|
userData: _,
|
|
13
13
|
binnedImages: $,
|
|
14
|
-
step:
|
|
14
|
+
step: c = 100
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: m } =
|
|
16
|
+
const { t: m } = W(), p = N(), r = {
|
|
17
17
|
top: 30,
|
|
18
18
|
bottom: 30,
|
|
19
19
|
left: 50,
|
|
20
20
|
right: 0
|
|
21
|
-
},
|
|
22
|
-
({ bin: e }) =>
|
|
23
|
-
),
|
|
24
|
-
({ distance: e }) =>
|
|
25
|
-
),
|
|
26
|
-
return /* @__PURE__ */ l(
|
|
27
|
-
/* @__PURE__ */ l(
|
|
28
|
-
/* @__PURE__ */ l(
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
21
|
+
}, a = 600, u = a / 1.6, j = [r.left, a - r.right], A = [u - r.bottom, r.top], h = 6, x = 7, y = i.map(({ value: e }) => e), f = 0, B = R(y) || Math.max(...y), d = i.map(({ bin: e }) => e), s = D(d) || 0, o = R(d) || Math.max(...d), g = T(s, o, h), v = T(f, B || f, x), b = k(g, j), H = k(v, A), [t, S] = U([s, o]), M = 15, w = `calc(${r.left / a * 100}% - ${M}px)`, O = `calc(${(1 - b(o) / a) * 100}% - ${M}px)`, C = i.map(
|
|
22
|
+
({ bin: e }) => V(e, t[0], t[1])
|
|
23
|
+
), L = _.filter(
|
|
24
|
+
({ distance: e }) => V(e, t[0], t[1] + c)
|
|
25
|
+
), q = i.reduce((e, { value: z }, E) => C[E] ? e + z : e, 0);
|
|
26
|
+
return /* @__PURE__ */ l(J, { ratio: "landscape", smallScreenRatio: "portrait", children: [
|
|
27
|
+
/* @__PURE__ */ l(K, { children: [
|
|
28
|
+
/* @__PURE__ */ l(P, { children: [
|
|
29
|
+
/* @__PURE__ */ n(I, { children: m("supernova_three_vector.histogram.title") }),
|
|
30
|
+
/* @__PURE__ */ n(
|
|
31
|
+
Q,
|
|
32
32
|
{
|
|
33
|
-
data:
|
|
34
|
-
activeRange:
|
|
35
|
-
xDomain:
|
|
36
|
-
yDomain:
|
|
37
|
-
xScale:
|
|
38
|
-
yScale:
|
|
33
|
+
data: i,
|
|
34
|
+
activeRange: t,
|
|
35
|
+
xDomain: g,
|
|
36
|
+
yDomain: v,
|
|
37
|
+
xScale: b,
|
|
38
|
+
yScale: H,
|
|
39
39
|
yTicks: x,
|
|
40
|
-
xTicks:
|
|
41
|
-
step:
|
|
42
|
-
margin:
|
|
43
|
-
width:
|
|
44
|
-
height:
|
|
40
|
+
xTicks: h,
|
|
41
|
+
step: c,
|
|
42
|
+
margin: r,
|
|
43
|
+
width: a,
|
|
44
|
+
height: u
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
48
|
+
/* @__PURE__ */ n(
|
|
49
|
+
X,
|
|
50
50
|
{
|
|
51
51
|
style: {
|
|
52
|
-
paddingInlineStart:
|
|
53
|
-
paddingInlineEnd:
|
|
52
|
+
paddingInlineStart: w,
|
|
53
|
+
paddingInlineEnd: O
|
|
54
54
|
},
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
|
|
55
|
+
children: /* @__PURE__ */ n(
|
|
56
|
+
F,
|
|
57
57
|
{
|
|
58
|
-
min:
|
|
59
|
-
max:
|
|
60
|
-
step:
|
|
61
|
-
value:
|
|
58
|
+
min: s,
|
|
59
|
+
max: o,
|
|
60
|
+
step: c,
|
|
61
|
+
value: t,
|
|
62
62
|
ariaValuetext: ({ valueNow: e }) => m("supernova_three_vector.slider.valueLabel", { value: e }),
|
|
63
63
|
color: "var(--turquoise85,#12726D)",
|
|
64
|
-
minLabel: `${
|
|
65
|
-
maxLabel: `${
|
|
66
|
-
onChangeCallback: (e) => Array.isArray(e) &&
|
|
64
|
+
minLabel: `${s} Mlyr`,
|
|
65
|
+
maxLabel: `${o} Mlyr`,
|
|
66
|
+
onChangeCallback: (e) => Array.isArray(e) && S(e)
|
|
67
67
|
}
|
|
68
68
|
)
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
/* @__PURE__ */ l(
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
71
|
+
/* @__PURE__ */ l(Y, { children: [
|
|
72
|
+
/* @__PURE__ */ n(I, { children: m("supernova_three_vector.skymap.title") }),
|
|
73
|
+
/* @__PURE__ */ n(
|
|
74
|
+
Z,
|
|
75
75
|
{
|
|
76
|
-
objects:
|
|
76
|
+
objects: L,
|
|
77
77
|
images: $,
|
|
78
|
-
describedById:
|
|
79
|
-
visibleImages:
|
|
78
|
+
describedById: p,
|
|
79
|
+
visibleImages: C
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
83
|
+
/* @__PURE__ */ n(
|
|
84
|
+
ee,
|
|
85
85
|
{
|
|
86
|
-
onResetCallback: () =>
|
|
86
|
+
onResetCallback: () => S([s, o])
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
] }),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
90
|
+
/* @__PURE__ */ n(
|
|
91
|
+
G,
|
|
92
92
|
{
|
|
93
|
-
id:
|
|
94
|
-
objects:
|
|
95
|
-
min:
|
|
96
|
-
max:
|
|
97
|
-
supernovaCount:
|
|
93
|
+
id: p,
|
|
94
|
+
objects: L,
|
|
95
|
+
min: t[0],
|
|
96
|
+
max: t[1] + c,
|
|
97
|
+
supernovaCount: q
|
|
98
98
|
}
|
|
99
99
|
)
|
|
100
100
|
] });
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
te.displayName = "Widgets.SupernovaThreeVector";
|
|
103
103
|
export {
|
|
104
|
-
|
|
104
|
+
te as default
|
|
105
105
|
};
|
|
@@ -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 t=require("react/jsx-runtime"),h=require("react"),C=require("../../lib/utils.cjs"),M=require("../../hooks/useInterval.cjs"),N=require("../ImageStack/index.cjs"),o=require("./styles.cjs"),B=({images:n=[],activeIndex:i=0,autoplay:g=!0,loop:j=!0,interval:p=200,blinkCallback:s,loadedCallback:u,className:q,showControls:y=!0,children:S,extraControls:v})=>{const[c,a]=h.useState(g),[d,k]=h.useState(!1),r=n.length>1,x=(e=0)=>{const A=n.length-1;return C.getClampedArrayIndex(i+e,A)},f=()=>{if(r){const e=x(1);j===!1&&e===n.length-1&&l(),s&&s(e)}},l=()=>{a(!1)},m=()=>{a(e=>!e)},I=()=>{l(),f()},P=()=>{l(),s&&s(x(-1))};return M.default(f,r&&d&&c?p:null),t.jsxs(o.BlinkerContainer,{className:q,children:[t.jsx(N.default,{loadCallback:()=>{k(!0),u&&u()},visible:i,images:n}),S,t.jsx(o.ControlsContainer,{children:r&&y&&t.jsxs(t.Fragment,{children:[t.jsx(o.BlinkerControls,{isDisabled:!d,playing:c,handleStartStop:m,handleNext:I,handlePrevious:P}),v]})})]})};B.displayName="Atomic.Blinker";const _=B;exports.default=_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
1
|
+
import { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { ImageShape } from '@rubin-epo/epo-react-lib/Image';
|
|
3
3
|
|
|
4
4
|
export interface BlinkerProps {
|
|
@@ -11,6 +11,7 @@ export interface BlinkerProps {
|
|
|
11
11
|
loadedCallback?: () => void;
|
|
12
12
|
className?: string;
|
|
13
13
|
showControls?: boolean;
|
|
14
|
+
extraControls?: ReactNode;
|
|
14
15
|
}
|
|
15
16
|
declare const Blinker: FunctionComponent<PropsWithChildren<BlinkerProps>>;
|
|
16
17
|
export default Blinker;
|
|
@@ -1,67 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as p, jsx as s, Fragment as P } from "react/jsx-runtime";
|
|
3
3
|
import { useState as u } from "react";
|
|
4
|
-
import { getClampedArrayIndex as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { BlinkerContainer as
|
|
8
|
-
const
|
|
4
|
+
import { getClampedArrayIndex as D } from "../../lib/utils.js";
|
|
5
|
+
import F from "../../hooks/useInterval.js";
|
|
6
|
+
import L from "../ImageStack/index.js";
|
|
7
|
+
import { BlinkerContainer as $, ControlsContainer as q, BlinkerControls as w } from "./styles.js";
|
|
8
|
+
const h = ({
|
|
9
9
|
images: n = [],
|
|
10
|
-
activeIndex:
|
|
11
|
-
autoplay:
|
|
10
|
+
activeIndex: l = 0,
|
|
11
|
+
autoplay: B = !0,
|
|
12
12
|
loop: x = !0,
|
|
13
13
|
interval: g = 200,
|
|
14
14
|
blinkCallback: e,
|
|
15
|
-
loadedCallback:
|
|
15
|
+
loadedCallback: i,
|
|
16
16
|
className: k,
|
|
17
17
|
showControls: y = !0,
|
|
18
|
-
children: I
|
|
18
|
+
children: I,
|
|
19
|
+
extraControls: S
|
|
19
20
|
}) => {
|
|
20
|
-
const [
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
if (
|
|
25
|
-
const t =
|
|
26
|
-
x === !1 && t === n.length - 1 &&
|
|
21
|
+
const [a, c] = u(B), [d, j] = u(!1), r = n.length > 1, m = (t = 0) => {
|
|
22
|
+
const N = n.length - 1;
|
|
23
|
+
return D(l + t, N);
|
|
24
|
+
}, f = () => {
|
|
25
|
+
if (r) {
|
|
26
|
+
const t = m(1);
|
|
27
|
+
x === !1 && t === n.length - 1 && o(), e && e(t);
|
|
27
28
|
}
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
}, j = () => {
|
|
31
|
-
a((t) => !t);
|
|
29
|
+
}, o = () => {
|
|
30
|
+
c(!1);
|
|
32
31
|
}, v = () => {
|
|
33
|
-
|
|
32
|
+
c((t) => !t);
|
|
34
33
|
}, A = () => {
|
|
35
|
-
|
|
34
|
+
o(), f();
|
|
35
|
+
}, C = () => {
|
|
36
|
+
o(), e && e(m(-1));
|
|
36
37
|
};
|
|
37
|
-
return
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
return F(f, r && d && a ? g : null), /* @__PURE__ */ p($, { className: k, children: [
|
|
39
|
+
/* @__PURE__ */ s(
|
|
40
|
+
L,
|
|
40
41
|
{
|
|
41
42
|
loadCallback: () => {
|
|
42
|
-
|
|
43
|
+
j(!0), i && i();
|
|
43
44
|
},
|
|
44
|
-
visible:
|
|
45
|
+
visible: l,
|
|
45
46
|
images: n
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
I,
|
|
50
|
+
/* @__PURE__ */ s(q, { children: r && y && /* @__PURE__ */ p(P, { children: [
|
|
51
|
+
/* @__PURE__ */ s(
|
|
52
|
+
w,
|
|
51
53
|
{
|
|
52
|
-
isDisabled: !
|
|
53
|
-
playing:
|
|
54
|
-
handleStartStop:
|
|
55
|
-
handleNext:
|
|
56
|
-
handlePrevious:
|
|
54
|
+
isDisabled: !d,
|
|
55
|
+
playing: a,
|
|
56
|
+
handleStartStop: v,
|
|
57
|
+
handleNext: A,
|
|
58
|
+
handlePrevious: C
|
|
57
59
|
}
|
|
58
60
|
),
|
|
59
|
-
|
|
60
|
-
] })
|
|
61
|
+
S
|
|
62
|
+
] }) })
|
|
61
63
|
] });
|
|
62
64
|
};
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
+
h.displayName = "Atomic.Blinker";
|
|
66
|
+
const M = h;
|
|
65
67
|
export {
|
|
66
|
-
|
|
68
|
+
M as default
|
|
67
69
|
};
|
|
@@ -28,18 +28,20 @@
|
|
|
28
28
|
grid-area: filler;
|
|
29
29
|
width: var(--label-height);
|
|
30
30
|
`,d=e.default.svg`
|
|
31
|
+
font-size: 1em;
|
|
31
32
|
grid-area: chart;
|
|
32
33
|
max-width: 100%;
|
|
33
34
|
max-height: 100%;
|
|
34
35
|
aspect-ratio: var(--aspect-ratio);
|
|
36
|
+
overflow: visible;
|
|
35
37
|
z-index: 1;
|
|
36
|
-
`,
|
|
38
|
+
`,o=e.default.div`
|
|
37
39
|
display: flex;
|
|
38
40
|
align-items: center;
|
|
39
41
|
grid-area: title;
|
|
40
42
|
height: var(--label-height);
|
|
41
43
|
padding-inline: var(--label-gutter);
|
|
42
|
-
`,
|
|
44
|
+
`,c=e.default.h3`
|
|
43
45
|
margin: 0;
|
|
44
46
|
`,s=e.default.div`
|
|
45
47
|
width: var(--label-height);
|
|
@@ -56,4 +58,4 @@
|
|
|
56
58
|
height: 100%;
|
|
57
59
|
width: 100%;
|
|
58
60
|
font-size: 80%;
|
|
59
|
-
`;exports.ChartContainer=r;exports.Filler=n;exports.HorizontalLabelWrapper=g;exports.Label=h;exports.SVG=d;exports.Title=
|
|
61
|
+
`;exports.ChartContainer=r;exports.Filler=n;exports.HorizontalLabelWrapper=g;exports.Label=h;exports.SVG=d;exports.Title=c;exports.TitleWrapper=o;exports.VerticalLabelWrapper=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e from "styled-components";
|
|
3
3
|
import { token as t } from "@rubin-epo/epo-react-lib/styles";
|
|
4
|
-
const
|
|
4
|
+
const a = e.div`
|
|
5
5
|
--label-height: 2em;
|
|
6
6
|
--label-gutter: calc(var(--label-height) / 2);
|
|
7
7
|
|
|
@@ -34,28 +34,30 @@ const r = e.div`
|
|
|
34
34
|
grid-area: filler;
|
|
35
35
|
width: var(--label-height);
|
|
36
36
|
`, n = e.svg`
|
|
37
|
+
font-size: 1em;
|
|
37
38
|
grid-area: chart;
|
|
38
39
|
max-width: 100%;
|
|
39
40
|
max-height: 100%;
|
|
40
41
|
aspect-ratio: var(--aspect-ratio);
|
|
42
|
+
overflow: visible;
|
|
41
43
|
z-index: 1;
|
|
42
|
-
`,
|
|
44
|
+
`, o = e.div`
|
|
43
45
|
display: flex;
|
|
44
46
|
align-items: center;
|
|
45
47
|
grid-area: title;
|
|
46
48
|
height: var(--label-height);
|
|
47
49
|
padding-inline: var(--label-gutter);
|
|
48
|
-
`,
|
|
50
|
+
`, c = e.h3`
|
|
49
51
|
margin: 0;
|
|
50
52
|
`, h = e.div`
|
|
51
53
|
width: var(--label-height);
|
|
52
54
|
writing-mode: vertical-rl;
|
|
53
55
|
transform: rotate(180deg);
|
|
54
56
|
grid-area: vertical-label;
|
|
55
|
-
`,
|
|
57
|
+
`, s = e.div`
|
|
56
58
|
height: var(--label-height);
|
|
57
59
|
grid-area: horizontal-label;
|
|
58
|
-
`,
|
|
60
|
+
`, g = e.span`
|
|
59
61
|
display: flex;
|
|
60
62
|
align-items: center;
|
|
61
63
|
justify-content: center;
|
|
@@ -64,12 +66,12 @@ const r = e.div`
|
|
|
64
66
|
font-size: 80%;
|
|
65
67
|
`;
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
a as ChartContainer,
|
|
68
70
|
r as Filler,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
s as HorizontalLabelWrapper,
|
|
72
|
+
g as Label,
|
|
71
73
|
n as SVG,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
c as Title,
|
|
75
|
+
o as TitleWrapper,
|
|
74
76
|
h as VerticalLabelWrapper
|
|
75
77
|
};
|
|
@@ -1 +1 @@
|
|
|
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"),d=require("../Viewport/index.cjs"),y=require("../ForeignObject/index.cjs")
|
|
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"),d=require("../Viewport/index.cjs"),y=require("../ForeignObject/index.cjs");require("../ScatterPlot/index.cjs");const o=require("./styles.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(y.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(d.default,{...s,children:l}):l};c.displayName="Charts.Readout";exports.default=c;
|
|
@@ -2,9 +2,10 @@ 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
3
|
import m from "../Viewport/index.js";
|
|
4
4
|
import f from "../ForeignObject/index.js";
|
|
5
|
+
import "../ScatterPlot/index.js";
|
|
5
6
|
import { DisplayContainer as u, Display as d } from "./styles.js";
|
|
6
7
|
const p = (n = "") => {
|
|
7
|
-
const
|
|
8
|
+
const o = ["top", "right"], s = ["center", "center"], i = n ? [...n.split(" "), ...s].slice(0, 2) : o, t = {
|
|
8
9
|
justifyContent: null,
|
|
9
10
|
alignItems: null
|
|
10
11
|
};
|
|
@@ -29,19 +30,19 @@ const p = (n = "") => {
|
|
|
29
30
|
}), t;
|
|
30
31
|
}, y = ({
|
|
31
32
|
className: n,
|
|
32
|
-
children:
|
|
33
|
-
position:
|
|
33
|
+
children: o,
|
|
34
|
+
position: s,
|
|
34
35
|
viewport: i,
|
|
35
36
|
forIds: t,
|
|
36
37
|
forScreenreaders: r
|
|
37
38
|
}) => {
|
|
38
|
-
const a = /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(u, { style: p(
|
|
39
|
+
const a = /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(u, { style: p(s), children: /* @__PURE__ */ l(
|
|
39
40
|
d,
|
|
40
41
|
{
|
|
41
42
|
form: Array.isArray(t) ? t.join(" ") : t,
|
|
42
43
|
className: n,
|
|
43
44
|
children: [
|
|
44
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children:
|
|
45
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children: o }),
|
|
45
46
|
/* @__PURE__ */ e(c, { children: r })
|
|
46
47
|
]
|
|
47
48
|
}
|
|
@@ -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"),K=require("../XAxis/index.cjs"),Q=require("../YAxis/index.cjs"),$=require("../Guidelines/index.cjs"),U=require("../Points/index.cjs"),V=require("../Tooltip/index.cjs"),X=require("../ClippingContainer/index.cjs"),R=require("../hooks/useAxis.cjs"),Y=require("./styles.cjs"),H=require("../defaults.cjs"),Z=require("../canvas/Points/index.cjs"),w={svg:U.default,canvas:Z.default},M=({data:
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react"),K=require("../XAxis/index.cjs"),Q=require("../YAxis/index.cjs"),$=require("../Guidelines/index.cjs"),U=require("../Points/index.cjs"),V=require("../Tooltip/index.cjs"),X=require("../ClippingContainer/index.cjs"),R=require("../hooks/useAxis.cjs"),Y=require("./styles.cjs"),H=require("../defaults.cjs"),Z=require("../canvas/Points/index.cjs"),w=require("../../lib/utils.cjs"),A={svg:U.default,canvas:Z.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={...H.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],[i,j,t]=R.default({...l,range:f}),[r,S,s]=R.default({...c,range:b}),m=s(r[0]),g=t(i[0]),I=s(r[1]),_=t(i[1]),k="x-axis-label",L="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=A[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:m,yEnd:I,xStart:g,xEnd:_,yDomain:r,xDomain:i};return n.jsxs(Y.Chart,{verticalLabel:c.label,verticalLabelId:L,horizontalLabel:l.label,horizontalLabelId:k,className:D,width:d,height:u,title:T,children:[n.jsx(Q.default,{ticks:S,x:g,labelledById:L,yDomain:r,yScale:s}),n.jsxs(X.default,{x:g,y:I,width:N,height:W,children:[l.guidelines&&n.jsx($.default,{guides:j.length,direction:"vertical",xDomain:i,yDomain:r,xScale:t,yScale:s}),c.guidelines&&n.jsx($.default,{guides:S.length,xDomain:i,yDomain:r,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(K.default,{ticks:j,y:m,labelledById:k,xDomain:i,xScale:t}),a&&!w.isSafari()&&n.jsxs(V.default,{x:e?t(e.x):void 0,y:e?s(e.y):void 0,visible:!!e,offset:H.default.pointRadius,children:[e&&typeof a=="function"&&a(e),e&&typeof a=="string"&&a]})]})};M.displayName="Charts.ScatterPlot";exports.default=M;
|