@rubin-epo/epo-widget-lib 0.9.9 → 0.9.10

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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),A=require("react-i18next"),O=require("@rubin-epo/epo-react-lib/HorizontalSlider"),t=require("../defaults.cjs"),T=require("../Plot/index.cjs"),B=require("./LightCurve/index.cjs"),M=require("./A11Y/LightCurveLabel/index.cjs"),p=require("../helpers.cjs"),N=require("../../../atomic/Button/patterns/Reset.cjs"),J=require("./MagnitudeSlider/index.cjs"),a=require("./styles.cjs"),K=require("../../../charts/Viewport/index.cjs"),Q=require("../../../layout/Controls/index.cjs"),V=s=>s&&s.__esModule?s:{default:s},L=V(O),I=({gaussianWidth:s=t.default.gaussianWidth,yOffset:d=t.default.yOffset,alerts:W,peakMjd:$,yMin:l=t.default.yMin,yMax:i=t.default.yMax,width:f=t.default.width,height:x=t.default.height,userMagnitude:P=(i-l)/2+l,onUserMagnitudeChangeCallback:u,onGaussianChangeCallback:o,onYOffsetChangeCallback:n,className:S,isDisplayOnly:c,...y})=>{const{t:h}=A.useTranslation(),j="lightCurveControls",m="gaussianWidthLabel",q="yOffsetLabel",v=p.useAlertsAsPoints(W,$),H=()=>{u&&u((i-l)/2+l),n&&n(t.default.yOffset),o&&o(t.default.gaussianWidth)},b=p.estimateMagnitudeWithOffset(0,s,d);return e.jsxs(e.Fragment,{children:[e.jsx(Q.default,{className:S,widget:e.jsx(T.default,{slider:e.jsx(J.default,{magnitude:P,onMagnitudeChangeCallback:r=>u&&u(r),disabled:c,yMin:l,yMax:i,estimatedPeak:b}),plotChildren:({xScale:r,yScale:R,xDomain:D,yDomain:F,xStart:g,xEnd:w,yStart:z,yEnd:_})=>e.jsxs(e.Fragment,{children:[e.jsx(B.default,{gaussianWidth:s,yOffset:d,xDomain:D,xScale:r,yScale:R,yDomain:F}),e.jsx(K.default,{x:g,y:_,outerHeight:z-_,outerWidth:w-g,innerWidth:f,innerHeight:x,children:e.jsx(a.DM15Display,{gaussianWidth:s})})]}),...y,data:v,width:f,height:x,yMin:l,yMax:i}),controls:!c&&e.jsxs(a.Controls,{id:j,children:[e.jsxs("div",{children:[e.jsx(a.ControlLabel,{id:m,children:h("light_curve.curve.controls.gaussian_width")}),e.jsx(L.default,{label:"Gaussian Width",labelledbyId:m,color:"var(--turquoise85, #12726D)",min:t.default.gaussianMin,max:t.default.gaussianMax,step:t.default.gaussianStep,value:s,onChangeCallback:r=>typeof r=="number"&&o&&o(r)})]}),e.jsxs("div",{children:[e.jsx(a.ControlLabel,{id:q,children:h("light_curve.curve.controls.y_offset")}),e.jsx(L.default,{label:"Y Offset",labelledbyId:q,color:"var(--turquoise85, #12726D)",min:t.default.yOffsetMin,max:t.default.yOffsetMax,step:t.default.yOffsetStep,value:d,onChangeCallback:r=>typeof r=="number"&&n&&n(r)})]})]}),actions:!c&&e.jsx(N.default,{onResetCallback:H})}),e.jsx(M.default,{controlledById:j,data:v,gaussianWidth:s,yOffset:d,estimatedPeak:b})]})};I.displayName="Widgets.LightCurve";const X=I;exports.default=X;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),A=require("react-i18next"),T=require("@rubin-epo/epo-react-lib/HorizontalSlider"),t=require("../defaults.cjs"),B=require("../Plot/index.cjs"),M=require("./LightCurve/index.cjs"),N=require("./A11Y/LightCurveLabel/index.cjs"),L=require("../helpers.cjs"),J=require("../../../atomic/Button/patterns/Reset.cjs"),K=require("./MagnitudeSlider/index.cjs"),a=require("./styles.cjs"),Q=require("../../../charts/Viewport/index.cjs"),V=require("../../../layout/Controls/index.cjs"),X=require("../../../layout/AspectRatio/index.cjs"),Z=s=>s&&s.__esModule?s:{default:s},I=Z(T),W=({gaussianWidth:s=t.default.gaussianWidth,yOffset:i=t.default.yOffset,alerts:$,peakMjd:y,yMin:l=t.default.yMin,yMax:d=t.default.yMax,width:c=t.default.width,height:f=t.default.height,userMagnitude:P=(d-l)/2+l,onUserMagnitudeChangeCallback:u,onGaussianChangeCallback:o,onYOffsetChangeCallback:n,className:S,isDisplayOnly:x,...D})=>{const{t:h}=A.useTranslation(),j="lightCurveControls",q="gaussianWidthLabel",m="yOffsetLabel",v=L.useAlertsAsPoints($,y),H=()=>{u&&u((d-l)/2+l),n&&n(t.default.yOffset),o&&o(t.default.gaussianWidth)},g=L.estimateMagnitudeWithOffset(0,s,i),b=e.jsx(B.default,{slider:e.jsx(K.default,{magnitude:P,onMagnitudeChangeCallback:r=>u&&u(r),disabled:x,yMin:l,yMax:d,estimatedPeak:g}),plotChildren:({xScale:r,yScale:R,xDomain:F,yDomain:O,xStart:p,xEnd:w,yStart:z,yEnd:_})=>e.jsxs(e.Fragment,{children:[e.jsx(M.default,{gaussianWidth:s,yOffset:i,xDomain:F,xScale:r,yScale:R,yDomain:O}),e.jsx(Q.default,{x:p,y:_,outerHeight:z-_,outerWidth:w-p,innerWidth:c,innerHeight:f,children:e.jsx(a.DM15Display,{gaussianWidth:s})})]}),...D,data:v,width:c,height:f,yMin:l,yMax:d});return x?e.jsx(X.default,{ratio:"square",children:b}):e.jsxs(e.Fragment,{children:[e.jsx(V.default,{className:S,widget:b,controls:e.jsxs(a.Controls,{id:j,children:[e.jsxs("div",{children:[e.jsx(a.ControlLabel,{id:q,children:h("light_curve.curve.controls.gaussian_width")}),e.jsx(I.default,{label:"Gaussian Width",labelledbyId:q,color:"var(--turquoise85, #12726D)",min:t.default.gaussianMin,max:t.default.gaussianMax,step:t.default.gaussianStep,value:s,onChangeCallback:r=>typeof r=="number"&&o&&o(r)})]}),e.jsxs("div",{children:[e.jsx(a.ControlLabel,{id:m,children:h("light_curve.curve.controls.y_offset")}),e.jsx(I.default,{label:"Y Offset",labelledbyId:m,color:"var(--turquoise85, #12726D)",min:t.default.yOffsetMin,max:t.default.yOffsetMax,step:t.default.yOffsetStep,value:i,onChangeCallback:r=>typeof r=="number"&&n&&n(r)})]})]}),actions:e.jsx(J.default,{onResetCallback:H})}),e.jsx(N.default,{controlledById:j,data:v,gaussianWidth:s,yOffset:i,estimatedPeak:g})]})};W.displayName="Widgets.LightCurve";const E=W;exports.default=E;
@@ -1,139 +1,140 @@
1
1
  "use client";
2
- import { jsxs as s, Fragment as x, jsx as e } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as s, Fragment as P } from "react/jsx-runtime";
3
3
  import { useTranslation as N } from "react-i18next";
4
- import P from "@rubin-epo/epo-react-lib/HorizontalSlider";
4
+ import y from "@rubin-epo/epo-react-lib/HorizontalSlider";
5
5
  import t from "../defaults.js";
6
- import O from "../Plot/index.js";
7
- import T from "./LightCurve/index.js";
8
- import V from "./A11Y/LightCurveLabel/index.js";
9
- import { useAlertsAsPoints as $, estimateMagnitudeWithOffset as C } from "../helpers.js";
10
- import J from "../../../atomic/Button/patterns/Reset.js";
11
- import K from "./MagnitudeSlider/index.js";
12
- import { DM15Display as Q, Controls as X, ControlLabel as _ } from "./styles.js";
13
- import Z from "../../../charts/Viewport/index.js";
14
- import E from "../../../layout/Controls/index.js";
15
- const w = ({
6
+ import T from "../Plot/index.js";
7
+ import V from "./LightCurve/index.js";
8
+ import $ from "./A11Y/LightCurveLabel/index.js";
9
+ import { useAlertsAsPoints as C, estimateMagnitudeWithOffset as J } from "../helpers.js";
10
+ import K from "../../../atomic/Button/patterns/Reset.js";
11
+ import Q from "./MagnitudeSlider/index.js";
12
+ import { DM15Display as X, Controls as Z, ControlLabel as R } from "./styles.js";
13
+ import E from "../../../charts/Viewport/index.js";
14
+ import M from "../../../layout/Controls/index.js";
15
+ import G from "../../../layout/AspectRatio/index.js";
16
+ const _ = ({
16
17
  gaussianWidth: i = t.gaussianWidth,
17
18
  yOffset: l = t.yOffset,
18
- alerts: H,
19
- peakMjd: R,
19
+ alerts: q,
20
+ peakMjd: w,
20
21
  yMin: o = t.yMin,
21
22
  yMax: d = t.yMax,
22
- width: f = t.width,
23
- height: p = t.height,
24
- userMagnitude: S = (d - o) / 2 + o,
23
+ width: c = t.width,
24
+ height: f = t.height,
25
+ userMagnitude: A = (d - o) / 2 + o,
25
26
  onUserMagnitudeChangeCallback: m,
26
27
  onGaussianChangeCallback: n,
27
28
  onYOffsetChangeCallback: u,
28
- className: j,
29
- isDisplayOnly: c,
30
- ...q
29
+ className: D,
30
+ isDisplayOnly: p,
31
+ ...H
31
32
  }) => {
32
- const { t: h } = N(), a = "lightCurveControls", v = "gaussianWidthLabel", g = "yOffsetLabel", L = $(H, R), y = () => {
33
+ const { t: a } = N(), h = "lightCurveControls", g = "gaussianWidthLabel", v = "yOffsetLabel", L = C(q, w), S = () => {
33
34
  m && m((d - o) / 2 + o), u && u(t.yOffset), n && n(t.gaussianWidth);
34
- }, b = C(0, i, l);
35
- return /* @__PURE__ */ s(x, { children: [
36
- /* @__PURE__ */ e(
37
- E,
38
- {
39
- className: j,
40
- widget: /* @__PURE__ */ e(
41
- O,
35
+ }, b = J(0, i, l), W = /* @__PURE__ */ r(
36
+ T,
37
+ {
38
+ slider: /* @__PURE__ */ r(
39
+ Q,
40
+ {
41
+ magnitude: A,
42
+ onMagnitudeChangeCallback: (e) => m && m(e),
43
+ disabled: p,
44
+ yMin: o,
45
+ yMax: d,
46
+ estimatedPeak: b
47
+ }
48
+ ),
49
+ plotChildren: ({
50
+ xScale: e,
51
+ yScale: j,
52
+ xDomain: F,
53
+ yDomain: O,
54
+ xStart: I,
55
+ xEnd: z,
56
+ yStart: B,
57
+ yEnd: x
58
+ }) => /* @__PURE__ */ s(P, { children: [
59
+ /* @__PURE__ */ r(
60
+ V,
42
61
  {
43
- slider: /* @__PURE__ */ e(
44
- K,
45
- {
46
- magnitude: S,
47
- onMagnitudeChangeCallback: (r) => m && m(r),
48
- disabled: c,
49
- yMin: o,
50
- yMax: d,
51
- estimatedPeak: b
52
- }
53
- ),
54
- plotChildren: ({
55
- xScale: r,
56
- yScale: A,
57
- xDomain: D,
58
- yDomain: F,
59
- xStart: W,
60
- xEnd: z,
61
- yStart: B,
62
- yEnd: I
63
- }) => /* @__PURE__ */ s(x, { children: [
64
- /* @__PURE__ */ e(
65
- T,
66
- {
67
- gaussianWidth: i,
68
- yOffset: l,
69
- xDomain: D,
70
- xScale: r,
71
- yScale: A,
72
- yDomain: F
73
- }
74
- ),
75
- /* @__PURE__ */ e(
76
- Z,
77
- {
78
- x: W,
79
- y: I,
80
- outerHeight: B - I,
81
- outerWidth: z - W,
82
- innerWidth: f,
83
- innerHeight: p,
84
- children: /* @__PURE__ */ e(Q, { gaussianWidth: i })
85
- }
86
- )
87
- ] }),
88
- ...q,
89
- data: L,
90
- width: f,
91
- height: p,
92
- yMin: o,
93
- yMax: d
62
+ gaussianWidth: i,
63
+ yOffset: l,
64
+ xDomain: F,
65
+ xScale: e,
66
+ yScale: j,
67
+ yDomain: O
94
68
  }
95
69
  ),
96
- controls: !c && /* @__PURE__ */ s(X, { id: a, children: [
70
+ /* @__PURE__ */ r(
71
+ E,
72
+ {
73
+ x: I,
74
+ y: x,
75
+ outerHeight: B - x,
76
+ outerWidth: z - I,
77
+ innerWidth: c,
78
+ innerHeight: f,
79
+ children: /* @__PURE__ */ r(X, { gaussianWidth: i })
80
+ }
81
+ )
82
+ ] }),
83
+ ...H,
84
+ data: L,
85
+ width: c,
86
+ height: f,
87
+ yMin: o,
88
+ yMax: d
89
+ }
90
+ );
91
+ return p ? /* @__PURE__ */ r(G, { ratio: "square", children: W }) : /* @__PURE__ */ s(P, { children: [
92
+ /* @__PURE__ */ r(
93
+ M,
94
+ {
95
+ className: D,
96
+ widget: W,
97
+ controls: /* @__PURE__ */ s(Z, { id: h, children: [
97
98
  /* @__PURE__ */ s("div", { children: [
98
- /* @__PURE__ */ e(_, { id: v, children: h("light_curve.curve.controls.gaussian_width") }),
99
- /* @__PURE__ */ e(
100
- P,
99
+ /* @__PURE__ */ r(R, { id: g, children: a("light_curve.curve.controls.gaussian_width") }),
100
+ /* @__PURE__ */ r(
101
+ y,
101
102
  {
102
103
  label: "Gaussian Width",
103
- labelledbyId: v,
104
+ labelledbyId: g,
104
105
  color: "var(--turquoise85, #12726D)",
105
106
  min: t.gaussianMin,
106
107
  max: t.gaussianMax,
107
108
  step: t.gaussianStep,
108
109
  value: i,
109
- onChangeCallback: (r) => typeof r == "number" && n && n(r)
110
+ onChangeCallback: (e) => typeof e == "number" && n && n(e)
110
111
  }
111
112
  )
112
113
  ] }),
113
114
  /* @__PURE__ */ s("div", { children: [
114
- /* @__PURE__ */ e(_, { id: g, children: h("light_curve.curve.controls.y_offset") }),
115
- /* @__PURE__ */ e(
116
- P,
115
+ /* @__PURE__ */ r(R, { id: v, children: a("light_curve.curve.controls.y_offset") }),
116
+ /* @__PURE__ */ r(
117
+ y,
117
118
  {
118
119
  label: "Y Offset",
119
- labelledbyId: g,
120
+ labelledbyId: v,
120
121
  color: "var(--turquoise85, #12726D)",
121
122
  min: t.yOffsetMin,
122
123
  max: t.yOffsetMax,
123
124
  step: t.yOffsetStep,
124
125
  value: l,
125
- onChangeCallback: (r) => typeof r == "number" && u && u(r)
126
+ onChangeCallback: (e) => typeof e == "number" && u && u(e)
126
127
  }
127
128
  )
128
129
  ] })
129
130
  ] }),
130
- actions: !c && /* @__PURE__ */ e(J, { onResetCallback: y })
131
+ actions: /* @__PURE__ */ r(K, { onResetCallback: S })
131
132
  }
132
133
  ),
133
- /* @__PURE__ */ e(
134
- V,
134
+ /* @__PURE__ */ r(
135
+ $,
135
136
  {
136
- controlledById: a,
137
+ controlledById: h,
137
138
  data: L,
138
139
  gaussianWidth: i,
139
140
  yOffset: l,
@@ -142,8 +143,8 @@ const w = ({
142
143
  )
143
144
  ] });
144
145
  };
145
- w.displayName = "Widgets.LightCurve";
146
- const mt = w;
146
+ _.displayName = "Widgets.LightCurve";
147
+ const ct = _;
147
148
  export {
148
- mt as default
149
+ ct as default
149
150
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubin-epo/epo-widget-lib",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
4
4
  "description": "Rubin Observatory Education & Public Outreach team React scientific and educational widgets.",
5
5
  "author": "Rubin EPO",
6
6
  "license": "MIT",