@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.
Files changed (48) hide show
  1. package/dist/IsochronePlot.js +7 -7
  2. package/dist/SourceSelector.cjs +1 -1
  3. package/dist/SourceSelector.js +4 -6
  4. package/dist/atomic/Blinker/Blinker.cjs +1 -1
  5. package/dist/atomic/Blinker/Blinker.d.ts +7 -3
  6. package/dist/atomic/Blinker/Blinker.js +65 -55
  7. package/dist/atomic/Blinker/_mocks/index.d.ts +5 -3
  8. package/dist/atomic/Blinker/styles.cjs +9 -4
  9. package/dist/atomic/Blinker/styles.d.ts +0 -8
  10. package/dist/atomic/Blinker/styles.js +11 -8
  11. package/dist/atomic/ImageStack/index.d.ts +5 -2
  12. package/dist/charts/Readout/index.cjs +1 -1
  13. package/dist/charts/Readout/index.js +5 -6
  14. package/dist/charts/ScatterPlot/index.cjs +1 -1
  15. package/dist/charts/ScatterPlot/index.js +50 -49
  16. package/dist/localeStrings/es/epo-widget-lib.json +82 -0
  17. package/dist/widgets/SourceSelector/SelectionList/index.cjs +1 -1
  18. package/dist/widgets/SourceSelector/SelectionList/index.d.ts +1 -1
  19. package/dist/widgets/SourceSelector/SelectionList/index.js +27 -21
  20. package/dist/widgets/SourceSelector/SelectionList/styles.cjs +10 -41
  21. package/dist/widgets/SourceSelector/SelectionList/styles.d.ts +492 -503
  22. package/dist/widgets/SourceSelector/SelectionList/styles.js +12 -43
  23. package/dist/widgets/SourceSelector/SourceMap/index.cjs +1 -0
  24. package/dist/widgets/SourceSelector/SourceMap/index.d.ts +10 -0
  25. package/dist/widgets/SourceSelector/SourceMap/index.js +38 -0
  26. package/dist/widgets/SourceSelector/SourceMap/styles.cjs +14 -0
  27. package/dist/widgets/SourceSelector/{Point → SourceMap}/styles.d.ts +482 -0
  28. package/dist/widgets/SourceSelector/{Point → SourceMap}/styles.js +9 -3
  29. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  30. package/dist/widgets/SourceSelector/SourceSelector.js +100 -78
  31. package/dist/widgets/SourceSelector/index.d.ts +0 -1
  32. package/dist/widgets/SourceSelector/styles.cjs +2 -6
  33. package/dist/widgets/SourceSelector/styles.d.ts +6 -484
  34. package/dist/widgets/SourceSelector/styles.js +3 -8
  35. package/dist/widgets/SourceSelector/utils.cjs +1 -0
  36. package/dist/widgets/SourceSelector/utils.d.ts +2 -0
  37. package/dist/widgets/SourceSelector/utils.js +14 -0
  38. package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
  39. package/dist/widgets/SupernovaThreeVector/Skymap/index.js +2 -3
  40. package/package.json +1 -1
  41. package/dist/widgets/SourceSelector/Point/Point.cjs +0 -1
  42. package/dist/widgets/SourceSelector/Point/Point.d.ts +0 -11
  43. package/dist/widgets/SourceSelector/Point/Point.js +0 -48
  44. package/dist/widgets/SourceSelector/Point/index.d.ts +0 -1
  45. package/dist/widgets/SourceSelector/Point/styles.cjs +0 -9
  46. package/dist/widgets/SourceSelector/PointSelector/index.cjs +0 -1
  47. package/dist/widgets/SourceSelector/PointSelector/index.d.ts +0 -13
  48. package/dist/widgets/SourceSelector/PointSelector/index.js +0 -47
@@ -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, Bt = ({
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: I,
24
- isDisplayOnly: k = !1,
25
- isLoading: B,
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 = !B && !j, C = { top: 0, right: 0, bottom: 20, left: 20 }, { width: c, height: d } = e, { ages: b = {} } = I, t = Object.keys(b).sort(
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: k,
167
+ isDisplayOnly: I,
168
168
  controlsId: x
169
169
  }
170
170
  );
171
171
  };
172
172
  export {
173
- Bt as default
173
+ kt as default
174
174
  };
@@ -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/PointSelector/index.cjs"),r=require("./widgets/SourceSelector/SelectionList/index.cjs"),u=require("./widgets/SourceSelector/Message/Message.cjs");exports.default=e.default;exports.PointSelector=t.default;exports.SelectionList=r.default;exports.Message=u.default;
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;
@@ -1,10 +1,8 @@
1
1
  import o from "./widgets/SourceSelector/SourceSelector.js";
2
- import { default as a } from "./widgets/SourceSelector/PointSelector/index.js";
3
- import { default as l } from "./widgets/SourceSelector/SelectionList/index.js";
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
- m as Message,
7
- a as PointSelector,
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"),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
+ "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: ImageShape[];
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 p, jsx as s, Fragment as P } from "react/jsx-runtime";
3
- import { useState as u } from "react";
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 = ({
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: l = 0,
11
+ activeIndex: i = 0,
11
12
  autoplay: B = !0,
12
- loop: x = !0,
13
- interval: g = 200,
13
+ loop: g = !0,
14
+ interval: y = 200,
14
15
  blinkCallback: e,
15
- loadedCallback: i,
16
- className: k,
17
- showControls: y = !0,
18
- children: I,
19
- extraControls: S
16
+ onClickCallback: l,
17
+ loadedCallback: a,
18
+ className: I,
19
+ showControls: S = !0,
20
+ children: k,
21
+ extraControls: j
20
22
  }) => {
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 = () => {
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 = m(1);
27
- x === !1 && t === n.length - 1 && o(), e && e(t);
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
- o(), f();
35
- }, C = () => {
36
- o(), e && e(m(-1));
34
+ c((t) => !t);
35
+ }, N = () => {
36
+ o(), p();
37
+ }, P = () => {
38
+ o(), e && e(f(-1));
37
39
  };
38
- return F(f, r && d && a ? g : null), /* @__PURE__ */ p($, { className: k, children: [
39
- /* @__PURE__ */ s(
40
- L,
41
- {
42
- loadCallback: () => {
43
- j(!0), i && i();
44
- },
45
- visible: l,
46
- images: n
47
- }
48
- ),
49
- I,
50
- /* @__PURE__ */ s(q, { children: r && y && /* @__PURE__ */ p(P, { children: [
51
- /* @__PURE__ */ s(
52
- w,
53
- {
54
- isDisabled: !d,
55
- playing: a,
56
- handleStartStop: v,
57
- handleNext: A,
58
- handlePrevious: C
59
- }
60
- ),
61
- S
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
- h.displayName = "Atomic.Blinker";
66
- const M = h;
75
+ x.displayName = "Atomic.Blinker";
76
+ const Q = x;
67
77
  export {
68
- M as default
78
+ Q as default
69
79
  };
@@ -1,3 +1,5 @@
1
- import { ImageShape } from '@rubin-epo/epo-react-lib/Image';
2
-
3
- export declare const mockImages: ImageShape[];
1
+ export declare const mockImages: Array<{
2
+ url: string;
3
+ width?: number;
4
+ height?: number;
5
+ }>;
@@ -1,11 +1,11 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),n=require("./Controls/Controls.cjs"),o=require("@rubin-epo/epo-react-lib/styles"),r=t=>t&&t.__esModule?t:{default:t},e=r(i),l=e.default.div`
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(n.default)``,a=e.default.div`
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
- @container (min-width: ${o.token("BREAK_PHABLET_MIN")}) {
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=l;exports.BlinkerControls=s;exports.ControlsContainer=a;
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 "./Controls/Controls.js";
4
- import { token as o } from "@rubin-epo/epo-react-lib/styles";
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
- `, a = t(i)``, d = t.div`
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
- @container (min-width: ${o("BREAK_PHABLET_MIN")}) {
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
- s as BlinkerContainer,
32
- a as BlinkerControls,
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<ImageShape>;
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");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;
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 o = ["top", "right"], s = ["center", "center"], i = n ? [...n.split(" "), ...s].slice(0, 2) : o, t = {
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: o,
34
- position: s,
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(s), children: /* @__PURE__ */ l(
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: o }),
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: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],[r,j,t]=R.default({...l,range:f}),[i,m,s]=R.default({...c,range:b}),S=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),k="x-axis-label",L="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[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:S,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};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:m,x:g,labelledById:L,yDomain:i,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:r,yDomain:i,xScale:t,yScale:s}),c.guidelines&&n.jsx($.default,{guides:m.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(K.default,{ticks:j,y:S,labelledById:k,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";exports.default=M;
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 F } from "react";
4
- import J from "../XAxis/index.js";
5
- import K from "../YAxis/index.js";
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 Q from "../Points/index.js";
8
- import U from "../Tooltip/index.js";
9
- import V from "../ClippingContainer/index.js";
10
- import D from "../hooks/useAxis.js";
11
- import { Chart as Z } from "./styles.js";
12
- import T from "../defaults.js";
13
- import _ from "../canvas/Points/index.js";
14
- const $ = {
15
- svg: Q,
16
- canvas: _
17
- }, w = ({
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: l,
21
- yAxis: c,
20
+ xAxis: c,
21
+ yAxis: l,
22
22
  width: d,
23
23
  height: m,
24
- title: B,
25
- activePointId: E,
26
- margins: M,
24
+ title: E,
25
+ activePointId: M,
26
+ margins: A,
27
27
  tooltip: n,
28
- onLoadedCallback: A,
29
- renderer: G = "svg",
28
+ onLoadedCallback: G,
29
+ renderer: N = "svg",
30
30
  plotChildren: x
31
31
  }) => {
32
- const [y, h] = F(), { label: N, points: f } = j, r = { ...T.margins, ...M }, t = typeof y < "u" ? f[y] : f.find(({ id: p }) => p === E), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [s, I, e] = D({ ...l, range: b }), [a, P, o] = D({ ...c, range: g }), S = o(a[0]), v = e(s[0]), k = o(a[1]), O = e(s[1]), C = "x-axis-label", L = "y-axis-label", W = Math.abs(b[1] - b[0]), X = Math.abs(g[1] - g[0]), Y = $[G], H = /* @__PURE__ */ i(
33
- Y,
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: N,
43
- onLoadedCallback: A
42
+ label: O,
43
+ onLoadedCallback: G
44
44
  }
45
- ), q = {
45
+ ), F = {
46
46
  Data: H,
47
47
  xScale: e,
48
48
  yScale: o,
49
- yStart: S,
49
+ yStart: I,
50
50
  yEnd: k,
51
51
  xStart: v,
52
- xEnd: O,
52
+ xEnd: W,
53
53
  yDomain: a,
54
54
  xDomain: s
55
55
  };
56
56
  return /* @__PURE__ */ u(
57
- Z,
57
+ _,
58
58
  {
59
- verticalLabel: c.label,
59
+ verticalLabel: l.label,
60
60
  verticalLabelId: L,
61
- horizontalLabel: l.label,
61
+ horizontalLabel: c.label,
62
62
  horizontalLabelId: C,
63
63
  className: z,
64
64
  width: d,
65
65
  height: m,
66
- title: B,
66
+ title: E,
67
67
  children: [
68
68
  /* @__PURE__ */ i(
69
- K,
69
+ Q,
70
70
  {
71
- ticks: P,
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
- V,
79
+ Z,
80
80
  {
81
81
  x: v,
82
82
  y: k,
83
- width: W,
84
- height: X,
83
+ width: X,
84
+ height: Y,
85
85
  children: [
86
- l.guidelines && /* @__PURE__ */ i(
86
+ c.guidelines && /* @__PURE__ */ i(
87
87
  R,
88
88
  {
89
- guides: I.length,
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
- c.guidelines && /* @__PURE__ */ i(
97
+ l.guidelines && /* @__PURE__ */ i(
98
98
  R,
99
99
  {
100
- guides: P.length,
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(q) : H
107
+ x ? x(F) : H
108
108
  ]
109
109
  }
110
110
  ),
111
111
  /* @__PURE__ */ i(
112
- J,
112
+ K,
113
113
  {
114
- ticks: I,
115
- y: S,
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
- U,
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: T.pointRadius,
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
- w.displayName = "Charts.ScatterPlot";
138
+ T.displayName = "Charts.ScatterPlot";
139
+ const ft = T;
139
140
  export {
140
- w as default
141
+ ft as default
141
142
  };