@rubin-epo/epo-widget-lib 0.10.2 → 0.10.3

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 (53) hide show
  1. package/dist/atomic/Blinker/Controls/styles.d.ts +56 -54
  2. package/dist/atomic/Blinker/styles.d.ts +109 -108
  3. package/dist/atomic/ElapsedTime/styles.d.ts +326 -324
  4. package/dist/atomic/LiveRegion/styles.d.ts +56 -54
  5. package/dist/atomic/Loader/styles.d.ts +56 -54
  6. package/dist/atomic/PlaybackControl/styles.d.ts +110 -108
  7. package/dist/atomic/PlotWrapper/styles.d.ts +56 -54
  8. package/dist/charts/Base/styles.d.ts +541 -539
  9. package/dist/charts/Readout/styles.d.ts +110 -108
  10. package/dist/charts/Tooltip/styles.d.ts +109 -108
  11. package/dist/charts/XAxis/index.cjs +1 -1
  12. package/dist/charts/XAxis/index.js +47 -32
  13. package/dist/charts/YAxis/index.cjs +1 -1
  14. package/dist/charts/YAxis/index.js +44 -29
  15. package/dist/charts/hooks/useAxis.cjs +1 -1
  16. package/dist/charts/hooks/useAxis.d.ts +4 -3
  17. package/dist/charts/hooks/useAxis.js +15 -25
  18. package/dist/charts/styles.d.ts +320 -318
  19. package/dist/layout/AspectRatio/styles.d.ts +55 -54
  20. package/dist/layout/Controls/styles.d.ts +379 -378
  21. package/dist/lib/utils.d.ts +2 -2
  22. package/dist/styles/svg.d.ts +56 -54
  23. package/dist/widgets/CameraFilter/styles.d.ts +860 -860
  24. package/dist/widgets/ColorTool/FilterControls/styles.d.ts +222 -221
  25. package/dist/widgets/FilterTool/styles.d.ts +426 -426
  26. package/dist/widgets/LightCurvePlot/Plot/index.cjs +1 -1
  27. package/dist/widgets/LightCurvePlot/Plot/index.js +67 -52
  28. package/dist/widgets/LightCurvePlot/Plot/styles.d.ts +110 -108
  29. package/dist/widgets/LightCurvePlot/PlotWithCurve/A11Y/LightCurveLabel/styles.d.ts +56 -54
  30. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/index.cjs +1 -1
  31. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/index.d.ts +1 -1
  32. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/index.js +29 -33
  33. package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.cjs +1 -1
  34. package/dist/widgets/LightCurvePlot/PlotWithCurve/MagnitudeSlider/index.js +4 -4
  35. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.cjs +1 -1
  36. package/dist/widgets/LightCurvePlot/PlotWithCurve/index.js +85 -81
  37. package/dist/widgets/LightCurvePlot/PlotWithCurve/styles.d.ts +164 -162
  38. package/dist/widgets/LightCurvePlot/defaults.cjs +1 -1
  39. package/dist/widgets/LightCurvePlot/defaults.d.ts +10 -6
  40. package/dist/widgets/LightCurvePlot/defaults.js +2 -6
  41. package/dist/widgets/LightCurvePlot/helpers.cjs +1 -1
  42. package/dist/widgets/LightCurvePlot/helpers.js +1 -1
  43. package/dist/widgets/SourceSelector/Point/styles.d.ts +55 -53
  44. package/dist/widgets/SourceSelector/SelectionList/styles.d.ts +164 -162
  45. package/dist/widgets/SourceSelector/styles.d.ts +496 -0
  46. package/dist/widgets/SupernovaThreeVector/Histogram/index.cjs +1 -1
  47. package/dist/widgets/SupernovaThreeVector/Histogram/index.js +8 -8
  48. package/dist/widgets/SupernovaThreeVector/Histogram/styles.d.ts +55 -53
  49. package/dist/widgets/SupernovaThreeVector/Skymap/styles.d.ts +373 -371
  50. package/package.json +4 -4
  51. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/styles.cjs +0 -5
  52. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/styles.d.ts +0 -272
  53. package/dist/widgets/LightCurvePlot/PlotWithCurve/DM15Display/styles.js +0 -10
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),y=require("d3-array"),a=require("../styles.cjs"),j=({yDomain:r=[0,1],yScale:l=c=>c,x:t=0,margin:f,ticks:i=0,labelRender:d,labelledById:h,showBaseline:A=!0,tickLength:u=5,className:p})=>{if(r.length<2)return console.error("Failed to render: invalid domain",r),null;const x={...{top:0,right:0,bottom:0,left:0},...f},g=Array.isArray(i)?i:y.ticks(r[0],r[1],i);return e.jsxs(e.Fragment,{children:[A&&e.jsx(a.BaseLine,{x1:t,x2:t,y1:l(r[0])+x.top,y2:l(r[1])-x.bottom}),g.length>0&&e.jsx("g",{role:"list","aria-labelledby":h,className:p,children:g.map((n,b)=>{const s=l(n),o=t-u;return e.jsxs("g",{role:"listitem",children:[u>0&&e.jsx(a.Tick,{x1:o,x2:t,y1:s,y2:s}),d?d(n,o,s,b):e.jsx(a.YLabel,{x:o,y:s,children:n})]},b)})})]})};j.displayName="Charts.YAxis";const M=j;exports.default=M;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),M=require("d3-array"),c=require("../styles.cjs"),Y=require("react-i18next"),b=({yDomain:s,yScale:l,x:n=0,margin:f,ticks:o=0,labelRender:g,labelledById:h,showBaseline:j=!0,tickLength:d=5,className:A})=>{const{i18n:{language:y}}=Y.useTranslation();if(s.length<2)return console.error("Failed to render: invalid domain",s),null;const m={...{top:0,right:0,bottom:0,left:0},...f},a=Array.isArray(o)?o:M.ticks(s[0],s[1],o),x=a.reduce((t,i)=>{if(Number.isInteger(i))return t;{const e=i.toString().split(".")[1].length;return e>t?e:t}},0),{format:F}=new Intl.NumberFormat(y,{minimumFractionDigits:x,maximumFractionDigits:x});return r.jsxs(r.Fragment,{children:[j&&r.jsx(c.BaseLine,{x1:n,x2:n,y1:l(s[0])+m.top,y2:l(s[1])-m.bottom}),a.length>0&&r.jsx("g",{role:"list","aria-labelledby":h,className:A,children:a.map((t,i)=>{const e=l(t),u=n-d;return r.jsxs("g",{role:"listitem",children:[d>0&&r.jsx(c.Tick,{x1:u,x2:n,y1:e,y2:e}),g?g(t,u,e,i):r.jsx(c.YLabel,{x:u,y:e,children:F(t)})]},i)})})]})};b.displayName="Charts.YAxis";const p=b;exports.default=p;
@@ -1,42 +1,57 @@
1
- import { jsxs as p, Fragment as Y, jsx as s } from "react/jsx-runtime";
2
- import { ticks as M } from "d3-array";
3
- import { BaseLine as j, Tick as y, YLabel as F } from "../styles.js";
1
+ "use client";
2
+ import { jsxs as f, Fragment as M, jsx as s } from "react/jsx-runtime";
3
+ import { ticks as N } from "d3-array";
4
+ import { BaseLine as j, Tick as y, YLabel as I } from "../styles.js";
5
+ import { useTranslation as T } from "react-i18next";
4
6
  const x = ({
5
- yDomain: r = [0, 1],
6
- yScale: l = (c) => c,
7
- x: t = 0,
8
- margin: h,
9
- ticks: i = 0,
10
- labelRender: a,
11
- labelledById: b,
12
- showBaseline: u = !0,
13
- tickLength: d = 5,
7
+ yDomain: i,
8
+ yScale: o,
9
+ x: e = 0,
10
+ margin: b,
11
+ ticks: l = 0,
12
+ labelRender: c,
13
+ labelledById: h,
14
+ showBaseline: p = !0,
15
+ tickLength: g = 5,
14
16
  className: A
15
17
  }) => {
16
- if (r.length < 2)
17
- return console.error("Failed to render: invalid domain", r), null;
18
- const f = { ...{ top: 0, right: 0, bottom: 0, left: 0 }, ...h }, g = Array.isArray(i) ? i : M(r[0], r[1], i);
19
- return /* @__PURE__ */ p(Y, { children: [
20
- u && /* @__PURE__ */ s(
18
+ const {
19
+ i18n: { language: F }
20
+ } = T();
21
+ if (i.length < 2)
22
+ return console.error("Failed to render: invalid domain", i), null;
23
+ const u = { ...{ top: 0, right: 0, bottom: 0, left: 0 }, ...b }, a = Array.isArray(l) ? l : N(i[0], i[1], l), d = a.reduce((t, n) => {
24
+ if (Number.isInteger(n))
25
+ return t;
26
+ {
27
+ const r = n.toString().split(".")[1].length;
28
+ return r > t ? r : t;
29
+ }
30
+ }, 0), { format: Y } = new Intl.NumberFormat(F, {
31
+ minimumFractionDigits: d,
32
+ maximumFractionDigits: d
33
+ });
34
+ return /* @__PURE__ */ f(M, { children: [
35
+ p && /* @__PURE__ */ s(
21
36
  j,
22
37
  {
23
- x1: t,
24
- x2: t,
25
- y1: l(r[0]) + f.top,
26
- y2: l(r[1]) - f.bottom
38
+ x1: e,
39
+ x2: e,
40
+ y1: o(i[0]) + u.top,
41
+ y2: o(i[1]) - u.bottom
27
42
  }
28
43
  ),
29
- g.length > 0 && /* @__PURE__ */ s("g", { role: "list", "aria-labelledby": b, className: A, children: g.map((o, m) => {
30
- const e = l(o), n = t - d;
31
- return /* @__PURE__ */ p("g", { role: "listitem", children: [
32
- d > 0 && /* @__PURE__ */ s(y, { x1: n, x2: t, y1: e, y2: e }),
33
- a ? a(o, n, e, m) : /* @__PURE__ */ s(F, { x: n, y: e, children: o })
34
- ] }, m);
44
+ a.length > 0 && /* @__PURE__ */ s("g", { role: "list", "aria-labelledby": h, className: A, children: a.map((t, n) => {
45
+ const r = o(t), m = e - g;
46
+ return /* @__PURE__ */ f("g", { role: "listitem", children: [
47
+ g > 0 && /* @__PURE__ */ s(y, { x1: m, x2: e, y1: r, y2: r }),
48
+ c ? c(t, m, r, n) : /* @__PURE__ */ s(I, { x: m, y: r, children: Y(t) })
49
+ ] }, n);
35
50
  }) })
36
51
  ] });
37
52
  };
38
53
  x.displayName = "Charts.YAxis";
39
- const L = x;
54
+ const X = x;
40
55
  export {
41
- L as default
56
+ X as default
42
57
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),i=require("d3-array"),h=require("../../lib/utils.cjs"),S={linear:h.getLinearScale},g=({min:e,max:t,step:c,range:o,scale:u="linear",scaleOptions:d})=>{const n=t>e?Math.abs(c):-Math.abs(c),r=n/2,l=a.useMemo(()=>Math.abs(Math.ceil((t-e+1)/10)*10/c),[e,t,c]),s=a.useMemo(()=>i.nice(e-r,t+r,l),[e,t,l,r]),M=i.range(s[0]+r,s[1],n),b=a.useCallback(S[u](s,o,d),[s,o,u]);return[s,M,b]};exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../../lib/utils.cjs"),a=require("d3-array"),k={linear:d.getLinearScale},M=(s,t,e)=>s>t?-Math.abs(e):Math.abs(e),h=(s,t)=>s.map((e,n)=>n===0?e-t:e+t),p=({min:s,max:t,step:e,ticks:n=5,range:o,scale:i="linear",scaleOptions:u})=>{const c=(typeof e=="number"?Math.floor(Math.abs((t-s)/e)):void 0)||n,l=(typeof e=="number"?M(s,t,e):a.tickStep(s,t,n))/2,r=h(a.nice(s,t,c),l),m=a.ticks(r[0],r[1],c),b=k[i](r,o,u);return[r,m,b]};exports.default=p;
@@ -3,15 +3,16 @@ import { Domain, Scale, ScaleFunction } from '../../types/charts';
3
3
  interface UseAxisProps {
4
4
  min: number;
5
5
  max: number;
6
- step: number;
6
+ step?: number;
7
+ ticks?: number;
7
8
  scale?: Scale;
8
9
  scaleOptions?: any;
9
10
  range: Array<number>;
10
11
  }
11
12
  type Axis = [Domain, Array<number>, ScaleFunction];
12
13
  /**
13
- * Creates an axis with ticks defined by a min, max, and desired step.
14
+ * Creates an axis with ticks defined by a min, max, and desired step or number of ticks.
14
15
  * @returns [domain, ticks, scale]
15
16
  */
16
- declare const useAxis: ({ min, max, step, range: scaleRange, scale: scaleType, scaleOptions, }: UseAxisProps) => Axis;
17
+ declare const useAxis: ({ min: start, max: stop, step: configStep, ticks: configTicks, range: configRange, scale: configScale, scaleOptions, }: UseAxisProps) => Axis;
17
18
  export default useAxis;
@@ -1,29 +1,19 @@
1
- "use client";
2
- import { useMemo as i, useCallback as M } from "react";
3
- import { nice as b, range as d } from "d3-array";
4
- import { getLinearScale as k } from "../../lib/utils.js";
5
- const S = {
6
- linear: k
7
- }, j = ({
8
- min: t,
9
- max: o,
10
- step: e,
11
- range: c,
12
- scale: r = "linear",
13
- scaleOptions: u
1
+ import { getLinearScale as p } from "../../lib/utils.js";
2
+ import { tickStep as k, nice as b, ticks as h } from "d3-array";
3
+ const f = {
4
+ linear: p
5
+ }, M = (a, e, t) => a > e ? -Math.abs(t) : Math.abs(t), d = (a, e) => a.map((t, n) => n === 0 ? t - e : t + e), F = ({
6
+ min: a,
7
+ max: e,
8
+ step: t,
9
+ ticks: n = 5,
10
+ range: r,
11
+ scale: c = "linear",
12
+ scaleOptions: i
14
13
  }) => {
15
- const n = o > t ? Math.abs(e) : -Math.abs(e), a = n / 2, l = i(
16
- () => Math.abs(Math.ceil((o - t + 1) / 10) * 10 / e),
17
- [t, o, e]
18
- ), s = i(
19
- () => b(t - a, o + a, l),
20
- [t, o, l, a]
21
- ), f = d(s[0] + a, s[1], n), h = M(
22
- S[r](s, c, u),
23
- [s, c, r]
24
- );
25
- return [s, f, h];
14
+ const o = (typeof t == "number" ? Math.floor(Math.abs((e - a) / t)) : void 0) || n, m = (typeof t == "number" ? M(a, e, t) : k(a, e, n)) / 2, s = d(b(a, e, o), m), l = h(s[0], s[1], o), u = f[c](s, r, i);
15
+ return [s, l, u];
26
16
  };
27
17
  export {
28
- j as default
18
+ F as default
29
19
  };