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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/CameraFilter.cjs +1 -1
  2. package/dist/CameraFilter.js +25 -24
  3. package/dist/Charts.cjs +1 -1
  4. package/dist/Charts.js +14 -12
  5. package/dist/ColorTool.cjs +1 -1
  6. package/dist/ColorTool.js +98 -103
  7. package/dist/FilterTool.cjs +1 -1
  8. package/dist/FilterTool.js +1 -1
  9. package/dist/SupernovaThreeVector.cjs +1 -1
  10. package/dist/SupernovaThreeVector.js +12 -12
  11. package/dist/atomic/PlaybackControl/PlaybackControl.d.ts +1 -2
  12. package/dist/charts/Bars/index.d.ts +1 -1
  13. package/dist/charts/Base/index.d.ts +1 -1
  14. package/dist/charts/Guidelines/index.cjs +1 -1
  15. package/dist/charts/Guidelines/index.d.ts +1 -1
  16. package/dist/charts/Guidelines/index.js +9 -9
  17. package/dist/charts/Points/ErrorBar.cjs +1 -0
  18. package/dist/charts/Points/ErrorBar.d.ts +9 -0
  19. package/dist/charts/Points/ErrorBar.js +119 -0
  20. package/dist/charts/Points/index.cjs +1 -1
  21. package/dist/charts/Points/index.d.ts +5 -11
  22. package/dist/charts/Points/index.js +44 -22
  23. package/dist/charts/ScatterPlot/index.cjs +1 -0
  24. package/dist/charts/ScatterPlot/index.d.ts +24 -0
  25. package/dist/charts/ScatterPlot/index.js +133 -0
  26. package/dist/charts/ScatterPlot/styles.cjs +22 -0
  27. package/dist/charts/ScatterPlot/styles.d.ts +16 -0
  28. package/dist/charts/ScatterPlot/styles.js +29 -0
  29. package/dist/charts/XAxis/index.d.ts +1 -1
  30. package/dist/charts/YAxis/index.d.ts +1 -1
  31. package/dist/charts/defaults.cjs +1 -0
  32. package/dist/charts/defaults.d.ts +22 -0
  33. package/dist/charts/defaults.js +23 -0
  34. package/dist/charts/hooks/useAxis.d.ts +1 -1
  35. package/dist/charts/index.d.ts +1 -0
  36. package/dist/hooks/useInterval.cjs +1 -1
  37. package/dist/hooks/useInterval.js +10 -10
  38. package/dist/hooks/useWindowSize.d.ts +4 -0
  39. package/dist/layout/AspectRatio/index.cjs +1 -0
  40. package/dist/layout/AspectRatio/index.d.ts +18 -0
  41. package/dist/layout/AspectRatio/index.js +24 -0
  42. package/dist/layout/AspectRatio/styles.cjs +16 -0
  43. package/dist/{widgets/ColorTool/Actions → layout/AspectRatio}/styles.d.ts +1 -1
  44. package/dist/layout/AspectRatio/styles.js +22 -0
  45. package/dist/layout/Controls/index.cjs +1 -0
  46. package/dist/layout/Controls/index.d.ts +10 -0
  47. package/dist/layout/Controls/index.js +31 -0
  48. package/dist/layout/Controls/styles.cjs +63 -0
  49. package/dist/{widgets/ColorTool → layout/Controls}/styles.d.ts +604 -332
  50. package/dist/layout/Controls/styles.js +75 -0
  51. package/dist/lib/reimg.cjs +1 -1
  52. package/dist/lib/reimg.d.ts +2 -2
  53. package/dist/lib/reimg.js +30 -31
  54. package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs +1 -1
  55. package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js +1 -1
  56. package/dist/widgets/CameraFilter/styles.cjs +24 -20
  57. package/dist/widgets/CameraFilter/styles.js +36 -32
  58. package/dist/widgets/ColorTool/Actions/index.cjs +1 -1
  59. package/dist/widgets/ColorTool/Actions/index.js +24 -25
  60. package/dist/widgets/ColorTool/FilterControls/styles.cjs +4 -4
  61. package/dist/widgets/ColorTool/FilterControls/styles.d.ts +1252 -0
  62. package/dist/widgets/ColorTool/FilterControls/styles.js +1 -1
  63. package/dist/widgets/ColorTool/ImageComposite/ImageComposite.cjs +1 -1
  64. package/dist/widgets/ColorTool/ImageComposite/ImageComposite.js +26 -29
  65. package/dist/widgets/ColorTool/ImageComposite/styles.cjs +5 -3
  66. package/dist/widgets/ColorTool/ImageComposite/styles.js +4 -2
  67. package/dist/widgets/ColorTool/styles.cjs +10 -24
  68. package/dist/widgets/ColorTool/styles.js +15 -29
  69. package/dist/widgets/FilterTool/FilterTool.d.ts +1 -1
  70. package/dist/widgets/FilterTool/styles.cjs +9 -9
  71. package/dist/widgets/FilterTool/styles.d.ts +6 -269
  72. package/dist/widgets/FilterTool/styles.js +17 -16
  73. package/dist/widgets/LightCurvePlot/Plot/index.cjs +1 -0
  74. package/dist/widgets/LightCurvePlot/Plot/index.d.ts +12 -0
  75. package/dist/widgets/LightCurvePlot/Plot/index.js +99 -0
  76. package/dist/widgets/LightCurvePlot/{ScatterPlot → Plot}/styles.cjs +4 -4
  77. package/dist/widgets/LightCurvePlot/{ScatterPlot → Plot}/styles.js +7 -6
  78. package/dist/widgets/LightCurvePlot/PlotWithCurve/A11Y/LightCurveLabel/index.cjs +1 -0
  79. package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/index.d.ts +2 -2
  80. package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/index.js +2 -2
  81. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/index.cjs +1 -0
  82. package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/index.js +2 -2
  83. package/dist/widgets/LightCurvePlot/PlotWithCurve/LightCurve/index.cjs +1 -0
  84. package/dist/widgets/LightCurvePlot/{LightCurve → PlotWithCurve/LightCurve}/index.d.ts +1 -1
  85. package/dist/widgets/LightCurvePlot/{LightCurve → PlotWithCurve/LightCurve}/index.js +1 -1
  86. package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/index.d.ts +0 -2
  87. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
  88. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +132 -119
  89. package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.cjs +9 -11
  90. package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.js +13 -16
  91. package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.cjs +1 -1
  92. package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.d.ts +2 -2
  93. package/dist/widgets/LightCurvePlot/PlotWithoutCurve/index.js +17 -15
  94. package/dist/widgets/LightCurvePlot/helpers.cjs +1 -1
  95. package/dist/widgets/LightCurvePlot/helpers.d.ts +3 -12
  96. package/dist/widgets/LightCurvePlot/helpers.js +33 -18
  97. package/dist/widgets/SourceSelector/SourceSelector.cjs +1 -1
  98. package/dist/widgets/SourceSelector/SourceSelector.js +53 -60
  99. package/dist/widgets/SupernovaThreeVector/Histogram/index.d.ts +1 -1
  100. package/dist/widgets/SupernovaThreeVector/index.d.ts +1 -1
  101. package/dist/widgets/SupernovaThreeVector/styles.cjs +10 -10
  102. package/dist/widgets/SupernovaThreeVector/styles.js +23 -22
  103. package/package.json +1 -1
  104. package/dist/styles/svg.cjs +0 -8
  105. package/dist/styles/svg.js +0 -13
  106. package/dist/widgets/ColorTool/Actions/styles.cjs +0 -5
  107. package/dist/widgets/ColorTool/Actions/styles.js +0 -10
  108. package/dist/widgets/LightCurvePlot/A11Y/LightCurveLabel/index.cjs +0 -1
  109. package/dist/widgets/LightCurvePlot/DM15Display/index.cjs +0 -1
  110. package/dist/widgets/LightCurvePlot/LightCurve/index.cjs +0 -1
  111. package/dist/widgets/LightCurvePlot/Point/index.cjs +0 -1
  112. package/dist/widgets/LightCurvePlot/Point/index.d.ts +0 -11
  113. package/dist/widgets/LightCurvePlot/Point/index.js +0 -68
  114. package/dist/widgets/LightCurvePlot/ScatterPlot/index.cjs +0 -1
  115. package/dist/widgets/LightCurvePlot/ScatterPlot/index.d.ts +0 -12
  116. package/dist/widgets/LightCurvePlot/ScatterPlot/index.js +0 -178
  117. /package/dist/widgets/LightCurvePlot/{ScatterPlot → Plot}/styles.d.ts +0 -0
  118. /package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/styles.cjs +0 -0
  119. /package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/styles.d.ts +0 -0
  120. /package/dist/widgets/LightCurvePlot/{A11Y → PlotWithCurve/A11Y}/LightCurveLabel/styles.js +0 -0
  121. /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/index.d.ts +0 -0
  122. /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/styles.cjs +0 -0
  123. /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/styles.d.ts +0 -0
  124. /package/dist/widgets/LightCurvePlot/{DM15Display → PlotWithCurve/DM15Display}/styles.js +0 -0
  125. /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/index.cjs +0 -0
  126. /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/index.js +0 -0
  127. /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/styles.cjs +0 -0
  128. /package/dist/widgets/LightCurvePlot/{MagnitudeSlider → PlotWithCurve/MagnitudeSlider}/styles.js +0 -0
@@ -1,11 +0,0 @@
1
- import { FunctionComponent } from "react";
2
- interface LightCurvePointProps {
3
- x: number;
4
- y: number;
5
- error: number;
6
- onMouseOver: () => void;
7
- onMouseOut: () => void;
8
- description?: string;
9
- }
10
- declare const LightCurvePoint: FunctionComponent<LightCurvePointProps>;
11
- export default LightCurvePoint;
@@ -1,68 +0,0 @@
1
- import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
- const n = ({
3
- x: e,
4
- y: a,
5
- error: t,
6
- onMouseOver: s,
7
- onMouseOut: l,
8
- description: o
9
- }) => /* @__PURE__ */ r(
10
- "g",
11
- {
12
- role: "listitem",
13
- "aria-label": o,
14
- transform: `translate(${e},${a})`,
15
- onMouseOver: s,
16
- onMouseOut: l,
17
- children: [
18
- /* @__PURE__ */ i(
19
- "line",
20
- {
21
- x: 0,
22
- y1: t,
23
- y2: -t,
24
- stroke: "var(--black, #000)",
25
- strokeWidth: 1,
26
- fill: "none"
27
- }
28
- ),
29
- /* @__PURE__ */ i(
30
- "line",
31
- {
32
- x1: -3,
33
- x2: 3,
34
- y1: t,
35
- y2: t,
36
- stroke: "var(--black, #000)",
37
- strokeWidth: 1,
38
- fill: "none"
39
- }
40
- ),
41
- /* @__PURE__ */ i(
42
- "line",
43
- {
44
- x1: -3,
45
- x2: 3,
46
- y1: -t,
47
- y2: -t,
48
- stroke: "var(--black, #000)",
49
- strokeWidth: 1,
50
- fill: "none"
51
- }
52
- ),
53
- /* @__PURE__ */ i(
54
- "circle",
55
- {
56
- fill: "var(--turquoise85, #12726D)",
57
- r: 6,
58
- cursor: "pointer"
59
- }
60
- )
61
- ]
62
- }
63
- );
64
- n.displayName = "Widgets.LightCurve.Point";
65
- const u = n;
66
- export {
67
- u as default
68
- };
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),w=require("react"),G=require("react-i18next"),k=require("d3-array"),D=require("../../../charts/hooks/useAxis.cjs"),J=require("../../../charts/XAxis/index.cjs"),K=require("../../../charts/YAxis/index.cjs"),Q=require("../../../charts/Tooltip/index.cjs"),V=require("../../../charts/ClippingContainer/index.cjs"),X=require("../../../charts/Viewport/index.cjs"),r=require("../defaults.cjs"),Y=require("../Point/index.cjs"),y=require("./styles.cjs"),Z=(i,b,g)=>{const p={};return Object.keys(i).forEach(o=>{const a=o==="top"||o==="bottom"?g:b,c=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;p[`padding${c}`]=`${i[o]/a*100}%`}),p},C=({data:i,activeAlertId:b,xMin:g,xMax:p,yMin:m=r.default.yMin,yMax:o=r.default.yMax,width:a=r.default.width,height:c=r.default.height,name:E,children:O,slider:q,className:P})=>{const{t:d,i18n:{language:R}}=G.useTranslation(),[S,L]=w.useState(),W=d("light_curve.plot.x_label"),_="xAxisLabel",T=d("light_curve.plot.y_label"),A="yAxisLabel",s=typeof S<"u"?i[S]:i.find(({id:n})=>n===b),x={top:10,right:10,bottom:25,left:40},f=[0+x.left,a-x.right],[M,z,l]=D.default({min:g||k.min(i,({x:n})=>n)||r.default.xMin,max:p||k.max(i,({x:n})=>n)||r.default.xMax,step:r.default.xStep,range:f}),v=l(M[0]),h=[c-x.bottom,0+x.top],[u,H,t]=D.default({min:m,max:o,step:m<o?Math.abs(r.default.yStep):r.default.yStep,range:h}),$=t(u[0]);return e.jsxs(y.PlotContainer,{className:P,children:[e.jsxs(y.Chart,{width:a,height:c,horizontalLabel:W,horizontalLabelId:_,verticalLabel:T,verticalLabelId:A,title:E,children:[e.jsxs(V.default,{x:v,y:t(u[1]),width:f[1]-f[0],height:h[0]-h[1],children:[e.jsx("rect",{x:l(0),y:t(u[1]),width:l(15)-l(0),height:$-t(u[1]),stroke:"var(--neutral60,##6A6E6E)",strokeDasharray:6,fill:"var(--neutral20,#DCE0E3)"}),e.jsx("g",{role:"list","aria-label":d("light_curve.plot.plot_label")||void 0,children:i.map(({x:n,y:I,error:B,id:F},N)=>{const j=Math.round(n),U=j>0?"after":j===0?"peak":"before";return e.jsx(Y.default,{x:l(n),y:t(I),error:t(B)-t(0),onMouseOver:()=>L(N),onMouseOut:()=>L(void 0),description:d("light_curve.plot.point_label",{magnitude:I,count:Math.abs(j),context:U})||void 0},F)})})]}),e.jsx(J.default,{ticks:z,y:$,labelledById:_,xDomain:M,xScale:l}),e.jsx(K.default,{ticks:H,x:v,labelledById:A,yDomain:u,yScale:t}),e.jsx(X.default,{x:v,y:t(u[1]),outerWidth:f[1]-f[0],outerHeight:h[0]-h[1],innerWidth:a,innerHeight:c,children:O}),e.jsx(Q.default,{x:s?l(s.x):void 0,y:s?t(s.y):void 0,visible:!!s,offset:6,children:d("light_curve.plot.tooltip",{magnitude:s==null?void 0:s.y.toLocaleString(R,{minimumFractionDigits:2,maximumFractionDigits:2})})})]}),q&&e.jsx(y.SliderOuterWrapper,{children:e.jsx(y.SliderInnerWrapper,{style:{...Z(x,a,c)},children:q})})]})};C.displayName="Widgets.LightCurve.ScatterPlot";const ee=C;exports.default=ee;
@@ -1,12 +0,0 @@
1
- import { FunctionComponent, PropsWithChildren, ReactNode } from "react";
2
- import { Bounds } from '../../../charts/types';
3
- import { formatMagnitudePoints } from "../helpers";
4
- export interface ScatterPlotProps extends Partial<Bounds> {
5
- data: ReturnType<typeof formatMagnitudePoints>;
6
- name?: string;
7
- activeAlertId?: number;
8
- className?: string;
9
- slider?: ReactNode;
10
- }
11
- declare const ScatterPlot: FunctionComponent<PropsWithChildren<ScatterPlotProps>>;
12
- export default ScatterPlot;
@@ -1,178 +0,0 @@
1
- "use client";
2
- import { jsxs as L, jsx as o } from "react/jsx-runtime";
3
- import { useState as U } from "react";
4
- import { useTranslation as V } from "react-i18next";
5
- import { min as X, max as Y } from "d3-array";
6
- import E from "../../../charts/hooks/useAxis.js";
7
- import q from "../../../charts/XAxis/index.js";
8
- import G from "../../../charts/YAxis/index.js";
9
- import J from "../../../charts/Tooltip/index.js";
10
- import K from "../../../charts/ClippingContainer/index.js";
11
- import Q from "../../../charts/Viewport/index.js";
12
- import e from "../defaults.js";
13
- import Z from "../Point/index.js";
14
- import { PlotContainer as tt, Chart as ot, SliderOuterWrapper as et, SliderInnerWrapper as it } from "./styles.js";
15
- const rt = (i, f, g) => {
16
- const h = {};
17
- return Object.keys(i).forEach((r) => {
18
- const a = r === "top" || r === "bottom" ? g : f, c = `${r.charAt(0).toUpperCase()}${r.slice(1)}`;
19
- h[`padding${c}`] = `${i[r] / a * 100}%`;
20
- }), h;
21
- }, P = ({
22
- data: i,
23
- activeAlertId: f,
24
- xMin: g,
25
- xMax: h,
26
- yMin: y = e.yMin,
27
- yMax: r = e.yMax,
28
- width: a = e.width,
29
- height: c = e.height,
30
- name: W,
31
- children: O,
32
- slider: A,
33
- className: R
34
- }) => {
35
- const {
36
- t: p,
37
- i18n: { language: T }
38
- } = V(), [S, _] = U(), $ = p("light_curve.plot.x_label"), M = "xAxisLabel", j = p("light_curve.plot.y_label"), k = "yAxisLabel", n = typeof S < "u" ? i[S] : i.find(({ id: l }) => l === f), d = {
39
- top: 10,
40
- right: 10,
41
- bottom: 25,
42
- left: 40
43
- }, x = [0 + d.left, a - d.right], [C, z, s] = E({
44
- min: g || X(i, ({ x: l }) => l) || e.xMin,
45
- max: h || Y(i, ({ x: l }) => l) || e.xMax,
46
- step: e.xStep,
47
- range: x
48
- }), b = s(C[0]), u = [c - d.bottom, 0 + d.top], [m, H, t] = E({
49
- min: y,
50
- max: r,
51
- step: y < r ? Math.abs(e.yStep) : e.yStep,
52
- range: u
53
- }), I = t(m[0]);
54
- return /* @__PURE__ */ L(tt, { className: R, children: [
55
- /* @__PURE__ */ L(
56
- ot,
57
- {
58
- width: a,
59
- height: c,
60
- horizontalLabel: $,
61
- horizontalLabelId: M,
62
- verticalLabel: j,
63
- verticalLabelId: k,
64
- title: W,
65
- children: [
66
- /* @__PURE__ */ L(
67
- K,
68
- {
69
- x: b,
70
- y: t(m[1]),
71
- width: x[1] - x[0],
72
- height: u[0] - u[1],
73
- children: [
74
- /* @__PURE__ */ o(
75
- "rect",
76
- {
77
- x: s(0),
78
- y: t(m[1]),
79
- width: s(15) - s(0),
80
- height: I - t(m[1]),
81
- stroke: "var(--neutral60,##6A6E6E)",
82
- strokeDasharray: 6,
83
- fill: "var(--neutral20,#DCE0E3)"
84
- }
85
- ),
86
- /* @__PURE__ */ o(
87
- "g",
88
- {
89
- role: "list",
90
- "aria-label": p("light_curve.plot.plot_label") || void 0,
91
- children: i.map(({ x: l, y: D, error: B, id: F }, N) => {
92
- const v = Math.round(l), w = v > 0 ? "after" : v === 0 ? "peak" : "before";
93
- return /* @__PURE__ */ o(
94
- Z,
95
- {
96
- x: s(l),
97
- y: t(D),
98
- error: t(B) - t(0),
99
- onMouseOver: () => _(N),
100
- onMouseOut: () => _(void 0),
101
- description: p("light_curve.plot.point_label", {
102
- magnitude: D,
103
- count: Math.abs(v),
104
- context: w
105
- }) || void 0
106
- },
107
- F
108
- );
109
- })
110
- }
111
- )
112
- ]
113
- }
114
- ),
115
- /* @__PURE__ */ o(
116
- q,
117
- {
118
- ticks: z,
119
- y: I,
120
- labelledById: M,
121
- xDomain: C,
122
- xScale: s
123
- }
124
- ),
125
- /* @__PURE__ */ o(
126
- G,
127
- {
128
- ticks: H,
129
- x: b,
130
- labelledById: k,
131
- yDomain: m,
132
- yScale: t
133
- }
134
- ),
135
- /* @__PURE__ */ o(
136
- Q,
137
- {
138
- x: b,
139
- y: t(m[1]),
140
- outerWidth: x[1] - x[0],
141
- outerHeight: u[0] - u[1],
142
- innerWidth: a,
143
- innerHeight: c,
144
- children: O
145
- }
146
- ),
147
- /* @__PURE__ */ o(
148
- J,
149
- {
150
- x: n ? s(n.x) : void 0,
151
- y: n ? t(n.y) : void 0,
152
- visible: !!n,
153
- offset: 6,
154
- children: p("light_curve.plot.tooltip", {
155
- magnitude: n == null ? void 0 : n.y.toLocaleString(T, {
156
- minimumFractionDigits: 2,
157
- maximumFractionDigits: 2
158
- })
159
- })
160
- }
161
- )
162
- ]
163
- }
164
- ),
165
- A && /* @__PURE__ */ o(et, { children: /* @__PURE__ */ o(
166
- it,
167
- {
168
- style: { ...rt(d, a, c) },
169
- children: A
170
- }
171
- ) })
172
- ] });
173
- };
174
- P.displayName = "Widgets.LightCurve.ScatterPlot";
175
- const yt = P;
176
- export {
177
- yt as default
178
- };