@rubin-epo/epo-widget-lib 1.0.0 → 1.0.1
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 +9 -9
- package/dist/ColorTool.cjs +1 -1
- package/dist/ColorTool.js +13 -12
- package/dist/FilterTool.cjs +1 -1
- package/dist/FilterTool.js +1 -1
- package/dist/IsochronePlot.cjs +1 -1
- package/dist/IsochronePlot.js +8 -7
- package/dist/SupernovaThreeVector.cjs +1 -1
- package/dist/SupernovaThreeVector.js +4 -4
- package/dist/charts/Base/styles.d.ts +1 -1
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +6 -5
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +49 -50
- package/dist/charts/styles.d.ts +6 -6
- package/dist/layout/AspectRatio/index.cjs +1 -1
- package/dist/layout/AspectRatio/index.d.ts +2 -4
- package/dist/layout/AspectRatio/index.js +18 -18
- package/dist/layout/AspectRatio/styles.cjs +8 -13
- package/dist/layout/AspectRatio/styles.d.ts +0 -5
- package/dist/layout/AspectRatio/styles.js +10 -18
- package/dist/layout/Controls/index.cjs +1 -1
- package/dist/layout/Controls/index.d.ts +2 -0
- package/dist/layout/Controls/index.js +27 -35
- package/dist/layout/Controls/styles.cjs +23 -21
- package/dist/layout/Controls/styles.js +25 -23
- package/dist/widgets/CameraFilter/styles.d.ts +7 -9
- package/dist/widgets/FilterTool/styles.cjs +12 -9
- package/dist/widgets/FilterTool/styles.d.ts +9 -11
- package/dist/widgets/FilterTool/styles.js +16 -13
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +29 -28
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.cjs +1 -1
- package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.js +9 -9
- package/dist/widgets/SourceSelector/Point/styles.d.ts +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
- package/dist/widgets/SourceSelector/SourceSelector.js +19 -19
- package/dist/widgets/SourceSelector/styles.d.ts +1 -1
- package/dist/widgets/SupernovaThreeVector/Histogram/styles.d.ts +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +3 -2
- package/dist/widgets/SupernovaThreeVector/Skymap/styles.d.ts +7 -7
- package/package.json +2 -2
package/dist/CameraFilter.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"),v=require("react"),q=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("./widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.cjs"),L=require("./widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs"),x=i=>i&&i.__esModule?i:{default:i},M=x(q),O=x(C),h=()=>{const{t:i}=S.useTranslation(),{ref:j,width:m=1}=O.default(),[c,p]=v.useState(null),{BREAK_TABLET:b}=y.tokens,s=m<parseInt(b),{[s?"condensed":"default"]:{min:o,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===c);return e.jsx(l.FilterWrapper,{ratio:5/4,children:e.jsxs(l.FilterContainer,{ref:j,children:[e.jsx(l.FilterTitle,{children:i("camera_filter.title")}),s&&e.jsx(R.default,{filters:f,min:o,spectrumRange:n}),e.jsxs(l.FilterTable,{style:{"--filter-table-margin-inline-start":`${((d-o)/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(L.default,{min:o,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(M.default,{options:F,value:c,onChangeCallback:t=>p(t),width:"100%",maxWidth:"100%",labelledById:"filterSelectLabel"})]})]})})};h.displayName="Widgets.CameraFilter";exports.default=h;
|
package/dist/CameraFilter.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
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
|
|
6
|
-
import { useTranslation as
|
|
4
|
+
import y from "@rubin-epo/epo-react-lib/SelectListbox";
|
|
5
|
+
import { tokens as R } from "@rubin-epo/epo-react-lib/styles";
|
|
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
9
|
import { FilterWrapper as L, FilterContainer as T, FilterTitle as _, FilterTable as w, FilterNames as O, FilterName as W, FilterRanges as $, FilterRange as A, Wavelength as M, SelectContainer as N, SelectLabel as k } from "./widgets/CameraFilter/styles.js";
|
|
10
10
|
import E from "./widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.js";
|
|
11
11
|
import I from "./widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js";
|
|
12
|
-
const
|
|
13
|
-
const { t: r } =
|
|
12
|
+
const z = () => {
|
|
13
|
+
const { t: r } = S(), { ref: p, width: h = 1 } = j(), [c, F] = v(null), { BREAK_TABLET: b } = R, l = h < parseInt(b), {
|
|
14
14
|
[l ? "condensed" : "default"]: { min: s, max: g, range: n }
|
|
15
15
|
} = B, d = i[0].range[0], m = i[i.length - 1].range[1] - d, f = i.filter(({ band: e }) => e), u = [{
|
|
16
16
|
value: "none",
|
|
@@ -21,7 +21,7 @@ const q = () => {
|
|
|
21
21
|
label: r("camera_filter.labels.option", { band: e })
|
|
22
22
|
}))
|
|
23
23
|
), x = i.find(({ band: e }) => e === c);
|
|
24
|
-
return /* @__PURE__ */ t(L, { ratio:
|
|
24
|
+
return /* @__PURE__ */ t(L, { ratio: 5 / 4, children: /* @__PURE__ */ o(T, { ref: p, children: [
|
|
25
25
|
/* @__PURE__ */ t(_, { children: r("camera_filter.title") }),
|
|
26
26
|
l && /* @__PURE__ */ t(
|
|
27
27
|
E,
|
|
@@ -83,7 +83,7 @@ const q = () => {
|
|
|
83
83
|
/* @__PURE__ */ o(N, { children: [
|
|
84
84
|
/* @__PURE__ */ t(k, { id: "filterSelectLabel", children: r("camera_filter.labels.select") }),
|
|
85
85
|
/* @__PURE__ */ t(
|
|
86
|
-
|
|
86
|
+
y,
|
|
87
87
|
{
|
|
88
88
|
options: u,
|
|
89
89
|
value: c,
|
|
@@ -96,7 +96,7 @@ const q = () => {
|
|
|
96
96
|
] })
|
|
97
97
|
] }) });
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
z.displayName = "Widgets.CameraFilter";
|
|
100
100
|
export {
|
|
101
|
-
|
|
101
|
+
z as default
|
|
102
102
|
};
|
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"),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"),
|
|
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"),p=require("./widgets/ColorTool/ImageComposite/ImageComposite.cjs"),D=require("./widgets/ColorTool/FilterControls/FilterControls.cjs"),P=l=>l&&l.__esModule?l:{default:l},$=P(R),y=({data:l,objectOptions:T=[],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:1,children:e.jsx(p.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,{ratio:{landscape:3/2,portrait:9/16},widget:e.jsx(p.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:T,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})]})})})};y.displayName="Widgets.ColorTool";exports.default=y;
|
package/dist/ColorTool.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as f, Fragment as L } from "react/jsx-runtime";
|
|
3
3
|
import { useRef as _, createElement as A } from "react";
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { getDataFiltersByName as
|
|
6
|
-
import { WidgetLayout as
|
|
7
|
-
import
|
|
4
|
+
import { useTranslation as D } from "react-i18next";
|
|
5
|
+
import { getDataFiltersByName as E } from "./widgets/ColorTool/lib/utils.js";
|
|
6
|
+
import { WidgetLayout as H, SelectionContainer as M, ControlsContainer as P, ToolsHeader as b, Title as $ } from "./widgets/ColorTool/styles.js";
|
|
7
|
+
import q from "@rubin-epo/epo-react-lib/SelectListbox";
|
|
8
8
|
import v from "./widgets/ColorTool/Actions/index.js";
|
|
9
9
|
import z from "./layout/AspectRatio/index.js";
|
|
10
10
|
import T from "./widgets/ColorTool/ImageComposite/ImageComposite.js";
|
|
@@ -30,12 +30,12 @@ const J = ({
|
|
|
30
30
|
width: 600,
|
|
31
31
|
height: 600,
|
|
32
32
|
hideSubtitle: !1
|
|
33
|
-
}, a = _(null), { t: r } =
|
|
33
|
+
}, a = _(null), { t: r } = D(), { filters: o, name: i } = n, { actions: B, width: c, height: d, hideSubtitle: I } = {
|
|
34
34
|
...x,
|
|
35
35
|
...w
|
|
36
36
|
}, u = o.map(({ image: t }) => ({ url: t, width: c, height: d }));
|
|
37
37
|
if (S)
|
|
38
|
-
return /* @__PURE__ */ e(z, { ratio:
|
|
38
|
+
return /* @__PURE__ */ e(z, { ratio: 1, children: /* @__PURE__ */ e(
|
|
39
39
|
T,
|
|
40
40
|
{
|
|
41
41
|
ref: a,
|
|
@@ -60,12 +60,13 @@ const J = ({
|
|
|
60
60
|
if (t)
|
|
61
61
|
return l && l({
|
|
62
62
|
name: t,
|
|
63
|
-
filters:
|
|
63
|
+
filters: E(p, t)
|
|
64
64
|
});
|
|
65
65
|
}, g = p.length > 1, R = r("colorTool.actions.select_an_object");
|
|
66
66
|
return /* @__PURE__ */ e(
|
|
67
|
-
|
|
67
|
+
H,
|
|
68
68
|
{
|
|
69
|
+
ratio: { landscape: 3 / 2, portrait: 9 / 16 },
|
|
69
70
|
widget: /* @__PURE__ */ e(
|
|
70
71
|
T,
|
|
71
72
|
{
|
|
@@ -75,8 +76,8 @@ const J = ({
|
|
|
75
76
|
height: d,
|
|
76
77
|
selectedObjectName: i,
|
|
77
78
|
images: u,
|
|
78
|
-
children: g && /* @__PURE__ */ e(
|
|
79
|
-
|
|
79
|
+
children: g && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
|
80
|
+
q,
|
|
80
81
|
{
|
|
81
82
|
id: "astroObjectSelector",
|
|
82
83
|
placeholder: R,
|
|
@@ -90,7 +91,7 @@ const J = ({
|
|
|
90
91
|
) })
|
|
91
92
|
}
|
|
92
93
|
),
|
|
93
|
-
controls: /* @__PURE__ */ f(
|
|
94
|
+
controls: /* @__PURE__ */ f(P, { children: [
|
|
94
95
|
o && /* @__PURE__ */ f(L, { children: [
|
|
95
96
|
/* @__PURE__ */ e(b, { id: "filterLabel", children: r("colorTool.labels.filter") }),
|
|
96
97
|
/* @__PURE__ */ e(b, { id: "colorLabel", children: r("colorTool.labels.color") }),
|
|
@@ -123,7 +124,7 @@ const J = ({
|
|
|
123
124
|
selectionCallback: l
|
|
124
125
|
}
|
|
125
126
|
),
|
|
126
|
-
caption: i && g && /* @__PURE__ */ e(
|
|
127
|
+
caption: i && g && /* @__PURE__ */ e($, { children: !I && /* @__PURE__ */ f(L, { children: [
|
|
127
128
|
/* @__PURE__ */ e("dt", { children: r("colorTool.labels.object") }),
|
|
128
129
|
/* @__PURE__ */ e("dd", { children: i })
|
|
129
130
|
] }) })
|
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(_),
|
|
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:"#006da8",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:3/2,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 370 342.5)",textAnchor:"end",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, { ratio:
|
|
71
|
+
return /* @__PURE__ */ l(L, { ratio: 3 / 2, children: [
|
|
72
72
|
/* @__PURE__ */ l(
|
|
73
73
|
T,
|
|
74
74
|
{
|
package/dist/IsochronePlot.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),y=require("react"),Q=require("react-i18next"),U=require("use-resize-observer"),X=require("lodash/round"),F=require("@rubin-epo/epo-react-lib/styles"),Y=require("./layout/Controls/index.cjs"),Z=require("./charts/ScatterPlot/index.cjs"),ee=require("./atomic/Button/patterns/Reset.cjs");require("./atomic/PlotWrapper/index.cjs");const te=require("./charts/Readout/index.cjs"),se=require("./charts/PathFromPoints/index.cjs"),u=require("./lib/utils.cjs"),ie=require("./lib/helpers.cjs"),re=require("./widgets/IsochronePlot/Controls/index.cjs"),i=require("./widgets/IsochronePlot/defaults.cjs"),ne=require("./widgets/IsochronePlot/A11Y/CurveFit.cjs"),oe=require("./atomic/PlotWrapper/styles.cjs"),W=e=>e&&e.__esModule?e:{default:e},ae=W(U),le=W(X),ue=e=>e?e<parseFloat(F.token("BREAK_PHABLET_MIN"))?i.default.pointRadius.md:e<parseFloat(F.token("BREAK_LARGE_TABLET"))?i.default.pointRadius.sm:i.default.pointRadius.lg:i.default.pointRadius.lg,ce=({data:e,value:D,ageLibrary:I,isDisplayOnly:M=!1,isLoading:P,xAxis:k,yAxis:T,name:$,onChangeCallback:c})=>{const{ref:B,width:E}=ae.default(),{t:d,i18n:{language:x}}=Q.useTranslation(),[K,O]=y.useState(!0),h=y.useId(),n=!P&&!K,w={top:0,right:0,bottom:20,left:20},{width:f,height:g}=i.default,{ages:q={}}=I,s=Object.keys(q).sort((r,l)=>parseFloat(r)-parseFloat(l)).map(parseFloat),z=u.mergeWithDefaults(k,{...i.default.xAxis,label:d("isochrone_plot.plot.x_label")}),_=u.mergeWithDefaults(T,{...i.default.yAxis,label:d("isochrone_plot.plot.y_label")}),o={age:{min:s.length>0?Math.min(...s):0,max:s.length>0?Math.max(...s):0,step:le.default(s[1]-s[0],1)||.5,marks:s},distance:{min:0,max:_.min+1,step:.05}},b={age:s.length>0?u.middle(s):0,distance:(o.distance.max-o.distance.min)/2+o.distance.min},{age:a,distance:p}=u.mergeWithDefaults(D,b),H=ue(E),R={age:a.toLocaleString(x,{minimumFractionDigits:1}),distance:ie.parsecsToLightyears(Math.pow(10,p/5+1)).toLocaleString(x,{maximumFractionDigits:0})},S=t.jsx(oe.PlotWrapper,{ref:B,children:t.jsx(Z.default,{renderer:"canvas",title:$,onLoadedCallback:()=>O(!1),data:{label:"Star Cluster",points:e.map(r=>({...r,radius:H,stroke:"rgba(18,114,108,0.5)",fill:"rgba(18,114,108,0.25)"}))},plotChildren:({Data:r,xScale:l,yScale:m,yStart:V,yEnd:j,xStart:v,xEnd:C,yDomain:G})=>{const A=(q[a.toFixed(1)]||[]).map(({x:N,y:J})=>({x:l(N),y:m(J)}))||[],L=m(p+G[1]);return t.jsxs(t.Fragment,{children:[r,a&&t.jsx(se.default,{points:A,svgProps:{strokeWidth:2,transform:`translate(0,${L})`}}),n&&t.jsx(te.default,{viewport:{x:v,y:j,outerHeight:V-j,outerWidth:C-v,innerWidth:f,innerHeight:g},position:"center right",forIds:h,forScreenreaders:t.jsx(ne.default,{points:e,value:R,isochrone:A,offset:L,xScale:l,yScale:m,width:f,height:g}),children:d("isochrone_plot.output",{...R})})]})},width:f,height:g,xAxis:z,yAxis:_,margins:w})});return t.jsx(Y.default,{widget:S,controls:t.jsx(re.default,{isDisabled:!n,value:{age:a,distance:p},configs:o,onChangeCallback:c}),actions:t.jsx(ee.default,{isDisabled:!n,onResetCallback:()=>{c&&c(b)}}),isLoading:!n,isDisplayOnly:M,controlsId:h})};exports.default=ce;
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),y=require("react"),Q=require("react-i18next"),U=require("use-resize-observer"),X=require("lodash/round"),F=require("@rubin-epo/epo-react-lib/styles"),Y=require("./layout/Controls/index.cjs"),Z=require("./charts/ScatterPlot/index.cjs"),ee=require("./atomic/Button/patterns/Reset.cjs");require("./atomic/PlotWrapper/index.cjs");const te=require("./charts/Readout/index.cjs"),se=require("./charts/PathFromPoints/index.cjs"),u=require("./lib/utils.cjs"),ie=require("./lib/helpers.cjs"),re=require("./widgets/IsochronePlot/Controls/index.cjs"),i=require("./widgets/IsochronePlot/defaults.cjs"),ne=require("./widgets/IsochronePlot/A11Y/CurveFit.cjs"),oe=require("./atomic/PlotWrapper/styles.cjs"),W=e=>e&&e.__esModule?e:{default:e},ae=W(U),le=W(X),ue=e=>e?e<parseFloat(F.token("BREAK_PHABLET_MIN"))?i.default.pointRadius.md:e<parseFloat(F.token("BREAK_LARGE_TABLET"))?i.default.pointRadius.sm:i.default.pointRadius.lg:i.default.pointRadius.lg,ce=({data:e,value:D,ageLibrary:I,isDisplayOnly:M=!1,isLoading:P,xAxis:k,yAxis:T,name:$,onChangeCallback:c})=>{const{ref:B,width:E}=ae.default(),{t:d,i18n:{language:x}}=Q.useTranslation(),[K,O]=y.useState(!0),h=y.useId(),n=!P&&!K,w={top:0,right:0,bottom:20,left:20},{width:f,height:g}=i.default,{ages:q={}}=I,s=Object.keys(q).sort((r,l)=>parseFloat(r)-parseFloat(l)).map(parseFloat),z=u.mergeWithDefaults(k,{...i.default.xAxis,label:d("isochrone_plot.plot.x_label")}),_=u.mergeWithDefaults(T,{...i.default.yAxis,label:d("isochrone_plot.plot.y_label")}),o={age:{min:s.length>0?Math.min(...s):0,max:s.length>0?Math.max(...s):0,step:le.default(s[1]-s[0],1)||.5,marks:s},distance:{min:0,max:_.min+1,step:.05}},b={age:s.length>0?u.middle(s):0,distance:(o.distance.max-o.distance.min)/2+o.distance.min},{age:a,distance:p}=u.mergeWithDefaults(D,b),H=ue(E),R={age:a.toLocaleString(x,{minimumFractionDigits:1}),distance:ie.parsecsToLightyears(Math.pow(10,p/5+1)).toLocaleString(x,{maximumFractionDigits:0})},S=t.jsx(oe.PlotWrapper,{ref:B,children:t.jsx(Z.default,{renderer:"canvas",title:$,onLoadedCallback:()=>O(!1),data:{label:"Star Cluster",points:e.map(r=>({...r,radius:H,stroke:"rgba(18,114,108,0.5)",fill:"rgba(18,114,108,0.25)"}))},plotChildren:({Data:r,xScale:l,yScale:m,yStart:V,yEnd:j,xStart:v,xEnd:C,yDomain:G})=>{const A=(q[a.toFixed(1)]||[]).map(({x:N,y:J})=>({x:l(N),y:m(J)}))||[],L=m(p+G[1]);return t.jsxs(t.Fragment,{children:[r,a&&t.jsx(se.default,{points:A,svgProps:{strokeWidth:2,transform:`translate(0,${L})`}}),n&&t.jsx(te.default,{viewport:{x:v,y:j,outerHeight:V-j,outerWidth:C-v,innerWidth:f,innerHeight:g},position:"center right",forIds:h,forScreenreaders:t.jsx(ne.default,{points:e,value:R,isochrone:A,offset:L,xScale:l,yScale:m,width:f,height:g}),children:d("isochrone_plot.output",{...R})})]})},width:f,height:g,xAxis:z,yAxis:_,margins:w})});return t.jsx(Y.default,{ratio:{portrait:2/3,landscape:3/2},widget:S,controls:t.jsx(re.default,{isDisabled:!n,value:{age:a,distance:p},configs:o,onChangeCallback:c}),actions:t.jsx(ee.default,{isDisabled:!n,onResetCallback:()=>{c&&c(b)}}),isLoading:!n,isDisplayOnly:M,controlsId:h})};exports.default=ce;
|
package/dist/IsochronePlot.js
CHANGED
|
@@ -17,12 +17,12 @@ import at from "./widgets/IsochronePlot/Controls/index.js";
|
|
|
17
17
|
import e from "./widgets/IsochronePlot/defaults.js";
|
|
18
18
|
import mt from "./widgets/IsochronePlot/A11Y/CurveFit.js";
|
|
19
19
|
import { PlotWrapper as lt } from "./atomic/PlotWrapper/styles.js";
|
|
20
|
-
const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md : r < parseFloat(W("BREAK_LARGE_TABLET")) ? e.pointRadius.sm : e.pointRadius.lg : e.pointRadius.lg,
|
|
20
|
+
const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md : r < parseFloat(W("BREAK_LARGE_TABLET")) ? e.pointRadius.sm : e.pointRadius.lg : e.pointRadius.lg, Bt = ({
|
|
21
21
|
data: r,
|
|
22
22
|
value: y,
|
|
23
|
-
ageLibrary:
|
|
24
|
-
isDisplayOnly:
|
|
25
|
-
isLoading:
|
|
23
|
+
ageLibrary: I,
|
|
24
|
+
isDisplayOnly: k = !1,
|
|
25
|
+
isLoading: B,
|
|
26
26
|
xAxis: D,
|
|
27
27
|
yAxis: T,
|
|
28
28
|
name: E,
|
|
@@ -31,7 +31,7 @@ const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md
|
|
|
31
31
|
const { ref: K, width: M } = Y(), {
|
|
32
32
|
t: p,
|
|
33
33
|
i18n: { language: h }
|
|
34
|
-
} = X(), [j, w] = Q(!0), x = U(), s = !
|
|
34
|
+
} = X(), [j, w] = Q(!0), x = U(), s = !B && !j, C = { top: 0, right: 0, bottom: 20, left: 20 }, { width: c, height: d } = e, { ages: b = {} } = I, t = Object.keys(b).sort(
|
|
35
35
|
(i, m) => parseFloat(i) - parseFloat(m)
|
|
36
36
|
).map(parseFloat), H = f(D, {
|
|
37
37
|
...e.xAxis,
|
|
@@ -143,6 +143,7 @@ const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md
|
|
|
143
143
|
return /* @__PURE__ */ o(
|
|
144
144
|
tt,
|
|
145
145
|
{
|
|
146
|
+
ratio: { portrait: 2 / 3, landscape: 3 / 2 },
|
|
146
147
|
widget: z,
|
|
147
148
|
controls: /* @__PURE__ */ o(
|
|
148
149
|
at,
|
|
@@ -163,11 +164,11 @@ const pt = (r) => r ? r < parseFloat(W("BREAK_PHABLET_MIN")) ? e.pointRadius.md
|
|
|
163
164
|
}
|
|
164
165
|
),
|
|
165
166
|
isLoading: !s,
|
|
166
|
-
isDisplayOnly:
|
|
167
|
+
isDisplayOnly: k,
|
|
167
168
|
controlsId: x
|
|
168
169
|
}
|
|
169
170
|
);
|
|
170
171
|
};
|
|
171
172
|
export {
|
|
172
|
-
|
|
173
|
+
Bt as default
|
|
173
174
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),q=require("react"),D=require("react-i18next"),l=require("d3-array"),E=require("@rubin-epo/epo-react-lib/HorizontalSlider"),d=require("./lib/utils.cjs"),N=require("./widgets/SupernovaThreeVector/LiveLabel/index.cjs"),r=require("./widgets/SupernovaThreeVector/styles.cjs"),P=n=>n&&n.__esModule?n:{default:n},U=P(E),R=({histogramData:n,userData:k,binnedImages:I,step:u=100})=>{const{t:x}=D.useTranslation(),h=q.useId(),i={top:30,bottom:30,left:50,right:0},o=600,y=o/1.6,L=[i.left,o-i.right],V=[y-i.bottom,i.top],g=6,p=7,v=n.map(({value:e})=>e),b=0,$=l.max(v)||Math.max(...v),m=n.map(({bin:e})=>e),c=l.min(m)||0,a=l.max(m)||Math.max(...m),j=l.nice(c,a,g),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),q=require("react"),D=require("react-i18next"),l=require("d3-array"),E=require("@rubin-epo/epo-react-lib/HorizontalSlider"),d=require("./lib/utils.cjs"),N=require("./widgets/SupernovaThreeVector/LiveLabel/index.cjs"),r=require("./widgets/SupernovaThreeVector/styles.cjs"),P=n=>n&&n.__esModule?n:{default:n},U=P(E),R=({histogramData:n,userData:k,binnedImages:I,step:u=100})=>{const{t:x}=D.useTranslation(),h=q.useId(),i={top:30,bottom:30,left:50,right:0},o=600,y=o/1.6,L=[i.left,o-i.right],V=[y-i.bottom,i.top],g=6,p=7,v=n.map(({value:e})=>e),b=0,$=l.max(v)||Math.max(...v),m=n.map(({bin:e})=>e),c=l.min(m)||0,a=l.max(m)||Math.max(...m),j=l.nice(c,a,g),f=l.nice(b,$||b,p),S=d.getLinearScale(j,L),A=d.getLinearScale(f,V),[s,M]=q.useState([c,a]),_=15,H=`calc(${i.left/o*100}% - ${_}px)`,w=`calc(${(1-S(a)/o)*100}% - ${_}px)`,C=n.map(({bin:e})=>d.between(e,s[0],s[1])),T=k.filter(({distance:e})=>d.between(e,s[0],s[1]+u)),B=n.reduce((e,{value:O},z)=>C[z]?e+O:e,0);return t.jsxs(r.ThreeVectorContainer,{ratio:{landscape:3/2,portrait:9/16},children:[t.jsxs(r.ThreeVectorLayout,{children:[t.jsxs(r.HistogramContainer,{children:[t.jsx(r.ChartTitle,{children:x("supernova_three_vector.histogram.title")}),t.jsx(r.Histogram,{data:n,activeRange:s,xDomain:j,yDomain:f,xScale:S,yScale:A,yTicks:p,xTicks:g,step:u,margin:i,width:o,height:y})]}),t.jsx(r.SliderContainer,{style:{paddingInlineStart:H,paddingInlineEnd:w},children:t.jsx(U.default,{min:c,max:a,step:u,value:s,ariaValuetext:({valueNow:e})=>x("supernova_three_vector.slider.valueLabel",{value:e}),color:"var(--turquoise85,#12726D)",minLabel:`${c} Mlyr`,maxLabel:`${a} Mlyr`,onChangeCallback:e=>Array.isArray(e)&&M(e)})}),t.jsxs(r.SkymapContainer,{children:[t.jsx(r.ChartTitle,{children:x("supernova_three_vector.skymap.title")}),t.jsx(r.Skymap,{objects:T,images:I,describedById:h,visibleImages:C})]}),t.jsx(r.ResetButton,{onResetCallback:()=>M([c,a])})]}),t.jsx(N.default,{id:h,objects:T,min:s[0],max:s[1]+u,supernovaCount:B})]})};R.displayName="Widgets.SupernovaThreeVector";exports.default=R;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
3
3
|
import { useId as N, useState as U } from "react";
|
|
4
4
|
import { useTranslation as W } from "react-i18next";
|
|
5
|
-
import { max as
|
|
5
|
+
import { max as T, min as D, nice as k } from "d3-array";
|
|
6
6
|
import F from "@rubin-epo/epo-react-lib/HorizontalSlider";
|
|
7
|
-
import { getLinearScale as
|
|
7
|
+
import { getLinearScale as R, between as V } from "./lib/utils.js";
|
|
8
8
|
import G from "./widgets/SupernovaThreeVector/LiveLabel/index.js";
|
|
9
9
|
import { ThreeVectorContainer as J, ThreeVectorLayout as K, HistogramContainer as P, ChartTitle as I, Histogram as Q, SliderContainer as X, SkymapContainer as Y, Skymap as Z, ResetButton as ee } from "./widgets/SupernovaThreeVector/styles.js";
|
|
10
10
|
const te = ({
|
|
@@ -18,12 +18,12 @@ const te = ({
|
|
|
18
18
|
bottom: 30,
|
|
19
19
|
left: 50,
|
|
20
20
|
right: 0
|
|
21
|
-
}, a = 600, u = a / 1.6, j = [r.left, a - r.right], A = [u - r.bottom, r.top], h = 6, x = 7, y = i.map(({ value: e }) => e), f = 0, B =
|
|
21
|
+
}, a = 600, u = a / 1.6, j = [r.left, a - r.right], A = [u - r.bottom, r.top], h = 6, x = 7, y = i.map(({ value: e }) => e), f = 0, B = T(y) || Math.max(...y), d = i.map(({ bin: e }) => e), s = D(d) || 0, o = T(d) || Math.max(...d), g = k(s, o, h), v = k(f, B || f, x), b = R(g, j), H = R(v, A), [t, S] = U([s, o]), M = 15, w = `calc(${r.left / a * 100}% - ${M}px)`, O = `calc(${(1 - b(o) / a) * 100}% - ${M}px)`, C = i.map(
|
|
22
22
|
({ bin: e }) => V(e, t[0], t[1])
|
|
23
23
|
), L = _.filter(
|
|
24
24
|
({ distance: e }) => V(e, t[0], t[1] + c)
|
|
25
25
|
), q = i.reduce((e, { value: z }, E) => C[E] ? e + z : e, 0);
|
|
26
|
-
return /* @__PURE__ */ l(J, { ratio:
|
|
26
|
+
return /* @__PURE__ */ l(J, { ratio: { landscape: 3 / 2, portrait: 9 / 16 }, children: [
|
|
27
27
|
/* @__PURE__ */ l(K, { children: [
|
|
28
28
|
/* @__PURE__ */ l(P, { children: [
|
|
29
29
|
/* @__PURE__ */ n(I, { children: m("supernova_three_vector.histogram.title") }),
|
|
@@ -1285,7 +1285,7 @@ export declare const SVG: import('styled-components').IStyledComponent<"web", {
|
|
|
1285
1285
|
stroke?: string | undefined;
|
|
1286
1286
|
strokeDasharray?: string | number | undefined;
|
|
1287
1287
|
strokeDashoffset?: string | number | undefined;
|
|
1288
|
-
strokeLinecap?: "inherit" | "
|
|
1288
|
+
strokeLinecap?: "inherit" | "butt" | "round" | "square" | undefined;
|
|
1289
1289
|
strokeLinejoin?: "inherit" | "round" | "miter" | "bevel" | undefined;
|
|
1290
1290
|
strokeMiterlimit?: string | number | undefined;
|
|
1291
1291
|
strokeOpacity?: string | number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),u=require("@rubin-epo/epo-react-lib/styles"),d=require("../Viewport/index.cjs"),y=require("../ForeignObject/index.cjs")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),u=require("@rubin-epo/epo-react-lib/styles"),d=require("../Viewport/index.cjs"),y=require("../ForeignObject/index.cjs");require("../ScatterPlot/index.cjs");const o=require("./styles.cjs"),j=(n="")=>{const r=["top","right"],a=["center","center"],s=n?[...n.split(" "),...a].slice(0,2):r,e={justifyContent:null,alignItems:null};return s.forEach(i=>{switch(i){case"center":e.alignItems=e.alignItems??"center",e.justifyContent=e.justifyContent??"center";break;case"top":e.alignItems="start";break;case"right":e.justifyContent="end";break;case"bottom":e.alignItems="end";break;case"left":e.justifyContent="start";break}}),e},c=({className:n,children:r,position:a,viewport:s,forIds:e,forScreenreaders:i})=>{const l=t.jsx(y.default,{children:t.jsx(o.DisplayContainer,{style:j(a),children:t.jsxs(o.Display,{form:Array.isArray(e)?e.join(" "):e,className:n,children:[t.jsx("span",{"aria-hidden":!!i,children:r}),t.jsx(u.ScreenreaderText,{children:i})]})})});return s?t.jsx(d.default,{...s,children:l}):l};c.displayName="Charts.Readout";exports.default=c;
|
|
@@ -2,9 +2,10 @@ import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { ScreenreaderText as c } from "@rubin-epo/epo-react-lib/styles";
|
|
3
3
|
import m from "../Viewport/index.js";
|
|
4
4
|
import f from "../ForeignObject/index.js";
|
|
5
|
+
import "../ScatterPlot/index.js";
|
|
5
6
|
import { DisplayContainer as u, Display as d } from "./styles.js";
|
|
6
7
|
const p = (n = "") => {
|
|
7
|
-
const
|
|
8
|
+
const o = ["top", "right"], s = ["center", "center"], i = n ? [...n.split(" "), ...s].slice(0, 2) : o, t = {
|
|
8
9
|
justifyContent: null,
|
|
9
10
|
alignItems: null
|
|
10
11
|
};
|
|
@@ -29,19 +30,19 @@ const p = (n = "") => {
|
|
|
29
30
|
}), t;
|
|
30
31
|
}, y = ({
|
|
31
32
|
className: n,
|
|
32
|
-
children:
|
|
33
|
-
position:
|
|
33
|
+
children: o,
|
|
34
|
+
position: s,
|
|
34
35
|
viewport: i,
|
|
35
36
|
forIds: t,
|
|
36
37
|
forScreenreaders: r
|
|
37
38
|
}) => {
|
|
38
|
-
const a = /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(u, { style: p(
|
|
39
|
+
const a = /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(u, { style: p(s), children: /* @__PURE__ */ l(
|
|
39
40
|
d,
|
|
40
41
|
{
|
|
41
42
|
form: Array.isArray(t) ? t.join(" ") : t,
|
|
42
43
|
className: n,
|
|
43
44
|
children: [
|
|
44
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children:
|
|
45
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children: o }),
|
|
45
46
|
/* @__PURE__ */ e(c, { children: r })
|
|
46
47
|
]
|
|
47
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react"),K=require("../XAxis/index.cjs"),Q=require("../YAxis/index.cjs"),$=require("../Guidelines/index.cjs"),U=require("../Points/index.cjs"),V=require("../Tooltip/index.cjs"),X=require("../ClippingContainer/index.cjs"),R=require("../hooks/useAxis.cjs"),Y=require("./styles.cjs"),H=require("../defaults.cjs"),Z=require("../canvas/Points/index.cjs"),w={svg:U.default,canvas:Z.default},M=({data:
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react"),K=require("../XAxis/index.cjs"),Q=require("../YAxis/index.cjs"),$=require("../Guidelines/index.cjs"),U=require("../Points/index.cjs"),V=require("../Tooltip/index.cjs"),X=require("../ClippingContainer/index.cjs"),R=require("../hooks/useAxis.cjs"),Y=require("./styles.cjs"),H=require("../defaults.cjs"),Z=require("../canvas/Points/index.cjs"),w={svg:U.default,canvas:Z.default},M=({data:C,className:D,xAxis:l,yAxis:c,width:d,height:u,title:T,activePointId:p,margins:z,tooltip:a,onLoadedCallback:B,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=C,o={...H.default.margins,...z},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===p),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,j,t]=R.default({...l,range:f}),[i,m,s]=R.default({...c,range:b}),S=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),k="x-axis-label",L="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[E],P=n.jsx(F,{data:x,onHoverCallback:a?v=>h(v):void 0,onHoverOutCallback:a?()=>h(void 0):void 0,width:d,height:u,xScale:t,yScale:s,label:O,onLoadedCallback:B}),G={Data:P,xScale:t,yScale:s,yStart:S,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(Y.Chart,{verticalLabel:c.label,verticalLabelId:L,horizontalLabel:l.label,horizontalLabelId:k,className:D,width:d,height:u,title:T,children:[n.jsx(Q.default,{ticks:m,x:g,labelledById:L,yDomain:i,yScale:s}),n.jsxs(X.default,{x:g,y:I,width:N,height:W,children:[l.guidelines&&n.jsx($.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),c.guidelines&&n.jsx($.default,{guides:m.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(K.default,{ticks:j,y:S,labelledById:k,xDomain:r,xScale:t}),a&&n.jsxs(V.default,{x:e?t(e.x):void 0,y:e?s(e.y):void 0,visible:!!e,offset:H.default.pointRadius,children:[e&&typeof a=="function"&&a(e),e&&typeof a=="string"&&a]})]})};M.displayName="Charts.ScatterPlot";exports.default=M;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { useState as F } from "react";
|
|
4
|
+
import J from "../XAxis/index.js";
|
|
5
|
+
import K from "../YAxis/index.js";
|
|
6
6
|
import R from "../Guidelines/index.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { Chart as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
svg:
|
|
16
|
-
canvas:
|
|
17
|
-
},
|
|
7
|
+
import Q from "../Points/index.js";
|
|
8
|
+
import U from "../Tooltip/index.js";
|
|
9
|
+
import V from "../ClippingContainer/index.js";
|
|
10
|
+
import D from "../hooks/useAxis.js";
|
|
11
|
+
import { Chart as Z } from "./styles.js";
|
|
12
|
+
import T from "../defaults.js";
|
|
13
|
+
import _ from "../canvas/Points/index.js";
|
|
14
|
+
const $ = {
|
|
15
|
+
svg: Q,
|
|
16
|
+
canvas: _
|
|
17
|
+
}, w = ({
|
|
18
18
|
data: j,
|
|
19
19
|
className: z,
|
|
20
|
-
xAxis:
|
|
21
|
-
yAxis:
|
|
20
|
+
xAxis: l,
|
|
21
|
+
yAxis: c,
|
|
22
22
|
width: d,
|
|
23
23
|
height: m,
|
|
24
|
-
title:
|
|
25
|
-
activePointId:
|
|
26
|
-
margins:
|
|
24
|
+
title: B,
|
|
25
|
+
activePointId: E,
|
|
26
|
+
margins: M,
|
|
27
27
|
tooltip: n,
|
|
28
|
-
onLoadedCallback:
|
|
29
|
-
renderer:
|
|
28
|
+
onLoadedCallback: A,
|
|
29
|
+
renderer: G = "svg",
|
|
30
30
|
plotChildren: x
|
|
31
31
|
}) => {
|
|
32
|
-
const [y, h] =
|
|
33
|
-
|
|
32
|
+
const [y, h] = F(), { label: N, points: f } = j, r = { ...T.margins, ...M }, t = typeof y < "u" ? f[y] : f.find(({ id: p }) => p === E), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [s, I, e] = D({ ...l, range: b }), [a, P, o] = D({ ...c, range: g }), S = o(a[0]), v = e(s[0]), k = o(a[1]), O = e(s[1]), C = "x-axis-label", L = "y-axis-label", W = Math.abs(b[1] - b[0]), X = Math.abs(g[1] - g[0]), Y = $[G], H = /* @__PURE__ */ i(
|
|
33
|
+
Y,
|
|
34
34
|
{
|
|
35
35
|
data: f,
|
|
36
36
|
onHoverCallback: n ? (p) => h(p) : void 0,
|
|
@@ -39,36 +39,36 @@ const w = {
|
|
|
39
39
|
height: m,
|
|
40
40
|
xScale: e,
|
|
41
41
|
yScale: o,
|
|
42
|
-
label:
|
|
43
|
-
onLoadedCallback:
|
|
42
|
+
label: N,
|
|
43
|
+
onLoadedCallback: A
|
|
44
44
|
}
|
|
45
|
-
),
|
|
45
|
+
), q = {
|
|
46
46
|
Data: H,
|
|
47
47
|
xScale: e,
|
|
48
48
|
yScale: o,
|
|
49
|
-
yStart:
|
|
49
|
+
yStart: S,
|
|
50
50
|
yEnd: k,
|
|
51
51
|
xStart: v,
|
|
52
|
-
xEnd:
|
|
52
|
+
xEnd: O,
|
|
53
53
|
yDomain: a,
|
|
54
54
|
xDomain: s
|
|
55
55
|
};
|
|
56
56
|
return /* @__PURE__ */ u(
|
|
57
|
-
|
|
57
|
+
Z,
|
|
58
58
|
{
|
|
59
|
-
verticalLabel:
|
|
59
|
+
verticalLabel: c.label,
|
|
60
60
|
verticalLabelId: L,
|
|
61
|
-
horizontalLabel:
|
|
61
|
+
horizontalLabel: l.label,
|
|
62
62
|
horizontalLabelId: C,
|
|
63
63
|
className: z,
|
|
64
64
|
width: d,
|
|
65
65
|
height: m,
|
|
66
|
-
title:
|
|
66
|
+
title: B,
|
|
67
67
|
children: [
|
|
68
68
|
/* @__PURE__ */ i(
|
|
69
|
-
|
|
69
|
+
K,
|
|
70
70
|
{
|
|
71
|
-
ticks:
|
|
71
|
+
ticks: P,
|
|
72
72
|
x: v,
|
|
73
73
|
labelledById: L,
|
|
74
74
|
yDomain: a,
|
|
@@ -76,17 +76,17 @@ const w = {
|
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
78
|
/* @__PURE__ */ u(
|
|
79
|
-
|
|
79
|
+
V,
|
|
80
80
|
{
|
|
81
81
|
x: v,
|
|
82
82
|
y: k,
|
|
83
|
-
width:
|
|
84
|
-
height:
|
|
83
|
+
width: W,
|
|
84
|
+
height: X,
|
|
85
85
|
children: [
|
|
86
|
-
|
|
86
|
+
l.guidelines && /* @__PURE__ */ i(
|
|
87
87
|
R,
|
|
88
88
|
{
|
|
89
|
-
guides:
|
|
89
|
+
guides: I.length,
|
|
90
90
|
direction: "vertical",
|
|
91
91
|
xDomain: s,
|
|
92
92
|
yDomain: a,
|
|
@@ -94,37 +94,37 @@ const w = {
|
|
|
94
94
|
yScale: o
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
|
|
97
|
+
c.guidelines && /* @__PURE__ */ i(
|
|
98
98
|
R,
|
|
99
99
|
{
|
|
100
|
-
guides:
|
|
100
|
+
guides: P.length,
|
|
101
101
|
xDomain: s,
|
|
102
102
|
yDomain: a,
|
|
103
103
|
xScale: e,
|
|
104
104
|
yScale: o
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
x ? x(
|
|
107
|
+
x ? x(q) : H
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
111
|
/* @__PURE__ */ i(
|
|
112
|
-
|
|
112
|
+
J,
|
|
113
113
|
{
|
|
114
|
-
ticks:
|
|
115
|
-
y:
|
|
114
|
+
ticks: I,
|
|
115
|
+
y: S,
|
|
116
116
|
labelledById: C,
|
|
117
117
|
xDomain: s,
|
|
118
118
|
xScale: e
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
121
|
n && /* @__PURE__ */ u(
|
|
122
|
-
|
|
122
|
+
U,
|
|
123
123
|
{
|
|
124
124
|
x: t ? e(t.x) : void 0,
|
|
125
125
|
y: t ? o(t.y) : void 0,
|
|
126
126
|
visible: !!t,
|
|
127
|
-
offset:
|
|
127
|
+
offset: T.pointRadius,
|
|
128
128
|
children: [
|
|
129
129
|
t && typeof n == "function" && n(t),
|
|
130
130
|
t && typeof n == "string" && n
|
|
@@ -135,8 +135,7 @@ const w = {
|
|
|
135
135
|
}
|
|
136
136
|
);
|
|
137
137
|
};
|
|
138
|
-
|
|
139
|
-
const ft = T;
|
|
138
|
+
w.displayName = "Charts.ScatterPlot";
|
|
140
139
|
export {
|
|
141
|
-
|
|
140
|
+
w as default
|
|
142
141
|
};
|