@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.
- package/dist/SortableTable.cjs +1 -0
- package/dist/SortableTable.d.ts +3 -0
- package/dist/SortableTable.js +5 -0
- package/dist/SourceSelector.cjs +1 -1
- package/dist/SourceSelector.js +6 -4
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.d.ts +1 -0
- package/dist/atomic/Blinker/Blinker.js +27 -25
- package/dist/atomic/SelectionList/index.cjs +1 -0
- package/dist/{widgets/SourceSelector → atomic}/SelectionList/index.d.ts +1 -1
- package/dist/atomic/SelectionList/index.js +31 -0
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +18 -25
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +50 -53
- package/dist/localeStrings/en/epo-widget-lib.json +11 -3
- package/dist/localeStrings/es/epo-widget-lib.json +8 -5
- package/dist/mock-data/OrbitalSim/index.d.ts +162 -0
- package/dist/widgets/OrbitalSim/Camera/Camera.cjs +1 -1
- package/dist/widgets/OrbitalSim/Camera/Camera.js +9 -8
- package/dist/widgets/OrbitalSim/Context/OrbitalSimContext.types.d.ts +12 -0
- package/dist/widgets/OrbitalSim/Context/index.cjs +1 -1
- package/dist/widgets/OrbitalSim/Context/index.d.ts +1 -1
- package/dist/widgets/OrbitalSim/Context/index.js +58 -32
- package/dist/widgets/OrbitalSim/OrbitalSim.cjs +1 -1
- package/dist/widgets/OrbitalSim/OrbitalSim.js +95 -78
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbital.js +41 -41
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/OrbitalDetails.js +21 -23
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.cjs +1 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.d.ts +2 -1
- package/dist/widgets/OrbitalSim/Orbitals/Orbitals.js +41 -40
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -1
- package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +65 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +100 -57
- package/dist/widgets/OrbitalSim/styles.cjs +33 -5
- package/dist/widgets/OrbitalSim/styles.d.ts +2 -0
- package/dist/widgets/OrbitalSim/styles.js +36 -6
- package/dist/widgets/SortableTable/SortableTable.cjs +1 -0
- package/dist/widgets/SortableTable/SortableTable.d.ts +19 -0
- package/dist/widgets/SortableTable/SortableTable.js +41 -0
- package/dist/widgets/SortableTable/index.d.ts +1 -0
- package/dist/widgets/SortableTable/styles.cjs +8 -0
- package/dist/widgets/SortableTable/styles.d.ts +1 -0
- package/dist/widgets/SortableTable/styles.js +13 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.cjs +1 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.d.ts +13 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/index.js +42 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.cjs +14 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.d.ts +2 -0
- package/dist/widgets/SourceSelector/MovingSourceMap/styles.js +20 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.cjs +1 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.d.ts +24 -0
- package/dist/widgets/SourceSelector/MovingSourceSelector.js +119 -0
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.d.ts +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +43 -42
- package/dist/widgets/SourceSelector/index.d.ts +2 -1
- package/dist/widgets/SourceSelector/mocks/index.d.ts +1 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
- package/package.json +1 -1
- package/dist/widgets/SourceSelector/SelectionList/index.cjs +0 -1
- package/dist/widgets/SourceSelector/SelectionList/index.js +0 -31
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.cjs +0 -0
- /package/dist/{widgets/SourceSelector → atomic}/SelectionList/styles.d.ts +0 -0
- /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;
|
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/SelectionList/index.cjs"),
|
|
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;
|
package/dist/SourceSelector.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import o from "./widgets/SourceSelector/SourceSelector.js";
|
|
2
|
-
import { default as a } from "./widgets/SourceSelector/
|
|
3
|
-
import { default as
|
|
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
|
-
|
|
6
|
-
a as
|
|
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"),
|
|
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;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as u, jsx as s, Fragment as
|
|
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
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { BlinkerContainer as
|
|
9
|
-
const
|
|
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,
|
|
24
|
-
const
|
|
25
|
-
return
|
|
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
|
-
|
|
36
|
+
k(), m((t) => !t);
|
|
37
37
|
}, N = () => {
|
|
38
|
+
o(), p();
|
|
39
|
+
}, P = () => {
|
|
38
40
|
o(), n && n(f(-1));
|
|
39
41
|
};
|
|
40
|
-
return
|
|
41
|
-
|
|
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
|
-
|
|
50
|
+
q,
|
|
49
51
|
{
|
|
50
52
|
loadCallback: () => {
|
|
51
|
-
|
|
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(
|
|
60
|
+
/* @__PURE__ */ s(E, { children: r && I && /* @__PURE__ */ u(D, { children: [
|
|
59
61
|
/* @__PURE__ */ s(
|
|
60
|
-
|
|
62
|
+
w,
|
|
61
63
|
{
|
|
62
64
|
isDisabled: !c,
|
|
63
65
|
playing: d,
|
|
64
|
-
handleStartStop:
|
|
65
|
-
handleNext:
|
|
66
|
-
handlePrevious:
|
|
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
|
-
|
|
77
|
+
G.displayName = "Atomic.Blinker";
|
|
76
78
|
export {
|
|
77
|
-
|
|
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;
|
|
@@ -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"),
|
|
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 "
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
19
|
-
switch (
|
|
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:
|
|
39
|
-
children:
|
|
40
|
-
position:
|
|
41
|
-
viewport:
|
|
31
|
+
className: n,
|
|
32
|
+
children: s,
|
|
33
|
+
position: o,
|
|
34
|
+
viewport: i,
|
|
42
35
|
forIds: t,
|
|
43
|
-
forScreenreaders:
|
|
36
|
+
forScreenreaders: r
|
|
44
37
|
}) => {
|
|
45
|
-
const a = /* @__PURE__ */ e(
|
|
46
|
-
|
|
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:
|
|
42
|
+
className: n,
|
|
50
43
|
children: [
|
|
51
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !!
|
|
52
|
-
/* @__PURE__ */ e(c, { children:
|
|
44
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children: s }),
|
|
45
|
+
/* @__PURE__ */ e(c, { children: r })
|
|
53
46
|
]
|
|
54
47
|
}
|
|
55
48
|
) }) });
|
|
56
|
-
return
|
|
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")
|
|
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
|
|
2
|
+
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import { useState as F } from "react";
|
|
4
|
-
import "../
|
|
5
|
-
import J from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import Q from "../
|
|
9
|
-
import U from "../
|
|
10
|
-
import
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
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:
|
|
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,
|
|
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 ? (
|
|
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:
|
|
44
|
-
yScale:
|
|
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:
|
|
51
|
-
yScale:
|
|
47
|
+
xScale: e,
|
|
48
|
+
yScale: o,
|
|
52
49
|
yStart: S,
|
|
53
50
|
yEnd: k,
|
|
54
|
-
xStart:
|
|
51
|
+
xStart: v,
|
|
55
52
|
xEnd: O,
|
|
56
|
-
yDomain:
|
|
57
|
-
xDomain:
|
|
53
|
+
yDomain: a,
|
|
54
|
+
xDomain: s
|
|
58
55
|
};
|
|
59
56
|
return /* @__PURE__ */ u(
|
|
60
|
-
|
|
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__ */
|
|
72
|
-
|
|
68
|
+
/* @__PURE__ */ i(
|
|
69
|
+
Q,
|
|
73
70
|
{
|
|
74
71
|
ticks: P,
|
|
75
|
-
x:
|
|
72
|
+
x: v,
|
|
76
73
|
labelledById: L,
|
|
77
|
-
yDomain:
|
|
78
|
-
yScale:
|
|
74
|
+
yDomain: a,
|
|
75
|
+
yScale: o
|
|
79
76
|
}
|
|
80
77
|
),
|
|
81
78
|
/* @__PURE__ */ u(
|
|
82
|
-
|
|
79
|
+
U,
|
|
83
80
|
{
|
|
84
|
-
x:
|
|
81
|
+
x: v,
|
|
85
82
|
y: k,
|
|
86
83
|
width: W,
|
|
87
84
|
height: X,
|
|
88
85
|
children: [
|
|
89
|
-
l.guidelines && /* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
l.guidelines && /* @__PURE__ */ i(
|
|
87
|
+
T,
|
|
91
88
|
{
|
|
92
89
|
guides: I.length,
|
|
93
90
|
direction: "vertical",
|
|
94
|
-
xDomain:
|
|
95
|
-
yDomain:
|
|
96
|
-
xScale:
|
|
97
|
-
yScale:
|
|
91
|
+
xDomain: s,
|
|
92
|
+
yDomain: a,
|
|
93
|
+
xScale: e,
|
|
94
|
+
yScale: o
|
|
98
95
|
}
|
|
99
96
|
),
|
|
100
|
-
c.guidelines && /* @__PURE__ */
|
|
101
|
-
|
|
97
|
+
c.guidelines && /* @__PURE__ */ i(
|
|
98
|
+
T,
|
|
102
99
|
{
|
|
103
100
|
guides: P.length,
|
|
104
|
-
xDomain:
|
|
105
|
-
yDomain:
|
|
106
|
-
xScale:
|
|
107
|
-
yScale:
|
|
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__ */
|
|
115
|
-
|
|
111
|
+
/* @__PURE__ */ i(
|
|
112
|
+
V,
|
|
116
113
|
{
|
|
117
114
|
ticks: I,
|
|
118
115
|
y: S,
|
|
119
116
|
labelledById: C,
|
|
120
|
-
xDomain:
|
|
121
|
-
xScale:
|
|
117
|
+
xDomain: s,
|
|
118
|
+
xScale: e
|
|
122
119
|
}
|
|
123
120
|
),
|
|
124
121
|
n && /* @__PURE__ */ u(
|
|
125
|
-
|
|
122
|
+
Z,
|
|
126
123
|
{
|
|
127
|
-
x: t ?
|
|
128
|
-
y: t ?
|
|
124
|
+
x: t ? e(t.x) : void 0,
|
|
125
|
+
y: t ? o(t.y) : void 0,
|
|
129
126
|
visible: !!t,
|
|
130
|
-
offset:
|
|
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
|
-
"
|
|
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": {
|