@rubin-epo/epo-widget-lib 0.9.8 → 0.9.9
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/CameraFilter.cjs +1 -1
- package/dist/CameraFilter.js +25 -24
- package/dist/Charts.cjs +1 -1
- package/dist/Charts.js +14 -12
- package/dist/ColorTool.cjs +1 -1
- package/dist/ColorTool.js +98 -103
- package/dist/FilterTool.cjs +1 -1
- package/dist/FilterTool.js +1 -1
- package/dist/SupernovaThreeVector.cjs +1 -1
- package/dist/SupernovaThreeVector.js +12 -12
- package/dist/atomic/PlaybackControl/PlaybackControl.d.ts +1 -2
- package/dist/charts/Bars/index.d.ts +1 -1
- package/dist/charts/Base/index.d.ts +1 -1
- package/dist/charts/Guidelines/index.cjs +1 -1
- package/dist/charts/Guidelines/index.d.ts +1 -1
- package/dist/charts/Guidelines/index.js +9 -9
- package/dist/charts/Points/ErrorBar.cjs +1 -0
- package/dist/charts/Points/ErrorBar.d.ts +9 -0
- package/dist/charts/Points/ErrorBar.js +119 -0
- package/dist/charts/Points/index.cjs +1 -1
- package/dist/charts/Points/index.d.ts +5 -11
- package/dist/charts/Points/index.js +44 -22
- package/dist/charts/ScatterPlot/index.cjs +1 -0
- package/dist/charts/ScatterPlot/index.d.ts +24 -0
- package/dist/charts/ScatterPlot/index.js +133 -0
- package/dist/charts/ScatterPlot/styles.cjs +22 -0
- package/dist/charts/ScatterPlot/styles.d.ts +16 -0
- package/dist/charts/ScatterPlot/styles.js +29 -0
- package/dist/charts/XAxis/index.d.ts +1 -1
- package/dist/charts/YAxis/index.d.ts +1 -1
- package/dist/charts/defaults.cjs +1 -0
- package/dist/charts/defaults.d.ts +22 -0
- package/dist/charts/defaults.js +23 -0
- package/dist/charts/hooks/useAxis.d.ts +1 -1
- package/dist/charts/index.d.ts +1 -0
- package/dist/hooks/useInterval.cjs +1 -1
- package/dist/hooks/useInterval.js +10 -10
- package/dist/hooks/useWindowSize.d.ts +4 -0
- package/dist/layout/AspectRatio/index.cjs +1 -0
- package/dist/layout/AspectRatio/index.d.ts +18 -0
- package/dist/layout/AspectRatio/index.js +24 -0
- package/dist/layout/AspectRatio/styles.cjs +16 -0
- package/dist/{widgets/ColorTool/Actions → layout/AspectRatio}/styles.d.ts +1 -1
- package/dist/layout/AspectRatio/styles.js +22 -0
- package/dist/layout/Controls/index.cjs +1 -0
- package/dist/layout/Controls/index.d.ts +10 -0
- package/dist/layout/Controls/index.js +31 -0
- package/dist/layout/Controls/styles.cjs +63 -0
- package/dist/{widgets/ColorTool → layout/Controls}/styles.d.ts +604 -332
- package/dist/layout/Controls/styles.js +75 -0
- package/dist/lib/reimg.cjs +1 -1
- package/dist/lib/reimg.d.ts +2 -2
- package/dist/lib/reimg.js +30 -31
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs +1 -1
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js +1 -1
- package/dist/widgets/CameraFilter/styles.cjs +24 -20
- package/dist/widgets/CameraFilter/styles.js +36 -32
- package/dist/widgets/ColorTool/Actions/index.cjs +1 -1
- package/dist/widgets/ColorTool/Actions/index.js +24 -25
- package/dist/widgets/ColorTool/FilterControls/styles.cjs +4 -4
- package/dist/widgets/ColorTool/FilterControls/styles.d.ts +1252 -0
- package/dist/widgets/ColorTool/FilterControls/styles.js +1 -1
- package/dist/widgets/ColorTool/ImageComposite/ImageComposite.cjs +1 -1
- package/dist/widgets/ColorTool/ImageComposite/ImageComposite.js +26 -29
- package/dist/widgets/ColorTool/ImageComposite/styles.cjs +5 -3
- package/dist/widgets/ColorTool/ImageComposite/styles.js +4 -2
- package/dist/widgets/ColorTool/styles.cjs +10 -24
- package/dist/widgets/ColorTool/styles.js +15 -29
- package/dist/widgets/FilterTool/FilterTool.d.ts +1 -1
- package/dist/widgets/FilterTool/styles.cjs +9 -9
- package/dist/widgets/FilterTool/styles.d.ts +6 -269
- package/dist/widgets/FilterTool/styles.js +17 -16
- package/dist/widgets/LightCurvePlot/Plot/index.cjs +1 -0
- package/dist/widgets/LightCurvePlot/Plot/index.d.ts +12 -0
- package/dist/widgets/LightCurvePlot/Plot/index.js +99 -0
- package/dist/widgets/LightCurvePlot/{ScatterPlot → Plot}/styles.cjs +4 -4
- package/dist/widgets/LightCurvePlot/{ScatterPlot → Plot}/styles.js +7 -6
- package/dist/widgets/LightCurvePlot/PlotWithCurve/A11Y/LightCurveLabel/index.cjs +1 -0
- package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/index.d.ts +2 -2
- package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/index.js +2 -2
- package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/index.cjs +1 -0
- package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/index.js +2 -2
- package/dist/widgets/LightCurvePlot/PlotWithCurve/LightCurve/index.cjs +1 -0
- package/dist/widgets/LightCurvePlot/{LightCurve → PlotWithCurve/LightCurve}/index.d.ts +1 -1
- package/dist/widgets/LightCurvePlot/{LightCurve → PlotWithCurve/LightCurve}/index.js +1 -1
- package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/index.d.ts +0 -2
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +132 -119
- package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.cjs +9 -11
- package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.js +13 -16
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.d.ts +2 -2
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.js +17 -15
- package/dist/widgets/LightCurvePlot/helpers.cjs +1 -1
- package/dist/widgets/LightCurvePlot/helpers.d.ts +3 -12
- package/dist/widgets/LightCurvePlot/helpers.js +33 -18
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +53 -60
- package/dist/widgets/SupernovaThreeVector/Histogram/index.d.ts +1 -1
- package/dist/widgets/SupernovaThreeVector/index.d.ts +1 -1
- package/dist/widgets/SupernovaThreeVector/styles.cjs +10 -10
- package/dist/widgets/SupernovaThreeVector/styles.js +23 -22
- package/package.json +1 -1
- package/dist/styles/svg.cjs +0 -8
- package/dist/styles/svg.js +0 -13
- package/dist/widgets/ColorTool/Actions/styles.cjs +0 -5
- package/dist/widgets/ColorTool/Actions/styles.js +0 -10
- package/dist/widgets/LightCurvePlot/A11Y/LightCurveLabel/index.cjs +0 -1
- package/dist/widgets/LightCurvePlot/DM15Display/index.cjs +0 -1
- package/dist/widgets/LightCurvePlot/LightCurve/index.cjs +0 -1
- package/dist/widgets/LightCurvePlot/Point/index.cjs +0 -1
- package/dist/widgets/LightCurvePlot/Point/index.d.ts +0 -11
- package/dist/widgets/LightCurvePlot/Point/index.js +0 -68
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.cjs +0 -1
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.d.ts +0 -12
- package/dist/widgets/LightCurvePlot/ScatterPlot/index.js +0 -178
- /package/dist/widgets/LightCurvePlot/{ScatterPlot → Plot}/styles.d.ts +0 -0
- /package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/styles.cjs +0 -0
- /package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/styles.d.ts +0 -0
- /package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/styles.js +0 -0
- /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/index.d.ts +0 -0
- /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/styles.cjs +0 -0
- /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/styles.d.ts +0 -0
- /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/styles.js +0 -0
- /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/index.cjs +0 -0
- /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/index.js +0 -0
- /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/styles.cjs +0 -0
- /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/styles.js +0 -0
package/dist/CameraFilter.cjs
CHANGED
|
@@ -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 e=require("react/jsx-runtime"),q=require("react"),v=require("@rubin-epo/epo-react-lib/SelectListbox"),y=require("@rubin-epo/epo-react-lib/styles"),S=require("react-i18next"),C=require("use-resize-observer"),r=require("./widgets/CameraFilter/data.cjs"),l=require("./widgets/CameraFilter/styles.cjs"),R=require("./layout/AspectRatio/index.cjs"),L=require("./widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.cjs"),M=require("./widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs"),x=i=>i&&i.__esModule?i:{default:i},O=x(v),T=x(C),h=()=>{const{t:i}=S.useTranslation(),{ref:j,width:m=1}=T.default(),[o,p]=q.useState(null),{BREAK_TABLET:b}=y.tokens,s=m<parseInt(b),{[s?"condensed":"default"]:{min:c,max:g,range:n}}=r.rangeConfig,d=r.filters[0].range[0],u=r.filters[r.filters.length-1].range[1]-d,f=r.filters.filter(({band:t})=>t),F=[{value:"none",label:i("camera_filter.labels.option",{context:"none"})}].concat(f.map(({band:t})=>({value:t,label:i("camera_filter.labels.option",{band:t})}))),_=r.filters.find(({band:t})=>t===o);return e.jsx(R.default,{ratio:"landscape",children:e.jsxs(l.FilterContainer,{ref:j,children:[e.jsx(l.FilterTitle,{children:i("camera_filter.title")}),s&&e.jsx(L.default,{filters:f,min:c,spectrumRange:n}),e.jsxs(l.FilterTable,{style:{"--filter-table-margin-inline-start":`${((d-c)/n*100).toFixed(2)}%`,"--filter-table-width":`${(u/n*100).toFixed(2)}%`},"data-testid":"expanded-filters",children:[e.jsx("colgroup",{children:r.filters.map(({range:t})=>e.jsx("col",{style:{width:`${(t[1]-t[0])/u*100}%`}},t.join("")))}),e.jsx(l.FilterNames,{children:e.jsx("tr",{children:r.filters.map(({band:t},a)=>e.jsx(l.FilterName,{id:`${t}-name`,style:{"--filter-name-border":t?"solid #b2b2b2":"none"},scope:"col","aria-hidden":!t,children:t},a))})}),!s&&e.jsx(l.FilterRanges,{children:e.jsx("tr",{children:r.filters.map(({band:t,range:a})=>e.jsx(l.FilterRange,{"aria-hidden":!t,children:t&&e.jsxs(e.Fragment,{children:[a.join("–"),e.jsx("br",{}),e.jsx(l.Wavelength,{children:"nm"})]})},a.join()))})})]}),e.jsx(M.default,{min:c,max:g,range:n,isCondensed:s,activeFilter:_}),e.jsxs(l.SelectContainer,{children:[e.jsx(l.SelectLabel,{id:"filterSelectLabel",children:i("camera_filter.labels.select")}),e.jsx(O.default,{options:F,value:o,onChangeCallback:t=>p(t),width:"100%",maxWidth:"100%",labelledById:"filterSelectLabel"})]})]})})};h.displayName="Widgets.CameraFilter";exports.default=h;
|
package/dist/CameraFilter.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as t, jsxs as o, Fragment as C } from "react/jsx-runtime";
|
|
3
3
|
import { useState as v } from "react";
|
|
4
|
-
import
|
|
5
|
-
import { tokens as
|
|
4
|
+
import R from "@rubin-epo/epo-react-lib/SelectListbox";
|
|
5
|
+
import { tokens as y } from "@rubin-epo/epo-react-lib/styles";
|
|
6
6
|
import { useTranslation as S } from "react-i18next";
|
|
7
7
|
import j from "use-resize-observer";
|
|
8
8
|
import { filters as i, rangeConfig as B } from "./widgets/CameraFilter/data.js";
|
|
9
|
-
import { FilterContainer as L, FilterTitle as T, FilterTable as _, FilterNames as w, FilterName as
|
|
10
|
-
import k from "./
|
|
11
|
-
import E from "./widgets/CameraFilter/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { FilterContainer as L, FilterTitle as T, FilterTable as _, FilterNames as w, FilterName as A, FilterRanges as O, FilterRange as $, Wavelength as M, SelectContainer as N, SelectLabel as W } from "./widgets/CameraFilter/styles.js";
|
|
10
|
+
import k from "./layout/AspectRatio/index.js";
|
|
11
|
+
import E from "./widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.js";
|
|
12
|
+
import I from "./widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js";
|
|
13
|
+
const z = () => {
|
|
14
|
+
const { t: r } = S(), { ref: p, width: h = 1 } = j(), [c, F] = v(null), { BREAK_TABLET: b } = y, l = h < parseInt(b), {
|
|
15
|
+
[l ? "condensed" : "default"]: { min: s, max: g, range: n }
|
|
15
16
|
} = B, d = i[0].range[0], m = i[i.length - 1].range[1] - d, f = i.filter(({ band: e }) => e), u = [{
|
|
16
17
|
value: "none",
|
|
17
|
-
label:
|
|
18
|
+
label: r("camera_filter.labels.option", { context: "none" })
|
|
18
19
|
}].concat(
|
|
19
20
|
f.map(({ band: e }) => ({
|
|
20
21
|
value: e,
|
|
21
|
-
label:
|
|
22
|
+
label: r("camera_filter.labels.option", { band: e })
|
|
22
23
|
}))
|
|
23
24
|
), x = i.find(({ band: e }) => e === c);
|
|
24
|
-
return /* @__PURE__ */ o(L, { ref: p, children: [
|
|
25
|
-
/* @__PURE__ */ t(T, { children:
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
return /* @__PURE__ */ t(k, { ratio: "landscape", children: /* @__PURE__ */ o(L, { ref: p, children: [
|
|
26
|
+
/* @__PURE__ */ t(T, { children: r("camera_filter.title") }),
|
|
27
|
+
l && /* @__PURE__ */ t(
|
|
28
|
+
E,
|
|
28
29
|
{
|
|
29
30
|
filters: f,
|
|
30
31
|
min: s,
|
|
@@ -50,7 +51,7 @@ const I = () => {
|
|
|
50
51
|
e.join("")
|
|
51
52
|
)) }),
|
|
52
53
|
/* @__PURE__ */ t(w, { children: /* @__PURE__ */ t("tr", { children: i.map(({ band: e }, a) => /* @__PURE__ */ t(
|
|
53
|
-
|
|
54
|
+
A,
|
|
54
55
|
{
|
|
55
56
|
id: `${e}-name`,
|
|
56
57
|
style: {
|
|
@@ -62,7 +63,7 @@ const I = () => {
|
|
|
62
63
|
},
|
|
63
64
|
a
|
|
64
65
|
)) }) }),
|
|
65
|
-
!
|
|
66
|
+
!l && /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t("tr", { children: i.map(({ band: e, range: a }) => /* @__PURE__ */ t($, { "aria-hidden": !e, children: e && /* @__PURE__ */ o(C, { children: [
|
|
66
67
|
a.join("–"),
|
|
67
68
|
/* @__PURE__ */ t("br", {}),
|
|
68
69
|
/* @__PURE__ */ t(M, { children: "nm" })
|
|
@@ -71,19 +72,19 @@ const I = () => {
|
|
|
71
72
|
}
|
|
72
73
|
),
|
|
73
74
|
/* @__PURE__ */ t(
|
|
74
|
-
|
|
75
|
+
I,
|
|
75
76
|
{
|
|
76
77
|
min: s,
|
|
77
78
|
max: g,
|
|
78
79
|
range: n,
|
|
79
|
-
isCondensed:
|
|
80
|
+
isCondensed: l,
|
|
80
81
|
activeFilter: x
|
|
81
82
|
}
|
|
82
83
|
),
|
|
83
84
|
/* @__PURE__ */ o(N, { children: [
|
|
84
|
-
/* @__PURE__ */ t(W, { id: "filterSelectLabel", children:
|
|
85
|
+
/* @__PURE__ */ t(W, { id: "filterSelectLabel", children: r("camera_filter.labels.select") }),
|
|
85
86
|
/* @__PURE__ */ t(
|
|
86
|
-
|
|
87
|
+
R,
|
|
87
88
|
{
|
|
88
89
|
options: u,
|
|
89
90
|
value: c,
|
|
@@ -94,9 +95,9 @@ const I = () => {
|
|
|
94
95
|
}
|
|
95
96
|
)
|
|
96
97
|
] })
|
|
97
|
-
] });
|
|
98
|
+
] }) });
|
|
98
99
|
};
|
|
99
|
-
|
|
100
|
+
z.displayName = "Widgets.CameraFilter";
|
|
100
101
|
export {
|
|
101
|
-
|
|
102
|
+
z as default
|
|
102
103
|
};
|
package/dist/Charts.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts/Base/index.cjs"),i=require("./charts/XAxis/index.cjs"),t=require("./charts/YAxis/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts/Base/index.cjs"),i=require("./charts/XAxis/index.cjs"),t=require("./charts/YAxis/index.cjs"),r=require("./charts/Guidelines/index.cjs"),n=require("./charts/Points/index.cjs"),u=require("./charts/Tooltip/index.cjs"),d=require("./charts/ClippingContainer/index.cjs"),o=require("./charts/Bars/index.cjs"),s=require("./charts/Viewport/index.cjs"),a=require("./charts/ForeignObject/index.cjs"),l=require("./charts/ScatterPlot/index.cjs");exports.Base=e.default;exports.XAxis=i.default;exports.YAxis=t.default;exports.Guidelines=r.default;exports.Points=n.default;exports.Tooltip=u.default;exports.ClippingContainer=d.default;exports.Bars=o.default;exports.Viewport=s.default;exports.ForeignObject=a.default;exports.ScatterPlot=l.default;
|
package/dist/Charts.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as o } from "./charts/Base/index.js";
|
|
2
2
|
import { default as a } from "./charts/XAxis/index.js";
|
|
3
3
|
import { default as s } from "./charts/YAxis/index.js";
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as p } from "./charts/Guidelines/index.js";
|
|
5
5
|
import { default as d } from "./charts/Points/index.js";
|
|
6
|
-
import { default as
|
|
6
|
+
import { default as i } from "./charts/Tooltip/index.js";
|
|
7
7
|
import { default as n } from "./charts/ClippingContainer/index.js";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
8
|
+
import { default as g } from "./charts/Bars/index.js";
|
|
9
|
+
import { default as B } from "./charts/Viewport/index.js";
|
|
10
|
+
import { default as P } from "./charts/ForeignObject/index.js";
|
|
11
|
+
import { default as j } from "./charts/ScatterPlot/index.js";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
g as Bars,
|
|
14
|
+
o as Base,
|
|
14
15
|
n as ClippingContainer,
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
P as ForeignObject,
|
|
17
|
+
p as Guidelines,
|
|
17
18
|
d as Points,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
j as ScatterPlot,
|
|
20
|
+
i as Tooltip,
|
|
21
|
+
B as Viewport,
|
|
20
22
|
a as XAxis,
|
|
21
23
|
s as YAxis
|
|
22
24
|
};
|
package/dist/ColorTool.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("react"),H=require("react-i18next"),N=require("./widgets/ColorTool/lib/utils.cjs"),o=require("./widgets/ColorTool/styles.cjs"),R=require("@rubin-epo/epo-react-lib/SelectListbox"),W=require("./widgets/ColorTool/Actions/index.cjs"),v=require("./layout/AspectRatio/index.cjs"),y=require("./widgets/ColorTool/ImageComposite/ImageComposite.cjs"),D=require("./widgets/ColorTool/FilterControls/FilterControls.cjs"),P=l=>l&&l.__esModule?l:{default:l},$=P(R),T=({data:l,objectOptions:p=[],selectedData:a,colorOptions:L=[],selectionCallback:s,isDisabled:c=!1,isDisplayOnly:q=!1,className:S,config:_={actions:["reset"],width:600,height:600,hideSubtitle:!1}})=>{const C={actions:["reset"],width:600,height:600,hideSubtitle:!1},d=m.useRef(null),{t:i}=H.useTranslation(),{filters:r,name:n}=a,{actions:F,width:u,height:h,hideSubtitle:w}={...C,..._},j=r.map(({image:t})=>({url:t,width:u,height:h}));if(q)return e.jsx(v.default,{ratio:"square",children:e.jsx(y.default,{ref:d,isDisplayOnly:!0,filters:r,width:u,height:h,selectedObjectName:n,className:S,images:j})});const I=t=>{const{label:f}=t,{filters:b}=a,M=b.map(g=>g.label===f?t:g);return s&&s({...a,filters:M})},O=t=>{if(t)return s&&s({name:t,filters:N.getDataFiltersByName(l,t)})},x=l.length>1,B=i("colorTool.actions.select_an_object");return e.jsx(o.WidgetLayout,{widget:e.jsx(y.default,{ref:d,filters:r,width:u,height:h,selectedObjectName:n,images:j,children:x&&e.jsx(o.SelectionContainer,{children:e.jsx($.default,{id:"astroObjectSelector",placeholder:B,options:p,onChangeCallback:O,value:n,isDisabled:c,width:"100%",maxWidth:"100%"})})}),controls:e.jsxs(o.ControlsContainer,{children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(o.ToolsHeader,{id:"filterLabel",children:i("colorTool.labels.filter")}),e.jsx(o.ToolsHeader,{id:"colorLabel",children:i("colorTool.labels.color")}),e.jsx(o.ToolsHeader,{id:"intensityLabel",children:i("colorTool.labels.color_intensity")})]}),r&&r.map(t=>{const{label:f,isDisabled:b}=t;return m.createElement(D.default,{filter:t,colorOptions:L,key:`filter-${f}`,isDisabled:c||b,onChangeFilterCallback:I,buttonLabelledById:"filterLabel",selectLabelledById:"colorLabel",sliderLabelledById:"intensityLabel"})})]}),actions:e.jsx(W.default,{actions:F,canvas:d.current,selectedData:a,isDisabled:c,selectionCallback:s}),caption:n&&x&&e.jsx(o.Title,{children:!w&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:i("colorTool.labels.object")}),e.jsx("dd",{children:n})]})})})};T.displayName="Widgets.ColorTool";exports.default=T;
|
package/dist/ColorTool.js
CHANGED
|
@@ -1,139 +1,134 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useTranslation as
|
|
2
|
+
import { jsx as e, jsxs as f, Fragment as L } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as _, createElement as A } from "react";
|
|
4
|
+
import { useTranslation as q } from "react-i18next";
|
|
5
5
|
import { getDataFiltersByName as D } from "./widgets/ColorTool/lib/utils.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { WidgetLayout as E, SelectionContainer as H, ControlsContainer as M, ToolsHeader as b, Title as P } from "./widgets/ColorTool/styles.js";
|
|
7
|
+
import $ from "@rubin-epo/epo-react-lib/SelectListbox";
|
|
8
|
+
import v from "./widgets/ColorTool/Actions/index.js";
|
|
9
|
+
import z from "./layout/AspectRatio/index.js";
|
|
9
10
|
import T from "./widgets/ColorTool/ImageComposite/ImageComposite.js";
|
|
10
11
|
import G from "./widgets/ColorTool/FilterControls/FilterControls.js";
|
|
11
12
|
const J = ({
|
|
12
13
|
data: p,
|
|
13
|
-
objectOptions:
|
|
14
|
-
selectedData:
|
|
15
|
-
colorOptions:
|
|
16
|
-
selectionCallback:
|
|
17
|
-
isDisabled:
|
|
14
|
+
objectOptions: C = [],
|
|
15
|
+
selectedData: n,
|
|
16
|
+
colorOptions: j = [],
|
|
17
|
+
selectionCallback: l,
|
|
18
|
+
isDisabled: s = !1,
|
|
18
19
|
isDisplayOnly: S = !1,
|
|
19
|
-
className:
|
|
20
|
-
config:
|
|
20
|
+
className: F,
|
|
21
|
+
config: w = {
|
|
21
22
|
actions: ["reset"],
|
|
22
23
|
width: 600,
|
|
23
24
|
height: 600,
|
|
24
25
|
hideSubtitle: !1
|
|
25
26
|
}
|
|
26
27
|
}) => {
|
|
27
|
-
const
|
|
28
|
+
const x = {
|
|
28
29
|
actions: ["reset"],
|
|
29
30
|
width: 600,
|
|
30
31
|
height: 600,
|
|
31
32
|
hideSubtitle: !1
|
|
32
|
-
},
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
},
|
|
33
|
+
}, a = _(null), { t: r } = q(), { filters: o, name: i } = n, { actions: B, width: c, height: d, hideSubtitle: I } = {
|
|
34
|
+
...x,
|
|
35
|
+
...w
|
|
36
|
+
}, u = o.map(({ image: t }) => ({ url: t, width: c, height: d }));
|
|
36
37
|
if (S)
|
|
37
|
-
return /* @__PURE__ */ e(
|
|
38
|
+
return /* @__PURE__ */ e(z, { ratio: "square", children: /* @__PURE__ */ e(
|
|
38
39
|
T,
|
|
39
40
|
{
|
|
40
|
-
ref:
|
|
41
|
+
ref: a,
|
|
41
42
|
isDisplayOnly: !0,
|
|
42
43
|
filters: o,
|
|
43
|
-
width:
|
|
44
|
-
height:
|
|
45
|
-
selectedObjectName:
|
|
46
|
-
className:
|
|
47
|
-
images:
|
|
44
|
+
width: c,
|
|
45
|
+
height: d,
|
|
46
|
+
selectedObjectName: i,
|
|
47
|
+
className: F,
|
|
48
|
+
images: u
|
|
48
49
|
}
|
|
49
|
-
);
|
|
50
|
+
) });
|
|
50
51
|
const O = (t) => {
|
|
51
|
-
const { label:
|
|
52
|
-
(
|
|
52
|
+
const { label: h } = t, { filters: m } = n, W = m.map(
|
|
53
|
+
(y) => y.label === h ? t : y
|
|
53
54
|
);
|
|
54
|
-
return
|
|
55
|
-
...
|
|
56
|
-
filters:
|
|
55
|
+
return l && l({
|
|
56
|
+
...n,
|
|
57
|
+
filters: W
|
|
57
58
|
});
|
|
58
|
-
},
|
|
59
|
+
}, N = (t) => {
|
|
59
60
|
if (t)
|
|
60
|
-
return
|
|
61
|
+
return l && l({
|
|
61
62
|
name: t,
|
|
62
63
|
filters: D(p, t)
|
|
63
64
|
});
|
|
64
|
-
},
|
|
65
|
-
return /* @__PURE__ */ e(
|
|
66
|
-
|
|
65
|
+
}, g = p.length > 1, R = r("colorTool.actions.select_an_object");
|
|
66
|
+
return /* @__PURE__ */ e(
|
|
67
|
+
E,
|
|
67
68
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
);
|
|
98
|
-
})
|
|
69
|
+
widget: /* @__PURE__ */ e(
|
|
70
|
+
T,
|
|
71
|
+
{
|
|
72
|
+
ref: a,
|
|
73
|
+
filters: o,
|
|
74
|
+
width: c,
|
|
75
|
+
height: d,
|
|
76
|
+
selectedObjectName: i,
|
|
77
|
+
images: u,
|
|
78
|
+
children: g && /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
|
79
|
+
$,
|
|
80
|
+
{
|
|
81
|
+
id: "astroObjectSelector",
|
|
82
|
+
placeholder: R,
|
|
83
|
+
options: C,
|
|
84
|
+
onChangeCallback: N,
|
|
85
|
+
value: i,
|
|
86
|
+
isDisabled: s,
|
|
87
|
+
width: "100%",
|
|
88
|
+
maxWidth: "100%"
|
|
89
|
+
}
|
|
90
|
+
) })
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
controls: /* @__PURE__ */ f(M, { children: [
|
|
94
|
+
o && /* @__PURE__ */ f(L, { children: [
|
|
95
|
+
/* @__PURE__ */ e(b, { id: "filterLabel", children: r("colorTool.labels.filter") }),
|
|
96
|
+
/* @__PURE__ */ e(b, { id: "colorLabel", children: r("colorTool.labels.color") }),
|
|
97
|
+
/* @__PURE__ */ e(b, { id: "intensityLabel", children: r("colorTool.labels.color_intensity") })
|
|
99
98
|
] }),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
selectionCallback: i
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
]
|
|
99
|
+
o && o.map((t) => {
|
|
100
|
+
const { label: h, isDisabled: m } = t;
|
|
101
|
+
return /* @__PURE__ */ A(
|
|
102
|
+
G,
|
|
103
|
+
{
|
|
104
|
+
filter: t,
|
|
105
|
+
colorOptions: j,
|
|
106
|
+
key: `filter-${h}`,
|
|
107
|
+
isDisabled: s || m,
|
|
108
|
+
onChangeFilterCallback: O,
|
|
109
|
+
buttonLabelledById: "filterLabel",
|
|
110
|
+
selectLabelledById: "colorLabel",
|
|
111
|
+
sliderLabelledById: "intensityLabel"
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
})
|
|
115
|
+
] }),
|
|
116
|
+
actions: /* @__PURE__ */ e(
|
|
117
|
+
v,
|
|
118
|
+
{
|
|
119
|
+
actions: B,
|
|
120
|
+
canvas: a.current,
|
|
121
|
+
selectedData: n,
|
|
122
|
+
isDisabled: s,
|
|
123
|
+
selectionCallback: l
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
caption: i && g && /* @__PURE__ */ e(P, { children: !I && /* @__PURE__ */ f(L, { children: [
|
|
127
|
+
/* @__PURE__ */ e("dt", { children: r("colorTool.labels.object") }),
|
|
128
|
+
/* @__PURE__ */ e("dd", { children: i })
|
|
129
|
+
] }) })
|
|
135
130
|
}
|
|
136
|
-
)
|
|
131
|
+
);
|
|
137
132
|
};
|
|
138
133
|
J.displayName = "Widgets.ColorTool";
|
|
139
134
|
export {
|
package/dist/FilterTool.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),i=require("react-i18next"),m=require("@rubin-epo/epo-react-lib/SelectListbox"),_=require("@rubin-epo/epo-react-lib/ColorSwatch"),r=require("./widgets/FilterTool/styles.cjs"),d=e=>e&&e.__esModule?e:{default:e},b=d(m),C=d(_),j=({selectedColor:e="none",selectionCallback:f,isDisabled:c=!1,id:h,labelledById:u})=>{const{t:l}=i.useTranslation(),t={violet:"#861cff",blue:"#0019ff",green:"#6bd853",yellow:"#ffdd15",orange:"#f18922",red:"#ec1c24",none:"transparent"},p={violet:"M546.1,312.5l212.8,1.9h0.4l0.5,0.2L1396,522.8c6.9,2.3,10.7,9.7,8.5,16.7s-9.7,10.7-16.7,8.5l0,0l-0.4-0.1L757.8,320.4l0.9,0.2L546.1,312.5z",blue:"M546.1,312.4l206.5-4.4h0.4l0.4,0.1l641.1,164c7,1.8,11.2,8.9,9.4,15.9c-1.8,7-8.9,11.2-15.9,9.4l-0.4-0.1L751.8,313.8l0.8,0.1L546.1,312.4z",green:"M547.8,312l200.6-10.6h0.3l0.4,0.1l644.8,120.3c7,1.4,11.5,8.2,10.1,15.2c-1.4,6.9-8,11.4-14.9,10.2l-0.4-0.1L747.8,307.4l0.7,0.1L547.8,312z",yellow:"M546.1,312.5l205.8-17.3h0.3h0.4l640.4,75.3c7.1,0.8,12.2,7.2,11.3,14.3c-0.8,7.1-7.2,12.2-14.3,11.3l-0.4-0.1l-637.9-94.5h0.6L546.1,312.5z",orange:"M546.1,311l189.3-21.8h0.2h0.3l656.5,33.3c7,0.4,12.4,6.3,12,13.3s-6.3,12.4-13.3,12h-0.4l-655.2-52.9h0.5L546.1,311z",red:"M546.1,311L730,283.9h0.1h0.2l661.4-9.9c6.9-0.1,12.6,5.4,12.7,12.3s-5.4,12.6-12.3,12.7h-0.4l-661.4-9.8h0.4L546.1,311z"},n={violet:[[1426.5,547.9],[1353.2,550.6],[1377.9,530.1],[1372.3,498.5]],blue:[[1431.5,496.4],[1358.6,504.1],[1381.8,482],[1374.1,450.9]],green:[[1437.9,443.4],[1366.1,458.4],[1387,434.1],[1376.2,403.9]],yellow:[[1438.9,389.7],[1368,408.2],[1387.6,382.8],[1375.4,353.3]],orange:[[1443.7,340.3],[1373.9,362.8],[1392.1,336.4],[1378.2,307.5]],red:[[1441.9,290],[1372.4,313.2],[1390.3,286.6],[1376.1,257.9]]},g=Object.keys(t).map(s=>({value:s,label:l(`filterTool.colors.${s}`),icon:o.jsx(C.default,{color:s,size:"small"})})),x=s=>e!==s&&e!=="none",y=l("filterTool.selectLabel"),a=e==="none";return o.jsxs(r.Wrapper,{children:[o.jsxs(r.PrismSVG,{version:"1.1",viewBox:"0 0 1551.6 736.7","aria-labelledby":u,children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"no-arrow-red",children:[o.jsx("stop",{offset:"0%",stopColor:t.red}),o.jsx("stop",{offset:"81%",stopColor:t.red}),o.jsx("stop",{offset:"81%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-orange",children:[o.jsx("stop",{offset:"0%",stopColor:t.orange}),o.jsx("stop",{offset:"80%",stopColor:t.orange}),o.jsx("stop",{offset:"80%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-yellow",children:[o.jsx("stop",{offset:"0%",stopColor:t.yellow}),o.jsx("stop",{offset:"79%",stopColor:t.yellow}),o.jsx("stop",{offset:"79%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-green",children:[o.jsx("stop",{offset:"0%",stopColor:t.green}),o.jsx("stop",{offset:"78%",stopColor:t.green}),o.jsx("stop",{offset:"78%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-blue",children:[o.jsx("stop",{offset:"0%",stopColor:t.blue}),o.jsx("stop",{offset:"77%",stopColor:t.blue}),o.jsx("stop",{offset:"77%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-violet",children:[o.jsx("stop",{offset:"0%",stopColor:t.violet}),o.jsx("stop",{offset:"77%",stopColor:t.violet}),o.jsx("stop",{offset:"77%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]})]}),o.jsxs("radialGradient",{id:"gradient_1_",cx:"718.4264",cy:"-294.6529",r:"417.8",fx:"638.9412",fy:"-303.5418",gradientTransform:"matrix(1 0 0 1 0 534)",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.12",style:{stopColor:"#FFFFFF"}}),o.jsx("stop",{offset:"1",style:{stopColor:"#000000"}})]}),o.jsxs("g",{children:[o.jsx(r.WhiteLine,{id:"white_ray",x1:"108.2",y1:"463.3",x2:"546.1",y2:"312.5"}),o.jsx(r.WhiteLine,{id:"white_light_arrow_line",x1:"376.8",y1:"327.9",x2:"430",y2:"309.6"}),o.jsx("polygon",{id:"white_light_arrow",points:"420.7,325.4 428.1,310.3 413,302.9 422.5,299.7 437.6,307 430.2,322.1",fill:"#ffffff"}),o.jsx("text",{transform:"matrix(0.9446 -0.3282 0.3282 0.9446 152.0965 417.697)",fill:"#ffffff",children:o.jsx(i.Trans,{i18nKey:"filterTool.whiteLight"})})]}),o.jsxs("g",{children:[o.jsx("text",{transform:"matrix(1 0 0 1 598.2964 606.0872)",fill:"#ffffff",children:o.jsx(i.Trans,{i18nKey:"filterTool.prism"})}),o.jsx("polygon",{id:"gradient",points:"653.2,127 867.4,498 438.9,498",fill:"url(#gradient_1_)",style:{opacity:.3}})]}),o.jsx(r.PrismOutline,{id:"outline",points:"653.2,127 760.3,312.5 867.4,498 653.2,498 438.9,498 546.1,312.5 "}),o.jsx("g",{role:"list",id:"rays_out","aria-label":l("filterTool.light_out"),children:Object.keys(p).map(s=>o.jsx(r.Ray,{id:`${s}_ray`,style:{"--ray-fill":x(s)?`url(#no-arrow-${s})`:t[s]},d:p[s],role:"listitem","aria-label":l(`filterTool.colors.${s}`)},s))}),o.jsxs("g",{children:[o.jsx("text",{transform:"matrix(1 0 0 1 1206.5464 164.1372)",fill:"#ffffff",children:o.jsx(i.Trans,{i18nKey:"filterTool.filter"})}),o.jsx(r.Filter,{id:"filter",x1:"1255.6",y1:"235.7",x2:"1193.1",y2:"550.3",stroke:t[e],fill:"#ffffff","aria-label":l(`filterTool.colors.${e}`)})]}),o.jsxs("g",{role:"list",id:"rays_filtered","aria-label":l("filterTool.light_filtered"),children:[Object.keys(n).map(s=>o.jsx(r.Arrow,{id:`${s}_arrow`,style:{"--arrow-opacity":x(s)&&0,"--arrow-fill":t[s]},points:n[s].map(w=>w.join(",")).join(" "),role:a?"listitem":"presentation","aria-label":a?l(`filterTool.colors.${s}`):void 0},s)),!a&&o.jsx("text",{role:"listitem",x:n[e][3][0],y:n[e][3][1],fill:"#ffffff",dy:"-25",children:o.jsx(i.Trans,{i18nKey:`filterTool.colors.${e}`})})]})]}),o.jsx(r.SelectContainer,{children:o.jsx(b.default,{options:g,isDisabled:c,value:e,onChangeCallback:s=>f&&f(s||"none"),placeholder:y,maxWidth:"100%",width:"200px",id:h})})]})};j.displayName="Widgets.FilterTool";exports.default=j;
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),i=require("react-i18next"),m=require("@rubin-epo/epo-react-lib/SelectListbox"),_=require("@rubin-epo/epo-react-lib/ColorSwatch"),r=require("./widgets/FilterTool/styles.cjs"),d=e=>e&&e.__esModule?e:{default:e},b=d(m),C=d(_),j=({selectedColor:e="none",selectionCallback:f,isDisabled:c=!1,id:h,labelledById:u})=>{const{t:l}=i.useTranslation(),t={violet:"#861cff",blue:"#0019ff",green:"#6bd853",yellow:"#ffdd15",orange:"#f18922",red:"#ec1c24",none:"transparent"},p={violet:"M546.1,312.5l212.8,1.9h0.4l0.5,0.2L1396,522.8c6.9,2.3,10.7,9.7,8.5,16.7s-9.7,10.7-16.7,8.5l0,0l-0.4-0.1L757.8,320.4l0.9,0.2L546.1,312.5z",blue:"M546.1,312.4l206.5-4.4h0.4l0.4,0.1l641.1,164c7,1.8,11.2,8.9,9.4,15.9c-1.8,7-8.9,11.2-15.9,9.4l-0.4-0.1L751.8,313.8l0.8,0.1L546.1,312.4z",green:"M547.8,312l200.6-10.6h0.3l0.4,0.1l644.8,120.3c7,1.4,11.5,8.2,10.1,15.2c-1.4,6.9-8,11.4-14.9,10.2l-0.4-0.1L747.8,307.4l0.7,0.1L547.8,312z",yellow:"M546.1,312.5l205.8-17.3h0.3h0.4l640.4,75.3c7.1,0.8,12.2,7.2,11.3,14.3c-0.8,7.1-7.2,12.2-14.3,11.3l-0.4-0.1l-637.9-94.5h0.6L546.1,312.5z",orange:"M546.1,311l189.3-21.8h0.2h0.3l656.5,33.3c7,0.4,12.4,6.3,12,13.3s-6.3,12.4-13.3,12h-0.4l-655.2-52.9h0.5L546.1,311z",red:"M546.1,311L730,283.9h0.1h0.2l661.4-9.9c6.9-0.1,12.6,5.4,12.7,12.3s-5.4,12.6-12.3,12.7h-0.4l-661.4-9.8h0.4L546.1,311z"},n={violet:[[1426.5,547.9],[1353.2,550.6],[1377.9,530.1],[1372.3,498.5]],blue:[[1431.5,496.4],[1358.6,504.1],[1381.8,482],[1374.1,450.9]],green:[[1437.9,443.4],[1366.1,458.4],[1387,434.1],[1376.2,403.9]],yellow:[[1438.9,389.7],[1368,408.2],[1387.6,382.8],[1375.4,353.3]],orange:[[1443.7,340.3],[1373.9,362.8],[1392.1,336.4],[1378.2,307.5]],red:[[1441.9,290],[1372.4,313.2],[1390.3,286.6],[1376.1,257.9]]},g=Object.keys(t).map(s=>({value:s,label:l(`filterTool.colors.${s}`),icon:o.jsx(C.default,{color:s,size:"small"})})),x=s=>e!==s&&e!=="none",y=l("filterTool.selectLabel"),a=e==="none";return o.jsxs(r.Wrapper,{ratio:"landscape",children:[o.jsxs(r.PrismSVG,{version:"1.1",viewBox:"0 0 1551.6 736.7","aria-labelledby":u,children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"no-arrow-red",children:[o.jsx("stop",{offset:"0%",stopColor:t.red}),o.jsx("stop",{offset:"81%",stopColor:t.red}),o.jsx("stop",{offset:"81%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-orange",children:[o.jsx("stop",{offset:"0%",stopColor:t.orange}),o.jsx("stop",{offset:"80%",stopColor:t.orange}),o.jsx("stop",{offset:"80%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-yellow",children:[o.jsx("stop",{offset:"0%",stopColor:t.yellow}),o.jsx("stop",{offset:"79%",stopColor:t.yellow}),o.jsx("stop",{offset:"79%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-green",children:[o.jsx("stop",{offset:"0%",stopColor:t.green}),o.jsx("stop",{offset:"78%",stopColor:t.green}),o.jsx("stop",{offset:"78%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-blue",children:[o.jsx("stop",{offset:"0%",stopColor:t.blue}),o.jsx("stop",{offset:"77%",stopColor:t.blue}),o.jsx("stop",{offset:"77%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]}),o.jsxs("linearGradient",{id:"no-arrow-violet",children:[o.jsx("stop",{offset:"0%",stopColor:t.violet}),o.jsx("stop",{offset:"77%",stopColor:t.violet}),o.jsx("stop",{offset:"77%",stopColor:"transparent"}),o.jsx("stop",{offset:"100%",stopColor:"transparent"})]})]}),o.jsxs("radialGradient",{id:"gradient_1_",cx:"718.4264",cy:"-294.6529",r:"417.8",fx:"638.9412",fy:"-303.5418",gradientTransform:"matrix(1 0 0 1 0 534)",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.12",style:{stopColor:"#FFFFFF"}}),o.jsx("stop",{offset:"1",style:{stopColor:"#000000"}})]}),o.jsxs("g",{children:[o.jsx(r.WhiteLine,{id:"white_ray",x1:"108.2",y1:"463.3",x2:"546.1",y2:"312.5"}),o.jsx(r.WhiteLine,{id:"white_light_arrow_line",x1:"376.8",y1:"327.9",x2:"430",y2:"309.6"}),o.jsx("polygon",{id:"white_light_arrow",points:"420.7,325.4 428.1,310.3 413,302.9 422.5,299.7 437.6,307 430.2,322.1",fill:"#ffffff"}),o.jsx("text",{transform:"matrix(0.9446 -0.3282 0.3282 0.9446 152.0965 417.697)",fill:"#ffffff",children:o.jsx(i.Trans,{i18nKey:"filterTool.whiteLight"})})]}),o.jsxs("g",{children:[o.jsx("text",{transform:"matrix(1 0 0 1 598.2964 606.0872)",fill:"#ffffff",children:o.jsx(i.Trans,{i18nKey:"filterTool.prism"})}),o.jsx("polygon",{id:"gradient",points:"653.2,127 867.4,498 438.9,498",fill:"url(#gradient_1_)",style:{opacity:.3}})]}),o.jsx(r.PrismOutline,{id:"outline",points:"653.2,127 760.3,312.5 867.4,498 653.2,498 438.9,498 546.1,312.5 "}),o.jsx("g",{role:"list",id:"rays_out","aria-label":l("filterTool.light_out"),children:Object.keys(p).map(s=>o.jsx(r.Ray,{id:`${s}_ray`,style:{"--ray-fill":x(s)?`url(#no-arrow-${s})`:t[s]},d:p[s],role:"listitem","aria-label":l(`filterTool.colors.${s}`)},s))}),o.jsxs("g",{children:[o.jsx("text",{transform:"matrix(1 0 0 1 1206.5464 164.1372)",fill:"#ffffff",children:o.jsx(i.Trans,{i18nKey:"filterTool.filter"})}),o.jsx(r.Filter,{id:"filter",x1:"1255.6",y1:"235.7",x2:"1193.1",y2:"550.3",stroke:t[e],fill:"#ffffff","aria-label":l(`filterTool.colors.${e}`)})]}),o.jsxs("g",{role:"list",id:"rays_filtered","aria-label":l("filterTool.light_filtered"),children:[Object.keys(n).map(s=>o.jsx(r.Arrow,{id:`${s}_arrow`,style:{"--arrow-opacity":x(s)&&0,"--arrow-fill":t[s]},points:n[s].map(w=>w.join(",")).join(" "),role:a?"listitem":"presentation","aria-label":a?l(`filterTool.colors.${s}`):void 0},s)),!a&&o.jsx("text",{role:"listitem",x:n[e][3][0],y:n[e][3][1],fill:"#ffffff",dy:"-25",children:o.jsx(i.Trans,{i18nKey:`filterTool.colors.${e}`})})]})]}),o.jsx(r.SelectContainer,{children:o.jsx(b.default,{options:g,isDisabled:c,value:e,onChangeCallback:s=>f&&f(s||"none"),placeholder:y,maxWidth:"100%",width:"200px",id:h})})]})};j.displayName="Widgets.FilterTool";exports.default=j;
|
package/dist/FilterTool.js
CHANGED
|
@@ -68,7 +68,7 @@ const j = ({
|
|
|
68
68
|
label: i(`filterTool.colors.${t}`),
|
|
69
69
|
icon: /* @__PURE__ */ o(u, { color: t, size: "small" })
|
|
70
70
|
})), d = (t) => e !== t && e !== "none", w = i("filterTool.selectLabel"), f = e === "none";
|
|
71
|
-
return /* @__PURE__ */ l(L, { children: [
|
|
71
|
+
return /* @__PURE__ */ l(L, { ratio: "landscape", children: [
|
|
72
72
|
/* @__PURE__ */ l(
|
|
73
73
|
T,
|
|
74
74
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),B=require("react"),O=require("react-i18next"),l=require("d3-array"),z=require("@rubin-epo/epo-react-lib/HorizontalSlider"),d=require("./lib/utils.cjs"),E=require("./widgets/SupernovaThreeVector/LiveLabel/index.cjs"),r=require("./widgets/SupernovaThreeVector/styles.cjs"),N=t=>t&&t.__esModule?t:{default:t},P=N(z),k=({histogramData:t,userData:C,binnedImages:T,step:u=100})=>{const{t:x}=O.useTranslation(),i={top:30,bottom:30,left:50,right:0},m="skyMapDescription",o=600,p=o/1.6,q=[i.left,o-i.right],R=[p-i.bottom,i.top],b=6,h=7,v=0,L=l.max(t,e=>e.value)||Math.max(...t.map(({value:e})=>e)),a=l.min(t,e=>e.bin)||0,c=l.max(t,e=>e.bin)||Math.max(...t.map(({bin:e})=>e)),y=l.nice(a,c,b),g=l.nice(v,L||v,h),j=d.getLinearScale(y,q),I=d.getLinearScale(g,R),[s,S]=B.useState([a,c]),f=15,$=`calc(${i.left/o*100}% - ${f}px)`,V=`calc(${(1-j(c)/o)*100}% - ${f}px)`,_=t.map(({bin:e})=>d.between(e,s[0],s[1])),M=C.filter(({distance:e})=>d.between(e,s[0],s[1]+u)),A=t.reduce((e,{value:H},w)=>_[w]?e+H:e,0);return n.jsxs(r.ThreeVectorContainer,{children:[n.jsxs(r.ThreeVectorLayout,{children:[n.jsxs(r.HistogramContainer,{children:[n.jsx(r.ChartTitle,{children:x("supernova_three_vector.histogram.title")}),n.jsx(r.Histogram,{data:t,activeRange:s,xDomain:y,yDomain:g,xScale:j,yScale:I,yTicks:h,xTicks:b,step:u,margin:i,width:o,height:p})]}),n.jsx(r.SliderContainer,{style:{paddingInlineStart:$,paddingInlineEnd:V},children:n.jsx(P.default,{min:a,max:c,step:u,value:s,ariaValuetext:({valueNow:e})=>x("supernova_three_vector.slider.valueLabel",{value:e}),label:"distanceSlider",color:"var(--turquoise85,#12726D)",minLabel:`${a} kpc`,maxLabel:`${c} kpc`,onChangeCallback:e=>Array.isArray(e)&&S(e)})}),n.jsxs(r.SkymapContainer,{children:[n.jsx(r.ChartTitle,{children:x("supernova_three_vector.skymap.title")}),n.jsx(r.Skymap,{objects:M,images:T,describedById:m,visibleImages:_})]}),n.jsx(r.ResetButton,{onResetCallback:()=>S([a,c])})]}),n.jsx(E.default,{id:m,objects:M,min:s[0],max:s[1]+u,supernovaCount:A})]})};k.displayName="Widgets.SupernovaThreeVector";exports.default=k;
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),B=require("react"),O=require("react-i18next"),l=require("d3-array"),z=require("@rubin-epo/epo-react-lib/HorizontalSlider"),d=require("./lib/utils.cjs"),E=require("./widgets/SupernovaThreeVector/LiveLabel/index.cjs"),r=require("./widgets/SupernovaThreeVector/styles.cjs"),N=t=>t&&t.__esModule?t:{default:t},P=N(z),k=({histogramData:t,userData:C,binnedImages:T,step:u=100})=>{const{t:x}=O.useTranslation(),i={top:30,bottom:30,left:50,right:0},m="skyMapDescription",o=600,p=o/1.6,q=[i.left,o-i.right],R=[p-i.bottom,i.top],b=6,h=7,v=0,L=l.max(t,e=>e.value)||Math.max(...t.map(({value:e})=>e)),a=l.min(t,e=>e.bin)||0,c=l.max(t,e=>e.bin)||Math.max(...t.map(({bin:e})=>e)),y=l.nice(a,c,b),g=l.nice(v,L||v,h),j=d.getLinearScale(y,q),I=d.getLinearScale(g,R),[s,S]=B.useState([a,c]),f=15,$=`calc(${i.left/o*100}% - ${f}px)`,V=`calc(${(1-j(c)/o)*100}% - ${f}px)`,_=t.map(({bin:e})=>d.between(e,s[0],s[1])),M=C.filter(({distance:e})=>d.between(e,s[0],s[1]+u)),A=t.reduce((e,{value:H},w)=>_[w]?e+H:e,0);return n.jsxs(r.ThreeVectorContainer,{ratio:"landscape",smallScreenRatio:"portrait",children:[n.jsxs(r.ThreeVectorLayout,{children:[n.jsxs(r.HistogramContainer,{children:[n.jsx(r.ChartTitle,{children:x("supernova_three_vector.histogram.title")}),n.jsx(r.Histogram,{data:t,activeRange:s,xDomain:y,yDomain:g,xScale:j,yScale:I,yTicks:h,xTicks:b,step:u,margin:i,width:o,height:p})]}),n.jsx(r.SliderContainer,{style:{paddingInlineStart:$,paddingInlineEnd:V},children:n.jsx(P.default,{min:a,max:c,step:u,value:s,ariaValuetext:({valueNow:e})=>x("supernova_three_vector.slider.valueLabel",{value:e}),label:"distanceSlider",color:"var(--turquoise85,#12726D)",minLabel:`${a} kpc`,maxLabel:`${c} kpc`,onChangeCallback:e=>Array.isArray(e)&&S(e)})}),n.jsxs(r.SkymapContainer,{children:[n.jsx(r.ChartTitle,{children:x("supernova_three_vector.skymap.title")}),n.jsx(r.Skymap,{objects:M,images:T,describedById:m,visibleImages:_})]}),n.jsx(r.ResetButton,{onResetCallback:()=>S([a,c])})]}),n.jsx(E.default,{id:m,objects:M,min:s[0],max:s[1]+u,supernovaCount:A})]})};k.displayName="Widgets.SupernovaThreeVector";exports.default=k;
|
|
@@ -4,9 +4,9 @@ import { useState as z } from "react";
|
|
|
4
4
|
import { useTranslation as E } from "react-i18next";
|
|
5
5
|
import { max as C, min as N, nice as M } from "d3-array";
|
|
6
6
|
import U from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
7
|
-
import { getLinearScale as L, between as
|
|
7
|
+
import { getLinearScale as L, between as R } from "./lib/utils.js";
|
|
8
8
|
import W from "./widgets/SupernovaThreeVector/LiveLabel/index.js";
|
|
9
|
-
import { ThreeVectorContainer as F, ThreeVectorLayout as G, HistogramContainer as J, ChartTitle as
|
|
9
|
+
import { ThreeVectorContainer as F, ThreeVectorLayout as G, HistogramContainer as J, ChartTitle as T, Histogram as K, SliderContainer as P, SkymapContainer as Q, Skymap as X, ResetButton as Y } from "./widgets/SupernovaThreeVector/styles.js";
|
|
10
10
|
const Z = ({
|
|
11
11
|
histogramData: t,
|
|
12
12
|
userData: _,
|
|
@@ -18,15 +18,15 @@ const Z = ({
|
|
|
18
18
|
bottom: 30,
|
|
19
19
|
left: 50,
|
|
20
20
|
right: 0
|
|
21
|
-
}, d = "skyMapDescription",
|
|
22
|
-
({ bin: e }) =>
|
|
21
|
+
}, d = "skyMapDescription", a = 600, p = a / 1.6, j = [i.left, a - i.right], I = [p - i.bottom, i.top], u = 6, x = 7, b = 0, V = C(t, (e) => e.value) || Math.max(...t.map(({ value: e }) => e)), c = N(t, (e) => e.bin) || 0, o = C(t, (e) => e.bin) || Math.max(...t.map(({ bin: e }) => e)), h = M(c, o, u), v = M(b, V || b, x), f = L(h, j), A = L(v, I), [n, y] = z([c, o]), g = 15, B = `calc(${i.left / a * 100}% - ${g}px)`, H = `calc(${(1 - f(o) / a) * 100}% - ${g}px)`, S = t.map(
|
|
22
|
+
({ bin: e }) => R(e, n[0], n[1])
|
|
23
23
|
), k = _.filter(
|
|
24
|
-
({ distance: e }) =>
|
|
24
|
+
({ distance: e }) => R(e, n[0], n[1] + s)
|
|
25
25
|
), w = t.reduce((e, { value: O }, q) => S[q] ? e + O : e, 0);
|
|
26
|
-
return /* @__PURE__ */ l(F, { children: [
|
|
26
|
+
return /* @__PURE__ */ l(F, { ratio: "landscape", smallScreenRatio: "portrait", children: [
|
|
27
27
|
/* @__PURE__ */ l(G, { children: [
|
|
28
28
|
/* @__PURE__ */ l(J, { children: [
|
|
29
|
-
/* @__PURE__ */ r(
|
|
29
|
+
/* @__PURE__ */ r(T, { children: m("supernova_three_vector.histogram.title") }),
|
|
30
30
|
/* @__PURE__ */ r(
|
|
31
31
|
K,
|
|
32
32
|
{
|
|
@@ -40,7 +40,7 @@ const Z = ({
|
|
|
40
40
|
xTicks: u,
|
|
41
41
|
step: s,
|
|
42
42
|
margin: i,
|
|
43
|
-
width:
|
|
43
|
+
width: a,
|
|
44
44
|
height: p
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -55,14 +55,14 @@ const Z = ({
|
|
|
55
55
|
children: /* @__PURE__ */ r(
|
|
56
56
|
U,
|
|
57
57
|
{
|
|
58
|
-
min:
|
|
58
|
+
min: c,
|
|
59
59
|
max: o,
|
|
60
60
|
step: s,
|
|
61
61
|
value: n,
|
|
62
62
|
ariaValuetext: ({ valueNow: e }) => m("supernova_three_vector.slider.valueLabel", { value: e }),
|
|
63
63
|
label: "distanceSlider",
|
|
64
64
|
color: "var(--turquoise85,#12726D)",
|
|
65
|
-
minLabel: `${
|
|
65
|
+
minLabel: `${c} kpc`,
|
|
66
66
|
maxLabel: `${o} kpc`,
|
|
67
67
|
onChangeCallback: (e) => Array.isArray(e) && y(e)
|
|
68
68
|
}
|
|
@@ -70,7 +70,7 @@ const Z = ({
|
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
72
|
/* @__PURE__ */ l(Q, { children: [
|
|
73
|
-
/* @__PURE__ */ r(
|
|
73
|
+
/* @__PURE__ */ r(T, { children: m("supernova_three_vector.skymap.title") }),
|
|
74
74
|
/* @__PURE__ */ r(
|
|
75
75
|
X,
|
|
76
76
|
{
|
|
@@ -84,7 +84,7 @@ const Z = ({
|
|
|
84
84
|
/* @__PURE__ */ r(
|
|
85
85
|
Y,
|
|
86
86
|
{
|
|
87
|
-
onResetCallback: () => y([
|
|
87
|
+
onResetCallback: () => y([c, o])
|
|
88
88
|
}
|
|
89
89
|
)
|
|
90
90
|
] }),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, HTMLProps, MouseEventHandler } from "react";
|
|
2
|
-
import { IconKey } from "@rubin-epo/epo-react-lib";
|
|
3
2
|
interface PlaybackControlProps extends HTMLProps<HTMLButtonElement> {
|
|
4
|
-
icon:
|
|
3
|
+
icon: string;
|
|
5
4
|
label: string;
|
|
6
5
|
handleClick: MouseEventHandler<HTMLButtonElement>;
|
|
7
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),b=require("d3-array"),G=require("../styles.cjs"),c=({guides:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),b=require("d3-array"),G=require("../styles.cjs"),c=({guides:l=0,direction:t="horizontal",xScale:n,xDomain:e,yScale:r,yDomain:i,margin:d,className:h})=>{if(l===0)return null;const u=t==="horizontal"?i:e,f=t==="horizontal"?r:n,s={...{top:0,right:0,bottom:0,left:0},...d},g=b.ticks(u[1],u[0],l);return a.jsx("g",{className:h,children:g.map((p,j)=>{const o=f(p),z=t==="horizontal"?[n(e[0])-s.left,o]:[o-s.top,r(i[0])],M=t==="horizontal"?[n(e[1])+s.right,o]:[o,r(i[1])+s.bottom];return a.jsx(G.Guide,{points:`${z.join()} ${M.join()}`},j)})})};c.displayName="Charts.Guidelines";const m=c;exports.default=m;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
|
-
import { ChartMargin, Domain, ScaleFunction } from
|
|
2
|
+
import { ChartMargin, Domain, ScaleFunction } from '../../types/charts';
|
|
3
3
|
export interface GuidelinesProps {
|
|
4
4
|
guides: number;
|
|
5
5
|
direction?: "horizontal" | "vertical";
|