@rubin-epo/epo-widget-lib 2.0.3 → 2.0.5

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 (68) hide show
  1. package/dist/SortableTable.cjs +1 -0
  2. package/dist/SortableTable.d.ts +3 -0
  3. package/dist/SortableTable.js +5 -0
  4. package/dist/SourceSelector.cjs +1 -1
  5. package/dist/SourceSelector.js +6 -4
  6. package/dist/atomic/Blinker/Blinker.cjs +1 -1
  7. package/dist/atomic/Blinker/Blinker.d.ts +1 -0
  8. package/dist/atomic/Blinker/Blinker.js +27 -25
  9. package/dist/atomic/SelectionList/index.cjs +1 -0
  10. package/dist/{widgets/SourceSelector → atomic}/SelectionList/index.d.ts +1 -1
  11. package/dist/atomic/SelectionList/index.js +31 -0
  12. package/dist/charts/Readout/index.cjs +1 -1
  13. package/dist/charts/Readout/index.js +18 -25
  14. package/dist/charts/ScatterPlot/index.cjs +1 -1
  15. package/dist/charts/ScatterPlot/index.js +50 -53
  16. package/dist/localeStrings/en/epo-widget-lib.json +11 -3
  17. package/dist/localeStrings/es/epo-widget-lib.json +8 -5
  18. package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
  19. package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -1
  20. package/dist/widgets/OrbitalSim/Camera/Camera.js +9 -8
  21. package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
  22. package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
  23. package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
  24. package/dist/widgets/OrbitalSim/Context/index.js +58 -32
  25. package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
  26. package/dist/widgets/OrbitalSim/OrbitalSim.js +95 -78
  27. package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
  28. package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
  29. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
  30. package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
  31. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
  32. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
  33. package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
  34. package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
  35. package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
  36. package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
  37. package/dist/widgets/OrbitalSim/styles.cjs +33 -5
  38. package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
  39. package/dist/widgets/OrbitalSim/styles.js +36 -6
  40. package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
  41. package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
  42. package/dist/widgets/SortableTable/SortableTable.js +41 -0
  43. package/dist/widgets/SortableTable/index.d.ts +1 -0
  44. package/dist/widgets/SortableTable/styles.cjs +8 -0
  45. package/dist/widgets/SortableTable/styles.d.ts +1 -0
  46. package/dist/widgets/SortableTable/styles.js +13 -0
  47. package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
  48. package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
  49. package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
  50. package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
  51. package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
  52. package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
  53. package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
  54. package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
  55. package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
  56. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  57. package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
  58. package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
  59. package/dist/widgets/SourceSelector/index.d.ts +2 -1
  60. package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
  61. package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
  62. package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
  63. package/package.json +1 -1
  64. package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
  65. package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
  66. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
  67. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
  68. /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./widgets/SortableTable/SortableTable.cjs");exports.SortableTable=e.default;exports.default=e.default;
@@ -0,0 +1,3 @@
1
+ export * from './widgets/SortableTable/index'
2
+ import _default from './widgets/SortableTable/index'
3
+ export default _default
@@ -0,0 +1,5 @@
1
+ import { default as l, default as t } from "./widgets/SortableTable/SortableTable.js";
2
+ export {
3
+ l as SortableTable,
4
+ t as default
5
+ };
@@ -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/SelectionList/index.cjs"),u=require("./widgets/SourceSelector/Message/Message.cjs");exports.default=e.default;exports.SelectionList=t.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/MovingSourceSelector.cjs"),r=require("./atomic/SelectionList/index.cjs"),o=require("./widgets/SourceSelector/Message/Message.cjs");exports.default=e.default;exports.MovingSourceSelector=t.default;exports.SelectionList=r.default;exports.Message=o.default;
@@ -1,8 +1,10 @@
1
1
  import o from "./widgets/SourceSelector/SourceSelector.js";
2
- import { default as a } from "./widgets/SourceSelector/SelectionList/index.js";
3
- import { default as s } from "./widgets/SourceSelector/Message/Message.js";
2
+ import { default as a } from "./widgets/SourceSelector/MovingSourceSelector.js";
3
+ import { default as l } from "./atomic/SelectionList/index.js";
4
+ import { default as u } from "./widgets/SourceSelector/Message/Message.js";
4
5
  export {
5
- s as Message,
6
- a as SelectionList,
6
+ u as Message,
7
+ a as MovingSourceSelector,
8
+ l as SelectionList,
7
9
  o as default
8
10
  };
@@ -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"),_=require("../../lib/utils.cjs"),k=require("../../hooks/useInterval.cjs"),C=require("../ImageStack/index.cjs"),D=require("./Controls/Controls.cjs"),g=require("./styles.cjs"),j=({images:n=[],activeIndex:i=0,autoplay:q=!0,loop:B=!0,interval:p=200,blinkCallback:s,onClickCallback:l,loadedCallback:u,className:y,showControls:S=!0,children:v,extraControls:m})=>{const[c,d]=h.useState(q),[a,I]=h.useState(!1),r=n.length>1,x=(e=0)=>{const N=n.length-1;return _.getClampedArrayIndex(i+e,N)},f=()=>{if(r){const e=x(1);B===!1&&e===n.length-1&&o(),s&&s(e)}},o=()=>{d(!1)},P=()=>{d(e=>!e)},A=()=>{o(),f()},M=()=>{o(),s&&s(x(-1))};return k.default(f,r&&a&&c?p:null),t.jsxs(g.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(g.ControlsContainer,{children:r&&S&&t.jsxs(t.Fragment,{children:[t.jsx(D.default,{isDisabled:!a,playing:c,handleStartStop:P,handleNext:A,handlePrevious:M}),m]})})]})};j.displayName="Atomic.Blinker";exports.default=j;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),k=require("../../lib/utils.cjs"),C=require("../../hooks/useInterval.cjs"),D=require("../ImageStack/index.cjs"),F=require("./Controls/Controls.cjs"),g=require("./styles.cjs"),j=({images:n=[],activeIndex:i=0,autoplay:q=!0,loop:B=!0,interval:p=200,blinkCallback:s,onClickCallback:l,loadedCallback:u,className:y,showControls:S=!0,children:v,extraControls:m,pauseCallback:I=()=>{}})=>{const[c,d]=h.useState(q),[a,P]=h.useState(!1),r=n.length>1,x=(e=0)=>{const _=n.length-1;return k.getClampedArrayIndex(i+e,_)},f=()=>{if(r){const e=x(1);B===!1&&e===n.length-1&&o(),s&&s(e)}},o=()=>{d(!1)},A=()=>{I(),d(e=>!e)},M=()=>{o(),f()},N=()=>{o(),s&&s(x(-1))};return C.default(f,r&&a&&c?p:null),t.jsxs(g.BlinkerContainer,{"data-testid":"blinker-container",onClick:e=>l&&l(e),className:y,children:[t.jsx(D.default,{loadCallback:()=>{P(!0),u&&u()},visible:i,images:n}),v,t.jsx(g.ControlsContainer,{children:r&&S&&t.jsxs(t.Fragment,{children:[t.jsx(F.default,{isDisabled:!a,playing:c,handleStartStop:A,handleNext:M,handlePrevious:N}),m]})})]})};j.displayName="Atomic.Blinker";exports.default=j;
@@ -16,6 +16,7 @@ export interface BlinkerProps {
16
16
  className?: string;
17
17
  showControls?: boolean;
18
18
  extraControls?: ReactNode;
19
+ pauseCallback?: () => void;
19
20
  }
20
21
  declare const Blinker: FunctionComponent<PropsWithChildren<BlinkerProps>>;
21
22
  export default Blinker;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as s, Fragment as C } from "react/jsx-runtime";
2
+ import { jsxs as u, jsx as s, Fragment as D } from "react/jsx-runtime";
3
3
  import { useState as h } 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 q from "./Controls/Controls.js";
8
- import { BlinkerContainer as w, ControlsContainer as z } from "./styles.js";
9
- const E = ({
4
+ import { getClampedArrayIndex as F } from "../../lib/utils.js";
5
+ import L from "../../hooks/useInterval.js";
6
+ import q from "../ImageStack/index.js";
7
+ import w from "./Controls/Controls.js";
8
+ import { BlinkerContainer as z, ControlsContainer as E } from "./styles.js";
9
+ const G = ({
10
10
  images: e = [],
11
11
  activeIndex: i = 0,
12
12
  autoplay: x = !0,
@@ -18,11 +18,13 @@ const E = ({
18
18
  className: y,
19
19
  showControls: I = !0,
20
20
  children: S,
21
- extraControls: j
21
+ extraControls: j,
22
+ pauseCallback: k = () => {
23
+ }
22
24
  }) => {
23
- const [d, m] = h(x), [c, k] = h(!1), r = e.length > 1, f = (t = 0) => {
24
- const P = e.length - 1;
25
- return D(i + t, P);
25
+ const [d, m] = h(x), [c, v] = h(!1), r = e.length > 1, f = (t = 0) => {
26
+ const C = e.length - 1;
27
+ return F(i + t, C);
26
28
  }, p = () => {
27
29
  if (r) {
28
30
  const t = f(1);
@@ -30,40 +32,40 @@ const E = ({
30
32
  }
31
33
  }, o = () => {
32
34
  m(!1);
33
- }, v = () => {
34
- m((t) => !t);
35
35
  }, A = () => {
36
- o(), p();
36
+ k(), m((t) => !t);
37
37
  }, N = () => {
38
+ o(), p();
39
+ }, P = () => {
38
40
  o(), n && n(f(-1));
39
41
  };
40
- return F(p, r && c && d ? g : null), /* @__PURE__ */ u(
41
- w,
42
+ return L(p, r && c && d ? g : null), /* @__PURE__ */ u(
43
+ z,
42
44
  {
43
45
  "data-testid": "blinker-container",
44
46
  onClick: (t) => l && l(t),
45
47
  className: y,
46
48
  children: [
47
49
  /* @__PURE__ */ s(
48
- L,
50
+ q,
49
51
  {
50
52
  loadCallback: () => {
51
- k(!0), a && a();
53
+ v(!0), a && a();
52
54
  },
53
55
  visible: i,
54
56
  images: e
55
57
  }
56
58
  ),
57
59
  S,
58
- /* @__PURE__ */ s(z, { children: r && I && /* @__PURE__ */ u(C, { children: [
60
+ /* @__PURE__ */ s(E, { children: r && I && /* @__PURE__ */ u(D, { children: [
59
61
  /* @__PURE__ */ s(
60
- q,
62
+ w,
61
63
  {
62
64
  isDisabled: !c,
63
65
  playing: d,
64
- handleStartStop: v,
65
- handleNext: A,
66
- handlePrevious: N
66
+ handleStartStop: A,
67
+ handleNext: N,
68
+ handlePrevious: P
67
69
  }
68
70
  ),
69
71
  j
@@ -72,7 +74,7 @@ const E = ({
72
74
  }
73
75
  );
74
76
  };
75
- E.displayName = "Atomic.Blinker";
77
+ G.displayName = "Atomic.Blinker";
76
78
  export {
77
- E as default
79
+ G as default
78
80
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("react-i18next"),s=require("./styles.cjs"),a=require("../Button/patterns/Reset.cjs"),n=({className:r,onRemoveCallback:c,sources:t=[]})=>{const{t:i}=u.useTranslation();return e.jsxs(s.SelectionWrapper,{children:[t.length>0&&e.jsx(s.SelectionList,{className:r,children:t.map(({type:o,id:l})=>e.jsxs(s.DescriptionWrapper,{children:[e.jsx("dt",{children:i("selection_list.selected_source",{type:i(`selection_list.sources.${o}`)})}),e.jsx("dd",{children:l})]},l))}),e.jsx(a.default,{isDisabled:t.length<1,onResetCallback:c})]})};n.displayName="Widgets.SelectionList";exports.default=n;
@@ -1,5 +1,5 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { SourceType } from '../../../types/astro';
2
+ import { SourceType } from '../../types/astro';
3
3
 
4
4
  interface SelectionListProps {
5
5
  className?: string;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
3
+ import { useTranslation as c } from "react-i18next";
4
+ import { SelectionWrapper as a, SelectionList as p, DescriptionWrapper as d } from "./styles.js";
5
+ import m from "../Button/patterns/Reset.js";
6
+ const h = ({
7
+ className: n,
8
+ onRemoveCallback: r,
9
+ sources: t = []
10
+ }) => {
11
+ const { t: i } = c();
12
+ return /* @__PURE__ */ l(a, { children: [
13
+ t.length > 0 && /* @__PURE__ */ e(p, { className: n, children: t.map(({ type: o, id: s }) => /* @__PURE__ */ l(d, { children: [
14
+ /* @__PURE__ */ e("dt", { children: i("selection_list.selected_source", {
15
+ type: i(`selection_list.sources.${o}`)
16
+ }) }),
17
+ /* @__PURE__ */ e("dd", { children: s })
18
+ ] }, s)) }),
19
+ /* @__PURE__ */ e(
20
+ m,
21
+ {
22
+ isDisabled: t.length < 1,
23
+ onResetCallback: r
24
+ }
25
+ )
26
+ ] });
27
+ };
28
+ h.displayName = "Widgets.SelectionList";
29
+ export {
30
+ h as default
31
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),c=require("@rubin-epo/epo-react-lib/styles");require("../Base/index.cjs");require("../XAxis/index.cjs");require("../YAxis/index.cjs");require("../Guidelines/index.cjs");require("../Tooltip/index.cjs");require("../Bars/index.cjs");const d=require("../Viewport/index.cjs"),y=require("../ForeignObject/index.cjs");require("../ScatterPlot/index.cjs");const o=require("./styles.cjs"),j=(r="")=>{const i=["top","right"],a=["center","center"],n=r?[...r.split(" "),...a].slice(0,2):i,e={justifyContent:null,alignItems:null};return n.forEach(s=>{switch(s){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},u=({className:r,children:i,position:a,viewport:n,forIds:e,forScreenreaders:s})=>{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:r,children:[t.jsx("span",{"aria-hidden":!!s,children:i}),t.jsx(c.ScreenreaderText,{children:s})]})})});return n?t.jsx(d.default,{...n,children:l}):l};u.displayName="Charts.Readout";exports.default=u;
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"),o=require("./styles.cjs"),d=require("../ForeignObject/index.cjs"),y=require("../Viewport/index.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(d.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(y.default,{...s,children:l}):l};c.displayName="Charts.Readout";exports.default=c;
@@ -1,22 +1,15 @@
1
1
  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
- import "../Base/index.js";
4
- import "../XAxis/index.js";
5
- import "../YAxis/index.js";
6
- import "../Guidelines/index.js";
7
- import "../Tooltip/index.js";
8
- import "../Bars/index.js";
9
- import m from "../Viewport/index.js";
10
- import p from "../ForeignObject/index.js";
11
- import "../ScatterPlot/index.js";
12
- import { DisplayContainer as f, Display as u } from "./styles.js";
13
- const d = (i = "") => {
14
- const o = ["top", "right"], s = ["center", "center"], r = i ? [...i.split(" "), ...s].slice(0, 2) : o, t = {
3
+ import { DisplayContainer as m, Display as f } from "./styles.js";
4
+ import u from "../ForeignObject/index.js";
5
+ import d from "../Viewport/index.js";
6
+ const p = (n = "") => {
7
+ const s = ["top", "right"], o = ["center", "center"], i = n ? [...n.split(" "), ...o].slice(0, 2) : s, t = {
15
8
  justifyContent: null,
16
9
  alignItems: null
17
10
  };
18
- return r.forEach((n) => {
19
- switch (n) {
11
+ return i.forEach((r) => {
12
+ switch (r) {
20
13
  case "center":
21
14
  t.alignItems = t.alignItems ?? "center", t.justifyContent = t.justifyContent ?? "center";
22
15
  break;
@@ -35,25 +28,25 @@ const d = (i = "") => {
35
28
  }
36
29
  }), t;
37
30
  }, y = ({
38
- className: i,
39
- children: o,
40
- position: s,
41
- viewport: r,
31
+ className: n,
32
+ children: s,
33
+ position: o,
34
+ viewport: i,
42
35
  forIds: t,
43
- forScreenreaders: n
36
+ forScreenreaders: r
44
37
  }) => {
45
- const a = /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(f, { style: d(s), children: /* @__PURE__ */ l(
46
- u,
38
+ const a = /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(m, { style: p(o), children: /* @__PURE__ */ l(
39
+ f,
47
40
  {
48
41
  form: Array.isArray(t) ? t.join(" ") : t,
49
- className: i,
42
+ className: n,
50
43
  children: [
51
- /* @__PURE__ */ e("span", { "aria-hidden": !!n, children: o }),
52
- /* @__PURE__ */ e(c, { children: n })
44
+ /* @__PURE__ */ e("span", { "aria-hidden": !!r, children: s }),
45
+ /* @__PURE__ */ e(c, { children: r })
53
46
  ]
54
47
  }
55
48
  ) }) });
56
- return r ? /* @__PURE__ */ e(m, { ...r, children: a }) : a;
49
+ return i ? /* @__PURE__ */ e(d, { ...i, children: a }) : a;
57
50
  };
58
51
  y.displayName = "Charts.Readout";
59
52
  export {
@@ -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");require("../Base/index.cjs");const 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");require("../Bars/index.cjs");require("../Viewport/index.cjs");const 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"),$=require("../hooks/useAxis.cjs"),K=require("./styles.cjs"),R=require("../defaults.cjs"),Q=require("../canvas/Points/index.cjs"),U=require("../YAxis/index.cjs"),V=require("../ClippingContainer/index.cjs"),H=require("../Guidelines/index.cjs"),X=require("../XAxis/index.cjs"),Y=require("../Tooltip/index.cjs"),Z=require("../Points/index.cjs"),w={svg:Z.default,canvas:Q.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={...R.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]=$.default({...l,range:f}),[i,m,s]=$.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(K.Chart,{verticalLabel:c.label,verticalLabelId:L,horizontalLabel:l.label,horizontalLabelId:k,className:D,width:d,height:u,title:T,children:[n.jsx(U.default,{ticks:m,x:g,labelledById:L,yDomain:i,yScale:s}),n.jsxs(V.default,{x:g,y:I,width:N,height:W,children:[l.guidelines&&n.jsx(H.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),c.guidelines&&n.jsx(H.default,{guides:m.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(X.default,{ticks:j,y:S,labelledById:k,xDomain:r,xScale:t}),a&&n.jsxs(Y.default,{x:e?t(e.x):void 0,y:e?s(e.y):void 0,visible:!!e,offset:R.default.pointRadius,children:[e&&typeof a=="function"&&a(e),e&&typeof a=="string"&&a]})]})};M.displayName="Charts.ScatterPlot";exports.default=M;
@@ -1,22 +1,19 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import { jsxs as u, jsx as i } from "react/jsx-runtime";
3
3
  import { useState as F } from "react";
4
- import "../Base/index.js";
5
- import J from "../XAxis/index.js";
6
- import K from "../YAxis/index.js";
7
- import R from "../Guidelines/index.js";
8
- import Q from "../Points/index.js";
9
- import U from "../Tooltip/index.js";
10
- import V from "../ClippingContainer/index.js";
11
- import "../Bars/index.js";
12
- import "../Viewport/index.js";
13
- import D from "../hooks/useAxis.js";
14
- import { Chart as Z } from "./styles.js";
15
- import T from "../defaults.js";
16
- import _ from "../canvas/Points/index.js";
4
+ import R from "../hooks/useAxis.js";
5
+ import { Chart as J } from "./styles.js";
6
+ import D from "../defaults.js";
7
+ import K from "../canvas/Points/index.js";
8
+ import Q from "../YAxis/index.js";
9
+ import U from "../ClippingContainer/index.js";
10
+ import T from "../Guidelines/index.js";
11
+ import V from "../XAxis/index.js";
12
+ import Z from "../Tooltip/index.js";
13
+ import _ from "../Points/index.js";
17
14
  const $ = {
18
- svg: Q,
19
- canvas: _
15
+ svg: _,
16
+ canvas: K
20
17
  }, w = ({
21
18
  data: j,
22
19
  className: z,
@@ -32,32 +29,32 @@ const $ = {
32
29
  renderer: G = "svg",
33
30
  plotChildren: x
34
31
  }) => {
35
- const [y, h] = F(), { label: N, points: f } = j, a = { ...T.margins, ...M }, t = typeof y < "u" ? f[y] : f.find(({ id: v }) => v === E), p = [0 + a.left, d - a.right], b = [m - a.bottom, 0 + a.top], [i, I, o] = D({ ...l, range: p }), [r, P, e] = D({ ...c, range: b }), S = e(r[0]), g = o(i[0]), k = e(r[1]), O = o(i[1]), C = "x-axis-label", L = "y-axis-label", W = Math.abs(p[1] - p[0]), X = Math.abs(b[1] - b[0]), Y = $[G], H = /* @__PURE__ */ s(
32
+ const [y, h] = F(), { label: N, points: f } = j, r = { ...D.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] = R({ ...l, range: b }), [a, P, o] = R({ ...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(
36
33
  Y,
37
34
  {
38
35
  data: f,
39
- onHoverCallback: n ? (v) => h(v) : void 0,
36
+ onHoverCallback: n ? (p) => h(p) : void 0,
40
37
  onHoverOutCallback: n ? () => h(void 0) : void 0,
41
38
  width: d,
42
39
  height: m,
43
- xScale: o,
44
- yScale: e,
40
+ xScale: e,
41
+ yScale: o,
45
42
  label: N,
46
43
  onLoadedCallback: A
47
44
  }
48
45
  ), q = {
49
46
  Data: H,
50
- xScale: o,
51
- yScale: e,
47
+ xScale: e,
48
+ yScale: o,
52
49
  yStart: S,
53
50
  yEnd: k,
54
- xStart: g,
51
+ xStart: v,
55
52
  xEnd: O,
56
- yDomain: r,
57
- xDomain: i
53
+ yDomain: a,
54
+ xDomain: s
58
55
  };
59
56
  return /* @__PURE__ */ u(
60
- Z,
57
+ J,
61
58
  {
62
59
  verticalLabel: c.label,
63
60
  verticalLabelId: L,
@@ -68,66 +65,66 @@ const $ = {
68
65
  height: m,
69
66
  title: B,
70
67
  children: [
71
- /* @__PURE__ */ s(
72
- K,
68
+ /* @__PURE__ */ i(
69
+ Q,
73
70
  {
74
71
  ticks: P,
75
- x: g,
72
+ x: v,
76
73
  labelledById: L,
77
- yDomain: r,
78
- yScale: e
74
+ yDomain: a,
75
+ yScale: o
79
76
  }
80
77
  ),
81
78
  /* @__PURE__ */ u(
82
- V,
79
+ U,
83
80
  {
84
- x: g,
81
+ x: v,
85
82
  y: k,
86
83
  width: W,
87
84
  height: X,
88
85
  children: [
89
- l.guidelines && /* @__PURE__ */ s(
90
- R,
86
+ l.guidelines && /* @__PURE__ */ i(
87
+ T,
91
88
  {
92
89
  guides: I.length,
93
90
  direction: "vertical",
94
- xDomain: i,
95
- yDomain: r,
96
- xScale: o,
97
- yScale: e
91
+ xDomain: s,
92
+ yDomain: a,
93
+ xScale: e,
94
+ yScale: o
98
95
  }
99
96
  ),
100
- c.guidelines && /* @__PURE__ */ s(
101
- R,
97
+ c.guidelines && /* @__PURE__ */ i(
98
+ T,
102
99
  {
103
100
  guides: P.length,
104
- xDomain: i,
105
- yDomain: r,
106
- xScale: o,
107
- yScale: e
101
+ xDomain: s,
102
+ yDomain: a,
103
+ xScale: e,
104
+ yScale: o
108
105
  }
109
106
  ),
110
107
  x ? x(q) : H
111
108
  ]
112
109
  }
113
110
  ),
114
- /* @__PURE__ */ s(
115
- J,
111
+ /* @__PURE__ */ i(
112
+ V,
116
113
  {
117
114
  ticks: I,
118
115
  y: S,
119
116
  labelledById: C,
120
- xDomain: i,
121
- xScale: o
117
+ xDomain: s,
118
+ xScale: e
122
119
  }
123
120
  ),
124
121
  n && /* @__PURE__ */ u(
125
- U,
122
+ Z,
126
123
  {
127
- x: t ? o(t.x) : void 0,
128
- y: t ? e(t.y) : void 0,
124
+ x: t ? e(t.x) : void 0,
125
+ y: t ? o(t.y) : void 0,
129
126
  visible: !!t,
130
- offset: T.pointRadius,
127
+ offset: D.pointRadius,
131
128
  children: [
132
129
  t && typeof n == "function" && n(t),
133
130
  t && typeof n == "string" && n
@@ -61,12 +61,15 @@
61
61
  "export": "Export"
62
62
  }
63
63
  },
64
- "source_selector": {
64
+ "selection_list": {
65
65
  "selected_source": "Selected {{type}}:",
66
66
  "sources": {
67
67
  "galaxy": "Galaxy",
68
- "supernova": "Supernova"
69
- },
68
+ "supernova": "Supernova",
69
+ "observation": "Observation"
70
+ }
71
+ },
72
+ "source_selector": {
70
73
  "messages": {
71
74
  "success": "You found it!",
72
75
  "failure": "Try again."
@@ -172,5 +175,10 @@
172
175
  "earth": "Earth",
173
176
  "mars": "Mars",
174
177
  "neptune": "Neptune"
178
+ },
179
+ "neo": {
180
+ "apollo": "Apollo",
181
+ "amor": "Amor",
182
+ "atira": "Atira"
175
183
  }
176
184
  }
@@ -48,15 +48,18 @@
48
48
  "export": "Exportar"
49
49
  }
50
50
  },
51
+ "selection_list": {
52
+ "selected_source": "{{type}} Seleccionada:",
53
+ "sources": {
54
+ "galaxy": "Galaxia",
55
+ "supernova": "Supernova",
56
+ "observation": "Observación"
57
+ }
58
+ },
51
59
  "source_selector": {
52
60
  "messages": {
53
61
  "success": "¡Muy bien!",
54
62
  "failure": "Inténtalo de nuevo."
55
- },
56
- "selected_source": "Seleccionada {{type}}:",
57
- "sources": {
58
- "galaxy": "Galaxia",
59
- "supernova": "Supernova"
60
63
  }
61
64
  },
62
65
  "camera_filter": {