@rubin-epo/epo-widget-lib 0.7.0-rc.2 → 0.8.0
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/Atomic.cjs +1 -1
- package/dist/Atomic.js +6 -4
- package/dist/SupernovaThreeVector.cjs +1 -0
- package/dist/SupernovaThreeVector.d.ts +3 -0
- package/dist/SupernovaThreeVector.js +100 -0
- package/dist/atomic/Blinker/Blinker.cjs +1 -1
- package/dist/atomic/Blinker/Blinker.js +18 -18
- package/dist/atomic/Blinker/styles.cjs +1 -1
- package/dist/atomic/Blinker/styles.js +7 -7
- package/dist/atomic/Button/index.d.ts +1 -0
- package/dist/atomic/Button/patterns/Reset.cjs +1 -0
- package/dist/atomic/Button/patterns/Reset.d.ts +8 -0
- package/dist/atomic/Button/patterns/Reset.js +29 -0
- package/dist/atomic/ImageStack/index.cjs +1 -0
- package/dist/atomic/ImageStack/index.d.ts +16 -0
- package/dist/atomic/ImageStack/index.js +68 -0
- package/dist/atomic/ImageStack/styles.cjs +31 -0
- package/dist/atomic/ImageStack/styles.js +39 -0
- package/dist/atomic/index.d.ts +1 -0
- package/dist/charts/Bars/index.cjs +1 -1
- package/dist/charts/Bars/index.d.ts +2 -2
- package/dist/charts/Bars/index.js +31 -37
- package/dist/charts/Base/index.cjs +1 -1
- package/dist/charts/Base/index.d.ts +4 -0
- package/dist/charts/Base/index.js +33 -25
- package/dist/charts/Base/styles.cjs +22 -2
- package/dist/charts/Base/styles.d.ts +816 -0
- package/dist/charts/Base/styles.js +26 -3
- package/dist/charts/Guidelines/index.cjs +1 -1
- package/dist/charts/Guidelines/index.d.ts +2 -2
- package/dist/charts/Guidelines/index.js +19 -18
- package/dist/charts/Points/index.cjs +1 -1
- package/dist/charts/Points/index.js +15 -15
- package/dist/charts/Tooltip/index.cjs +1 -1
- package/dist/charts/Tooltip/index.d.ts +5 -4
- package/dist/charts/Tooltip/index.js +38 -40
- package/dist/charts/Tooltip/styles.cjs +19 -13
- package/dist/charts/Tooltip/styles.d.ts +417 -1801
- package/dist/charts/Tooltip/styles.js +21 -17
- package/dist/charts/XAxis/index.cjs +1 -1
- package/dist/charts/XAxis/index.js +31 -36
- package/dist/charts/YAxis/index.cjs +1 -1
- package/dist/charts/YAxis/index.d.ts +5 -0
- package/dist/charts/YAxis/index.js +28 -35
- package/dist/images/lunar_phase/first-quarter.webp +0 -0
- package/dist/images/lunar_phase/full.webp +0 -0
- package/dist/images/lunar_phase/new-moon.webp +0 -0
- package/dist/images/lunar_phase/third-quarter.webp +0 -0
- package/dist/images/lunar_phase/waning-crescent.webp +0 -0
- package/dist/images/lunar_phase/waning-gibbous.webp +0 -0
- package/dist/images/lunar_phase/waxing-crescent.webp +0 -0
- package/dist/images/lunar_phase/waxing-gibbous.webp +0 -0
- package/dist/images/supernovae_skymap/range0_500.png +0 -0
- package/dist/images/supernovae_skymap/range1000_2500.png +0 -0
- package/dist/images/supernovae_skymap/range500_1000.png +0 -0
- package/dist/localeStrings/en/epo-widget-lib.json +19 -0
- package/dist/widgets/ColorTool/Actions/index.cjs +1 -1
- package/dist/widgets/ColorTool/Actions/index.js +37 -27
- package/dist/widgets/ColorTool/FilterControls/FilterControls.cjs +1 -1
- package/dist/widgets/ColorTool/FilterControls/FilterControls.js +11 -11
- package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/index.d.ts +19 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/index.js +106 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.cjs +5 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.d.ts +482 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.js +10 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/index.cjs +1 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/index.d.ts +11 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/index.js +36 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/styles.cjs +10 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/styles.d.ts +272 -0
- package/dist/widgets/SupernovaThreeVector/LiveLabel/styles.js +15 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.d.ts +18 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +122 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.cjs +24 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.d.ts +3374 -0
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.js +35 -0
- package/dist/widgets/SupernovaThreeVector/index.d.ts +12 -0
- package/dist/widgets/SupernovaThreeVector/styles.cjs +78 -0
- package/dist/widgets/SupernovaThreeVector/styles.js +94 -0
- package/package.json +5 -2
- package/dist/atomic/Blinker/Image/Image.cjs +0 -1
- package/dist/atomic/Blinker/Image/Image.d.ts +0 -9
- package/dist/atomic/Blinker/Image/Image.js +0 -23
- package/dist/atomic/Blinker/Image/styles.cjs +0 -17
- package/dist/atomic/Blinker/Image/styles.d.ts +0 -283
- package/dist/atomic/Blinker/Image/styles.js +0 -22
- package/dist/atomic/Blinker/Images/Images.cjs +0 -1
- package/dist/atomic/Blinker/Images/Images.d.ts +0 -8
- package/dist/atomic/Blinker/Images/Images.js +0 -45
- package/dist/atomic/Blinker/Images/styles.cjs +0 -10
- package/dist/atomic/Blinker/Images/styles.d.ts +0 -544
- package/dist/atomic/Blinker/Images/styles.js +0 -16
- package/dist/widgets/ColorTool/Actions/Reset/index.cjs +0 -1
- package/dist/widgets/ColorTool/Actions/Reset/index.d.ts +0 -9
- package/dist/widgets/ColorTool/Actions/Reset/index.js +0 -39
- package/dist/widgets/ColorTool/FilterControls/styles.d.ts +0 -1232
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import r from "styled-components";
|
|
3
|
+
const t = r.div`
|
|
4
|
+
background-color: #dce0e3;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
font-size: 0.5em;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
padding: 2px 4px;
|
|
9
|
+
text-align: center;
|
|
10
|
+
position: absolute;
|
|
11
|
+
`, e = r.div`
|
|
12
|
+
width: 0;
|
|
13
|
+
height: 0;
|
|
14
|
+
border-left: var(--arrow-width, 6px) solid transparent;
|
|
15
|
+
border-right: var(--arrow-width, 6px) solid transparent;
|
|
16
|
+
|
|
17
|
+
border-top: var(--arrow-width, 6px) solid #dce0e3;
|
|
18
|
+
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: 0;
|
|
15
21
|
`;
|
|
16
22
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
e as TooltipBackground,
|
|
20
|
-
c as TooltipText
|
|
23
|
+
e as Arrow,
|
|
24
|
+
t as Tooltip
|
|
21
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),M=require("d3-array"),o=require("../styles.cjs"),j=({xDomain:e=[0,1],xScale:n=a=>a,y:t=0,ticks:u=0,labelRender:c,labelledById:b,margin:h,tickHeight:d=5,showBaseline:x=!0,className:y})=>{if(e.length<2)return console.error("Failed to render: invalid domain",e),null;const g={...{top:0,right:0,bottom:0,left:0},...h},A=M.ticks(e[0],e[1],u);return r.jsxs(r.Fragment,{children:[x&&r.jsx(o.BaseLine,{x1:n(e[0])-g.left,x2:n(e[1])+g.right,y1:t,y2:t}),u>0&&r.jsx("g",{role:"list","aria-labelledby":b,className:y,children:A.map((s,f)=>{if(s>=e[1])return null;const i=t+d,l=n(s);return r.jsxs("g",{role:"listitem",children:[d>0&&r.jsx(o.Tick,{x1:l,x2:l,y1:t,y2:i}),c?c(s,l,i,f):r.jsx(o.XLabel,{x:l,y:i,children:s})]},f)})})]})};j.displayName="Charts.XAxis";const X=j;exports.default=X;
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsxs as h, Fragment as A, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { ticks as x } from "d3-array";
|
|
3
|
+
import { BaseLine as M, Tick as j, XLabel as k } from "../styles.js";
|
|
4
|
+
const p = ({
|
|
4
5
|
xDomain: r = [0, 1],
|
|
5
|
-
xScale:
|
|
6
|
-
y:
|
|
7
|
-
ticks:
|
|
8
|
-
|
|
9
|
-
labelledById:
|
|
10
|
-
|
|
6
|
+
xScale: i = (a) => a,
|
|
7
|
+
y: t = 0,
|
|
8
|
+
ticks: o = 0,
|
|
9
|
+
labelRender: c,
|
|
10
|
+
labelledById: u,
|
|
11
|
+
margin: m,
|
|
11
12
|
tickHeight: d = 5,
|
|
12
|
-
showBaseline:
|
|
13
|
-
className:
|
|
13
|
+
showBaseline: b = !0,
|
|
14
|
+
className: X
|
|
14
15
|
}) => {
|
|
15
16
|
if (r.length < 2)
|
|
16
17
|
return console.error("Failed to render: invalid domain", r), null;
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const f = { ...{ top: 0, right: 0, bottom: 0, left: 0 }, ...m }, y = x(r[0], r[1], o);
|
|
19
|
+
return /* @__PURE__ */ h(A, { children: [
|
|
20
|
+
b && /* @__PURE__ */ s(
|
|
21
|
+
M,
|
|
21
22
|
{
|
|
22
|
-
x1:
|
|
23
|
-
x2:
|
|
24
|
-
y1:
|
|
25
|
-
y2:
|
|
23
|
+
x1: i(r[0]) - f.left,
|
|
24
|
+
x2: i(r[1]) + f.right,
|
|
25
|
+
y1: t,
|
|
26
|
+
y2: t
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
y1: e,
|
|
37
|
-
y2: e + d
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ t(x, { x: i, y: e + d, children: b })
|
|
41
|
-
] }, o);
|
|
29
|
+
o > 0 && /* @__PURE__ */ s("g", { role: "list", "aria-labelledby": u, className: X, children: y.map((e, g) => {
|
|
30
|
+
if (e >= r[1])
|
|
31
|
+
return null;
|
|
32
|
+
const n = t + d, l = i(e);
|
|
33
|
+
return /* @__PURE__ */ h("g", { role: "listitem", children: [
|
|
34
|
+
d > 0 && /* @__PURE__ */ s(j, { x1: l, x2: l, y1: t, y2: n }),
|
|
35
|
+
c ? c(e, l, n, g) : /* @__PURE__ */ s(k, { x: l, y: n, children: e })
|
|
36
|
+
] }, g);
|
|
42
37
|
}) })
|
|
43
38
|
] });
|
|
44
39
|
};
|
|
45
|
-
|
|
46
|
-
const
|
|
40
|
+
p.displayName = "Charts.XAxis";
|
|
41
|
+
const C = p;
|
|
47
42
|
export {
|
|
48
|
-
|
|
43
|
+
C as default
|
|
49
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),M=require("d3-array"),o=require("../styles.cjs"),b=({yDomain:t=[0,1],yScale:l=u=>u,x:r=0,margin:j,ticks:a=0,labelRender:c,labelledById:f,showBaseline:h=!0,tickLength:d=5,className:p})=>{if(t.length<2)return console.error("Failed to render: invalid domain",t),null;const x={...{top:0,right:0,bottom:0,left:0},...j},A=M.ticks(t[0],t[1],a);return e.jsxs(e.Fragment,{children:[h&&e.jsx(o.BaseLine,{x1:r,x2:r,y1:l(t[0])+x.top,y2:l(t[1])-x.bottom}),a>0&&e.jsx("g",{role:"list","aria-labelledby":f,className:p,children:A.map((i,g)=>{const s=l(i),n=r-d;return e.jsxs("g",{role:"listitem",children:[d>0&&e.jsx(o.Tick,{x1:n,x2:r,y1:s,y2:s}),c?c(i,n,s,g):e.jsx(o.YLabel,{x:n,y:s,children:i})]},g)})})]})};b.displayName="Charts.YAxis";const Y=b;exports.default=Y;
|
|
@@ -6,5 +6,10 @@ export interface YAxisProps extends BaseAxisProps {
|
|
|
6
6
|
x?: number;
|
|
7
7
|
tickLength?: number;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* YAxis creates an axis with ticks. It needs a yDomain (your input data) and a yScale method to place
|
|
11
|
+
* the ticks and data. Remember that SVG starts from the upper left corner, so the yScale will need an inverted
|
|
12
|
+
* range for most purposes.
|
|
13
|
+
*/
|
|
9
14
|
declare const YAxis: FunctionComponent<YAxisProps>;
|
|
10
15
|
export default YAxis;
|
|
@@ -1,49 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsxs as p, Fragment as A, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ticks as M } from "d3-array";
|
|
3
|
+
import { BaseLine as j, Tick as k, YLabel as F } from "../styles.js";
|
|
4
|
+
const x = ({
|
|
4
5
|
yDomain: r = [0, 1],
|
|
5
|
-
yScale:
|
|
6
|
-
x:
|
|
7
|
-
|
|
6
|
+
yScale: i = (d) => d,
|
|
7
|
+
x: t = 0,
|
|
8
|
+
margin: g,
|
|
8
9
|
ticks: n = 0,
|
|
9
|
-
|
|
10
|
-
labelledById:
|
|
11
|
-
showBaseline:
|
|
10
|
+
labelRender: a,
|
|
11
|
+
labelledById: b,
|
|
12
|
+
showBaseline: h = !0,
|
|
12
13
|
tickLength: c = 5,
|
|
13
|
-
className:
|
|
14
|
+
className: u
|
|
14
15
|
}) => {
|
|
15
16
|
if (r.length < 2)
|
|
16
17
|
return console.error("Failed to render: invalid domain", r), null;
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const f = { ...{ top: 0, right: 0, bottom: 0, left: 0 }, ...g }, Y = M(r[0], r[1], n);
|
|
19
|
+
return /* @__PURE__ */ p(A, { children: [
|
|
20
|
+
h && /* @__PURE__ */ e(
|
|
21
|
+
j,
|
|
21
22
|
{
|
|
22
|
-
x1:
|
|
23
|
-
x2:
|
|
24
|
-
y1:
|
|
25
|
-
y2:
|
|
23
|
+
x1: t,
|
|
24
|
+
x2: t,
|
|
25
|
+
y1: i(r[0]) + f.top,
|
|
26
|
+
y2: i(r[1]) - f.bottom
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
n > 0 && /* @__PURE__ */
|
|
29
|
-
const
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */ s
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
x1: e - c,
|
|
35
|
-
x2: e,
|
|
36
|
-
y1: o,
|
|
37
|
-
y2: o
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ s(g, { x: e - c - 2, y: o, children: Y })
|
|
41
|
-
] }, u);
|
|
29
|
+
n > 0 && /* @__PURE__ */ e("g", { role: "list", "aria-labelledby": b, className: u, children: Y.map((l, m) => {
|
|
30
|
+
const s = i(l), o = t - c;
|
|
31
|
+
return /* @__PURE__ */ p("g", { role: "listitem", children: [
|
|
32
|
+
c > 0 && /* @__PURE__ */ e(k, { x1: o, x2: t, y1: s, y2: s }),
|
|
33
|
+
a ? a(l, o, s, m) : /* @__PURE__ */ e(F, { x: o, y: s, children: l })
|
|
34
|
+
] }, m);
|
|
42
35
|
}) })
|
|
43
36
|
] });
|
|
44
37
|
};
|
|
45
|
-
|
|
46
|
-
const
|
|
38
|
+
x.displayName = "Charts.YAxis";
|
|
39
|
+
const N = x;
|
|
47
40
|
export {
|
|
48
|
-
|
|
41
|
+
N as default
|
|
49
42
|
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -79,5 +79,24 @@
|
|
|
79
79
|
"visible": "Visible Light",
|
|
80
80
|
"infrared": "Infrared"
|
|
81
81
|
}
|
|
82
|
+
},
|
|
83
|
+
"supernova_three_vector": {
|
|
84
|
+
"histogram": {
|
|
85
|
+
"x_label": "Distance [kpc]",
|
|
86
|
+
"bar_label_one": "{{binMin}} to {{binMax}} kiloparsecs: {{count}} supernova",
|
|
87
|
+
"bar_label_other": "{{binMin}} to {{binMax}} kiloparsecs: {{count}} supernovae"
|
|
88
|
+
},
|
|
89
|
+
"slider": {
|
|
90
|
+
"label": "Select visible range",
|
|
91
|
+
"valueLabel": "{{value}} kiloparsecs"
|
|
92
|
+
},
|
|
93
|
+
"skymap": {
|
|
94
|
+
"description": "$t(supernova_three_vector.skymap.supernova_count, {\"count\": {{supernovaCount}}, \"min\": {{min}}, \"max\": {{max}}}) $t(supernova_three_vector.skymap.user_supernova_count, {\"count\": {{userObjectCount}}})",
|
|
95
|
+
"supernova_count_one": "Sky map projection showing {{count}} supernova between the distances of {{min}} and {{max}} kiloparsecs.",
|
|
96
|
+
"supernova_count_other": "Sky map projection showing {{count}} supernovae between the distances of {{min}} and {{max}} kiloparsecs.",
|
|
97
|
+
"user_supernova_count_zero": "None of your supernovae are visible.",
|
|
98
|
+
"user_supernova_count_one": "{{count}} of your supernovae is visible near {{coords}}.",
|
|
99
|
+
"user_supernova_count_other": "{{count}} of your supernovae are visible near {{coords}}."
|
|
100
|
+
}
|
|
82
101
|
}
|
|
83
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),m=require("react-i18next"),x=require("../../../atomic/Button/patterns/Reset.cjs"),b=require("./Export/index.cjs"),g=require("./styles.cjs"),c=require("../lib/utils.cjs"),p=n=>n.map(s=>{const{defaultValue:e,min:t,max:i}=s,r=e||1;return{...s,active:!1,color:"",brightness:c.getBrightnessValue(t,i,r),value:r}}),a=({actions:n,isDisabled:s,selectedData:e,selectionCallback:t,canvas:i})=>{const{t:r}=m.useTranslation(),{name:d,filters:f}=e,u=s||!c.areActionsActive(e);return l.jsx(g.Actions,{children:n.map(o=>{switch(o){case"reset":return l.jsx(x.default,{isDisabled:u,onResetCallback:()=>t&&t({...e,filters:p(f)})},o);case"export":return l.jsx(b.default,{isDisabled:u,canvas:i,filename:d,children:r("colorTool.actions.export")},o);case"save":return null;default:return null}})})};a.displayName="Widgets.ColorTool.Actions";const q=a;exports.default=q;
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as p } from "react-i18next";
|
|
4
|
+
import f from "../../../atomic/Button/patterns/Reset.js";
|
|
4
5
|
import d from "./Export/index.js";
|
|
5
6
|
import { Actions as A } from "./styles.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import { areActionsActive as x, getBrightnessValue as h } from "../lib/utils.js";
|
|
8
|
+
const b = (r) => r.map((s) => {
|
|
9
|
+
const { defaultValue: t, min: o, max: n } = s, e = t || 1;
|
|
10
|
+
return {
|
|
11
|
+
...s,
|
|
12
|
+
active: !1,
|
|
13
|
+
color: "",
|
|
14
|
+
brightness: h(o, n, e),
|
|
15
|
+
value: e
|
|
16
|
+
};
|
|
17
|
+
}), c = ({
|
|
18
|
+
actions: r,
|
|
19
|
+
isDisabled: s,
|
|
20
|
+
selectedData: t,
|
|
21
|
+
selectionCallback: o,
|
|
22
|
+
canvas: n
|
|
14
23
|
}) => {
|
|
15
|
-
const { t:
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
switch (
|
|
24
|
+
const { t: e } = p(), { name: m, filters: u } = t, a = s || !x(t);
|
|
25
|
+
return /* @__PURE__ */ l(A, { children: r.map((i) => {
|
|
26
|
+
switch (i) {
|
|
18
27
|
case "reset":
|
|
19
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ l(
|
|
20
29
|
f,
|
|
21
30
|
{
|
|
22
|
-
isDisabled:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
isDisabled: a,
|
|
32
|
+
onResetCallback: () => o && o({
|
|
33
|
+
...t,
|
|
34
|
+
filters: b(u)
|
|
35
|
+
})
|
|
26
36
|
},
|
|
27
|
-
|
|
37
|
+
i
|
|
28
38
|
);
|
|
29
39
|
case "export":
|
|
30
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ l(
|
|
31
41
|
d,
|
|
32
42
|
{
|
|
33
|
-
isDisabled:
|
|
34
|
-
canvas:
|
|
43
|
+
isDisabled: a,
|
|
44
|
+
canvas: n,
|
|
35
45
|
filename: m,
|
|
36
|
-
children:
|
|
46
|
+
children: e("colorTool.actions.export")
|
|
37
47
|
},
|
|
38
|
-
|
|
48
|
+
i
|
|
39
49
|
);
|
|
40
50
|
case "save":
|
|
41
51
|
return null;
|
|
@@ -44,8 +54,8 @@ const i = ({
|
|
|
44
54
|
}
|
|
45
55
|
}) });
|
|
46
56
|
};
|
|
47
|
-
|
|
48
|
-
const
|
|
57
|
+
c.displayName = "Widgets.ColorTool.Actions";
|
|
58
|
+
const $ = c;
|
|
49
59
|
export {
|
|
50
|
-
|
|
60
|
+
$ as default
|
|
51
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),q=require("@rubin-epo/epo-react-lib/SelectListbox"),v=require("../lib/utils.cjs"),S=require("react-i18next"),l=require("./styles.cjs"),T=e=>e&&e.__esModule?e:{default:e},I=T(q),d=({filter:e,colorOptions:a,isDisabled:r,onChangeFilterCallback:s,buttonLabelledById:u,selectLabelledById:h,sliderLabelledById:x})=>{const{t:b}=S.useTranslation(),{label:i,color:c="",value:m,active:n,min:g,max:j}=e,p=()=>s&&s({...e,active:!n}),y=t=>t&&s&&s({...e,color:t}),_=t=>s&&s({...e,brightness:v.getBrightnessValue(g,j,t),value:t}),f=b("colorTool.actions.select_filter");return o.jsxs(l.FilterContainer,{disabled:r,children:[o.jsxs(l.FilterLabel,{children:[o.jsx(l.HiddenCheckbox,{checked:n,type:"checkbox",onChange:p,"aria-describedby":u}),o.jsx(l.FilterToggle,{as:"span",children:i})]}),o.jsx(I.default,{placeholder:f,value:c,options:a,onChangeCallback:y,width:"100%",maxWidth:"100%",labelledById:h,isDisabled:!n||r}),o.jsx(l.Slider,{min:1,max:100,onChangeCallback:t=>typeof t=="number"&&_(t),isDisabled:!n||r,labelledbyId:x,value:m,label:i,color:c})]})};d.displayName="Widgets.ColorTool.FilterControls";const B=d;exports.default=B;
|
|
@@ -8,16 +8,16 @@ const d = ({
|
|
|
8
8
|
filter: t,
|
|
9
9
|
colorOptions: a,
|
|
10
10
|
isDisabled: r,
|
|
11
|
-
onChangeFilterCallback:
|
|
11
|
+
onChangeFilterCallback: o,
|
|
12
12
|
buttonLabelledById: m,
|
|
13
13
|
selectLabelledById: h,
|
|
14
14
|
sliderLabelledById: p
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: b } = I(), { label:
|
|
16
|
+
const { t: b } = I(), { label: n, color: i = "", value: x, active: s, min: g, max: u } = t, y = () => o && o({ ...t, active: !s }), f = (e) => e && o && o({ ...t, color: e }), T = (e) => o && o({
|
|
17
17
|
...t,
|
|
18
|
-
brightness: C(g, u,
|
|
19
|
-
value:
|
|
20
|
-
}),
|
|
18
|
+
brightness: C(g, u, e),
|
|
19
|
+
value: e
|
|
20
|
+
}), v = b("colorTool.actions.select_filter");
|
|
21
21
|
return /* @__PURE__ */ c(j, { disabled: r, children: [
|
|
22
22
|
/* @__PURE__ */ c(L, { children: [
|
|
23
23
|
/* @__PURE__ */ l(
|
|
@@ -29,13 +29,13 @@ const d = ({
|
|
|
29
29
|
"aria-describedby": m
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
|
-
/* @__PURE__ */ l(W, { as: "span", children:
|
|
32
|
+
/* @__PURE__ */ l(W, { as: "span", children: n })
|
|
33
33
|
] }),
|
|
34
34
|
/* @__PURE__ */ l(
|
|
35
35
|
B,
|
|
36
36
|
{
|
|
37
|
-
placeholder:
|
|
38
|
-
value:
|
|
37
|
+
placeholder: v,
|
|
38
|
+
value: i,
|
|
39
39
|
options: a,
|
|
40
40
|
onChangeCallback: f,
|
|
41
41
|
width: "100%",
|
|
@@ -49,12 +49,12 @@ const d = ({
|
|
|
49
49
|
{
|
|
50
50
|
min: 1,
|
|
51
51
|
max: 100,
|
|
52
|
-
onChangeCallback:
|
|
52
|
+
onChangeCallback: (e) => typeof e == "number" && T(e),
|
|
53
53
|
isDisabled: !s || r,
|
|
54
54
|
labelledbyId: p,
|
|
55
55
|
value: x,
|
|
56
|
-
label:
|
|
57
|
-
color:
|
|
56
|
+
label: n,
|
|
57
|
+
color: i
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
] });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),I=require("react"),M=require("react-i18next"),w=require("../../../charts/Base/index.cjs"),H=require("../../../charts/XAxis/index.cjs"),O=require("../../../charts/Guidelines/index.cjs"),R=require("../../../charts/YAxis/index.cjs"),k=require("../../../charts/Bars/index.cjs"),z=require("../../../charts/Tooltip/index.cjs"),A=require("../../../charts/styles.cjs"),B=require("../../../lib/utils.cjs"),E=require("./styles.cjs"),T=({data:c,margin:b,activeRange:x,xDomain:r,yDomain:n,xScale:o,yScale:i,yTicks:h,xTicks:j,step:p,width:_,height:L,className:$})=>{const{t:v}=M.useTranslation(),[u,q]=I.useState(),g=i(n[0]),f="xAxisLabel",d=typeof u=="number",a=c.map(({value:s,bin:e},l)=>({x:e,value:s,width:12,fill:B.between(e,x[0],x[1])?void 0:"#30E0E3",props:{"aria-label":v("supernova_three_vector.histogram.bar_label",{count:s,binMin:e,binMax:e+p}),onMouseOver:()=>q(l),onMouseOut:()=>q(void 0)}}));return t.jsxs(w.default,{minX:r[0],minY:n[0],width:_,height:L,className:$,horizontalLabel:v("supernova_three_vector.histogram.x_label")||void 0,horizontalLabelId:f,children:[t.jsx(R.default,{showBaseline:!1,x:o(r[0])-10,ticks:h,tickLength:0,labelRender:(s,e,l)=>t.jsx(E.YLabel,{x:e,y:l,children:s}),yDomain:n,yScale:i}),t.jsx(O.default,{guides:h,xDomain:r,xScale:o,yDomain:n,yScale:i,margin:b}),t.jsx(k.default,{data:a,xDomain:r,yDomain:n,xScale:o,yScale:i}),t.jsx(H.default,{ticks:j,y:g,labelledById:f,labelRender:(s,e,l)=>t.jsx(A.XLabel,{x:e,y:l+5,children:s}),xDomain:r,xScale:o,margin:b}),t.jsx(z.default,{x:d?o(c[u].bin):0,y:d?i(a[u].value):0,visible:d,children:d?a[u].value:null})]})},X=T;exports.default=X;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import { ChartMargin, Domain, HistogramData, ScaleFunction } from '../../../charts/types';
|
|
3
|
+
interface DistanceHistogramProps {
|
|
4
|
+
data: HistogramData;
|
|
5
|
+
activeRange: Array<number>;
|
|
6
|
+
margin: ChartMargin;
|
|
7
|
+
xDomain: Domain;
|
|
8
|
+
yDomain: Domain;
|
|
9
|
+
xScale: ScaleFunction;
|
|
10
|
+
yScale: ScaleFunction;
|
|
11
|
+
yTicks: number;
|
|
12
|
+
xTicks: number;
|
|
13
|
+
step: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const DistanceHistogram: FunctionComponent<DistanceHistogramProps>;
|
|
19
|
+
export default DistanceHistogram;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as B, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as M } from "react";
|
|
4
|
+
import { useTranslation as w } from "react-i18next";
|
|
5
|
+
import H from "../../../charts/Base/index.js";
|
|
6
|
+
import X from "../../../charts/XAxis/index.js";
|
|
7
|
+
import Y from "../../../charts/Guidelines/index.js";
|
|
8
|
+
import j from "../../../charts/YAxis/index.js";
|
|
9
|
+
import k from "../../../charts/Bars/index.js";
|
|
10
|
+
import z from "../../../charts/Tooltip/index.js";
|
|
11
|
+
import { XLabel as E } from "../../../charts/styles.js";
|
|
12
|
+
import { between as O } from "../../../lib/utils.js";
|
|
13
|
+
import { YLabel as R } from "./styles.js";
|
|
14
|
+
const T = ({
|
|
15
|
+
data: a,
|
|
16
|
+
margin: b,
|
|
17
|
+
activeRange: u,
|
|
18
|
+
xDomain: t,
|
|
19
|
+
yDomain: s,
|
|
20
|
+
xScale: i,
|
|
21
|
+
yScale: l,
|
|
22
|
+
yTicks: f,
|
|
23
|
+
xTicks: x,
|
|
24
|
+
step: L,
|
|
25
|
+
width: _,
|
|
26
|
+
height: I,
|
|
27
|
+
className: g
|
|
28
|
+
}) => {
|
|
29
|
+
const { t: h } = w(), [m, c] = M(), A = l(s[0]), v = "xAxisLabel", d = typeof m == "number", p = a.map(({ value: e, bin: o }, n) => ({
|
|
30
|
+
x: o,
|
|
31
|
+
value: e,
|
|
32
|
+
width: 12,
|
|
33
|
+
fill: O(o, u[0], u[1]) ? void 0 : "#30E0E3",
|
|
34
|
+
props: {
|
|
35
|
+
"aria-label": h("supernova_three_vector.histogram.bar_label", {
|
|
36
|
+
count: e,
|
|
37
|
+
binMin: o,
|
|
38
|
+
binMax: o + L
|
|
39
|
+
}),
|
|
40
|
+
onMouseOver: () => c(n),
|
|
41
|
+
onMouseOut: () => c(void 0)
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
return /* @__PURE__ */ B(
|
|
45
|
+
H,
|
|
46
|
+
{
|
|
47
|
+
minX: t[0],
|
|
48
|
+
minY: s[0],
|
|
49
|
+
width: _,
|
|
50
|
+
height: I,
|
|
51
|
+
className: g,
|
|
52
|
+
horizontalLabel: h("supernova_three_vector.histogram.x_label") || void 0,
|
|
53
|
+
horizontalLabelId: v,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ r(
|
|
56
|
+
j,
|
|
57
|
+
{
|
|
58
|
+
showBaseline: !1,
|
|
59
|
+
x: i(t[0]) - 10,
|
|
60
|
+
ticks: f,
|
|
61
|
+
tickLength: 0,
|
|
62
|
+
labelRender: (e, o, n) => /* @__PURE__ */ r(R, { x: o, y: n, children: e }),
|
|
63
|
+
yDomain: s,
|
|
64
|
+
yScale: l
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ r(
|
|
68
|
+
Y,
|
|
69
|
+
{
|
|
70
|
+
guides: f,
|
|
71
|
+
xDomain: t,
|
|
72
|
+
xScale: i,
|
|
73
|
+
yDomain: s,
|
|
74
|
+
yScale: l,
|
|
75
|
+
margin: b
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ r(k, { data: p, xDomain: t, yDomain: s, xScale: i, yScale: l }),
|
|
79
|
+
/* @__PURE__ */ r(
|
|
80
|
+
X,
|
|
81
|
+
{
|
|
82
|
+
ticks: x,
|
|
83
|
+
y: A,
|
|
84
|
+
labelledById: v,
|
|
85
|
+
labelRender: (e, o, n) => /* @__PURE__ */ r(E, { x: o, y: n + 5, children: e }),
|
|
86
|
+
xDomain: t,
|
|
87
|
+
xScale: i,
|
|
88
|
+
margin: b
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ r(
|
|
92
|
+
z,
|
|
93
|
+
{
|
|
94
|
+
x: d ? i(a[m].bin) : 0,
|
|
95
|
+
y: d ? l(p[m].value) : 0,
|
|
96
|
+
visible: d,
|
|
97
|
+
children: d ? p[m].value : null
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}, W = T;
|
|
104
|
+
export {
|
|
105
|
+
W as default
|
|
106
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),l=e=>e&&e.__esModule?e:{default:e},n=l(t),o=n.default.text`
|
|
2
|
+
dominant-baseline: text-before-edge;
|
|
3
|
+
font-size: 0.4em;
|
|
4
|
+
text-anchor: end;
|
|
5
|
+
`;exports.YLabel=o;
|