@rubin-epo/epo-widget-lib 1.0.1 → 1.0.3
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/SourceSelector.cjs +1 -1
- package/dist/SourceSelector.js +4 -6
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.d.ts +7 -3
- package/dist/atomic/Blinker/Blinker.js +65 -55
- package/dist/atomic/Blinker/_mocks/index.d.ts +5 -3
- package/dist/atomic/Blinker/styles.cjs +9 -4
- package/dist/atomic/Blinker/styles.d.ts +0 -8
- package/dist/atomic/Blinker/styles.js +11 -8
- package/dist/atomic/ImageStack/index.d.ts +5 -2
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +5 -6
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +50 -49
- package/dist/localeStrings/es/epo-widget-lib.json +82 -0
- package/dist/widgets/SourceSelector/SelectionList/index.cjs +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.d.ts +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.js +27 -21
- package/dist/widgets/SourceSelector/SelectionList/styles.cjs +10 -41
- package/dist/widgets/SourceSelector/SelectionList/styles.d.ts +492 -503
- package/dist/widgets/SourceSelector/SelectionList/styles.js +12 -43
- package/dist/widgets/SourceSelector/SourceMap/index.cjs +1 -0
- package/dist/widgets/SourceSelector/SourceMap/index.d.ts +10 -0
- package/dist/widgets/SourceSelector/SourceMap/index.js +38 -0
- package/dist/widgets/SourceSelector/SourceMap/styles.cjs +14 -0
- package/dist/widgets/SourceSelector/{Point → SourceMap}/styles.d.ts +482 -0
- package/dist/widgets/SourceSelector/{Point → SourceMap}/styles.js +9 -3
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +100 -78
- package/dist/widgets/SourceSelector/index.d.ts +0 -1
- package/dist/widgets/SourceSelector/styles.cjs +2 -6
- package/dist/widgets/SourceSelector/styles.d.ts +6 -484
- package/dist/widgets/SourceSelector/styles.js +3 -8
- package/dist/widgets/SourceSelector/utils.cjs +1 -0
- package/dist/widgets/SourceSelector/utils.d.ts +2 -0
- package/dist/widgets/SourceSelector/utils.js +14 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +2 -3
- package/package.json +1 -1
- package/dist/widgets/SourceSelector/Point/Point.cjs +0 -1
- package/dist/widgets/SourceSelector/Point/Point.d.ts +0 -11
- package/dist/widgets/SourceSelector/Point/Point.js +0 -48
- package/dist/widgets/SourceSelector/Point/index.d.ts +0 -1
- package/dist/widgets/SourceSelector/Point/styles.cjs +0 -9
- package/dist/widgets/SourceSelector/PointSelector/index.cjs +0 -1
- package/dist/widgets/SourceSelector/PointSelector/index.d.ts +0 -13
- package/dist/widgets/SourceSelector/PointSelector/index.js +0 -47
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, kt = ({
|
|
21
21
|
data: r,
|
|
22
22
|
value: y,
|
|
23
|
-
ageLibrary:
|
|
24
|
-
isDisplayOnly:
|
|
25
|
-
isLoading:
|
|
23
|
+
ageLibrary: B,
|
|
24
|
+
isDisplayOnly: I = !1,
|
|
25
|
+
isLoading: k,
|
|
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 = !k && !j, C = { top: 0, right: 0, bottom: 20, left: 20 }, { width: c, height: d } = e, { ages: b = {} } = B, t = Object.keys(b).sort(
|
|
35
35
|
(i, m) => parseFloat(i) - parseFloat(m)
|
|
36
36
|
).map(parseFloat), H = f(D, {
|
|
37
37
|
...e.xAxis,
|
|
@@ -164,11 +164,11 @@ const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md
|
|
|
164
164
|
}
|
|
165
165
|
),
|
|
166
166
|
isLoading: !s,
|
|
167
|
-
isDisplayOnly:
|
|
167
|
+
isDisplayOnly: I,
|
|
168
168
|
controlsId: x
|
|
169
169
|
}
|
|
170
170
|
);
|
|
171
171
|
};
|
|
172
172
|
export {
|
|
173
|
-
|
|
173
|
+
kt as default
|
|
174
174
|
};
|
package/dist/SourceSelector.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/SourceSelector/SourceSelector.cjs"),t=require("./widgets/SourceSelector/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/SourceSelector/SourceSelector.cjs"),t=require("./widgets/SourceSelector/SelectionList/index.cjs"),u=require("./widgets/SourceSelector/Message/Message.cjs");exports.default=e.default;exports.SelectionList=t.default;exports.Message=u.default;
|
package/dist/SourceSelector.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import o from "./widgets/SourceSelector/SourceSelector.js";
|
|
2
|
-
import { default as a } from "./widgets/SourceSelector/
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as m } from "./widgets/SourceSelector/Message/Message.js";
|
|
2
|
+
import { default as a } from "./widgets/SourceSelector/SelectionList/index.js";
|
|
3
|
+
import { default as s } from "./widgets/SourceSelector/Message/Message.js";
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
a as
|
|
8
|
-
l as SelectionList,
|
|
5
|
+
s as Message,
|
|
6
|
+
a as SelectionList,
|
|
9
7
|
o as default
|
|
10
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),N=require("../../lib/utils.cjs"),_=require("../../hooks/useInterval.cjs"),C=require("../ImageStack/index.cjs"),D=require("./Controls/Controls.cjs"),B=require("./styles.cjs"),g=({images:n=[],activeIndex:i=0,autoplay:j=!0,loop:q=!0,interval:p=200,blinkCallback:s,onClickCallback:l,loadedCallback:u,className:y,showControls:S=!0,children:v,extraControls:m})=>{const[c,d]=h.useState(j),[a,I]=h.useState(!1),r=n.length>1,x=(e=0)=>{const M=n.length-1;return N.getClampedArrayIndex(i+e,M)},f=()=>{if(r){const e=x(1);q===!1&&e===n.length-1&&o(),s&&s(e)}},o=()=>{d(!1)},P=()=>{d(e=>!e)},k=()=>{o(),f()},A=()=>{o(),s&&s(x(-1))};return _.default(f,r&&a&&c?p:null),t.jsxs(B.BlinkerContainer,{"data-testid":"blinker-container",onClick:e=>l&&l(e),className:y,children:[t.jsx(C.default,{loadCallback:()=>{I(!0),u&&u()},visible:i,images:n}),v,t.jsx(B.ControlsContainer,{children:r&&S&&t.jsxs(t.Fragment,{children:[t.jsx(D.default,{isDisabled:!a,playing:c,handleStartStop:P,handleNext:k,handlePrevious:A}),m]})})]})};g.displayName="Atomic.Blinker";const F=g;exports.default=F;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import { ImageShape } from '@rubin-epo/epo-react-lib/Image';
|
|
1
|
+
import { FunctionComponent, PropsWithChildren, ReactNode, MouseEventHandler } from 'react';
|
|
3
2
|
|
|
4
3
|
export interface BlinkerProps {
|
|
5
|
-
images:
|
|
4
|
+
images: {
|
|
5
|
+
url: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
}[];
|
|
6
9
|
activeIndex: number;
|
|
7
10
|
autoplay?: boolean;
|
|
8
11
|
loop?: boolean;
|
|
9
12
|
interval?: number;
|
|
10
13
|
blinkCallback?: (activeIndex: number) => void;
|
|
14
|
+
onClickCallback?: MouseEventHandler<HTMLDivElement>;
|
|
11
15
|
loadedCallback?: () => void;
|
|
12
16
|
className?: string;
|
|
13
17
|
showControls?: boolean;
|
|
@@ -1,69 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { getClampedArrayIndex as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
2
|
+
import { jsxs as u, jsx as s, Fragment as D } from "react/jsx-runtime";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { getClampedArrayIndex as F } from "../../lib/utils.js";
|
|
5
|
+
import L from "../../hooks/useInterval.js";
|
|
6
|
+
import $ from "../ImageStack/index.js";
|
|
7
|
+
import q from "./Controls/Controls.js";
|
|
8
|
+
import { BlinkerContainer as w, ControlsContainer as z } from "./styles.js";
|
|
9
|
+
const x = ({
|
|
9
10
|
images: n = [],
|
|
10
|
-
activeIndex:
|
|
11
|
+
activeIndex: i = 0,
|
|
11
12
|
autoplay: B = !0,
|
|
12
|
-
loop:
|
|
13
|
-
interval:
|
|
13
|
+
loop: g = !0,
|
|
14
|
+
interval: y = 200,
|
|
14
15
|
blinkCallback: e,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
onClickCallback: l,
|
|
17
|
+
loadedCallback: a,
|
|
18
|
+
className: I,
|
|
19
|
+
showControls: S = !0,
|
|
20
|
+
children: k,
|
|
21
|
+
extraControls: j
|
|
20
22
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
},
|
|
23
|
+
const [d, c] = h(B), [m, v] = h(!1), r = n.length > 1, f = (t = 0) => {
|
|
24
|
+
const C = n.length - 1;
|
|
25
|
+
return F(i + t, C);
|
|
26
|
+
}, p = () => {
|
|
25
27
|
if (r) {
|
|
26
|
-
const t =
|
|
27
|
-
|
|
28
|
+
const t = f(1);
|
|
29
|
+
g === !1 && t === n.length - 1 && o(), e && e(t);
|
|
28
30
|
}
|
|
29
31
|
}, o = () => {
|
|
30
32
|
c(!1);
|
|
31
|
-
}, v = () => {
|
|
32
|
-
c((t) => !t);
|
|
33
33
|
}, A = () => {
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
o(),
|
|
34
|
+
c((t) => !t);
|
|
35
|
+
}, N = () => {
|
|
36
|
+
o(), p();
|
|
37
|
+
}, P = () => {
|
|
38
|
+
o(), e && e(f(-1));
|
|
37
39
|
};
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
40
|
+
return L(p, r && m && d ? y : null), /* @__PURE__ */ u(
|
|
41
|
+
w,
|
|
42
|
+
{
|
|
43
|
+
"data-testid": "blinker-container",
|
|
44
|
+
onClick: (t) => l && l(t),
|
|
45
|
+
className: I,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ s(
|
|
48
|
+
$,
|
|
49
|
+
{
|
|
50
|
+
loadCallback: () => {
|
|
51
|
+
v(!0), a && a();
|
|
52
|
+
},
|
|
53
|
+
visible: i,
|
|
54
|
+
images: n
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
k,
|
|
58
|
+
/* @__PURE__ */ s(z, { children: r && S && /* @__PURE__ */ u(D, { children: [
|
|
59
|
+
/* @__PURE__ */ s(
|
|
60
|
+
q,
|
|
61
|
+
{
|
|
62
|
+
isDisabled: !m,
|
|
63
|
+
playing: d,
|
|
64
|
+
handleStartStop: A,
|
|
65
|
+
handleNext: N,
|
|
66
|
+
handlePrevious: P
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
j
|
|
70
|
+
] }) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
64
74
|
};
|
|
65
|
-
|
|
66
|
-
const
|
|
75
|
+
x.displayName = "Atomic.Blinker";
|
|
76
|
+
const Q = x;
|
|
67
77
|
export {
|
|
68
|
-
|
|
78
|
+
Q as default
|
|
69
79
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),n=require("
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),n=require("@rubin-epo/epo-react-lib/styles"),o=t=>t&&t.__esModule?t:{default:t},e=o(i),r=e.default.div`
|
|
2
2
|
aspect-ratio: 1;
|
|
3
3
|
container-type: inline-size;
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
position: relative;
|
|
7
7
|
height: 100%;
|
|
8
|
-
`,s=e.default
|
|
8
|
+
`,s=e.default.div`
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
display: grid;
|
|
11
11
|
grid-auto-flow: column;
|
|
@@ -18,8 +18,13 @@
|
|
|
18
18
|
width: 100%;
|
|
19
19
|
gap: var(--widget-padding, var(--PADDING_SMALL));
|
|
20
20
|
padding: var(--widget-padding, var(--PADDING_SMALL));
|
|
21
|
+
pointer-events: none;
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
> * {
|
|
24
|
+
pointer-events: initial;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@container (min-width: ${n.token("BREAK_PHABLET_MIN")}) {
|
|
23
28
|
justify-items: center;
|
|
24
29
|
}
|
|
25
|
-
`;exports.BlinkerContainer=
|
|
30
|
+
`;exports.BlinkerContainer=r;exports.ControlsContainer=s;
|
|
@@ -272,14 +272,6 @@ export declare const BlinkerContainer: import('styled-components').IStyledCompon
|
|
|
272
272
|
onTransitionEnd?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
273
273
|
onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
274
274
|
}>;
|
|
275
|
-
export declare const BlinkerControls: import('styled-components').IStyledComponent<"web", {
|
|
276
|
-
playing: boolean;
|
|
277
|
-
handleStartStop: import('react').MouseEventHandler<HTMLButtonElement>;
|
|
278
|
-
handleNext: import('react').MouseEventHandler<HTMLButtonElement>;
|
|
279
|
-
handlePrevious: import('react').MouseEventHandler<HTMLButtonElement>;
|
|
280
|
-
className?: string | undefined;
|
|
281
|
-
isDisabled?: boolean | undefined;
|
|
282
|
-
}> & import('react').FunctionComponent<import('./Controls/Controls').ControlsProps>;
|
|
283
275
|
export declare const ControlsContainer: import('styled-components').IStyledComponent<"web", {
|
|
284
276
|
ref?: import('react').LegacyRef<HTMLDivElement> | undefined;
|
|
285
277
|
key?: import('react').Key | null | undefined;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import t from "styled-components";
|
|
3
|
-
import i from "
|
|
4
|
-
|
|
5
|
-
const s = t.div`
|
|
3
|
+
import { token as i } from "@rubin-epo/epo-react-lib/styles";
|
|
4
|
+
const o = t.div`
|
|
6
5
|
aspect-ratio: 1;
|
|
7
6
|
container-type: inline-size;
|
|
8
7
|
display: flex;
|
|
9
8
|
justify-content: center;
|
|
10
9
|
position: relative;
|
|
11
10
|
height: 100%;
|
|
12
|
-
`,
|
|
11
|
+
`, r = t.div`
|
|
13
12
|
box-sizing: border-box;
|
|
14
13
|
display: grid;
|
|
15
14
|
grid-auto-flow: column;
|
|
@@ -22,13 +21,17 @@ const s = t.div`
|
|
|
22
21
|
width: 100%;
|
|
23
22
|
gap: var(--widget-padding, var(--PADDING_SMALL));
|
|
24
23
|
padding: var(--widget-padding, var(--PADDING_SMALL));
|
|
24
|
+
pointer-events: none;
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
> * {
|
|
27
|
+
pointer-events: initial;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@container (min-width: ${i("BREAK_PHABLET_MIN")}) {
|
|
27
31
|
justify-items: center;
|
|
28
32
|
}
|
|
29
33
|
`;
|
|
30
34
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
d as ControlsContainer
|
|
35
|
+
o as BlinkerContainer,
|
|
36
|
+
r as ControlsContainer
|
|
34
37
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, FunctionComponent } from 'react';
|
|
2
|
-
import { ImageShape } from '@rubin-epo/epo-react-lib/Image';
|
|
3
2
|
|
|
4
3
|
export interface ImageStackProps {
|
|
5
|
-
images: Array<
|
|
4
|
+
images: Array<{
|
|
5
|
+
url: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
}>;
|
|
6
9
|
visible?: number | Array<boolean>;
|
|
7
10
|
describedById?: string;
|
|
8
11
|
loadCallback?: () => void;
|
|
@@ -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"),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,10 +2,9 @@ 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";
|
|
6
5
|
import { DisplayContainer as u, Display as d } from "./styles.js";
|
|
7
6
|
const p = (n = "") => {
|
|
8
|
-
const
|
|
7
|
+
const s = ["top", "right"], o = ["center", "center"], i = n ? [...n.split(" "), ...o].slice(0, 2) : s, t = {
|
|
9
8
|
justifyContent: null,
|
|
10
9
|
alignItems: null
|
|
11
10
|
};
|
|
@@ -30,19 +29,19 @@ const p = (n = "") => {
|
|
|
30
29
|
}), t;
|
|
31
30
|
}, y = ({
|
|
32
31
|
className: n,
|
|
33
|
-
children:
|
|
34
|
-
position:
|
|
32
|
+
children: s,
|
|
33
|
+
position: o,
|
|
35
34
|
viewport: i,
|
|
36
35
|
forIds: t,
|
|
37
36
|
forScreenreaders: r
|
|
38
37
|
}) => {
|
|
39
|
-
const a = /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(u, { style: p(
|
|
38
|
+
const a = /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(u, { style: p(o), children: /* @__PURE__ */ l(
|
|
40
39
|
d,
|
|
41
40
|
{
|
|
42
41
|
form: Array.isArray(t) ? t.join(" ") : t,
|
|
43
42
|
className: n,
|
|
44
43
|
children: [
|
|
45
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children:
|
|
44
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children: s }),
|
|
46
45
|
/* @__PURE__ */ e(c, { children: r })
|
|
47
46
|
]
|
|
48
47
|
}
|
|
@@ -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={svg:U.default,canvas:Z.default},M=({data:B,className:C,xAxis:c,yAxis:l,width:d,height:u,title:D,activePointId:T,margins:p,tooltip:a,onLoadedCallback:z,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=B,o={...H.default.margins,...p},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===T),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,j,t]=R.default({...c,range:f}),[i,S,s]=R.default({...l,range:b}),m=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),P="x-axis-label",k="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[E],L=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:z}),G={Data:L,xScale:t,yScale:s,yStart:m,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(Y.Chart,{verticalLabel:l.label,verticalLabelId:k,horizontalLabel:c.label,horizontalLabelId:P,className:C,width:d,height:u,title:D,children:[n.jsx(Q.default,{ticks:S,x:g,labelledById:k,yDomain:i,yScale:s}),n.jsxs(X.default,{x:g,y:I,width:N,height:W,children:[c.guidelines&&n.jsx($.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),l.guidelines&&n.jsx($.default,{guides:S.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):L]}),n.jsx(K.default,{ticks:j,y:m,labelledById:P,xDomain:r,xScale:t}),a&&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";const A=M;exports.default=A;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { useState as J } from "react";
|
|
4
|
+
import K from "../XAxis/index.js";
|
|
5
|
+
import Q from "../YAxis/index.js";
|
|
6
6
|
import R from "../Guidelines/index.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { Chart as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
svg:
|
|
16
|
-
canvas:
|
|
17
|
-
},
|
|
7
|
+
import U from "../Points/index.js";
|
|
8
|
+
import V from "../Tooltip/index.js";
|
|
9
|
+
import Z from "../ClippingContainer/index.js";
|
|
10
|
+
import B from "../hooks/useAxis.js";
|
|
11
|
+
import { Chart as _ } from "./styles.js";
|
|
12
|
+
import D from "../defaults.js";
|
|
13
|
+
import $ from "../canvas/Points/index.js";
|
|
14
|
+
const w = {
|
|
15
|
+
svg: U,
|
|
16
|
+
canvas: $
|
|
17
|
+
}, T = ({
|
|
18
18
|
data: j,
|
|
19
19
|
className: z,
|
|
20
|
-
xAxis:
|
|
21
|
-
yAxis:
|
|
20
|
+
xAxis: c,
|
|
21
|
+
yAxis: l,
|
|
22
22
|
width: d,
|
|
23
23
|
height: m,
|
|
24
|
-
title:
|
|
25
|
-
activePointId:
|
|
26
|
-
margins:
|
|
24
|
+
title: E,
|
|
25
|
+
activePointId: M,
|
|
26
|
+
margins: A,
|
|
27
27
|
tooltip: n,
|
|
28
|
-
onLoadedCallback:
|
|
29
|
-
renderer:
|
|
28
|
+
onLoadedCallback: G,
|
|
29
|
+
renderer: N = "svg",
|
|
30
30
|
plotChildren: x
|
|
31
31
|
}) => {
|
|
32
|
-
const [y, h] =
|
|
33
|
-
|
|
32
|
+
const [y, h] = J(), { label: O, points: f } = j, r = { ...D.margins, ...A }, t = typeof y < "u" ? f[y] : f.find(({ id: p }) => p === M), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [s, P, e] = B({ ...c, range: b }), [a, S, o] = B({ ...l, range: g }), I = o(a[0]), v = e(s[0]), k = o(a[1]), W = e(s[1]), C = "x-axis-label", L = "y-axis-label", X = Math.abs(b[1] - b[0]), Y = Math.abs(g[1] - g[0]), q = w[N], H = /* @__PURE__ */ i(
|
|
33
|
+
q,
|
|
34
34
|
{
|
|
35
35
|
data: f,
|
|
36
36
|
onHoverCallback: n ? (p) => h(p) : void 0,
|
|
@@ -39,36 +39,36 @@ const $ = {
|
|
|
39
39
|
height: m,
|
|
40
40
|
xScale: e,
|
|
41
41
|
yScale: o,
|
|
42
|
-
label:
|
|
43
|
-
onLoadedCallback:
|
|
42
|
+
label: O,
|
|
43
|
+
onLoadedCallback: G
|
|
44
44
|
}
|
|
45
|
-
),
|
|
45
|
+
), F = {
|
|
46
46
|
Data: H,
|
|
47
47
|
xScale: e,
|
|
48
48
|
yScale: o,
|
|
49
|
-
yStart:
|
|
49
|
+
yStart: I,
|
|
50
50
|
yEnd: k,
|
|
51
51
|
xStart: v,
|
|
52
|
-
xEnd:
|
|
52
|
+
xEnd: W,
|
|
53
53
|
yDomain: a,
|
|
54
54
|
xDomain: s
|
|
55
55
|
};
|
|
56
56
|
return /* @__PURE__ */ u(
|
|
57
|
-
|
|
57
|
+
_,
|
|
58
58
|
{
|
|
59
|
-
verticalLabel:
|
|
59
|
+
verticalLabel: l.label,
|
|
60
60
|
verticalLabelId: L,
|
|
61
|
-
horizontalLabel:
|
|
61
|
+
horizontalLabel: c.label,
|
|
62
62
|
horizontalLabelId: C,
|
|
63
63
|
className: z,
|
|
64
64
|
width: d,
|
|
65
65
|
height: m,
|
|
66
|
-
title:
|
|
66
|
+
title: E,
|
|
67
67
|
children: [
|
|
68
68
|
/* @__PURE__ */ i(
|
|
69
|
-
|
|
69
|
+
Q,
|
|
70
70
|
{
|
|
71
|
-
ticks:
|
|
71
|
+
ticks: S,
|
|
72
72
|
x: v,
|
|
73
73
|
labelledById: L,
|
|
74
74
|
yDomain: a,
|
|
@@ -76,17 +76,17 @@ const $ = {
|
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
78
|
/* @__PURE__ */ u(
|
|
79
|
-
|
|
79
|
+
Z,
|
|
80
80
|
{
|
|
81
81
|
x: v,
|
|
82
82
|
y: k,
|
|
83
|
-
width:
|
|
84
|
-
height:
|
|
83
|
+
width: X,
|
|
84
|
+
height: Y,
|
|
85
85
|
children: [
|
|
86
|
-
|
|
86
|
+
c.guidelines && /* @__PURE__ */ i(
|
|
87
87
|
R,
|
|
88
88
|
{
|
|
89
|
-
guides:
|
|
89
|
+
guides: P.length,
|
|
90
90
|
direction: "vertical",
|
|
91
91
|
xDomain: s,
|
|
92
92
|
yDomain: a,
|
|
@@ -94,37 +94,37 @@ const $ = {
|
|
|
94
94
|
yScale: o
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
|
|
97
|
+
l.guidelines && /* @__PURE__ */ i(
|
|
98
98
|
R,
|
|
99
99
|
{
|
|
100
|
-
guides:
|
|
100
|
+
guides: S.length,
|
|
101
101
|
xDomain: s,
|
|
102
102
|
yDomain: a,
|
|
103
103
|
xScale: e,
|
|
104
104
|
yScale: o
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
x ? x(
|
|
107
|
+
x ? x(F) : H
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
111
|
/* @__PURE__ */ i(
|
|
112
|
-
|
|
112
|
+
K,
|
|
113
113
|
{
|
|
114
|
-
ticks:
|
|
115
|
-
y:
|
|
114
|
+
ticks: P,
|
|
115
|
+
y: I,
|
|
116
116
|
labelledById: C,
|
|
117
117
|
xDomain: s,
|
|
118
118
|
xScale: e
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
121
|
n && /* @__PURE__ */ u(
|
|
122
|
-
|
|
122
|
+
V,
|
|
123
123
|
{
|
|
124
124
|
x: t ? e(t.x) : void 0,
|
|
125
125
|
y: t ? o(t.y) : void 0,
|
|
126
126
|
visible: !!t,
|
|
127
|
-
offset:
|
|
127
|
+
offset: D.pointRadius,
|
|
128
128
|
children: [
|
|
129
129
|
t && typeof n == "function" && n(t),
|
|
130
130
|
t && typeof n == "string" && n
|
|
@@ -135,7 +135,8 @@ const $ = {
|
|
|
135
135
|
}
|
|
136
136
|
);
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
T.displayName = "Charts.ScatterPlot";
|
|
139
|
+
const ft = T;
|
|
139
140
|
export {
|
|
140
|
-
|
|
141
|
+
ft as default
|
|
141
142
|
};
|