@rubin-epo/epo-widget-lib 0.10.4 → 1.0.0-beta.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.
Files changed (28) hide show
  1. package/dist/SupernovaThreeVector.cjs +1 -1
  2. package/dist/SupernovaThreeVector.js +66 -66
  3. package/dist/atomic/Blinker/Blinker.cjs +1 -1
  4. package/dist/atomic/Blinker/Blinker.d.ts +2 -1
  5. package/dist/atomic/Blinker/Blinker.js +43 -41
  6. package/dist/charts/Base/styles.cjs +5 -3
  7. package/dist/charts/Base/styles.js +12 -10
  8. package/dist/charts/ScatterPlot/index.cjs +1 -1
  9. package/dist/charts/ScatterPlot/index.js +34 -33
  10. package/dist/charts/ScatterPlot/styles.cjs +3 -4
  11. package/dist/charts/ScatterPlot/styles.js +5 -6
  12. package/dist/localeStrings/en/epo-widget-lib.json +6 -6
  13. package/dist/widgets/LightCurvePlot/Plot/index.cjs +1 -1
  14. package/dist/widgets/LightCurvePlot/Plot/index.js +53 -68
  15. package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.cjs +1 -1
  16. package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.js +1 -1
  17. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
  18. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +94 -80
  19. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  20. package/dist/widgets/SourceSelector/SourceSelector.js +53 -55
  21. package/dist/widgets/SourceSelector/styles.cjs +2 -6
  22. package/dist/widgets/SourceSelector/styles.d.ts +0 -12
  23. package/dist/widgets/SourceSelector/styles.js +2 -8
  24. package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -1
  25. package/dist/widgets/SupernovaThreeVector/Histogram/index.js +43 -43
  26. package/dist/widgets/SupernovaThreeVector/styles.cjs +6 -7
  27. package/dist/widgets/SupernovaThreeVector/styles.js +11 -12
  28. package/package.json +1 -1
@@ -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,{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}),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 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),S=l.nice(b,$||b,p),f=d.getLinearScale(j,L),A=d.getLinearScale(S,V),[s,M]=q.useState([c,a]),_=15,H=`calc(${i.left/o*100}% - ${_}px)`,w=`calc(${(1-f(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",smallScreenRatio:"portrait",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:S,xScale:f,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;
@@ -1,105 +1,105 @@
1
1
  "use client";
2
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
3
- import { useState as z } from "react";
4
- import { useTranslation as E } from "react-i18next";
5
- import { max as C, min as N, nice as M } from "d3-array";
6
- import U from "@rubin-epo/epo-react-lib/HorizontalSlider";
7
- import { getLinearScale as L, between as R } from "./lib/utils.js";
8
- import W from "./widgets/SupernovaThreeVector/LiveLabel/index.js";
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
- const Z = ({
11
- histogramData: t,
2
+ import { jsxs as l, jsx as n } from "react/jsx-runtime";
3
+ import { useId as N, useState as U } from "react";
4
+ import { useTranslation as W } from "react-i18next";
5
+ import { max as R, min as D, nice as T } from "d3-array";
6
+ import F from "@rubin-epo/epo-react-lib/HorizontalSlider";
7
+ import { getLinearScale as k, between as V } from "./lib/utils.js";
8
+ import G from "./widgets/SupernovaThreeVector/LiveLabel/index.js";
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
+ const te = ({
11
+ histogramData: i,
12
12
  userData: _,
13
13
  binnedImages: $,
14
- step: s = 100
14
+ step: c = 100
15
15
  }) => {
16
- const { t: m } = E(), o = {
16
+ const { t: m } = W(), p = N(), r = {
17
17
  top: 30,
18
18
  bottom: 30,
19
19
  left: 50,
20
20
  right: 0
21
- }, d = "skyMapDescription", c = 600, p = c / 1.6, j = [o.left, c - o.right], I = [p - o.bottom, o.top], u = 6, x = 7, h = 0, V = C(t, (e) => e.value) || Math.max(...t.map(({ value: e }) => e)), a = N(t, (e) => e.bin) || 0, i = C(t, (e) => e.bin) || Math.max(...t.map(({ bin: e }) => e)), v = M(a, i, u), b = M(h, V || h, x), f = L(v, j), A = L(b, I), [n, y] = z([a, i]), g = 15, B = `calc(${o.left / c * 100}% - ${g}px)`, H = `calc(${(1 - f(i) / c) * 100}% - ${g}px)`, S = t.map(
22
- ({ bin: e }) => R(e, n[0], n[1])
23
- ), k = _.filter(
24
- ({ distance: e }) => R(e, n[0], n[1] + s)
25
- ), w = t.reduce((e, { value: O }, q) => S[q] ? e + O : e, 0);
26
- return /* @__PURE__ */ l(F, { ratio: "landscape", smallScreenRatio: "portrait", children: [
27
- /* @__PURE__ */ l(G, { children: [
28
- /* @__PURE__ */ l(J, { children: [
29
- /* @__PURE__ */ r(T, { children: m("supernova_three_vector.histogram.title") }),
30
- /* @__PURE__ */ r(
31
- K,
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 = R(y) || Math.max(...y), d = i.map(({ bin: e }) => e), s = D(d) || 0, o = R(d) || Math.max(...d), g = T(s, o, h), v = T(f, B || f, x), b = k(g, j), H = k(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
+ ({ bin: e }) => V(e, t[0], t[1])
23
+ ), L = _.filter(
24
+ ({ distance: e }) => V(e, t[0], t[1] + c)
25
+ ), q = i.reduce((e, { value: z }, E) => C[E] ? e + z : e, 0);
26
+ return /* @__PURE__ */ l(J, { ratio: "landscape", smallScreenRatio: "portrait", children: [
27
+ /* @__PURE__ */ l(K, { children: [
28
+ /* @__PURE__ */ l(P, { children: [
29
+ /* @__PURE__ */ n(I, { children: m("supernova_three_vector.histogram.title") }),
30
+ /* @__PURE__ */ n(
31
+ Q,
32
32
  {
33
- data: t,
34
- activeRange: n,
35
- xDomain: v,
36
- yDomain: b,
37
- xScale: f,
38
- yScale: A,
33
+ data: i,
34
+ activeRange: t,
35
+ xDomain: g,
36
+ yDomain: v,
37
+ xScale: b,
38
+ yScale: H,
39
39
  yTicks: x,
40
- xTicks: u,
41
- step: s,
42
- margin: o,
43
- width: c,
44
- height: p
40
+ xTicks: h,
41
+ step: c,
42
+ margin: r,
43
+ width: a,
44
+ height: u
45
45
  }
46
46
  )
47
47
  ] }),
48
- /* @__PURE__ */ r(
49
- P,
48
+ /* @__PURE__ */ n(
49
+ X,
50
50
  {
51
51
  style: {
52
- paddingInlineStart: B,
53
- paddingInlineEnd: H
52
+ paddingInlineStart: w,
53
+ paddingInlineEnd: O
54
54
  },
55
- children: /* @__PURE__ */ r(
56
- U,
55
+ children: /* @__PURE__ */ n(
56
+ F,
57
57
  {
58
- min: a,
59
- max: i,
60
- step: s,
61
- value: n,
58
+ min: s,
59
+ max: o,
60
+ step: c,
61
+ value: t,
62
62
  ariaValuetext: ({ valueNow: e }) => m("supernova_three_vector.slider.valueLabel", { value: e }),
63
63
  color: "var(--turquoise85,#12726D)",
64
- minLabel: `${a} kpc`,
65
- maxLabel: `${i} kpc`,
66
- onChangeCallback: (e) => Array.isArray(e) && y(e)
64
+ minLabel: `${s} Mlyr`,
65
+ maxLabel: `${o} Mlyr`,
66
+ onChangeCallback: (e) => Array.isArray(e) && S(e)
67
67
  }
68
68
  )
69
69
  }
70
70
  ),
71
- /* @__PURE__ */ l(Q, { children: [
72
- /* @__PURE__ */ r(T, { children: m("supernova_three_vector.skymap.title") }),
73
- /* @__PURE__ */ r(
74
- X,
71
+ /* @__PURE__ */ l(Y, { children: [
72
+ /* @__PURE__ */ n(I, { children: m("supernova_three_vector.skymap.title") }),
73
+ /* @__PURE__ */ n(
74
+ Z,
75
75
  {
76
- objects: k,
76
+ objects: L,
77
77
  images: $,
78
- describedById: d,
79
- visibleImages: S
78
+ describedById: p,
79
+ visibleImages: C
80
80
  }
81
81
  )
82
82
  ] }),
83
- /* @__PURE__ */ r(
84
- Y,
83
+ /* @__PURE__ */ n(
84
+ ee,
85
85
  {
86
- onResetCallback: () => y([a, i])
86
+ onResetCallback: () => S([s, o])
87
87
  }
88
88
  )
89
89
  ] }),
90
- /* @__PURE__ */ r(
91
- W,
90
+ /* @__PURE__ */ n(
91
+ G,
92
92
  {
93
- id: d,
94
- objects: k,
95
- min: n[0],
96
- max: n[1] + s,
97
- supernovaCount: w
93
+ id: p,
94
+ objects: L,
95
+ min: t[0],
96
+ max: t[1] + c,
97
+ supernovaCount: q
98
98
  }
99
99
  )
100
100
  ] });
101
101
  };
102
- Z.displayName = "Widgets.SupernovaThreeVector";
102
+ te.displayName = "Widgets.SupernovaThreeVector";
103
103
  export {
104
- Z as default
104
+ te as default
105
105
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),B=require("react"),A=require("../../lib/utils.cjs"),C=require("../../hooks/useInterval.cjs"),M=require("../ImageStack/index.cjs"),l=require("./styles.cjs"),h=({images:t=[],activeIndex:i=0,autoplay:g=!0,loop:j=!0,interval:p=200,blinkCallback:n,loadedCallback:u,className:q,showControls:y=!0,children:S})=>{const[c,a]=B.useState(g),[d,v]=B.useState(!1),r=t.length>1,x=(e=0)=>{const m=t.length-1;return A.getClampedArrayIndex(i+e,m)},f=()=>{if(r){const e=x(1);j===!1&&e===t.length-1&&o(),n&&n(e)}},o=()=>{a(!1)},k=()=>{a(e=>!e)},I=()=>{o(),f()},P=()=>{o(),n&&n(x(-1))};return C.default(f,r&&d&&c?p:null),s.jsxs(l.BlinkerContainer,{className:q,children:[s.jsx(M.default,{loadCallback:()=>{v(!0),u&&u()},visible:i,images:t}),s.jsxs(l.ControlsContainer,{children:[r&&y&&s.jsx(l.BlinkerControls,{isDisabled:!d,playing:c,handleStartStop:k,handleNext:I,handlePrevious:P}),S]})]})};h.displayName="Atomic.Blinker";const N=h;exports.default=N;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("react"),C=require("../../lib/utils.cjs"),M=require("../../hooks/useInterval.cjs"),N=require("../ImageStack/index.cjs"),o=require("./styles.cjs"),B=({images:n=[],activeIndex:i=0,autoplay:g=!0,loop:j=!0,interval:p=200,blinkCallback:s,loadedCallback:u,className:q,showControls:y=!0,children:S,extraControls:v})=>{const[c,a]=h.useState(g),[d,k]=h.useState(!1),r=n.length>1,x=(e=0)=>{const A=n.length-1;return C.getClampedArrayIndex(i+e,A)},f=()=>{if(r){const e=x(1);j===!1&&e===n.length-1&&l(),s&&s(e)}},l=()=>{a(!1)},m=()=>{a(e=>!e)},I=()=>{l(),f()},P=()=>{l(),s&&s(x(-1))};return M.default(f,r&&d&&c?p:null),t.jsxs(o.BlinkerContainer,{className:q,children:[t.jsx(N.default,{loadCallback:()=>{k(!0),u&&u()},visible:i,images:n}),S,t.jsx(o.ControlsContainer,{children:r&&y&&t.jsxs(t.Fragment,{children:[t.jsx(o.BlinkerControls,{isDisabled:!d,playing:c,handleStartStop:m,handleNext:I,handlePrevious:P}),v]})})]})};B.displayName="Atomic.Blinker";const _=B;exports.default=_;
@@ -1,4 +1,4 @@
1
- import { FunctionComponent, PropsWithChildren } from 'react';
1
+ import { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
2
2
  import { ImageShape } from '@rubin-epo/epo-react-lib/Image';
3
3
 
4
4
  export interface BlinkerProps {
@@ -11,6 +11,7 @@ export interface BlinkerProps {
11
11
  loadedCallback?: () => void;
12
12
  className?: string;
13
13
  showControls?: boolean;
14
+ extraControls?: ReactNode;
14
15
  }
15
16
  declare const Blinker: FunctionComponent<PropsWithChildren<BlinkerProps>>;
16
17
  export default Blinker;
@@ -1,67 +1,69 @@
1
1
  "use client";
2
- import { jsxs as f, jsx as p } from "react/jsx-runtime";
2
+ import { jsxs as p, jsx as s, Fragment as P } from "react/jsx-runtime";
3
3
  import { useState as u } from "react";
4
- import { getClampedArrayIndex as N } from "../../lib/utils.js";
5
- import P from "../../hooks/useInterval.js";
6
- import D from "../ImageStack/index.js";
7
- import { BlinkerContainer as L, ControlsContainer as $, BlinkerControls as q } from "./styles.js";
8
- const B = ({
4
+ import { getClampedArrayIndex as D } from "../../lib/utils.js";
5
+ import F from "../../hooks/useInterval.js";
6
+ import L from "../ImageStack/index.js";
7
+ import { BlinkerContainer as $, ControlsContainer as q, BlinkerControls as w } from "./styles.js";
8
+ const h = ({
9
9
  images: n = [],
10
- activeIndex: s = 0,
11
- autoplay: h = !0,
10
+ activeIndex: l = 0,
11
+ autoplay: B = !0,
12
12
  loop: x = !0,
13
13
  interval: g = 200,
14
14
  blinkCallback: e,
15
- loadedCallback: l,
15
+ loadedCallback: i,
16
16
  className: k,
17
17
  showControls: y = !0,
18
- children: I
18
+ children: I,
19
+ extraControls: S
19
20
  }) => {
20
- const [i, a] = u(h), [c, S] = u(!1), o = n.length > 1, d = (t = 0) => {
21
- const C = n.length - 1;
22
- return N(s + t, C);
23
- }, m = () => {
24
- if (o) {
25
- const t = d(1);
26
- x === !1 && t === n.length - 1 && r(), e && e(t);
21
+ const [a, c] = u(B), [d, j] = u(!1), r = n.length > 1, m = (t = 0) => {
22
+ const N = n.length - 1;
23
+ return D(l + t, N);
24
+ }, f = () => {
25
+ if (r) {
26
+ const t = m(1);
27
+ x === !1 && t === n.length - 1 && o(), e && e(t);
27
28
  }
28
- }, r = () => {
29
- a(!1);
30
- }, j = () => {
31
- a((t) => !t);
29
+ }, o = () => {
30
+ c(!1);
32
31
  }, v = () => {
33
- r(), m();
32
+ c((t) => !t);
34
33
  }, A = () => {
35
- r(), e && e(d(-1));
34
+ o(), f();
35
+ }, C = () => {
36
+ o(), e && e(m(-1));
36
37
  };
37
- return P(m, o && c && i ? g : null), /* @__PURE__ */ f(L, { className: k, children: [
38
- /* @__PURE__ */ p(
39
- D,
38
+ return F(f, r && d && a ? g : null), /* @__PURE__ */ p($, { className: k, children: [
39
+ /* @__PURE__ */ s(
40
+ L,
40
41
  {
41
42
  loadCallback: () => {
42
- S(!0), l && l();
43
+ j(!0), i && i();
43
44
  },
44
- visible: s,
45
+ visible: l,
45
46
  images: n
46
47
  }
47
48
  ),
48
- /* @__PURE__ */ f($, { children: [
49
- o && y && /* @__PURE__ */ p(
50
- q,
49
+ I,
50
+ /* @__PURE__ */ s(q, { children: r && y && /* @__PURE__ */ p(P, { children: [
51
+ /* @__PURE__ */ s(
52
+ w,
51
53
  {
52
- isDisabled: !c,
53
- playing: i,
54
- handleStartStop: j,
55
- handleNext: v,
56
- handlePrevious: A
54
+ isDisabled: !d,
55
+ playing: a,
56
+ handleStartStop: v,
57
+ handleNext: A,
58
+ handlePrevious: C
57
59
  }
58
60
  ),
59
- I
60
- ] })
61
+ S
62
+ ] }) })
61
63
  ] });
62
64
  };
63
- B.displayName = "Atomic.Blinker";
64
- const J = B;
65
+ h.displayName = "Atomic.Blinker";
66
+ const M = h;
65
67
  export {
66
- J as default
68
+ M as default
67
69
  };
@@ -28,18 +28,20 @@
28
28
  grid-area: filler;
29
29
  width: var(--label-height);
30
30
  `,d=e.default.svg`
31
+ font-size: 1em;
31
32
  grid-area: chart;
32
33
  max-width: 100%;
33
34
  max-height: 100%;
34
35
  aspect-ratio: var(--aspect-ratio);
36
+ overflow: visible;
35
37
  z-index: 1;
36
- `,c=e.default.div`
38
+ `,o=e.default.div`
37
39
  display: flex;
38
40
  align-items: center;
39
41
  grid-area: title;
40
42
  height: var(--label-height);
41
43
  padding-inline: var(--label-gutter);
42
- `,o=e.default.h3`
44
+ `,c=e.default.h3`
43
45
  margin: 0;
44
46
  `,s=e.default.div`
45
47
  width: var(--label-height);
@@ -56,4 +58,4 @@
56
58
  height: 100%;
57
59
  width: 100%;
58
60
  font-size: 80%;
59
- `;exports.ChartContainer=r;exports.Filler=n;exports.HorizontalLabelWrapper=g;exports.Label=h;exports.SVG=d;exports.Title=o;exports.TitleWrapper=c;exports.VerticalLabelWrapper=s;
61
+ `;exports.ChartContainer=r;exports.Filler=n;exports.HorizontalLabelWrapper=g;exports.Label=h;exports.SVG=d;exports.Title=c;exports.TitleWrapper=o;exports.VerticalLabelWrapper=s;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import e from "styled-components";
3
3
  import { token as t } from "@rubin-epo/epo-react-lib/styles";
4
- const l = e.div`
4
+ const a = e.div`
5
5
  --label-height: 2em;
6
6
  --label-gutter: calc(var(--label-height) / 2);
7
7
 
@@ -34,28 +34,30 @@ const r = e.div`
34
34
  grid-area: filler;
35
35
  width: var(--label-height);
36
36
  `, n = e.svg`
37
+ font-size: 1em;
37
38
  grid-area: chart;
38
39
  max-width: 100%;
39
40
  max-height: 100%;
40
41
  aspect-ratio: var(--aspect-ratio);
42
+ overflow: visible;
41
43
  z-index: 1;
42
- `, c = e.div`
44
+ `, o = e.div`
43
45
  display: flex;
44
46
  align-items: center;
45
47
  grid-area: title;
46
48
  height: var(--label-height);
47
49
  padding-inline: var(--label-gutter);
48
- `, o = e.h3`
50
+ `, c = e.h3`
49
51
  margin: 0;
50
52
  `, h = e.div`
51
53
  width: var(--label-height);
52
54
  writing-mode: vertical-rl;
53
55
  transform: rotate(180deg);
54
56
  grid-area: vertical-label;
55
- `, g = e.div`
57
+ `, s = e.div`
56
58
  height: var(--label-height);
57
59
  grid-area: horizontal-label;
58
- `, d = e.span`
60
+ `, g = e.span`
59
61
  display: flex;
60
62
  align-items: center;
61
63
  justify-content: center;
@@ -64,12 +66,12 @@ const r = e.div`
64
66
  font-size: 80%;
65
67
  `;
66
68
  export {
67
- l as ChartContainer,
69
+ a as ChartContainer,
68
70
  r as Filler,
69
- g as HorizontalLabelWrapper,
70
- d as Label,
71
+ s as HorizontalLabelWrapper,
72
+ g as Label,
71
73
  n as SVG,
72
- o as Title,
73
- c as TitleWrapper,
74
+ c as Title,
75
+ o as TitleWrapper,
74
76
  h as VerticalLabelWrapper
75
77
  };
@@ -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:B,className:C,xAxis:c,yAxis:l,width:d,height:u,title:D,activePointId:T,margins:p,tooltip:a,onLoadedCallback:z,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=B,o={...H.default.margins,...p},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===T),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,j,t]=R.default({...c,range:f}),[i,S,s]=R.default({...l,range:b}),m=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),P="x-axis-label",k="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[E],L=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:z}),G={Data:L,xScale:t,yScale:s,yStart:m,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(Y.Chart,{verticalLabel:l.label,verticalLabelId:k,horizontalLabel:c.label,horizontalLabelId:P,className:C,width:d,height:u,title:D,children:[n.jsx(Q.default,{ticks:S,x:g,labelledById:k,yDomain:i,yScale:s}),n.jsxs(X.default,{x:g,y:I,width:N,height:W,children:[c.guidelines&&n.jsx($.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),l.guidelines&&n.jsx($.default,{guides:S.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):L]}),n.jsx(K.default,{ticks:j,y:m,labelledById:P,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";const A=M;exports.default=A;
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=require("../../lib/utils.cjs"),A={svg:U.default,canvas:Z.default},M=({data:B,className:C,xAxis:c,yAxis:l,width:d,height:u,title:D,activePointId:T,margins:p,tooltip:a,onLoadedCallback:z,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=B,o={...H.default.margins,...p},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===T),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,S,t]=R.default({...c,range:f}),[i,j,s]=R.default({...l,range:b}),m=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),P="x-axis-label",k="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=A[E],L=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:z}),G={Data:L,xScale:t,yScale:s,yStart:m,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(Y.Chart,{verticalLabel:l.label,verticalLabelId:k,horizontalLabel:c.label,horizontalLabelId:P,className:C,width:d,height:u,title:D,children:[n.jsx(Q.default,{ticks:j,x:g,labelledById:k,yDomain:i,yScale:s}),n.jsxs(X.default,{x:g,y:I,width:N,height:W,children:[c.guidelines&&n.jsx($.default,{guides:S.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),l.guidelines&&n.jsx($.default,{guides:j.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):L]}),n.jsx(K.default,{ticks:S,y:m,labelledById:P,xDomain:r,xScale:t}),a&&!w.isSafari()&&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";const ee=M;exports.default=ee;
@@ -11,7 +11,8 @@ import B from "../hooks/useAxis.js";
11
11
  import { Chart as _ } from "./styles.js";
12
12
  import D from "../defaults.js";
13
13
  import $ from "../canvas/Points/index.js";
14
- const w = {
14
+ import { isSafari as w } from "../../lib/utils.js";
15
+ const tt = {
15
16
  svg: U,
16
17
  canvas: $
17
18
  }, T = ({
@@ -29,29 +30,29 @@ const w = {
29
30
  renderer: N = "svg",
30
31
  plotChildren: x
31
32
  }) => {
32
- const [y, h] = J(), { label: O, points: f } = j, r = { ...D.margins, ...A }, t = typeof y < "u" ? f[y] : f.find(({ id: p }) => p === M), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [s, P, e] = B({ ...c, range: b }), [a, S, o] = B({ ...l, range: g }), I = o(a[0]), v = e(s[0]), k = o(a[1]), W = e(s[1]), C = "x-axis-label", L = "y-axis-label", X = Math.abs(b[1] - b[0]), Y = Math.abs(g[1] - g[0]), q = w[N], H = /* @__PURE__ */ i(
33
+ const [y, h] = J(), { label: O, points: f } = j, r = { ...D.margins, ...A }, t = typeof y < "u" ? f[y] : f.find(({ id: v }) => v === M), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [a, S, o] = B({ ...c, range: b }), [s, P, e] = B({ ...l, range: g }), I = e(s[0]), p = o(a[0]), k = e(s[1]), W = o(a[1]), C = "x-axis-label", L = "y-axis-label", X = Math.abs(b[1] - b[0]), Y = Math.abs(g[1] - g[0]), q = tt[N], H = /* @__PURE__ */ i(
33
34
  q,
34
35
  {
35
36
  data: f,
36
- onHoverCallback: n ? (p) => h(p) : void 0,
37
+ onHoverCallback: n ? (v) => h(v) : void 0,
37
38
  onHoverOutCallback: n ? () => h(void 0) : void 0,
38
39
  width: d,
39
40
  height: m,
40
- xScale: e,
41
- yScale: o,
41
+ xScale: o,
42
+ yScale: e,
42
43
  label: O,
43
44
  onLoadedCallback: G
44
45
  }
45
46
  ), F = {
46
47
  Data: H,
47
- xScale: e,
48
- yScale: o,
48
+ xScale: o,
49
+ yScale: e,
49
50
  yStart: I,
50
51
  yEnd: k,
51
- xStart: v,
52
+ xStart: p,
52
53
  xEnd: W,
53
- yDomain: a,
54
- xDomain: s
54
+ yDomain: s,
55
+ xDomain: a
55
56
  };
56
57
  return /* @__PURE__ */ u(
57
58
  _,
@@ -68,17 +69,17 @@ const w = {
68
69
  /* @__PURE__ */ i(
69
70
  Q,
70
71
  {
71
- ticks: S,
72
- x: v,
72
+ ticks: P,
73
+ x: p,
73
74
  labelledById: L,
74
- yDomain: a,
75
- yScale: o
75
+ yDomain: s,
76
+ yScale: e
76
77
  }
77
78
  ),
78
79
  /* @__PURE__ */ u(
79
80
  Z,
80
81
  {
81
- x: v,
82
+ x: p,
82
83
  y: k,
83
84
  width: X,
84
85
  height: Y,
@@ -86,22 +87,22 @@ const w = {
86
87
  c.guidelines && /* @__PURE__ */ i(
87
88
  R,
88
89
  {
89
- guides: P.length,
90
+ guides: S.length,
90
91
  direction: "vertical",
91
- xDomain: s,
92
- yDomain: a,
93
- xScale: e,
94
- yScale: o
92
+ xDomain: a,
93
+ yDomain: s,
94
+ xScale: o,
95
+ yScale: e
95
96
  }
96
97
  ),
97
98
  l.guidelines && /* @__PURE__ */ i(
98
99
  R,
99
100
  {
100
- guides: S.length,
101
- xDomain: s,
102
- yDomain: a,
103
- xScale: e,
104
- yScale: o
101
+ guides: P.length,
102
+ xDomain: a,
103
+ yDomain: s,
104
+ xScale: o,
105
+ yScale: e
105
106
  }
106
107
  ),
107
108
  x ? x(F) : H
@@ -111,18 +112,18 @@ const w = {
111
112
  /* @__PURE__ */ i(
112
113
  K,
113
114
  {
114
- ticks: P,
115
+ ticks: S,
115
116
  y: I,
116
117
  labelledById: C,
117
- xDomain: s,
118
- xScale: e
118
+ xDomain: a,
119
+ xScale: o
119
120
  }
120
121
  ),
121
- n && /* @__PURE__ */ u(
122
+ n && !w() && /* @__PURE__ */ u(
122
123
  V,
123
124
  {
124
- x: t ? e(t.x) : void 0,
125
- y: t ? o(t.y) : void 0,
125
+ x: t ? o(t.x) : void 0,
126
+ y: t ? e(t.y) : void 0,
126
127
  visible: !!t,
127
128
  offset: D.pointRadius,
128
129
  children: [
@@ -136,7 +137,7 @@ const w = {
136
137
  );
137
138
  };
138
139
  T.displayName = "Charts.ScatterPlot";
139
- const ft = T;
140
+ const gt = T;
140
141
  export {
141
- ft as default
142
+ gt as default
142
143
  };
@@ -1,10 +1,9 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),o=require("@rubin-epo/epo-react-lib/styles"),n=require("../Base/index.cjs"),s=e=>e&&e.__esModule?e:{default:e},i=s(t),l=i.default(n.default)`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("styled-components"),n=require("@rubin-epo/epo-react-lib/styles"),o=require("../Base/index.cjs"),s=e=>e&&e.__esModule?e:{default:e},i=s(t),r=i.default(o.default)`
2
2
  font-size: 1.5em;
3
- overflow: visible;
4
3
 
5
4
  @container (
6
- min-width: ${o.token("BREAK_PHABLET_MIN")}
5
+ min-width: ${n.token("BREAK_PHABLET_MIN")}
7
6
  ) {
8
7
  font-size: 1em;
9
8
  }
10
- `;exports.Chart=l;
9
+ `;exports.Chart=r;
@@ -1,13 +1,12 @@
1
1
  "use client";
2
- import o from "styled-components";
3
- import { token as e } from "@rubin-epo/epo-react-lib/styles";
4
- import t from "../Base/index.js";
5
- const n = o(t)`
2
+ import t from "styled-components";
3
+ import { token as o } from "@rubin-epo/epo-react-lib/styles";
4
+ import e from "../Base/index.js";
5
+ const n = t(e)`
6
6
  font-size: 1.5em;
7
- overflow: visible;
8
7
 
9
8
  @container (
10
- min-width: ${e("BREAK_PHABLET_MIN")}
9
+ min-width: ${o("BREAK_PHABLET_MIN")}
11
10
  ) {
12
11
  font-size: 1em;
13
12
  }
@@ -83,19 +83,19 @@
83
83
  "supernova_three_vector": {
84
84
  "histogram": {
85
85
  "title": "Supernova Distances",
86
- "x_label": "Distance [kpc]",
87
- "bar_label_one": "{{binMin}} to {{binMax}} kiloparsecs: {{count}} supernova",
88
- "bar_label_other": "{{binMin}} to {{binMax}} kiloparsecs: {{count}} supernovae"
86
+ "x_label": "Distance [Mlyr]",
87
+ "bar_label_one": "{{binMin}} to {{binMax}} mega-lightyears: {{count}} supernova",
88
+ "bar_label_other": "{{binMin}} to {{binMax}} mega-lightyears: {{count}} supernovae"
89
89
  },
90
90
  "slider": {
91
91
  "label": "Select visible range",
92
- "valueLabel": "{{value}} kiloparsecs"
92
+ "valueLabel": "{{value}} mega-lightyears"
93
93
  },
94
94
  "skymap": {
95
95
  "title": "Supernova Distribution",
96
96
  "description": "$t(supernova_three_vector.skymap.supernova_count, {\"count\": {{supernovaCount}}, \"min\": {{min}}, \"max\": {{max}}}) $t(supernova_three_vector.skymap.user_supernova_count, {\"count\": {{userObjectCount}}})",
97
- "supernova_count_one": "Sky map projection showing {{count}} supernova between the distances of {{min}} and {{max}} kiloparsecs.",
98
- "supernova_count_other": "Sky map projection showing {{count}} supernovae between the distances of {{min}} and {{max}} kiloparsecs.",
97
+ "supernova_count_one": "Sky map projection showing {{count}} supernova between the distances of {{min}} and {{max}} mega-lightyears.",
98
+ "supernova_count_other": "Sky map projection showing {{count}} supernovae between the distances of {{min}} and {{max}} mega-lightyears.",
99
99
  "user_supernova_count_zero": "None of your supernovae are visible.",
100
100
  "user_supernova_count_one": "{{count}} of your supernovae is visible near {{coords}}.",
101
101
  "user_supernova_count_other": "{{count}} of your supernovae are visible near {{coords}}."