@rubin-epo/epo-widget-lib 0.10.4 → 1.0.0-beta.2

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 (33) hide show
  1. package/dist/IsochronePlot.js +7 -7
  2. package/dist/SupernovaThreeVector.cjs +1 -1
  3. package/dist/SupernovaThreeVector.js +66 -66
  4. package/dist/atomic/Blinker/Blinker.cjs +1 -1
  5. package/dist/atomic/Blinker/Blinker.d.ts +2 -1
  6. package/dist/atomic/Blinker/Blinker.js +43 -41
  7. package/dist/charts/Base/styles.cjs +5 -3
  8. package/dist/charts/Base/styles.js +12 -10
  9. package/dist/charts/Readout/index.cjs +1 -1
  10. package/dist/charts/Readout/index.js +6 -5
  11. package/dist/charts/ScatterPlot/index.cjs +1 -1
  12. package/dist/charts/ScatterPlot/index.js +77 -77
  13. package/dist/charts/ScatterPlot/styles.cjs +3 -4
  14. package/dist/charts/ScatterPlot/styles.js +5 -6
  15. package/dist/lib/utils.cjs +1 -1
  16. package/dist/lib/utils.js +18 -16
  17. package/dist/localeStrings/en/epo-widget-lib.json +6 -6
  18. package/dist/widgets/LightCurvePlot/Plot/index.cjs +1 -1
  19. package/dist/widgets/LightCurvePlot/Plot/index.js +53 -68
  20. package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.cjs +1 -1
  21. package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.js +1 -1
  22. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
  23. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +94 -80
  24. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  25. package/dist/widgets/SourceSelector/SourceSelector.js +37 -39
  26. package/dist/widgets/SourceSelector/styles.d.ts +1 -0
  27. package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -1
  28. package/dist/widgets/SupernovaThreeVector/Histogram/index.js +43 -43
  29. package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
  30. package/dist/widgets/SupernovaThreeVector/Skymap/index.js +3 -2
  31. package/dist/widgets/SupernovaThreeVector/styles.cjs +6 -7
  32. package/dist/widgets/SupernovaThreeVector/styles.js +11 -12
  33. package/package.json +1 -1
@@ -1,120 +1,134 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as L, Fragment as d } from "react/jsx-runtime";
3
- import { useId as N } from "react";
4
- import { useTranslation as T } from "react-i18next";
5
- import { range as V } from "d3-array";
6
- import I from "@rubin-epo/epo-react-lib/HorizontalSlider";
2
+ import { jsx as t, jsxs as A, Fragment as d } from "react/jsx-runtime";
3
+ import { useId as T } from "react";
4
+ import { useTranslation as V } from "react-i18next";
5
+ import { range as J } from "d3-array";
6
+ import D from "@rubin-epo/epo-react-lib/HorizontalSlider";
7
7
  import r from "../defaults.js";
8
- import J from "../Plot/index.js";
9
- import K from "./A11Y/LightCurveLabel/index.js";
10
- import { useAlertsAsPoints as Q, estimateMagnitudeWithOffset as X, estimateMagnitude as Z } from "../helpers.js";
11
- import E from "../../../atomic/Button/patterns/Reset.js";
12
- import O from "./MagnitudeSlider/index.js";
13
- import { DM15Display as G } from "./styles.js";
14
- import U from "../../../charts/Viewport/index.js";
15
- import Y from "../../../layout/Controls/index.js";
16
- import A from "../../../atomic/ControlLabel/index.js";
17
- import k from "../../../charts/PathFromPoints/index.js";
18
- import { mergeWithDefaults as C } from "../../../lib/utils.js";
19
- const B = ({
20
- gaussianWidth: i = r.gaussianWidth,
8
+ import K from "../Plot/index.js";
9
+ import Q from "./A11Y/LightCurveLabel/index.js";
10
+ import { useAlertsAsPoints as X, estimateMagnitudeWithOffset as Z, estimateMagnitude as O } from "../helpers.js";
11
+ import k from "../../../atomic/Button/patterns/Reset.js";
12
+ import S from "./MagnitudeSlider/index.js";
13
+ import { DM15Display as C } from "./styles.js";
14
+ import G from "../../../charts/Viewport/index.js";
15
+ import U from "../../../layout/Controls/index.js";
16
+ import I from "../../../atomic/ControlLabel/index.js";
17
+ import Y from "../../../charts/PathFromPoints/index.js";
18
+ import { mergeWithDefaults as tt } from "../../../lib/utils.js";
19
+ const w = ({
20
+ gaussianWidth: m = r.gaussianWidth,
21
21
  yOffset: s = r.yOffset,
22
- alerts: _,
23
- peakMjd: w,
24
- yMin: p,
22
+ alerts: B,
23
+ peakMjd: _,
24
+ yMin: a,
25
25
  yMax: f,
26
- width: a = r.width,
27
- height: c = r.height,
28
- userMagnitude: D,
26
+ width: c = r.width,
27
+ height: h = r.height,
28
+ userMagnitude: F,
29
29
  onUserMagnitudeChangeCallback: n,
30
30
  onGaussianChangeCallback: l,
31
31
  onYOffsetChangeCallback: u,
32
- className: F,
32
+ className: H,
33
33
  isDisplayOnly: g,
34
- ...H
34
+ ...R
35
35
  }) => {
36
- const { t: h } = T(), m = C(
37
- { min: p, max: f },
36
+ const { t: v } = V(), i = tt(
37
+ { min: a, max: f },
38
38
  r.yAxis
39
- ), y = (m.max - m.min) / 2 + m.min, v = Q(_, w), R = N(), j = () => {
39
+ ), y = (i.max - i.min) / 2 + i.min, x = X(B, _), j = T(), q = () => {
40
40
  n && n(y), u && u(r.yOffset), l && l(r.gaussianWidth);
41
- }, x = X(0, i, s), q = /* @__PURE__ */ t(
42
- J,
41
+ }, b = Z(0, m, s), $ = /* @__PURE__ */ t(
42
+ K,
43
43
  {
44
44
  slider: /* @__PURE__ */ t(
45
- O,
45
+ S,
46
46
  {
47
- magnitude: D || y,
47
+ magnitude: F || y,
48
48
  onMagnitudeChangeCallback: (e) => n && n(e),
49
49
  disabled: g,
50
- yMin: m.min,
51
- yMax: m.max,
52
- estimatedPeak: x
50
+ yMin: i.min - i.step / 2,
51
+ yMax: i.max + i.step / 2,
52
+ estimatedPeak: b
53
53
  }
54
54
  ),
55
55
  plotChildren: ({
56
56
  xScale: e,
57
57
  yScale: o,
58
- xDomain: b,
59
- yDomain: S,
60
- xStart: P,
61
- xEnd: $,
62
- yStart: z,
63
- yEnd: M
64
- }) => /* @__PURE__ */ L(d, { children: [
58
+ xDomain: P,
59
+ yDomain: z,
60
+ xStart: M,
61
+ xEnd: E,
62
+ yStart: W,
63
+ yEnd: p,
64
+ Data: N
65
+ }) => /* @__PURE__ */ A(d, { children: [
65
66
  /* @__PURE__ */ t(
66
- k,
67
+ "rect",
67
68
  {
68
- points: V(b[0], b[1], 0.5).map((W) => ({
69
- x: e(W),
70
- y: o(Z(W, i))
69
+ x: e(0),
70
+ y: p,
71
+ width: e(15) - e(0),
72
+ height: W - p,
73
+ stroke: "var(--neutral60,##6A6E6E)",
74
+ strokeDasharray: 6,
75
+ fill: "var(--neutral20,#DCE0E3)"
76
+ }
77
+ ),
78
+ N,
79
+ /* @__PURE__ */ t(
80
+ Y,
81
+ {
82
+ points: J(P[0], P[1], 0.5).map((L) => ({
83
+ x: e(L),
84
+ y: o(O(L, m))
71
85
  })),
72
86
  svgProps: {
73
- transform: `translate(0,${o(S[1] - s)})`
87
+ transform: `translate(0,${o(z[1] - s)})`
74
88
  }
75
89
  }
76
90
  ),
77
91
  /* @__PURE__ */ t(
78
- U,
92
+ G,
79
93
  {
80
- x: P,
81
- y: M,
82
- outerHeight: z - M,
83
- outerWidth: $ - P,
84
- innerWidth: a,
85
- innerHeight: c,
86
- children: /* @__PURE__ */ t(G, { gaussianWidth: i })
94
+ x: M,
95
+ y: p,
96
+ outerHeight: W - p,
97
+ outerWidth: E - M,
98
+ innerWidth: c,
99
+ innerHeight: h,
100
+ children: /* @__PURE__ */ t(C, { gaussianWidth: m })
87
101
  }
88
102
  )
89
103
  ] }),
90
- ...H,
91
- data: v,
92
- width: a,
93
- height: c,
94
- yMin: p,
104
+ ...R,
105
+ data: x,
106
+ width: c,
107
+ height: h,
108
+ yMin: a,
95
109
  yMax: f
96
110
  }
97
111
  );
98
112
  return /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(
99
- Y,
113
+ U,
100
114
  {
101
- className: F,
115
+ className: H,
102
116
  isDisplayOnly: g,
103
- widget: q,
104
- controls: /* @__PURE__ */ L(d, { children: [
117
+ widget: $,
118
+ controls: /* @__PURE__ */ A(d, { children: [
105
119
  /* @__PURE__ */ t(
106
- A,
120
+ I,
107
121
  {
108
- label: h("light_curve.curve.controls.gaussian_width"),
122
+ label: v("light_curve.curve.controls.gaussian_width"),
109
123
  input: (e) => /* @__PURE__ */ t(
110
- I,
124
+ D,
111
125
  {
112
126
  labelledbyId: e,
113
127
  color: "var(--turquoise85, #12726D)",
114
128
  min: r.gaussianMin,
115
129
  max: r.gaussianMax,
116
130
  step: r.gaussianStep,
117
- value: i,
131
+ value: m,
118
132
  onChangeCallback: (o) => typeof o == "number" && l && l(o)
119
133
  }
120
134
  ),
@@ -122,11 +136,11 @@ const B = ({
122
136
  }
123
137
  ),
124
138
  /* @__PURE__ */ t(
125
- A,
139
+ I,
126
140
  {
127
- label: h("light_curve.curve.controls.y_offset"),
141
+ label: v("light_curve.curve.controls.y_offset"),
128
142
  input: (e) => /* @__PURE__ */ t(
129
- I,
143
+ D,
130
144
  {
131
145
  labelledbyId: e,
132
146
  color: "var(--turquoise85, #12726D)",
@@ -141,22 +155,22 @@ const B = ({
141
155
  }
142
156
  ),
143
157
  /* @__PURE__ */ t(
144
- K,
158
+ Q,
145
159
  {
146
- controlledById: R,
147
- data: v,
148
- gaussianWidth: i,
160
+ controlledById: j,
161
+ data: x,
162
+ gaussianWidth: m,
149
163
  yOffset: s,
150
- estimatedPeak: x
164
+ estimatedPeak: b
151
165
  }
152
166
  )
153
167
  ] }),
154
- actions: /* @__PURE__ */ t(E, { onResetCallback: j })
168
+ actions: /* @__PURE__ */ t(k, { onResetCallback: q })
155
169
  }
156
170
  ) });
157
171
  };
158
- B.displayName = "Widgets.LightCurve";
159
- const yt = B;
172
+ w.displayName = "Widgets.LightCurve";
173
+ const yt = w;
160
174
  export {
161
175
  yt as default
162
176
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),l=require("react"),y=require("react-i18next"),z=require("@rubin-epo/epo-react-lib/IconComposer"),E=require("../../layout/AspectRatio/index.cjs"),I=require("./PointSelector/index.cjs"),N=require("../../atomic/Loader/index.cjs"),R=require("./styles.cjs"),U=require("./Message/Message.cjs"),w=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),D=e=>e&&e.__esModule?e:{default:e},G=D(z),H=(e,u)=>{var r;const n={day:0,hour:0},o=e[u];if(!o)return n;const t=(o==null?void 0:o.date)-((r=e[0])==null?void 0:r.date);return t?{day:Math.round(t)||0,hour:Math.round(24/t%24)||0}:n},q=({width:e=600,height:u=600,selectedSource:n=[],sources:o,alerts:t=[],activeAlertIndex:r=0,alertChangeCallback:M,selectionCallback:d,blinkConfig:j,isDisplayOnly:c=!1,isLoading:b,className:_})=>{var S;const[C,k]=l.useState(!0),[p,f]=l.useState(),[V,i]=l.useState(!1),{t:g}=y.useTranslation(),h="sourceSelectorWidget",m=!C&&!b,x=()=>{f(g("source_selector.messages.failure")),i(!0)},L=a=>{if(!(!m||c))if(a){const F=!!o.find(({id:W})=>W===a),P=!n.includes(a);F&&P?(d&&d(n.concat(a)),f(s.jsxs(s.Fragment,{children:[s.jsx(G.default,{icon:"checkmark"}),g("source_selector.messages.success")]})),i(!0)):x()}else x()},T=()=>{i(!1)},{day:$,hour:v}=H(t,r),B=c?[(S=t[r])==null?void 0:S.image]:t.map(({image:a})=>a);return s.jsxs(E.default,{ratio:"square",className:_,children:[!c&&s.jsx(U.default,{onMessageChangeCallback:T,isVisible:V,forIds:[h],children:p}),s.jsxs(R.BackgroundBlinker,{images:B,activeIndex:r,blinkCallback:M,loadedCallback:()=>k(!1),...j,children:[t.length>0&&!c&&s.jsx(w.default,{day:$,hour:v}),s.jsx(I.default,{id:h,onSelectCallback:L,width:e,height:u,sources:o,selectedSource:n})]}),!m&&s.jsx(N.default,{})]})};q.displayName="Widgets.SourceSelector";const J=q;exports.default=J;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),l=require("react"),y=require("react-i18next"),z=require("@rubin-epo/epo-react-lib/IconComposer"),E=require("../../layout/AspectRatio/index.cjs"),I=require("../../atomic/Loader/index.cjs"),N=require("./PointSelector/index.cjs"),R=require("./styles.cjs"),U=require("./Message/Message.cjs"),w=require("../../atomic/ElapsedTime/ElapsedTime.cjs"),D=e=>e&&e.__esModule?e:{default:e},G=D(z),H=(e,u)=>{var r;const n={day:0,hour:0},o=e[u];if(!o)return n;const t=(o==null?void 0:o.date)-((r=e[0])==null?void 0:r.date);return t?{day:Math.round(t)||0,hour:Math.round(24/t%24)||0}:n},q=({width:e=600,height:u=600,selectedSource:n=[],sources:o,alerts:t=[],activeAlertIndex:r=0,alertChangeCallback:M,selectionCallback:d,blinkConfig:j,isDisplayOnly:c=!1,isLoading:b,className:C})=>{var S;const[_,k]=l.useState(!0),[p,f]=l.useState(),[V,i]=l.useState(!1),{t:g}=y.useTranslation(),h="sourceSelectorWidget",m=!_&&!b,x=()=>{f(g("source_selector.messages.failure")),i(!0)},L=a=>{if(!(!m||c))if(a){const F=!!o.find(({id:W})=>W===a),P=!n.includes(a);F&&P?(d&&d(n.concat(a)),f(s.jsxs(s.Fragment,{children:[s.jsx(G.default,{icon:"checkmark"}),g("source_selector.messages.success")]})),i(!0)):x()}else x()},T=()=>{i(!1)},{day:$,hour:v}=H(t,r),B=c?[(S=t[r])==null?void 0:S.image]:t.map(({image:a})=>a);return s.jsxs(E.default,{ratio:"square",className:C,children:[!c&&s.jsx(U.default,{onMessageChangeCallback:T,isVisible:V,forIds:[h],children:p}),s.jsx(R.BackgroundBlinker,{images:B,activeIndex:r,blinkCallback:M,loadedCallback:()=>k(!1),extraControls:t.length>0&&!c&&s.jsx(w.default,{day:$,hour:v}),...j,children:s.jsx(N.default,{id:h,onSelectCallback:L,width:e,height:u,sources:o,selectedSource:n})}),!m&&s.jsx(I.default,{})]})};q.displayName="Widgets.SourceSelector";const J=q;exports.default=J;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as f, jsx as a, Fragment as R } from "react/jsx-runtime";
3
- import { useState as u } from "react";
2
+ import { jsxs as C, jsx as a, Fragment as R } from "react/jsx-runtime";
3
+ import { useState as f } from "react";
4
4
  import { useTranslation as U } from "react-i18next";
5
5
  import $ from "@rubin-epo/epo-react-lib/IconComposer";
6
6
  import v from "../../layout/AspectRatio/index.js";
7
- import w from "./PointSelector/index.js";
8
- import G from "../../atomic/Loader/index.js";
7
+ import w from "../../atomic/Loader/index.js";
8
+ import G from "./PointSelector/index.js";
9
9
  import { BackgroundBlinker as H } from "./styles.js";
10
10
  import J from "./Message/Message.js";
11
11
  import K from "../../atomic/ElapsedTime/ElapsedTime.js";
@@ -19,77 +19,75 @@ const Q = (n, c) => {
19
19
  day: Math.round(e) || 0,
20
20
  hour: Math.round(24 / e % 24) || 0
21
21
  } : s;
22
- }, b = ({
22
+ }, M = ({
23
23
  width: n = 600,
24
24
  height: c = 600,
25
25
  selectedSource: s = [],
26
26
  sources: o,
27
27
  alerts: e = [],
28
28
  activeAlertIndex: r = 0,
29
- alertChangeCallback: C,
30
- selectionCallback: d,
29
+ alertChangeCallback: b,
30
+ selectionCallback: l,
31
31
  blinkConfig: k,
32
32
  isDisplayOnly: i = !1,
33
33
  isLoading: L,
34
34
  className: V
35
35
  }) => {
36
- var M;
37
- const [j, x] = u(!0), [B, l] = u(), [F, m] = u(!1), { t: g } = U(), h = "sourceSelectorWidget", p = !j && !L, S = () => {
38
- l(g("source_selector.messages.failure")), m(!0);
36
+ var S;
37
+ const [x, j] = f(!0), [B, u] = f(), [F, m] = f(!1), { t: d } = U(), g = "sourceSelectorWidget", h = !x && !L, p = () => {
38
+ u(d("source_selector.messages.failure")), m(!0);
39
39
  }, P = (t) => {
40
- if (!(!p || i))
40
+ if (!(!h || i))
41
41
  if (t) {
42
42
  const z = !!o.find(({ id: N }) => N === t), E = !s.includes(t);
43
- z && E ? (d && d(s.concat(t)), l(
44
- /* @__PURE__ */ f(R, { children: [
43
+ z && E ? (l && l(s.concat(t)), u(
44
+ /* @__PURE__ */ C(R, { children: [
45
45
  /* @__PURE__ */ a($, { icon: "checkmark" }),
46
- g("source_selector.messages.success")
46
+ d("source_selector.messages.success")
47
47
  ] })
48
- ), m(!0)) : S();
48
+ ), m(!0)) : p();
49
49
  } else
50
- S();
50
+ p();
51
51
  }, T = () => {
52
52
  m(!1);
53
- }, { day: W, hour: _ } = Q(e, r), q = i ? [(M = e[r]) == null ? void 0 : M.image] : e.map(({ image: t }) => t);
54
- return /* @__PURE__ */ f(v, { ratio: "square", className: V, children: [
53
+ }, { day: W, hour: _ } = Q(e, r), q = i ? [(S = e[r]) == null ? void 0 : S.image] : e.map(({ image: t }) => t);
54
+ return /* @__PURE__ */ C(v, { ratio: "square", className: V, children: [
55
55
  !i && /* @__PURE__ */ a(
56
56
  J,
57
57
  {
58
58
  onMessageChangeCallback: T,
59
59
  isVisible: F,
60
- forIds: [h],
60
+ forIds: [g],
61
61
  children: B
62
62
  }
63
63
  ),
64
- /* @__PURE__ */ f(
64
+ /* @__PURE__ */ a(
65
65
  H,
66
66
  {
67
67
  images: q,
68
68
  activeIndex: r,
69
- blinkCallback: C,
70
- loadedCallback: () => x(!1),
69
+ blinkCallback: b,
70
+ loadedCallback: () => j(!1),
71
+ extraControls: e.length > 0 && !i && /* @__PURE__ */ a(K, { day: W, hour: _ }),
71
72
  ...k,
72
- children: [
73
- e.length > 0 && !i && /* @__PURE__ */ a(K, { day: W, hour: _ }),
74
- /* @__PURE__ */ a(
75
- w,
76
- {
77
- id: h,
78
- onSelectCallback: P,
79
- width: n,
80
- height: c,
81
- sources: o,
82
- selectedSource: s
83
- }
84
- )
85
- ]
73
+ children: /* @__PURE__ */ a(
74
+ G,
75
+ {
76
+ id: g,
77
+ onSelectCallback: P,
78
+ width: n,
79
+ height: c,
80
+ sources: o,
81
+ selectedSource: s
82
+ }
83
+ )
86
84
  }
87
85
  ),
88
- !p && /* @__PURE__ */ a(G, {})
86
+ !h && /* @__PURE__ */ a(w, {})
89
87
  ] });
90
88
  };
91
- b.displayName = "Widgets.SourceSelector";
92
- const se = b;
89
+ M.displayName = "Widgets.SourceSelector";
90
+ const se = M;
93
91
  export {
94
92
  se as default
95
93
  };
@@ -492,5 +492,6 @@ export declare const BackgroundBlinker: import('styled-components').IStyledCompo
492
492
  loadedCallback?: (() => void) | undefined;
493
493
  className?: string | undefined;
494
494
  showControls?: boolean | undefined;
495
+ extraControls?: import('react').ReactNode;
495
496
  children?: import('react').ReactNode;
496
497
  }> & import('react').FunctionComponent<import('react').PropsWithChildren<import('../../atomic/Blinker/Blinker').BlinkerProps>>;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("react"),I=require("react-i18next"),w=require("../../../charts/Base/index.cjs"),H=require("../../../charts/XAxis/index.cjs"),O=require("../../../charts/Guidelines/index.cjs"),R=require("../../../charts/YAxis/index.cjs"),k=require("../../../charts/Bars/index.cjs"),z=require("../../../charts/Tooltip/index.cjs"),A=require("../../../charts/styles.cjs"),B=require("../../../lib/utils.cjs"),E=require("./styles.cjs"),T=({data:c,margin:x,activeRange:b,xDomain:r,yDomain:n,xScale:o,yScale:i,yTicks:h,xTicks:j,step:p,width:M,height:_,className:L})=>{const{t:q}=I.useTranslation(),[u,v]=g.useState(),$=i(n[0]),f="xAxisLabel",d=typeof u=="number",a=c.map(({value:s,bin:e},l)=>({x:e,value:s,width:12,fill:B.between(e,b[0],b[1])?void 0:"#30E0E3",props:{"aria-label":q("supernova_three_vector.histogram.bar_label",{count:s,binMin:e,binMax:e+p}),onMouseOver:()=>v(l),onMouseOut:()=>v(void 0)}}));return t.jsxs(w.default,{xMin:r[0],yMin:n[0],width:M,height:_,className:L,horizontalLabel:q("supernova_three_vector.histogram.x_label"),horizontalLabelId:f,children:[t.jsx(R.default,{showBaseline:!1,x:o(r[0])-10,ticks:h,tickLength:0,labelRender:(s,e,l)=>t.jsx(E.YLabel,{x:e,y:l,children:s}),yDomain:n,yScale:i}),t.jsx(O.default,{guides:h,xDomain:r,xScale:o,yDomain:n,yScale:i,margin:x}),t.jsx(k.default,{data:a,xDomain:r,yDomain:n,xScale:o,yScale:i}),t.jsx(H.default,{ticks:j,y:$,labelledById:f,labelRender:(s,e,l)=>t.jsx(A.XLabel,{x:e,y:l+5,children:s}),xDomain:r,xScale:o,margin:x}),t.jsx(z.default,{x:d?o(c[u].bin):0,y:d?i(a[u].value):0,visible:d,children:d?a[u].value:null})]})},y=T;exports.default=y;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),j=require("react"),L=require("react-i18next"),w=require("../../../charts/Base/index.cjs"),H=require("../../../charts/XAxis/index.cjs"),O=require("../../../charts/Guidelines/index.cjs"),R=require("../../../charts/YAxis/index.cjs"),k=require("../../../charts/Bars/index.cjs"),z=require("../../../charts/Tooltip/index.cjs"),B=require("../../../charts/styles.cjs"),E=require("../../../lib/utils.cjs"),T=require("./styles.cjs"),y=({data:c,margin:b,activeRange:x,xDomain:r,yDomain:n,xScale:o,yScale:i,yTicks:h,xTicks:p,step:M,width:_,height:I,className:$})=>{const{t:q}=L.useTranslation(),[l,v]=j.useState(),g=i(n[0]),f=j.useId(),d=typeof l=="number",a=c.map(({value:s,bin:e},u)=>({x:e,value:s,width:12,fill:E.between(e,x[0],x[1])?void 0:"#30E0E3",props:{"aria-label":q("supernova_three_vector.histogram.bar_label",{count:s,binMin:e,binMax:e+M}),onMouseOver:()=>v(u),onMouseOut:()=>v(void 0)}}));return t.jsxs(w.default,{xMin:r[0],yMin:n[0],width:_,height:I,className:$,horizontalLabel:q("supernova_three_vector.histogram.x_label"),horizontalLabelId:f,children:[t.jsx(R.default,{showBaseline:!1,x:o(r[0])-10,ticks:h,tickLength:0,labelRender:(s,e,u)=>t.jsx(T.YLabel,{x:e,y:u,children:s}),yDomain:n,yScale:i}),t.jsx(O.default,{guides:h,xDomain:r,xScale:o,yDomain:n,yScale:i,margin:b}),t.jsx(k.default,{data:a,xDomain:r,yDomain:n,xScale:o,yScale:i}),t.jsx(H.default,{ticks:p,y:g,labelledById:f,labelRender:(s,e,u)=>t.jsx(B.XLabel,{x:e,y:u+5,children:s}),xDomain:r,xScale:o,margin:b}),t.jsx(z.default,{x:d?o(c[l].bin):0,y:d?i(a[l].value):0,visible:d,children:d?a[l].value:null})]})},A=y;exports.default=A;
@@ -1,106 +1,106 @@
1
1
  "use client";
2
- import { jsxs as A, jsx as r } from "react/jsx-runtime";
3
- import { useState as B } from "react";
4
- import { useTranslation as w } from "react-i18next";
5
- import H from "../../../charts/Base/index.js";
6
- import j from "../../../charts/XAxis/index.js";
7
- import k from "../../../charts/Guidelines/index.js";
8
- import z from "../../../charts/YAxis/index.js";
9
- import E from "../../../charts/Bars/index.js";
10
- import O from "../../../charts/Tooltip/index.js";
11
- import { XLabel as R } from "../../../charts/styles.js";
12
- import { between as T } from "../../../lib/utils.js";
13
- import { YLabel as X } from "./styles.js";
14
- const Y = ({
15
- data: d,
16
- margin: b,
17
- activeRange: u,
2
+ import { jsxs as B, jsx as r } from "react/jsx-runtime";
3
+ import { useState as w, useId as A } from "react";
4
+ import { useTranslation as H } from "react-i18next";
5
+ import j from "../../../charts/Base/index.js";
6
+ import k from "../../../charts/XAxis/index.js";
7
+ import z from "../../../charts/Guidelines/index.js";
8
+ import E from "../../../charts/YAxis/index.js";
9
+ import O from "../../../charts/Bars/index.js";
10
+ import R from "../../../charts/Tooltip/index.js";
11
+ import { XLabel as T } from "../../../charts/styles.js";
12
+ import { between as X } from "../../../lib/utils.js";
13
+ import { YLabel as Y } from "./styles.js";
14
+ const G = ({
15
+ data: a,
16
+ margin: u,
17
+ activeRange: b,
18
18
  xDomain: t,
19
19
  yDomain: s,
20
20
  xScale: i,
21
21
  yScale: l,
22
22
  yTicks: f,
23
23
  xTicks: x,
24
- step: L,
25
- width: M,
26
- height: _,
27
- className: I
24
+ step: I,
25
+ width: L,
26
+ height: M,
27
+ className: _
28
28
  }) => {
29
- const { t: h } = w(), [m, c] = B(), g = l(s[0]), v = "xAxisLabel", p = typeof m == "number", a = d.map(({ value: e, bin: o }, n) => ({
29
+ const { t: h } = H(), [d, c] = w(), g = l(s[0]), v = A(), m = typeof d == "number", p = a.map(({ value: e, bin: o }, n) => ({
30
30
  x: o,
31
31
  value: e,
32
32
  width: 12,
33
- fill: T(o, u[0], u[1]) ? void 0 : "#30E0E3",
33
+ fill: X(o, b[0], b[1]) ? void 0 : "#30E0E3",
34
34
  props: {
35
35
  "aria-label": h("supernova_three_vector.histogram.bar_label", {
36
36
  count: e,
37
37
  binMin: o,
38
- binMax: o + L
38
+ binMax: o + I
39
39
  }),
40
40
  onMouseOver: () => c(n),
41
41
  onMouseOut: () => c(void 0)
42
42
  }
43
43
  }));
44
- return /* @__PURE__ */ A(
45
- H,
44
+ return /* @__PURE__ */ B(
45
+ j,
46
46
  {
47
47
  xMin: t[0],
48
48
  yMin: s[0],
49
- width: M,
50
- height: _,
51
- className: I,
49
+ width: L,
50
+ height: M,
51
+ className: _,
52
52
  horizontalLabel: h("supernova_three_vector.histogram.x_label"),
53
53
  horizontalLabelId: v,
54
54
  children: [
55
55
  /* @__PURE__ */ r(
56
- z,
56
+ E,
57
57
  {
58
58
  showBaseline: !1,
59
59
  x: i(t[0]) - 10,
60
60
  ticks: f,
61
61
  tickLength: 0,
62
- labelRender: (e, o, n) => /* @__PURE__ */ r(X, { x: o, y: n, children: e }),
62
+ labelRender: (e, o, n) => /* @__PURE__ */ r(Y, { x: o, y: n, children: e }),
63
63
  yDomain: s,
64
64
  yScale: l
65
65
  }
66
66
  ),
67
67
  /* @__PURE__ */ r(
68
- k,
68
+ z,
69
69
  {
70
70
  guides: f,
71
71
  xDomain: t,
72
72
  xScale: i,
73
73
  yDomain: s,
74
74
  yScale: l,
75
- margin: b
75
+ margin: u
76
76
  }
77
77
  ),
78
- /* @__PURE__ */ r(E, { data: a, xDomain: t, yDomain: s, xScale: i, yScale: l }),
78
+ /* @__PURE__ */ r(O, { data: p, xDomain: t, yDomain: s, xScale: i, yScale: l }),
79
79
  /* @__PURE__ */ r(
80
- j,
80
+ k,
81
81
  {
82
82
  ticks: x,
83
83
  y: g,
84
84
  labelledById: v,
85
- labelRender: (e, o, n) => /* @__PURE__ */ r(R, { x: o, y: n + 5, children: e }),
85
+ labelRender: (e, o, n) => /* @__PURE__ */ r(T, { x: o, y: n + 5, children: e }),
86
86
  xDomain: t,
87
87
  xScale: i,
88
- margin: b
88
+ margin: u
89
89
  }
90
90
  ),
91
91
  /* @__PURE__ */ r(
92
- O,
92
+ R,
93
93
  {
94
- x: p ? i(d[m].bin) : 0,
95
- y: p ? l(a[m].value) : 0,
96
- visible: p,
97
- children: p ? a[m].value : null
94
+ x: m ? i(a[d].bin) : 0,
95
+ y: m ? l(p[d].value) : 0,
96
+ visible: m,
97
+ children: m ? p[d].value : null
98
98
  }
99
99
  )
100
100
  ]
101
101
  }
102
102
  );
103
- }, W = Y;
103
+ }, Z = G;
104
104
  export {
105
- W as default
105
+ Z as default
106
106
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),_=require("d3-geo-projection"),y=require("d3-geo"),M=require("d3-array"),E=require("../../../charts/Base/index.cjs"),N=require("../../../charts/Tooltip/index.cjs"),U=require("../../../atomic/ImageStack/index.cjs"),a=require("./styles.cjs"),q=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,B]=S.useState(!1),[x,f]=S.useState(),l=600,c=300,s={top:20,right:0,bottom:20,left:20},P=l+s.right+s.left,W=c+s.top+s.bottom,d=15,u=30,j=-90,m=90,g=-180,k=180,h=2,i=_.geoAitoff(),n=y.geoGraticule();n.step([u,d]),n.extent([[g,j],[k,m]]),i.fitExtent([[s.left,s.top],[s.left+l-h,s.top+c]],n.outline());const $=M.range(j+d,m,d),A=M.range(g+u,k,u),C=y.geoPath(i).pointRadius(6),r=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,b=(o?i([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(E.default,{width:P,height:W,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:r(n.outline()),fill:"white"})}),e.jsx(a.Background,{d:r(n.outline())}),e.jsx(a.Graticule,{d:r(n())}),e.jsx(a.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:s.left,y:s.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(U.default,{images:v,describedById:G,visible:w,loadCallback:()=>B(!0),showBackdrop:!1,showLoader:!1})}),e.jsx("g",{children:p.map(({id:t,lat:H,long:R},T)=>e.jsx(a.UserObject,{d:r({type:"Point",coordinates:[R,H]}),onMouseOver:()=>f(T),onMouseOut:()=>f(void 0)},t))}),e.jsx("g",{"aria-hidden":"true",children:$.map(t=>t===0?null:e.jsxs(a.LatLabel,{style:{dominantBaseline:t>0?"text-after-edge":"text-before-edge"},transform:`translate(${i([g,t])})`,children:[t,"°"]},t))}),e.jsx("g",{"aria-hidden":"true",children:A.map(t=>e.jsxs(a.LongLabel,{transform:`translate(${i([t,0])})`,children:[t,"°"]},t))}),e.jsx(a.Outline,{strokeWidth:h,d:r(n.outline())}),e.jsx(N.default,{visible:!!o,x:b[0],y:b[1],children:o==null?void 0:o.id})]})};q.displayName="Widgets.SupernovaThreeVector.Skymap";const V=q;exports.default=V;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),_=require("d3-geo-projection"),q=require("d3-geo"),y=require("d3-array"),E=require("../../../charts/Base/index.cjs"),N=require("../../../charts/Tooltip/index.cjs");require("../../../charts/ScatterPlot/index.cjs");const U=require("../../../atomic/ImageStack/index.cjs"),a=require("./styles.cjs"),M=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,B]=S.useState(!1),[x,f]=S.useState(),l=600,c=300,s={top:20,right:0,bottom:20,left:20},P=l+s.right+s.left,W=c+s.top+s.bottom,d=15,u=30,j=-90,m=90,g=-180,k=180,h=2,r=_.geoAitoff(),n=q.geoGraticule();n.step([u,d]),n.extent([[g,j],[k,m]]),r.fitExtent([[s.left,s.top],[s.left+l-h,s.top+c]],n.outline());const $=y.range(j+d,m,d),A=y.range(g+u,k,u),C=q.geoPath(r).pointRadius(6),i=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,b=(o?r([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(E.default,{width:P,height:W,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:i(n.outline()),fill:"white"})}),e.jsx(a.Background,{d:i(n.outline())}),e.jsx(a.Graticule,{d:i(n())}),e.jsx(a.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:s.left,y:s.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(U.default,{images:v,describedById:G,visible:w,loadCallback:()=>B(!0),showBackdrop:!1,showLoader:!1})}),e.jsx("g",{children:p.map(({id:t,lat:H,long:R},T)=>e.jsx(a.UserObject,{d:i({type:"Point",coordinates:[R,H]}),onMouseOver:()=>f(T),onMouseOut:()=>f(void 0)},t))}),e.jsx("g",{"aria-hidden":"true",children:$.map(t=>t===0?null:e.jsxs(a.LatLabel,{style:{dominantBaseline:t>0?"text-after-edge":"text-before-edge"},transform:`translate(${r([g,t])})`,children:[t,"°"]},t))}),e.jsx("g",{"aria-hidden":"true",children:A.map(t=>e.jsxs(a.LongLabel,{transform:`translate(${r([t,0])})`,children:[t,"°"]},t))}),e.jsx(a.Outline,{strokeWidth:h,d:i(n.outline())}),e.jsx(N.default,{visible:!!o,x:b[0],y:b[1],children:o==null?void 0:o.id})]})};M.displayName="Widgets.SupernovaThreeVector.Skymap";const V=M;exports.default=V;
@@ -6,6 +6,7 @@ import { geoGraticule as R, geoPath as U } from "d3-geo";
6
6
  import { range as M } from "d3-array";
7
7
  import V from "../../../charts/Base/index.js";
8
8
  import q from "../../../charts/Tooltip/index.js";
9
+ import "../../../charts/ScatterPlot/index.js";
9
10
  import z from "../../../atomic/ImageStack/index.js";
10
11
  import { Background as D, Graticule as F, ImageStackerWrapper as J, UserObject as K, LatLabel as Q, LongLabel as X, Outline as Y } from "./styles.js";
11
12
  const y = ({
@@ -116,7 +117,7 @@ const y = ({
116
117
  ] });
117
118
  };
118
119
  y.displayName = "Widgets.SupernovaThreeVector.Skymap";
119
- const rt = y;
120
+ const st = y;
120
121
  export {
121
- rt as default
122
+ st as default
122
123
  };
@@ -1,6 +1,6 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),t=require("@rubin-epo/epo-react-lib/styles"),i=require("../../layout/AspectRatio/index.cjs"),a=require("../../atomic/Button/patterns/Reset.cjs"),o=require("./Histogram/index.cjs"),s=require("./Skymap/index.cjs"),d=n=>n&&n.__esModule?n:{default:n},e=d(r),l=e.default(i.default)`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),t=require("@rubin-epo/epo-react-lib/styles"),i=require("../../layout/AspectRatio/index.cjs"),a=require("../../atomic/Button/patterns/Reset.cjs"),o=require("./Histogram/index.cjs"),s=require("./Skymap/index.cjs"),d=n=>n&&n.__esModule?n:{default:n},e=d(r),c=e.default(i.default)`
2
2
  container-type: inline-size;
3
- `,c=e.default.div`
3
+ `,l=e.default.div`
4
4
  --three-vector-gap: calc(var(--PADDING_SMALL, 20px) / 2);
5
5
 
6
6
  display: grid;
@@ -33,17 +33,16 @@
33
33
  container-type: inline-size;
34
34
  grid-area: histogram;
35
35
  `,u=e.default(o.default)`
36
- font-size: 0.75;
37
- overflow: visible;
36
+ font-size: 0.75em;
38
37
 
39
38
  @container (
40
39
  min-width: ${t.token("BREAK_PHABLET_MIN")}
41
40
  ) {
42
41
  font-size: 1em;
43
42
  }
44
- `,f=e.default.div`
43
+ `,p=e.default.div`
45
44
  grid-area: slider;
46
- `,p=e.default(a.default)`
45
+ `,f=e.default(a.default)`
47
46
  grid-area: reset;
48
47
  `,g=e.default.div`
49
48
  display: flex;
@@ -74,4 +73,4 @@
74
73
  }
75
74
  `,y=e.default.h4`
76
75
  margin: 0;
77
- `;exports.ChartTitle=y;exports.Histogram=u;exports.HistogramContainer=m;exports.ResetButton=p;exports.Skymap=h;exports.SkymapContainer=g;exports.SliderContainer=f;exports.ThreeVectorContainer=l;exports.ThreeVectorLayout=c;
76
+ `;exports.ChartTitle=y;exports.Histogram=u;exports.HistogramContainer=m;exports.ResetButton=f;exports.Skymap=h;exports.SkymapContainer=g;exports.SliderContainer=p;exports.ThreeVectorContainer=c;exports.ThreeVectorLayout=l;