uplot-plus 0.1.0

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +341 -0
  3. package/dist/annotations.d.ts +22 -0
  4. package/dist/annotations.d.ts.map +1 -0
  5. package/dist/axes/layout.d.ts +30 -0
  6. package/dist/axes/layout.d.ts.map +1 -0
  7. package/dist/axes/ticks.d.ts +47 -0
  8. package/dist/axes/ticks.d.ts.map +1 -0
  9. package/dist/colors.d.ts +32 -0
  10. package/dist/colors.d.ts.map +1 -0
  11. package/dist/components/Axis.d.ts +14 -0
  12. package/dist/components/Axis.d.ts.map +1 -0
  13. package/dist/components/Band.d.ts +10 -0
  14. package/dist/components/Band.d.ts.map +1 -0
  15. package/dist/components/Chart.d.ts +8 -0
  16. package/dist/components/Chart.d.ts.map +1 -0
  17. package/dist/components/Legend.d.ts +12 -0
  18. package/dist/components/Legend.d.ts.map +1 -0
  19. package/dist/components/ResponsiveChart.d.ts +18 -0
  20. package/dist/components/ResponsiveChart.d.ts.map +1 -0
  21. package/dist/components/Scale.d.ts +11 -0
  22. package/dist/components/Scale.d.ts.map +1 -0
  23. package/dist/components/Series.d.ts +11 -0
  24. package/dist/components/Series.d.ts.map +1 -0
  25. package/dist/components/Sparkline.d.ts +28 -0
  26. package/dist/components/Sparkline.d.ts.map +1 -0
  27. package/dist/components/Timeline.d.ts +8 -0
  28. package/dist/components/Timeline.d.ts.map +1 -0
  29. package/dist/components/Tooltip.d.ts +9 -0
  30. package/dist/components/Tooltip.d.ts.map +1 -0
  31. package/dist/components/ZoomRanger.d.ts +26 -0
  32. package/dist/components/ZoomRanger.d.ts.map +1 -0
  33. package/dist/components/annotations/AnnotationLabel.d.ts +26 -0
  34. package/dist/components/annotations/AnnotationLabel.d.ts.map +1 -0
  35. package/dist/components/annotations/HLine.d.ts +22 -0
  36. package/dist/components/annotations/HLine.d.ts.map +1 -0
  37. package/dist/components/annotations/Region.d.ts +22 -0
  38. package/dist/components/annotations/Region.d.ts.map +1 -0
  39. package/dist/components/annotations/VLine.d.ts +22 -0
  40. package/dist/components/annotations/VLine.d.ts.map +1 -0
  41. package/dist/components/annotations/index.d.ts +9 -0
  42. package/dist/components/annotations/index.d.ts.map +1 -0
  43. package/dist/core/BlockMinMax.d.ts +42 -0
  44. package/dist/core/BlockMinMax.d.ts.map +1 -0
  45. package/dist/core/CursorManager.d.ts +43 -0
  46. package/dist/core/CursorManager.d.ts.map +1 -0
  47. package/dist/core/DataStore.d.ts +51 -0
  48. package/dist/core/DataStore.d.ts.map +1 -0
  49. package/dist/core/RenderScheduler.d.ts +28 -0
  50. package/dist/core/RenderScheduler.d.ts.map +1 -0
  51. package/dist/core/Scale.d.ts +23 -0
  52. package/dist/core/Scale.d.ts.map +1 -0
  53. package/dist/core/ScaleManager.d.ts +45 -0
  54. package/dist/core/ScaleManager.d.ts.map +1 -0
  55. package/dist/formatters.d.ts +39 -0
  56. package/dist/formatters.d.ts.map +1 -0
  57. package/dist/hooks/useChart.d.ts +5 -0
  58. package/dist/hooks/useChart.d.ts.map +1 -0
  59. package/dist/hooks/useChartStore.d.ts +69 -0
  60. package/dist/hooks/useChartStore.d.ts.map +1 -0
  61. package/dist/hooks/useDrawHook.d.ts +14 -0
  62. package/dist/hooks/useDrawHook.d.ts.map +1 -0
  63. package/dist/hooks/useInteraction.d.ts +14 -0
  64. package/dist/hooks/useInteraction.d.ts.map +1 -0
  65. package/dist/hooks/useStreamingData.d.ts +35 -0
  66. package/dist/hooks/useStreamingData.d.ts.map +1 -0
  67. package/dist/index.cjs +1 -0
  68. package/dist/index.d.ts +47 -0
  69. package/dist/index.d.ts.map +1 -0
  70. package/dist/index.js +3203 -0
  71. package/dist/math/align.d.ts +10 -0
  72. package/dist/math/align.d.ts.map +1 -0
  73. package/dist/math/increments.d.ts +9 -0
  74. package/dist/math/increments.d.ts.map +1 -0
  75. package/dist/math/stack.d.ts +16 -0
  76. package/dist/math/stack.d.ts.map +1 -0
  77. package/dist/math/utils.d.ts +74 -0
  78. package/dist/math/utils.d.ts.map +1 -0
  79. package/dist/paths/bars.d.ts +9 -0
  80. package/dist/paths/bars.d.ts.map +1 -0
  81. package/dist/paths/candlestick.d.ts +35 -0
  82. package/dist/paths/candlestick.d.ts.map +1 -0
  83. package/dist/paths/catmullRom.d.ts +9 -0
  84. package/dist/paths/catmullRom.d.ts.map +1 -0
  85. package/dist/paths/linear.d.ts +10 -0
  86. package/dist/paths/linear.d.ts.map +1 -0
  87. package/dist/paths/monotoneCubic.d.ts +10 -0
  88. package/dist/paths/monotoneCubic.d.ts.map +1 -0
  89. package/dist/paths/points.d.ts +10 -0
  90. package/dist/paths/points.d.ts.map +1 -0
  91. package/dist/paths/spline.d.ts +9 -0
  92. package/dist/paths/spline.d.ts.map +1 -0
  93. package/dist/paths/stepped.d.ts +9 -0
  94. package/dist/paths/stepped.d.ts.map +1 -0
  95. package/dist/paths/types.d.ts +32 -0
  96. package/dist/paths/types.d.ts.map +1 -0
  97. package/dist/paths/utils.d.ts +19 -0
  98. package/dist/paths/utils.d.ts.map +1 -0
  99. package/dist/rendering/CanvasRenderer.d.ts +75 -0
  100. package/dist/rendering/CanvasRenderer.d.ts.map +1 -0
  101. package/dist/rendering/drawAxes.d.ts +8 -0
  102. package/dist/rendering/drawAxes.d.ts.map +1 -0
  103. package/dist/rendering/drawBands.d.ts +8 -0
  104. package/dist/rendering/drawBands.d.ts.map +1 -0
  105. package/dist/rendering/drawCursor.d.ts +22 -0
  106. package/dist/rendering/drawCursor.d.ts.map +1 -0
  107. package/dist/rendering/drawPoints.d.ts +13 -0
  108. package/dist/rendering/drawPoints.d.ts.map +1 -0
  109. package/dist/rendering/drawSelect.d.ts +14 -0
  110. package/dist/rendering/drawSelect.d.ts.map +1 -0
  111. package/dist/rendering/drawSeries.d.ts +7 -0
  112. package/dist/rendering/drawSeries.d.ts.map +1 -0
  113. package/dist/sync/SyncGroup.d.ts +33 -0
  114. package/dist/sync/SyncGroup.d.ts.map +1 -0
  115. package/dist/sync/useSyncGroup.d.ts +8 -0
  116. package/dist/sync/useSyncGroup.d.ts.map +1 -0
  117. package/dist/time/fmtDate.d.ts +15 -0
  118. package/dist/time/fmtDate.d.ts.map +1 -0
  119. package/dist/time/timeIncrs.d.ts +17 -0
  120. package/dist/time/timeIncrs.d.ts.map +1 -0
  121. package/dist/time/timeSplits.d.ts +6 -0
  122. package/dist/time/timeSplits.d.ts.map +1 -0
  123. package/dist/time/timeVals.d.ts +16 -0
  124. package/dist/time/timeVals.d.ts.map +1 -0
  125. package/dist/types/axes.d.ts +84 -0
  126. package/dist/types/axes.d.ts.map +1 -0
  127. package/dist/types/bands.d.ts +12 -0
  128. package/dist/types/bands.d.ts.map +1 -0
  129. package/dist/types/chart.d.ts +53 -0
  130. package/dist/types/chart.d.ts.map +1 -0
  131. package/dist/types/common.d.ts +62 -0
  132. package/dist/types/common.d.ts.map +1 -0
  133. package/dist/types/cursor.d.ts +22 -0
  134. package/dist/types/cursor.d.ts.map +1 -0
  135. package/dist/types/data.d.ts +32 -0
  136. package/dist/types/data.d.ts.map +1 -0
  137. package/dist/types/events.d.ts +57 -0
  138. package/dist/types/events.d.ts.map +1 -0
  139. package/dist/types/hooks.d.ts +28 -0
  140. package/dist/types/hooks.d.ts.map +1 -0
  141. package/dist/types/index.d.ts +10 -0
  142. package/dist/types/index.d.ts.map +1 -0
  143. package/dist/types/legend.d.ts +8 -0
  144. package/dist/types/legend.d.ts.map +1 -0
  145. package/dist/types/scales.d.ts +60 -0
  146. package/dist/types/scales.d.ts.map +1 -0
  147. package/dist/types/series.d.ts +76 -0
  148. package/dist/types/series.d.ts.map +1 -0
  149. package/dist/types/timeline.d.ts +30 -0
  150. package/dist/types/timeline.d.ts.map +1 -0
  151. package/dist/types/tooltip.d.ts +33 -0
  152. package/dist/types/tooltip.d.ts.map +1 -0
  153. package/dist/utils/shallowEqual.d.ts +10 -0
  154. package/dist/utils/shallowEqual.d.ts.map +1 -0
  155. package/package.json +59 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDrawHook.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrawHook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGvE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAYlD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAY9D"}
@@ -0,0 +1,14 @@
1
+ import type { ChartStore } from './useChartStore';
2
+ /**
3
+ * Hook that attaches mouse/touch listeners to the chart container
4
+ * for cursor tracking, drag-to-zoom selection, wheel zoom, focus mode,
5
+ * pinch zoom, and y-axis drag.
6
+ */
7
+ export declare function useInteraction(store: ChartStore, containerEl: HTMLDivElement | null): void;
8
+ /**
9
+ * Attach mouse/touch listeners to a container element for chart interactions.
10
+ * Returns a cleanup function that removes all listeners.
11
+ * Extracted from useInteraction for testability.
12
+ */
13
+ export declare function setupInteraction(store: ChartStore, el: HTMLElement): () => void;
14
+ //# sourceMappingURL=useInteraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,cAAc,GAAG,IAAI,GACjC,IAAI,CAKN;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,GAAG,MAAM,IAAI,CAsjB/E"}
@@ -0,0 +1,35 @@
1
+ import type { ChartData } from '../types';
2
+ export interface StreamingOptions {
3
+ /** Maximum number of data points to retain (sliding window size) */
4
+ window: number;
5
+ /** Number of points to push per tick (default: 1) */
6
+ batchSize?: number;
7
+ /** Start streaming immediately on mount (default: true) */
8
+ autoStart?: boolean;
9
+ }
10
+ export interface StreamingResult {
11
+ /** Current chart data (pass to <Chart data={...}>) */
12
+ data: ChartData;
13
+ /**
14
+ * Push new data points. Oldest points beyond the window are dropped.
15
+ * @param x - new x values
16
+ * @param ySeries - one array of new y values per series
17
+ */
18
+ push: (x: number[], ...ySeries: number[][]) => void;
19
+ /** Start the rAF loop (calls the onTick callback each frame) */
20
+ start: () => void;
21
+ /** Stop the rAF loop */
22
+ stop: () => void;
23
+ /** Whether the rAF loop is running */
24
+ running: boolean;
25
+ /** Frames per second (smoothed) */
26
+ fps: number;
27
+ }
28
+ /**
29
+ * Hook for streaming/real-time chart data with a sliding window.
30
+ *
31
+ * Manages a requestAnimationFrame loop and FPS counter.
32
+ * Call `push()` from your own tick callback, or use it standalone.
33
+ */
34
+ export declare function useStreamingData(initialData: ChartData, options: StreamingOptions): StreamingResult;
35
+ //# sourceMappingURL=useStreamingData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStreamingData.d.ts","sourceRoot":"","sources":["../../src/hooks/useStreamingData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,IAAI,EAAE,SAAS,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC;IACpD,gEAAgE;IAChE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,wBAAwB;IACxB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,gBAAgB,GACxB,eAAe,CAqFjB"}
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),z=require("react");var $=(e=>(e[e.Top=0]="Top",e[e.Right=1]="Right",e[e.Bottom=2]="Bottom",e[e.Left=3]="Left",e))($||{}),H=(e=>(e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e))(H||{}),Y=(e=>(e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward",e))(Y||{}),O=(e=>(e[e.Linear=1]="Linear",e[e.Ordinal=2]="Ordinal",e[e.Log=3]="Log",e[e.Asinh=4]="Asinh",e))(O||{}),me=(e=>(e[e.Ascending=1]="Ascending",e[e.Descending=-1]="Descending",e[e.Unsorted=0]="Unsorted",e))(me||{});function he(e){return e%2}var q=(e=>(e[e.None=0]="None",e[e.Scales=1]="Scales",e[e.Axes=2]="Axes",e[e.Paths=4]="Paths",e[e.Cursor=8]="Cursor",e[e.Select=16]="Select",e[e.Size=32]="Size",e[e.Full=63]="Full",e))(q||{});const N=Math,ze=N.PI,fe=N.abs,te=N.floor,B=N.round,ye=N.ceil,Oe=N.min,Me=N.max,pe=N.pow,Ue=N.sign,Z=N.log10,xe=N.log2,Tt=(e,t=1)=>N.sinh(e)*t,Ge=(e,t=1)=>N.asinh(e/t),U=1/0,rt=Number.isInteger;function Fe(e,t){return e[t]??0}function ie(e,t,n=0,s=t.length-1){let o;const i=s<=2147483647;for(;s-n>1;)o=i?n+s>>1:te((n+s)/2),Fe(t,o)<e?n=o:s=o;return e-Fe(t,n)<=Fe(t,s)-e?n:s}const at=e=>e!=null,ct=e=>e!=null&&e>0;function ut(e){return(t,n,s)=>{let o=-1,i=-1;for(let l=n;l<=s;l++)if(e(t[l])){o=l;break}for(let l=s;l>=n;l--)if(e(t[l])){i=l;break}return[o,i]}}const Ae=ut(at),ft=ut(ct);function It(e,t,n,s=me.Unsorted,o=!1){const i=o?ft:Ae,l=o?ct:at,[r,a]=i(e,t,n);let c=e[r]??U,u=e[r]??-U;if(r>-1)if(s===me.Ascending)c=e[r]??U,u=e[a]??-U;else if(s===me.Descending)c=e[a]??U,u=e[r]??-U;else for(let h=r;h<=a;h++){const f=e[h];f!=null&&l(f)&&(f<c?c=f:f>u&&(u=f))}return[c,u]}function re(e,t=0){if(rt(e))return e;const n=10**t,s=e*n*(1+Number.EPSILON);return B(s)/n}const we=new Map;function At(e){return(String(e).split(".")[1]??"").length}const Pt=/\.\d*?(?=9{6,}|0{6,})/gm;function ke(e){if(rt(e)||we.has(e))return e;const t=`${e}`,n=t.match(Pt);if(n==null)return e;const s=n[0].length-1;if(t.indexOf("e-")!==-1){const o=t.split("e"),i=o[0]??"0",l=o[1]??"0";return+`${ke(+i)}e${l}`}return re(e,s)}function He(e,t,n=!0){return n?ke(ye(ke(e/t))*t):ye(e/t)*t}function ht(e,t,n=!0){return n?ke(te(ke(e/t))*t):te(e/t)*t}function dt(e,t,n,s){const o=[],i=s.map(At);for(let l=t;l<n;l++){const r=fe(l);for(let a=0;a<s.length;a++){const c=s[a]??0,u=i[a]??0,h=+`${c}e${l}`,f=(l>=0?0:r)+(l>=u?0:u),d=h;o.push(d),we.set(d,f)}}return o}const Lt=new Intl.NumberFormat,gt=e=>Lt.format(e),Rt=.1,se={mode:3,pad:Rt,soft:null},be={pad:0,soft:null,mode:0},Dt={min:be,max:be};function Se(e,t,n,s){let o;typeof n=="number"?(be.pad=n,be.soft=null,be.mode=0,o=Dt):o=n;const i=o.min,l=o.max,r=i.pad,a=l.pad,c=i.hard??-U,u=l.hard??U,h=i.soft??U,f=l.soft??-U,d=i.mode,y=l.mode;let M=t-e;const p=Z(M),g=Me(fe(e),fe(t)),I=Z(g),L=fe(I-p);(M<1e-24||L>10)&&(M=0,(e===0||t===0)&&(M=1e-24));const P=M||g||1e3,T=Z(P),S=pe(10,te(T)),w=P*(M===0?e===0?.1:1:r),b=re(ht(e-w,S/10),24),k=e>=h&&(d===1||d===3&&b<=h||d===2&&b>=h)?h:U,D=Me(c,b<k&&e>=k?k:Oe(k,b)),m=P*(M===0?t===0?.1:1:a),x=re(He(t+m,S/10),24),v=t<=f&&(y===1||y===3&&x>=f||y===2&&x<=f)?f:-U,C=Oe(u,x>v&&t<=v?v:Me(v,x));return D===C&&D===0?[0,100]:[D,C]}function zt(e,t,n,s){n===2&&(s=!0);const o=Ue(e),i=Ue(t);e===t&&(o===-1?(e*=n,t/=n):(e/=n,t*=n));const l=n===10?Z:xe,r=o===1?te:ye,a=i===1?ye:te,c=l(fe(e)),u=l(fe(t)),h=r(c),f=a(u);let d=pe(n,h),y=pe(n,f);return n===10&&(h<0&&(d=re(d,-h)),f<0&&(y=re(y,-f))),s?(e=d*o,t=y*i):(e=ht(e,pe(n,te(c)),!1),t=He(t,pe(n,te(u)),!1)),[e,t]}function Ne(e){return(Z((e^e>>31)-(e>>31))|0)+1}function Ft(e,t,n,s,o){const i=Me(Ne(e),Ne(t)),l=t-e;let r=Me(0,ie(o/s*l,n)-1);do{const a=n[r]??0,c=s*a/l;if(c>=o*.9&&i+(a<5?we.get(a)??0:0)<=17)return[a,c]}while(++r<n.length);return[0,0]}function Et(e){return{id:e.id,min:e.min??null,max:e.max??null,distr:e.distr??O.Linear,log:e.log??10,asinh:e.asinh??1,ori:e.ori??(e.id==="x"?H.Horizontal:H.Vertical),dir:e.dir??Y.Forward,time:e.time??!1,auto:e.auto??!0,range:e.range??null,_min:null,_max:null}}function le(e){e._min=null,e._max=null}function pt(e){if(e._min!=null)return e._min;const{min:t,distr:n}=e;if(t==null)return 0;if(n===O.Log){const s=t>0?t:1e-10;e._min=(e.log===10?Z:xe)(s)}else n===O.Asinh?e._min=Ge(t,e.asinh):e._min=t;return e._min}function mt(e){if(e._max!=null)return e._max;const{max:t,distr:n}=e;if(t==null)return 0;if(n===O.Log){const s=t>0?t:1e-10;e._max=(e.log===10?Z:xe)(s)}else n===O.Asinh?e._max=Ge(t,e.asinh):e._max=t;return e._max}function _t(e,t){if(t.min==null||t.max==null)return 0;const n=pt(t),o=mt(t)-n;if(o===0)return 0;const{distr:i}=t;if(i===O.Log){const l=t.log===10?Z:xe,r=e>0?e:1e-10;return(l(r)-n)/o}return i===O.Asinh?(Ge(e,t.asinh)-n)/o:(e-n)/o}function Gt(e,t){if(t.min==null||t.max==null)return 0;const n=pt(t),s=mt(t);if(s===n)return t.min;const{distr:o}=t;return o===O.Log?Math.pow(t.log,n+e*(s-n)):o===O.Asinh?Tt(n+e*(s-n),t.asinh):n+e*(s-n)}function V(e,t,n,s){const o=_t(e,t);let i;return t.ori===H.Horizontal?i=t.dir===Y.Forward?o:1-o:i=t.dir===Y.Forward?1-o:o,s+i*n}function ee(e,t,n,s){if(n===0)return t.min??0;let o=(e-s)/n;return t.ori===H.Horizontal?t.dir===Y.Backward&&(o=1-o):t.dir!==Y.Backward&&(o=1-o),Gt(o,t)}class Ht{constructor(){this.scales=new Map,this.groupXScales=new Map}addScale(t){this.scales.set(t.id,Et(t))}removeScale(t){this.scales.delete(t)}getScale(t){return this.scales.get(t)}getAllScales(){return this.scales.values()}setGroupXScale(t,n){this.groupXScales.set(t,n)}getGroupXScaleKey(t){return this.groupXScales.get(t)}setRange(t,n,s){const o=this.scales.get(t);o&&(o.min=n,o.max=s,le(o))}autoRangeX(t){var s,o,i,l,r,a;const n=new Map;for(const[c,u]of this.groupXScales){const h=this.scales.get(u);if(!h||!h.auto)continue;const f=t[c];if(!f||f.x.length===0)continue;const d=f.x[0],y=f.x[f.x.length-1];if(d==null||y==null)continue;const M=n.get(u);M?(M.dataMin=Math.min(M.dataMin,d),M.dataMax=Math.max(M.dataMax,y)):n.set(u,{dataMin:d,dataMax:y})}for(const[c,{dataMin:u,dataMax:h}]of n){const f=this.scales.get(c);if(f){if(f.range){const[d,y]=Se(u,h,{min:{pad:((s=f.range.min)==null?void 0:s.pad)??0,soft:((o=f.range.min)==null?void 0:o.soft)??null,mode:((i=f.range.min)==null?void 0:i.mode)??0},max:{pad:((l=f.range.max)==null?void 0:l.pad)??0,soft:((r=f.range.max)==null?void 0:r.soft)??null,mode:((a=f.range.max)==null?void 0:a.mode)??0}});f.min=d,f.max=y}else u===h?[f.min,f.max]=Se(u,h,{min:{pad:.1,soft:null,mode:0},max:{pad:.1,soft:null,mode:0}}):(f.min=u,f.max=h);le(f)}}}autoRange(t,n,s){var r,a,c,u,h,f,d,y,M,p,g,I;const o=new Map;for(const[L,P]of this.groupXScales){const T=this.scales.get(P);if(!T||!T.auto)continue;const S=t[L];if(!S||S.x.length===0)continue;const w=S.x[0],b=S.x[S.x.length-1];if(w==null||b==null)continue;const k=o.get(P);k?(k.dataMin=Math.min(k.dataMin,w),k.dataMax=Math.max(k.dataMax,b)):o.set(P,{dataMin:w,dataMax:b})}for(const[L,{dataMin:P,dataMax:T}]of o){const S=this.scales.get(L);if(S){if(S.range){const[w,b]=Se(P,T,{min:{pad:((r=S.range.min)==null?void 0:r.pad)??0,soft:((a=S.range.min)==null?void 0:a.soft)??null,mode:((c=S.range.min)==null?void 0:c.mode)??0},max:{pad:((u=S.range.max)==null?void 0:u.pad)??0,soft:((h=S.range.max)==null?void 0:h.soft)??null,mode:((f=S.range.max)==null?void 0:f.mode)??0}});S.min=w,S.max=b}else P===T?[S.min,S.max]=Se(P,T,{min:{pad:.1,soft:null,mode:0},max:{pad:.1,soft:null,mode:0}}):(S.min=P,S.max=T);le(S)}}const i=new Map,l=new Map;for(const{group:L,index:P,yScale:T}of n){const S=t[L];if(!S)continue;const w=S.series[P];if(!w||w.length===0)continue;const b=s.windows.get(L),k=b?b[0]:0,D=b?b[1]:w.length-1,m=this.scales.get(T),x=(m==null?void 0:m.distr)===O.Log,[v,C]=s.getCachedMinMax(L,P,k,D,0,x),R=i.get(T),A=l.get(T);i.set(T,R!=null?Math.min(R,v):v),l.set(T,A!=null?Math.max(A,C):C)}for(const[L,P]of i){const T=this.scales.get(L);if(!T||!T.auto)continue;const S=l.get(L)??-U;if(P===U)continue;let w,b;if(T.distr===O.Log)[w,b]=zt(P,S,T.log,!1);else{const k=T.range??{min:se,max:se};[w,b]=Se(P,S,{min:{pad:((d=k.min)==null?void 0:d.pad)??se.pad,soft:((y=k.min)==null?void 0:y.soft)??se.soft,mode:((M=k.min)==null?void 0:M.mode)??se.mode},max:{pad:((p=k.max)==null?void 0:p.pad)??se.pad,soft:((g=k.max)==null?void 0:g.soft)??se.soft,mode:((I=k.max)==null?void 0:I.mode)??se.mode}})}T.min=w,T.max=b,le(T)}}}const Vt=1024;class Bt{constructor(t,n=Vt){this.data=t,this.len=t.length,this.blockSize=n,this.nBlocks=Math.ceil(t.length/n),this.blocks=new Float64Array(this.nBlocks*2),this.buildAll()}buildAll(){const{data:t,blockSize:n,nBlocks:s,blocks:o,len:i}=this;for(let l=0;l<s;l++){const r=l*n,a=Math.min(r+n,i);let c=1/0,u=-1/0;for(let h=r;h<a;h++){const f=t[h];f!=null&&(f<c&&(c=f),f>u&&(u=f))}o[l*2]=c,o[l*2+1]=u}}rangeMinMax(t,n){const{data:s,blockSize:o,blocks:i}=this;let l=1/0,r=-1/0;const a=Math.floor(t/o),c=Math.floor(n/o);if(a===c){for(let f=t;f<=n;f++){const d=s[f];d!=null&&(d<l&&(l=d),d>r&&(r=d))}return[l,r]}const u=(a+1)*o-1;for(let f=t;f<=u;f++){const d=s[f];d!=null&&(d<l&&(l=d),d>r&&(r=d))}for(let f=a+1;f<c;f++){const d=i[f*2]??1/0,y=i[f*2+1]??-1/0;d<l&&(l=d),y>r&&(r=y)}const h=c*o;for(let f=h;f<=n;f++){const d=s[f];d!=null&&(d<l&&(l=d),d>r&&(r=d))}return[l,r]}updateBlock(t){const{data:n,blockSize:s,blocks:o,len:i}=this;if(t>=this.nBlocks)return;const l=t*s,r=Math.min(l+s,i);let a=1/0,c=-1/0;for(let u=l;u<r;u++){const h=n[u];h!=null&&(h<a&&(a=h),h>c&&(c=h))}o[t*2]=a,o[t*2+1]=c}grow(t){const n=this.nBlocks;if(this.len=t,this.nBlocks=Math.ceil(t/this.blockSize),this.nBlocks>n){const o=new Float64Array(this.nBlocks*2);o.set(this.blocks),this.blocks=o}const s=Math.max(0,n-1);for(let o=s;o<this.nBlocks;o++)this.updateBlock(o)}setData(t){this.data=t}}class Wt{constructor(){this.data=[],this.windows=new Map,this.minMaxCache=new Map,this.blockTrees=new Map}setData(t){this.data=t,this.windows.clear();for(const n of this.minMaxCache.values())n.clear();this.minMaxCache.clear(),this.blockTrees.clear()}getOrBuildTree(t,n){const s=`${t}:${n}`;let o=this.blockTrees.get(s);if(o)return o;const i=this.data[t];if(!i)return;const l=i.series[n];if(!(!l||l.length===0))return o=new Bt(l),this.blockTrees.set(s,o),o}updateWindows(t){var s;let n=!1;for(let o=0;o<this.data.length;o++){const i=this.data[o],l=t(o),r=this.windows.get(o);let a,c;if(!i||!l||l.min==null||l.max==null)a=0,c=Math.max(0,((i==null?void 0:i.x.length)??1)-1);else{const u=i.x;if(u.length===0)a=0,c=0;else{a=ie(l.min,u),c=ie(l.max,u);const h=u[a],f=u[c];a>0&&h!=null&&h>l.min&&a--,c<u.length-1&&f!=null&&f<l.max&&c++}}(!r||r[0]!==a||r[1]!==c)&&(n=!0,(s=this.minMaxCache.get(o))==null||s.clear()),this.windows.set(o,[a,c])}return n}getWindow(t){var n;return this.windows.get(t)??[0,(((n=this.data[t])==null?void 0:n.x.length)||1)-1]}getXValues(t){var n;return((n=this.data[t])==null?void 0:n.x)??[]}getYValues(t,n){var s;return((s=this.data[t])==null?void 0:s.series[n])??[]}getCachedMinMax(t,n,s,o,i,l){let r=this.minMaxCache.get(t);const a=`${n}:${s}:${o}`;if(r){const d=r.get(a);if(d!=null)return d}else r=new Map,this.minMaxCache.set(t,r);const c=this.data[t];if(!c)return[1/0,-1/0];const u=c.series[n];if(!u||u.length===0)return[1/0,-1/0];let h;const f=!l&&i===me.Unsorted?this.getOrBuildTree(t,n):void 0;return f?h=f.rangeMinMax(s,o):h=It(u,s,o,i,l),r.set(a,h),h}getBlockTree(t,n){return this.getOrBuildTree(t,n)}appendData(t,n,s){var l;const o=this.data[t];if(!o)return;const i=o.x;if(Array.isArray(i)){for(let r=0;r<n.length;r++){const a=n[r];a!=null&&i.push(a)}for(let r=0;r<o.series.length;r++){const a=o.series[r];if(!a||!Array.isArray(a))continue;const c=s[r];if(c)for(let h=0;h<c.length;h++)a.push(c[h]??null);const u=this.blockTrees.get(`${t}:${r}`);u&&(u.setData(a),u.grow(a.length))}(l=this.minMaxCache.get(t))==null||l.clear()}}static toTypedX(t){for(const n of t)Array.isArray(n.x)&&(n.x=Float64Array.from(n.x));return t}}class jt{constructor(){this.state={left:-10,top:-10,activeGroup:-1,activeSeriesIdx:-1,activeDataIdx:-1}}hide(){this.state.left=-10,this.state.top=-10,this.state.activeGroup=-1,this.state.activeSeriesIdx=-1,this.state.activeDataIdx=-1}update(t,n,s,o,i,l,r,a){this.state.left=t,this.state.top=n;let c=1/0,u=-1,h=-1,f=-1;for(let d=0;d<o.length;d++){const y=o[d];if(y==null)continue;const M=y.x;if(M.length===0)continue;const p=a(d);if(p==null)continue;const g=l(p);if(g==null||g.min==null||g.max==null)continue;const[I,L]=r(d),P=s.width,T=s.left,S=ee(t+T,g,P,T),w=ie(S,M,I,L),b=[w];w>I&&b.push(w-1),w<L&&b.push(w+1);const k=new Map;for(const D of b){const m=M[D];if(m==null)continue;const x=V(m,g,P,T);for(const v of i){if(v.group!==d||v.show===!1)continue;const C=y.series[v.index];if(C==null)continue;const R=C[D];if(R==null)continue;let A=k.get(v.yScale);if(A==null&&!k.has(v.yScale)&&(A=l(v.yScale),k.set(v.yScale,A)),A==null||A.min==null||A.max==null)continue;const F=s.height,E=s.top,G=V(R,A,F,E),W=t+T-x,X=n+E-G,j=W*W+X*X;if(j<c&&(c=j,u=d,h=v.index,f=D,j===0))break}if(c===0)break}}this.state.activeGroup=u,this.state.activeSeriesIdx=h,this.state.activeDataIdx=f}syncToValue(t,n){const s=n.dataStore.data;if(s.length===0)return;const o=s[0];if(o==null)return;const i=n.scaleManager.getGroupXScaleKey(0);if(i==null)return;const l=n.scaleManager.getScale(i);if(l==null||l.min==null||l.max==null)return;const[r,a]=n.dataStore.getWindow(0),c=ie(t,o.x,r,a),u=o.x[c];if(u==null)return;const h=V(u,l,n.plotBox.width,n.plotBox.left);this.state.left=h-n.plotBox.left,this.state.activeGroup=0,this.state.activeDataIdx=c;let f=0,d=n.plotBox.height/2;for(const y of n.seriesConfigs){if(y.group!==0||y.show===!1)continue;const M=o.series[y.index];if(M==null)continue;const p=M[c];if(p==null)continue;const g=n.scaleManager.getScale(y.yScale);if(!(g==null||g.min==null||g.max==null)){d=V(p,g,n.plotBox.height,n.plotBox.top)-n.plotBox.top,f=y.index;break}}this.state.top=d,this.state.activeSeriesIdx=f}}class Xt{constructor(){this.flags=q.None,this.frameId=null,this.callback=null}mark(t){this.flags|=t,this.scheduleFrame()}has(t){return(this.flags&t)!==0}get dirty(){return this.flags}clear(){this.flags=q.None}onRedraw(t){this.callback=t}scheduleFrame(){this.frameId==null&&(this.frameId=requestAnimationFrame(()=>{this.frameId=null;const t=this.callback;t!=null&&t(),this.clear()}))}cancel(){this.frameId!=null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}dispose(){this.cancel(),this.callback=null,this.flags=q.None}}function Pe(e,t,n){e.lineTo(t,n)}function Le(e,t,n){e.lineTo(n,t)}function Ve(e,t,n,s,o,i){const l=[];let r=-1;const a=o===Y.Forward?n:s,c=o===Y.Forward?s:n,u=o;for(let h=a;o===Y.Forward?h<=c:h>=c;h+=u)if(t[h]===null||t[h]===void 0){if(r===-1){const f=Math.max(n,Math.min(h-o,s));r=i(e[f])}}else r!==-1&&(l.push([r,i(e[h])]),r=-1);return r!==-1&&l.push([r,i(e[s])]),l}function Be(e,t,n,s,o,i){const l=new Path2D;let r=t===H.Horizontal?n:s;const a=t===H.Horizontal?n+o:s+i,c=t===H.Horizontal?s:n,u=t===H.Horizontal?i:o;for(const[h,f]of e)h>r&&(t===H.Horizontal?l.rect(r,c,h-r,u):l.rect(c,r,u,h-r)),r=f;return r<a&&(t===H.Horizontal?l.rect(r,c,a-r,u):l.rect(c,r,u,a-r)),l}function wt(e){return(t,n,s,o,i,l)=>{s!==o&&(i!==s&&l!==s&&e(t,n,s),i!==o&&l!==o&&e(t,n,o),e(t,n,l))}}const $t=wt(Pe),Yt=wt(Le);function xt(){return(e,t,n,s,o,i,l,r,a,c,u,h,f)=>{const d=(f==null?void 0:f.spanGaps)??!1;if([a,c]=(s.distr===O.Log?ft:Ae)(t,a,c),a===-1)return{stroke:new Path2D,fill:null,clip:null,band:null,gaps:null};const M=w=>h(V(w,n,o,l)),p=w=>h(V(w,s,i,r));let g,I;n.ori===H.Horizontal?(g=Pe,I=$t):(g=Le,I=Yt);const L={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null},P=L.stroke;let T=!1;if(c-a>=o*4){const w=A=>ee(A,n,o,l);let b=null,k=0,D=0,m=0,x=M(e[u===Y.Forward?a:c]);const v=M(e[a]),C=M(e[c]);let R=w(u===Y.Forward?v+1:C-1);for(let A=u===Y.Forward?a:c;A>=a&&A<=c;A+=u){const F=e[A],G=(u===Y.Forward?F<R:F>R)?x:M(F),W=t[A];G===x?W!=null?(m=W,b==null?(g(P,G,p(m)),D=b=k=m):m<b?b=m:m>k&&(k=m)):W===null&&!d&&(T=!0):(b!=null&&I(P,x,p(b),p(k),p(D),p(m)),W!=null?(m=W,g(P,G,p(m)),b=k=D=m):(b=null,k=0,W===null&&!d&&(T=!0)),x=G,R=w(x+u))}b!=null&&(b!==k?I(P,x,p(b),p(k),p(D),p(m)):g(P,x,p(m)))}else for(let w=u===Y.Forward?a:c;w>=a&&w<=c;w+=u){const b=t[w];b===null&&!d?T=!0:b!=null&&g(P,M(e[w]),p(b))}{const w=L.fill=new Path2D(P),b=(f==null?void 0:f.fillTo)??s.min??0,k=p(b);let D=l,m=l+o;u===Y.Backward&&([m,D]=[D,m]),g(w,m,k),g(w,D,k)}if(T){const w=Ve(e,t,a,c,u,M);L.gaps=w,L.clip=Be(w,n.ori,l,r,o,i)}return L}}function Ke(e,t,n){return typeof t=="string"?t:Ot(e,t,n)}function Ot(e,t,n){const s=e.createLinearGradient(0,n.top,0,n.top+n.height);for(const[o,i]of t.stops)s.addColorStop(o,i);return s}function Ut(e,t,n,s,o){if(t.show===!1)return;const i=t.alpha??1;e.save(),i<1&&(e.globalAlpha=i),n.clip&&e.clip(n.clip);const l=o??{top:0,width:e.canvas.width/s,height:e.canvas.height/s};if(t.fill&&n.fill&&(e.fillStyle=Ke(e,t.fill,l),e.fill(n.fill)),t.stroke){const r=(t.width??1)*s;e.strokeStyle=Ke(e,t.stroke,l),e.lineWidth=r,e.lineJoin=t.join??"round",e.lineCap=t.cap??"butt",t.dash&&e.setLineDash(t.dash.map(h=>h*s));const a=t.pxAlign??1,c=r%2/2;a===1&&c>0&&e.translate(c,c),e.stroke(n.stroke)}e.restore()}const Nt=xt(),qe=64;class Kt{constructor(){this.ctx=null,this.pxRatio=1,this.pathCache=new Map,this.pathCacheSize=0,this.lruOrder=[],this.snapshotCanvas=null,this.snapshotValid=!1,this.cachedFillStyle="",this.cachedStrokeStyle="",this.cachedLineWidth=-1,this.cachedFont="",this.cachedTextAlign="",this.cachedTextBaseline="",this.cachedGlobalAlpha=-1}setContext(t,n){this.ctx=t,this.pxRatio=n,this.resetPropertyCache()}resetPropertyCache(){this.cachedFillStyle="",this.cachedStrokeStyle="",this.cachedLineWidth=-1,this.cachedFont="",this.cachedTextAlign="",this.cachedTextBaseline="",this.cachedGlobalAlpha=-1}setFillStyle(t,n){n!==this.cachedFillStyle&&(t.fillStyle=n,this.cachedFillStyle=n)}setStrokeStyle(t,n){n!==this.cachedStrokeStyle&&(t.strokeStyle=n,this.cachedStrokeStyle=n)}setLineWidth(t,n){n!==this.cachedLineWidth&&(t.lineWidth=n,this.cachedLineWidth=n)}setFont(t,n){n!==this.cachedFont&&(t.font=n,this.cachedFont=n)}setTextAlign(t,n){n!==this.cachedTextAlign&&(t.textAlign=n,this.cachedTextAlign=n)}setTextBaseline(t,n){n!==this.cachedTextBaseline&&(t.textBaseline=n,this.cachedTextBaseline=n)}setGlobalAlpha(t,n){n!==this.cachedGlobalAlpha&&(t.globalAlpha=n,this.cachedGlobalAlpha=n)}saveSnapshot(t,n,s){const o=t.canvas;(this.snapshotCanvas==null||this.snapshotCanvas.width!==n||this.snapshotCanvas.height!==s)&&(this.snapshotCanvas=typeof OffscreenCanvas<"u"?new OffscreenCanvas(n,s):document.createElement("canvas"),this.snapshotCanvas.width=n,this.snapshotCanvas.height=s);const i=this.snapshotCanvas.getContext("2d");i!=null&&typeof i.drawImage=="function"&&(i.clearRect(0,0,n,s),i.drawImage(o,0,0),this.snapshotValid=!0)}restoreSnapshot(t){return!this.snapshotValid||this.snapshotCanvas==null||typeof t.drawImage!="function"?!1:(t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(this.snapshotCanvas,0,0),!0)}invalidateSnapshot(){this.snapshotValid=!1}windowKey(t,n){return`${t}:${n}`}getCachedPaths(t,n,s,o){const i=this.pathCache.get(t);if(i==null)return;const l=i.get(n);if(l==null)return;const r=this.windowKey(s,o),a=l.get(r);if(a!=null){const c=this.lruOrder.findIndex(u=>u.group===t&&u.index===n&&u.key===r);if(c>=0){const u=this.lruOrder.splice(c,1)[0];u!=null&&this.lruOrder.push(u)}}return a}setCachedPaths(t,n,s,o,i){if(this.pathCacheSize>=qe){const c=qe>>2,u=this.lruOrder.splice(0,c);for(const h of u){const f=this.pathCache.get(h.group);if(f==null)continue;const d=f.get(h.index);d!=null&&(d.delete(h.key),this.pathCacheSize--,d.size===0&&f.delete(h.index),f.size===0&&this.pathCache.delete(h.group))}}let l=this.pathCache.get(t);l==null&&(l=new Map,this.pathCache.set(t,l));let r=l.get(n);r==null&&(r=new Map,l.set(n,r));const a=this.windowKey(s,o);r.has(a)||(this.pathCacheSize++,this.lruOrder.push({group:t,index:n,key:a})),r.set(a,i)}invalidateSeries(t,n){const s=this.pathCache.get(t);if(s==null)return;const o=s.get(n);o!=null&&(this.pathCacheSize-=o.size,s.delete(n),this.lruOrder=this.lruOrder.filter(i=>!(i.group===t&&i.index===n)))}clearGroupCache(t){const n=this.pathCache.get(t);if(n!=null){for(const s of n.values())this.pathCacheSize-=s.size;this.pathCache.delete(t),this.lruOrder=this.lruOrder.filter(s=>s.group!==t)}this.snapshotValid=!1}clearCache(){this.pathCache.clear(),this.pathCacheSize=0,this.lruOrder.length=0,this.snapshotValid=!1}drawSeries(t,n,s){const o=this.ctx;if(o==null||t.config.show===!1)return;const i=t.config.group,l=t.config.index,[r,a]=t.window;let c=this.getCachedPaths(i,l,r,a);if(c==null){const u=t.config.paths??Nt,h=t.xScale.dir,f=M=>B(M),d=t.config.fillTo,y=typeof d=="function"?d(t.yScale.min??0,t.yScale.max??0):d;c=u(t.dataX,t.dataY,t.xScale,t.yScale,n.width,n.height,n.left,n.top,r,a,h,f,{fillTo:y,spanGaps:t.config.spanGaps}),this.setCachedPaths(i,l,r,a,c)}Ut(o,t.config,c,s,n)}draw(t,n,s,o){const i=this.ctx;if(i==null)return;const l=this.pxRatio;i.clearRect(0,0,t*l,n*l),i.save(),i.scale(l,l),i.beginPath(),i.rect(s.left,s.top,s.width,s.height),i.clip();for(const r of o)this.drawSeries(r,s,1);i.restore(),this.resetPropertyCache()}}const vt=[1,2,2.5,5],qt=dt(10,-32,0,vt),Zt=dt(10,0,32,vt),ae=qt.concat(Zt);function Jt(e,t,n,s,o){if(n<=0||t<e)return[];const i=[],l=we.get(n)??0,r=o?e:re(He(e,n),l);for(let a=r;a<=t;a=re(a+n,l))i.push(Object.is(a,-0)?0:a);return i}function Ze(e){return e.map(t=>gt(t))}function Qt(e,t,n){if(e<=0||t<=0||e>=t)return[];const s=[],i=te((n===10?Z:xe)(e));let l=pe(n,i);n===10&&(l=ae[ie(l,ae)]??l);let r=l,a=l*n;n===10&&(a=ae[ie(a,ae)]??a);let c=0;do{if(r>=e&&s.push(r),r=r+l,n===10&&!we.has(r)){const u=we.get(l)??0;r=re(r,u)}r>=a*(1-1e-10)&&(l=r,a=l*n,n===10&&(a=ae[ie(a,ae)]??a))}while(r<=t&&++c<1e4);return s}function en(e,t){const n=t===10?Z:xe;return e.map(s=>{if(s===0)return!0;if(s<0)return!1;const o=n(s);return fe(o-Math.round(o))<1e-10})}function tn(e,t){const s=gt(Math.max(Math.abs(e),Math.abs(t))).length*7;return Math.max(50,s+16)}function nn(e,t,n,s){if(s<=0)return[0,0];const o=he(e.side)===H.Vertical,i=e.space??(o?30:tn(t,n)),l=e.incrs??ae;return Ft(t,n,l,s,i)}const sn=50;function on(e,t,n){var r,a;if(e.size!=null)return e.size;const s=((r=e.ticks)==null?void 0:r.show)!==!1?((a=e.ticks)==null?void 0:a.size)??10:0,o=e.gap??5,i=12;if(he(e.side)===H.Vertical&&t!=null){let c=0;for(const h of t)h.length>c&&(c=h.length);const u=c*7;return Math.max(50,s+o+u+4)}return Math.max(50,s+o+i+3)}function ln(e){return{config:e,_show:e.show!==!1,_size:e.size??sn,_pos:0,_lpos:0,_splits:null,_values:null,_incr:0,_space:0,_rotate:0}}const ge=60,ce=3600,oe=86400,ue=2592e3,Ce=31536e3,rn=[1,5,10,15,30,ge,5*ge,10*ge,15*ge,30*ge,ce,2*ce,3*ce,4*ce,6*ce,12*ce,oe,2*oe,3*oe,7*oe,14*oe,ue,2*ue,3*ue,6*ue,Ce];function an(e,t,n,s){const o=[];if(n<=0||e>=t)return o;let i;if(n>=Ce){const l=new Date(e*1e3);for(l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0),i=l.getTime()/1e3,i<e&&(l.setUTCFullYear(l.getUTCFullYear()+1),i=l.getTime()/1e3);i<=t;)o.push(i),l.setUTCFullYear(l.getUTCFullYear()+Math.round(n/Ce)),i=l.getTime()/1e3;return o}if(n>=ue){const l=new Date(e*1e3);l.setUTCDate(1),l.setUTCHours(0,0,0,0),i=l.getTime()/1e3;const r=Math.max(1,Math.round(n/ue));if(i<e&&(l.setUTCMonth(l.getUTCMonth()+1),i=l.getTime()/1e3),r>1){const a=l.getUTCMonth(),c=Math.ceil((a+1)/r)*r;l.setUTCMonth(c-1),i=l.getTime()/1e3}for(;i<=t;)o.push(i),l.setUTCMonth(l.getUTCMonth()+r),i=l.getTime()/1e3;return o}if(n>=oe){const l=new Date(e*1e3);l.setUTCHours(0,0,0,0),i=l.getTime()/1e3,i<e&&(i+=oe)}else i=Math.ceil(e/n)*n;for(let l=0;;l++){const r=i+l*n;if(r>t)break;o.push(r)}return o}const Je=new Map;function cn(e,t){const n=JSON.stringify(e)+(t??"");let s=Je.get(n);return s==null&&(s=new Intl.DateTimeFormat(void 0,{...e,timeZone:t}),Je.set(n,s)),s}function J(e,t,n){const s=new Date(e*1e3);return cn(t,n).format(s)}function un(e,t){return J(e,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},t)}function fn(e,t){return J(e,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},t)}function hn(e,t){return J(e,{hour:"2-digit",minute:"2-digit",hour12:!1},t)}function dn(e,t){return J(e,{month:"short",day:"numeric"},t)}function gn(e,t){return J(e,{year:"numeric"},t)}function pn(e,t){return J(e,{year:"numeric",month:"short"},t)}function mn(e,t,n){let s;return t>=Ce?s=gn:t>=ue?s=pn:t>=oe?s=dn:t>=ce?s=hn:t>=ge?s=fn:s=un,e.map(o=>s(o,n))}function wn(e,t,n,s,o){const i=t-e;if(i<=0||s<=0)return[0,0];for(const r of n){const a=i/r,c=s/a;if(c>=o)return[r,c]}const l=n[n.length-1]??Ce;return[l,s/(i/l)]}const xn=3;function vn(e,t,n,s,o){let i=!0;for(const l of e){const r=l.config;if(r.show===!1)continue;const a=t(r.scale);if(!a||a.min==null||a.max==null){l._show&&(i=!1,l._show=!1);continue}else l._show||(i=!1,l._show=!0);const c=r.side,h=he(c)===H.Horizontal?n:s,{min:f,max:d}=a;let y,M;if(a.time){const g=r.space??80;[y,M]=wn(f,d,rn,h,g)}else[y,M]=nn(r,f,d,h);if(l._incr=y,l._space=M,M===0)continue;if(r.splits)l._splits=r.splits(f,d,y,M);else if(a.time)l._splits=an(f,d,y);else if(a.distr===O.Log)l._splits=Qt(f,d,a.log);else{const g=a.distr===O.Ordinal;l._splits=Jt(f,d,y,M,g)}if(r.values)l._values=r.values(l._splits,M,y);else if(a.time)l._values=mn(l._splits,y);else if(a.distr===O.Log){const g=en(l._splits,a.log),I=Ze(l._splits);l._values=I.map((L,P)=>g[P]?L:"")}else l._values=Ze(l._splits);l._rotate=c===$.Bottom?r.rotate??0:0;const p=l._size;l._size=ye(on(r,l._values)),p!==l._size&&(i=!1)}return i}function Qe(e,t,n){let s=e,o=t,i=0,l=0;for(const r of n){if(!r._show)continue;const a=r.config.side,c=he(a)===H.Vertical,u=r.config.label!=null?r.config.labelSize??20:0,h=r._size+u;h>0&&(c?(s-=h,a===$.Left&&(i+=h)):(o-=h,a===$.Top&&(l+=h)))}return{left:i,top:l,width:Math.max(s,0),height:Math.max(o,0)}}function Sn(e,t){let n=t.top,s=t.left+t.width,o=t.top+t.height,i=t.left;function l(r,a){switch(r){case $.Top:return n-=a,n+a;case $.Right:{const c=s;return s+=a,c}case $.Bottom:{const c=o;return o+=a,c}case $.Left:return i-=a,i+a;default:return 0}}for(const r of e){if(!r._show)continue;const a=r.config.side;if(r._pos=l(a,r._size),r.config.label!=null){const c=r.config.labelSize??20;r._lpos=l(a,c)}}}function Mn(e,t,n,s){for(const r of n)r._size=0;let o=!1,i=0,l={left:0,top:0,width:e,height:t};for(;!o;){i++;const r=vn(n,s,l.width,l.height);o=i===xn||r,o||(l=Qe(e,t,n))}return l=Qe(e,t,n),Sn(n,l),l}const et="top",tt="bottom",bn="left",yn="right";function nt(e,t){return t===1?e:e.replace(/(\d+(?:\.\d+)?)px/,(n,s)=>`${Math.round(Number(s)*t)}px`)}function st(e,t,n,s,o,i,l,r,a,c,u){const h=r%2/2;e.save(),e.translate(h,h),e.strokeStyle=a,e.lineWidth=r,c.length>0&&e.setLineDash(c),e.beginPath();let f=0,d=0,y=0,M=0;const p=i+(o===$.Top||o===$.Left?-l:l);s===H.Horizontal?(d=i,M=p):(f=i,y=p);for(let g=0;g<t.length;g++)n[g]!=null&&(s===H.Horizontal?f=y=t[g]??0:d=M=t[g]??0,e.moveTo(f,d),e.lineTo(y,M));e.stroke(),e.restore()}function kn(e,t,n,s,o){const i=B(s.left*o),l=B(s.top*o),r=B(s.width*o),a=B(s.height*o);for(const c of t){if(!c._show)continue;const u=c.config,h=u.side,f=he(h),d=n(u.scale);if(!d||d.min==null||d.max==null)continue;const y=u.stroke??"#000",M=h===$.Top||h===$.Left?-1:1,p=c._splits,g=c._values;if(!p||!g||c._space===0)continue;const I=f===H.Horizontal?s.width:s.height,L=f===H.Horizontal?s.left:s.top,P=p.map(k=>B(V(k,d,I,L)*o)),T=g.map(k=>k===""?null:k),S=u.grid;if((S==null?void 0:S.show)!==!1){const k=(S==null?void 0:S.stroke)??"rgba(0,0,0,0.12)",D=B(((S==null?void 0:S.width)??2)*o),m=((S==null?void 0:S.dash)??[]).map(C=>C*o),x=f===H.Horizontal?l:i,v=f===H.Horizontal?a:r;st(e,P,T,f,2,x,v,D,k,m)}const w=u.ticks;if((w==null?void 0:w.show)!==!1){const k=(w==null?void 0:w.stroke)??y,D=B(((w==null?void 0:w.width)??1)*o),m=B(((w==null?void 0:w.size)??10)*o),x=((w==null?void 0:w.dash)??[]).map(C=>C*o),v=B(c._pos*o);st(e,P,T,f,h,v,m,D,k,x)}{const k=(w==null?void 0:w.show)!==!1?((w==null?void 0:w.size)??10)*o:0,D=B((u.gap??5)*o),m=B(c._pos*o),x=(k+D)*M,v=m+x,C=nt(u.font??"12px system-ui, sans-serif",o),R=f===H.Horizontal?"center":h===$.Left?yn:bn,A=f===H.Horizontal?h===$.Bottom?et:tt:"middle";e.font=C,e.fillStyle=y,e.textAlign=R,e.textBaseline=A;const F=c._rotate*-ze/180;for(let E=0;E<g.length;E++){const G=g[E];if(G==null||G==="")continue;const W=P[E]??0;if(F!==0)e.save(),e.translate(W,v),e.rotate(F),e.fillText(G,0,0),e.restore();else{const X=f===H.Horizontal?W:v,j=f===H.Horizontal?v:W;e.fillText(G,X,j)}}}if(u.label!=null){const k=nt(u.labelFont??"bold 12px system-ui, sans-serif",o);e.font=k,e.fillStyle=y,e.textAlign="center",e.textBaseline=h===$.Bottom?et:tt;const D=B((c._lpos+(u.labelGap??0)*M)*o);f===H.Vertical?(e.save(),e.translate(D,B(l+a/2)),e.rotate((h===$.Left?-ze:ze)/2),e.fillText(u.label,0,0),e.restore()):e.fillText(u.label,B(i+r/2),D)}const b=u.border;if((b==null?void 0:b.show)!==!1&&b!=null){const k=b.stroke??y,D=B((b.width??1)*o),m=(b.dash??[]).map(v=>v*o),x=B(c._pos*o);e.strokeStyle=k,e.lineWidth=D,m.length>0&&e.setLineDash(m),e.beginPath(),f===H.Horizontal?(e.moveTo(i,x),e.lineTo(i+r,x)):(e.moveTo(x,l),e.lineTo(x,l+a)),e.stroke(),m.length>0&&e.setLineDash([])}}}const Cn={stroke:"#607D8B",width:1,dash:[5,3],pointRadius:4,showX:!0,showY:!0};function ot(e,t,n,s,o,i,l,r,a){var L;if(t.left<0||t.top<0)return;const c={...Cn,...a},u=s,h=B(n.left*u),f=B(n.top*u),d=B(n.width*u),y=B(n.height*u),M=B(c.width*u),p=M%2/2,g=B((n.left+t.left)*u)+p,I=B((n.top+t.top)*u)+p;if(e.save(),e.strokeStyle=c.stroke,e.lineWidth=M,e.setLineDash(c.dash.map(P=>P*u)),c.showX&&(e.beginPath(),e.moveTo(g,f),e.lineTo(g,f+y),e.stroke()),c.showY&&(e.beginPath(),e.moveTo(h,I),e.lineTo(h+d,I),e.stroke()),e.setLineDash([]),t.activeGroup>=0&&t.activeDataIdx>=0){const P=t.activeGroup,T=t.activeSeriesIdx,S=t.activeDataIdx,w=o[P];if(w!=null&&T>=0&&T<w.series.length&&S<w.x.length){const b=w.x[S],k=w.series[T],D=k!=null?k[S]:null;if(b!=null&&D!=null){let m=c.stroke,x=!0;for(const v of i)if(v.group===P&&v.index===T){const C=v.stroke;m=(typeof C=="string"?C:void 0)??c.stroke,x=((L=v.cursor)==null?void 0:L.show)!==!1;break}if(x){const v=r(P),C=v!=null?l(v):void 0,R=Tn(i,P,T),A=R!=null?l(R):void 0;if(C!=null&&A!=null&&C.min!=null&&C.max!=null&&A.min!=null&&A.max!=null){const F=B(V(b,C,n.width,n.left)*u),E=B(V(D,A,n.height,n.top)*u),G=c.pointRadius*u,W=B(2*u);e.beginPath(),e.arc(F,E,G,0,Math.PI*2),e.fillStyle="#fff",e.fill(),e.strokeStyle=m,e.lineWidth=W,e.stroke()}}}}}e.restore()}function Tn(e,t,n){for(const s of e)if(s.group===t&&s.index===n)return s.yScale}const In={fill:"rgba(0,0,0,0.07)",stroke:"rgba(0,0,0,0.15)",width:1};function lt(e,t,n,s,o){if(!t.show||t.width<=0)return;const i={...In,...o},l=s,r=B((n.left+t.left)*l),a=B((n.top+t.top)*l),c=B(t.width*l),u=B(t.height*l);e.save(),e.fillStyle=i.fill,e.fillRect(r,a,c,u),i.width>0&&(e.strokeStyle=i.stroke,e.lineWidth=B(i.width*l),e.strokeRect(r,a,c,u)),e.restore()}function An(e,t,n,s,o,i,l,r,a,c,u,h){const f=u/2*l,d=Math.max(1,B(u*.2))*l,y=(c==null?void 0:c.stroke)??h,M=(c==null?void 0:c.fill)??"#fff";e.save(),e.strokeStyle=y,e.fillStyle=M,e.lineWidth=d,(c==null?void 0:c.dash)!=null&&e.setLineDash(c.dash.map(p=>p*l));for(let p=r;p<=a;p++){const g=n[p];if(g==null)continue;const I=t[p];if(I==null)continue;const L=B(V(I,s,i.width,i.left)*l),P=B(V(g,o,i.height,i.top)*l);e.beginPath(),e.arc(L,P,f,0,Math.PI*2),e.fill(),e.stroke()}e.restore()}function Pn(e,t,n,s,o,i,l){if(typeof e=="function")return e(t,n,s,o,i);if(e===!0)return!0;if(e===!1)return!1;const r=o-s;return r>0&&r<=i/l}function Ln(e,t,n,s,o,i,l,r,a,c,u){if(c>u||c<0)return;const h=t.fill??"rgba(0, 120, 255, 0.1)",f=M=>V(M,i,r.width,r.left)*a,d=M=>V(M,l,r.height,r.top)*a;e.save(),e.fillStyle=h,e.beginPath();let y=!1;for(let M=c;M<=u;M++){const p=s[M],g=n[M];if(p==null||g==null)continue;const I=f(g),L=d(p);y?e.lineTo(I,L):(e.moveTo(I,L),y=!0)}if(!y){e.restore();return}for(let M=u;M>=c;M--){const p=o[M],g=n[M];p==null||g==null||e.lineTo(f(g),d(p))}e.closePath(),e.fill(),e.restore()}function Ee(e,t,n,s){return{ctx:e,plotBox:t,pxRatio:n,getScale:s,valToX:(l,r="x")=>{const a=s(r);return a==null||a.min==null||a.max==null?null:V(l,a,t.width,t.left)},valToY:(l,r)=>{const a=s(r);return a==null||a.min==null||a.max==null?null:V(l,a,t.height,t.top)}}}function Rn(){const e={scaleManager:new Ht,dataStore:new Wt,renderer:new Kt,cursorManager:new jt,selectState:{show:!1,left:0,top:0,width:0,height:0},scaleConfigs:[],seriesConfigs:[],axisConfigs:[],bandConfigs:[],axisStates:[],width:0,height:0,pxRatio:typeof window<"u"&&window.devicePixelRatio||1,plotBox:{left:0,top:0,width:0,height:0},canvas:null,listeners:new Set,scheduler:new Xt,drawHooks:new Set,cursorDrawHooks:new Set,focusedSeries:null,focusAlpha:.15,wheelZoom:!1,revision:0,eventCallbacks:{},_prevScaleRanges:new Map,registerScale(t){e.scaleConfigs=e.scaleConfigs.filter(n=>n.id!==t.id),e.scaleConfigs.push(t),e.scaleManager.addScale(t)},unregisterScale(t){e.scaleConfigs=e.scaleConfigs.filter(n=>n.id!==t),e.scaleManager.removeScale(t)},registerSeries(t){e.seriesConfigs=e.seriesConfigs.filter(n=>!(n.group===t.group&&n.index===t.index)),e.seriesConfigs.push(t)},unregisterSeries(t,n){e.seriesConfigs=e.seriesConfigs.filter(s=>!(s.group===t&&s.index===n))},toggleSeries(t,n){const s=e.seriesConfigs.find(o=>o.group===t&&o.index===n);s!=null&&(s.show=s.show===!1,e.revision++,e.renderer.invalidateSeries(t,n),e.scheduleRedraw())},setFocus(t){e.focusedSeries=t,e.scheduleRedraw()},setSize(t,n){e.width=t,e.height=n,e.canvas&&(e.canvas.width=t*e.pxRatio,e.canvas.height=n*e.pxRatio,e.canvas.style.width=`${t}px`,e.canvas.style.height=`${n}px`),e.renderer.clearCache(),e.scheduleRedraw()},scheduleRedraw(){e.scheduler.mark(q.Full)},scheduleCursorRedraw(){e.scheduler.mark(q.Cursor)},subscribe(t){return e.listeners.add(t),()=>{e.listeners.delete(t)}},redraw(){const{scaleManager:t,dataStore:n,renderer:s,seriesConfigs:o,width:i,height:l,pxRatio:r,canvas:a,scheduler:c}=e;if(a==null||i===0||l===0)return;const u=a.getContext("2d");if(u==null)return;s.setContext(u,r);const f=(c.dirty&~(q.Cursor|q.Select))===0,d=p=>t.getScale(p);if(f&&s.restoreSnapshot(u)){if(ot(u,e.cursorManager.state,e.plotBox,r,n.data,o,d,p=>t.getGroupXScaleKey(p)),lt(u,e.selectState,e.plotBox,r),e.cursorDrawHooks.size>0){u.save(),u.scale(r,r);const p=Ee(u,e.plotBox,r,d);for(const g of e.cursorDrawHooks)try{g(p,e.cursorManager.state)}catch(I){console.warn("[uPlot+] draw hook error:",I)}u.restore()}for(const p of e.listeners)p();return}t.autoRangeX(n.data),n.updateWindows(p=>{const g=t.getGroupXScaleKey(p);return g!=null?t.getScale(g):void 0});const y=o.map(p=>({group:p.group,index:p.index,yScale:p.yScale}));t.autoRange(n.data,y,n),Dn(e),e.axisStates.length>0?e.plotBox=Mn(i,l,e.axisStates,d):e.plotBox={left:10,top:10,width:i-20,height:l-20},u.clearRect(0,0,i*r,l*r),e.axisStates.length>0&&kn(u,e.axisStates,d,e.plotBox,r);const M=[];for(const p of o){const g=t.getGroupXScaleKey(p.group),I=g!=null?t.getScale(g):void 0,L=t.getScale(p.yScale);I==null||L==null||M.push({config:p,dataX:n.getXValues(p.group),dataY:n.getYValues(p.group,p.index),xScale:I,yScale:L,window:n.getWindow(p.group)})}u.save(),u.scale(r,r),u.beginPath(),u.rect(e.plotBox.left,e.plotBox.top,e.plotBox.width,e.plotBox.height),u.clip();for(let p=0;p<M.length;p++){const g=M[p];g!=null&&(e.focusedSeries!=null&&p!==e.focusedSeries?(u.globalAlpha=e.focusAlpha,s.drawSeries(g,e.plotBox,1),u.globalAlpha=1):s.drawSeries(g,e.plotBox,1))}for(const p of e.bandConfigs){const g=t.getGroupXScaleKey(p.group),I=g!=null?t.getScale(g):void 0,L=o.find(b=>b.group===p.group&&b.index===p.series[0]),P=o.find(b=>b.group===p.group&&b.index===p.series[1]);if(I==null||L==null||P==null)continue;const T=t.getScale(L.yScale);if(T==null)continue;const[S,w]=n.getWindow(p.group);Ln(u,p,n.getXValues(p.group),n.getYValues(p.group,p.series[0]),n.getYValues(p.group,p.series[1]),I,T,e.plotBox,r,S,w)}for(const p of M){const g=p.config;if(g.show===!1)continue;const I=g.points,L=g.width??1,P=(I==null?void 0:I.size)??3+L*2,T=(I==null?void 0:I.space)??P*2,[S,w]=p.window;Pn(I==null?void 0:I.show,g.group,g.index,S,w,e.plotBox.width,T)&&An(u,p.dataX,p.dataY,p.xScale,p.yScale,e.plotBox,r,S,w,I,P,(typeof g.stroke=="string"?g.stroke:null)??"#000")}if(u.restore(),e.drawHooks.size>0){u.save(),u.beginPath(),u.rect(e.plotBox.left*r,e.plotBox.top*r,e.plotBox.width*r,e.plotBox.height*r),u.clip(),u.scale(r,r);const p=Ee(u,e.plotBox,r,d);for(const g of e.drawHooks)try{g(p)}catch(I){console.warn("[uPlot+] draw hook error:",I)}u.restore()}if(e.cursorManager.state.left>=0&&(s.saveSnapshot(u,i*r,l*r),e.cursorManager.update(e.cursorManager.state.left,e.cursorManager.state.top,e.plotBox,n.data,o,d,p=>n.getWindow(p),p=>t.getGroupXScaleKey(p))),ot(u,e.cursorManager.state,e.plotBox,r,n.data,o,d,p=>t.getGroupXScaleKey(p)),lt(u,e.selectState,e.plotBox,r),e.cursorDrawHooks.size>0){u.save(),u.scale(r,r);const p=Ee(u,e.plotBox,r,d);for(const g of e.cursorDrawHooks)try{g(p,e.cursorManager.state)}catch(I){console.warn("[uPlot+] draw hook error:",I)}u.restore()}for(const p of e.listeners)p();if(e._prevScaleRanges.size>0&&e.eventCallbacks.onScaleChange!=null)for(const p of t.getAllScales()){if(p.min==null||p.max==null)continue;const g=e._prevScaleRanges.get(p.id);if(g==null||g.min!==p.min||g.max!==p.max)try{e.eventCallbacks.onScaleChange(p.id,p.min,p.max)}catch(I){console.warn("[uPlot+] event callback error:",I)}}e._prevScaleRanges.clear();for(const p of t.getAllScales())p.min!=null&&p.max!=null&&e._prevScaleRanges.set(p.id,{min:p.min,max:p.max})}};return e.scheduler.onRedraw(()=>e.redraw()),e}function Dn(e){const{axisConfigs:t,axisStates:n}=e,s=new Map;for(const o of n)s.set(`${o.config.scale}:${o.config.side}`,o);e.axisStates=t.map(o=>{const i=`${o.scale}:${o.side}`,l=s.get(i);return l!=null?(l.config=o,l):ln(o)})}function zn(){const e=z.useRef(null);return e.current===null&&(e.current=Rn()),e.current}const St=z.createContext(null);function Q(){const e=z.useContext(St);if(!e)throw new Error("useChart must be used within a <Chart> component");return e}function Fn(e,t){z.useEffect(()=>{if(t!=null)return En(e,t)},[e,t])}function En(e,t){let n=null;const s={show:!1,left:0,top:0,width:0,height:0};let o=null,i=null,l=!1;function r(m){const x=t.getBoundingClientRect(),v=e.plotBox,C=m.clientX-x.left-v.left,R=m.clientY-x.top-v.top;return{cx:C,cy:R}}function a(m,x){const v=e.plotBox;return m>=0&&m<=v.width&&x>=0&&x<=v.height}function c(m,x){const v=t.getBoundingClientRect(),C=m-v.left,R=x-v.top,A=e.plotBox;for(const F of e.axisStates){const E=F.config,G=E.side;if(F._size<=0)continue;const X=R>=A.top&&R<=A.top+A.height,j=C>=A.left&&C<=A.left+A.width;if(G===$.Left&&C<A.left&&X||G===$.Right&&C>A.left+A.width&&X||G===$.Top&&R<A.top&&j||G===$.Bottom&&R>A.top+A.height&&j){const K=he(G);return{scaleId:E.scale,ori:K}}}return null}function u(m,x,v){const C=e.cursorManager.state;let R=null;if(C.activeGroup>=0&&C.activeDataIdx>=0){const A=e.dataStore.data[C.activeGroup];if(A!=null){const F=A.x[C.activeDataIdx],E=A.series[C.activeSeriesIdx],G=E!=null?E[C.activeDataIdx]:void 0;if(F!=null&&G!=null){const W=e.plotBox,X=e.scaleManager.getGroupXScaleKey(C.activeGroup),j=X!=null?e.scaleManager.getScale(X):void 0,ne=e.seriesConfigs.find(Ye=>Ye.group===C.activeGroup&&Ye.index===C.activeSeriesIdx),K=ne!=null?e.scaleManager.getScale(ne.yScale):void 0;let de=x,De=v;(j==null?void 0:j.min)!=null&&j.max!=null&&(de=V(F,j,W.width,W.left)-W.left),(K==null?void 0:K.min)!=null&&K.max!=null&&(De=V(G,K,W.height,W.top)-W.top);const Xe=x-de,$e=v-De;R={group:C.activeGroup,seriesIdx:C.activeSeriesIdx,dataIdx:C.activeDataIdx,xVal:F,yVal:G,pxX:de,pxY:De,dist:Math.sqrt(Xe*Xe+$e*$e)}}}}return{plotX:x,plotY:v,point:R,srcEvent:m}}function h(m){const x=e.plotBox,v=m.left/x.width,C=(m.left+m.width)/x.width,R={};for(const A of e.scaleManager.getAllScales()){if(A.ori!==H.Horizontal||A.min==null||A.max==null)continue;const F=ee(x.left+v*x.width,A,x.width,x.left),E=ee(x.left+C*x.width,A,x.width,x.left);R[A.id]={min:Math.min(F,E),max:Math.max(F,E)}}return{left:v,right:C,ranges:R}}function f(){const m=e.eventCallbacks.onScaleChange;if(m!=null)for(const x of e.scaleManager.getAllScales()){if(x.min==null||x.max==null)continue;const v=e._prevScaleRanges.get(x.id);(v==null||v.min!==x.min||v.max!==x.max)&&m(x.id,x.min,x.max)}}function d(m,x){if(i!=null){const A=t.getBoundingClientRect(),F=m.clientY-A.top,E=e.plotBox,G=(F-i.startY)/E.height,W=i.startMax-i.startMin,X=e.scaleManager.getScale(i.scaleId);X!=null&&(X.min=i.startMin+G*W,X.max=i.startMax+G*W,X.auto=!1,le(X),e.renderer.clearCache(),e.scheduleRedraw());return}const v=r(m);if(v==null)return;const{cx:C,cy:R}=v;if(!a(C,R)&&n==null){e.cursorManager.hide(),e.focusedSeries!=null&&e.setFocus(null),e.scheduleCursorRedraw();return}if(e.cursorManager.update(C,R,e.plotBox,e.dataStore.data,e.seriesConfigs,A=>e.scaleManager.getScale(A),A=>e.dataStore.getWindow(A),A=>e.scaleManager.getGroupXScaleKey(A)),e.focusAlpha<1){const A=e.cursorManager.state;if(A.activeGroup>=0&&A.activeSeriesIdx>=0){const F=e.seriesConfigs.findIndex(E=>E.group===A.activeGroup&&E.index===A.activeSeriesIdx);F>=0&&e.focusedSeries!==F&&(e.focusedSeries=F,e.renderer.clearCache(),e.scheduleRedraw())}}if(x!=null&&e.eventCallbacks.onCursorMove!=null&&a(C,R))try{e.eventCallbacks.onCursorMove(u(x,C,R))}catch(A){console.warn("[uPlot+] event callback error:",A)}if(n!=null){const A=n.x,F=e.plotBox,E=Math.max(0,Math.min(C,F.width));s.show=!0,s.left=Math.min(A,E),s.top=0,s.width=Math.abs(E-A),s.height=F.height,e.selectState=s}n!=null?e.scheduler.mark(q.Cursor|q.Select):e.scheduleCursorRedraw()}function y(m){d(m,m)}function M(m){if(m.button!==0)return;const x=c(m.clientX,m.clientY);if(x!=null&&x.ori===H.Vertical){const C=e.scaleManager.getScale(x.scaleId);if(C!=null&&C.min!=null&&C.max!=null){const R=t.getBoundingClientRect();i={scaleId:x.scaleId,startY:m.clientY-R.top,startMin:C.min,startMax:C.max},m.preventDefault();return}}const v=r(m);v!=null&&a(v.cx,v.cy)&&(n={x:v.cx,y:v.cy},l=!1,s.show=!1,s.left=0,s.width=0,e.selectState=s)}function p(m){if(i!=null){f(),i=null;return}if(n!=null){if(s.width>5){l=!0;let x=!0;if(e.eventCallbacks.onSelect!=null){const v=h(s);let C;try{C=e.eventCallbacks.onSelect(v)}catch(R){console.warn("[uPlot+] event callback error:",R)}C===!1&&(x=!1)}x&&(w(s),f())}n=null,s.show=!1,s.left=0,s.width=0,e.selectState=s,e.scheduleRedraw()}}function g(m){p()}function I(m){if(l){l=!1;return}const x=e.eventCallbacks.onClick;if(x==null)return;const v=r(m);if(v!=null&&a(v.cx,v.cy))try{x(u(m,v.cx,v.cy))}catch(C){console.warn("[uPlot+] event callback error:",C)}}function L(m){const x=e.eventCallbacks.onContextMenu;if(x==null)return;const v=r(m);if(v!=null&&a(v.cx,v.cy)){m.preventDefault();try{x(u(m,v.cx,v.cy))}catch(C){console.warn("[uPlot+] event callback error:",C)}}}function P(m){var x,v;e.cursorManager.hide(),e.focusedSeries!=null&&e.setFocus(null),n!=null&&(n=null,s.show=!1,s.width=0,e.selectState=s),i!=null&&(i=null),e.scheduleCursorRedraw();try{(v=(x=e.eventCallbacks).onCursorLeave)==null||v.call(x)}catch(C){console.warn("[uPlot+] event callback error:",C)}}function T(m){if(e.eventCallbacks.onDblClick!=null){const x=r(m);if(x!=null&&a(x.cx,x.cy)){let v;try{v=e.eventCallbacks.onDblClick(u(m,x.cx,x.cy))}catch(C){console.warn("[uPlot+] event callback error:",C)}if(v===!1)return}}for(const x of e.scaleConfigs)e.scaleManager.addScale(x);e.renderer.clearCache(),e.scheduleRedraw()}function S(m){if(!e.wheelZoom)return;const x=r(m);if(x==null||!a(x.cx,x.cy))return;m.preventDefault();const v=Math.max(.1,Math.min(10,1-m.deltaY*.001)),C=e.plotBox;for(const R of e.scaleManager.getAllScales()){if(R.ori!==H.Horizontal||R.min==null||R.max==null)continue;const A=ee(x.cx+C.left,R,C.width,C.left),F=A-(A-R.min)*v,E=A+(R.max-A)*v;R.min=Math.min(F,E),R.max=Math.max(F,E),R.auto=!1,le(R)}e.renderer.clearCache(),e.scheduleRedraw(),f()}function w(m){const x=e.plotBox,v=m.left/x.width,C=(m.left+m.width)/x.width;for(const R of e.scaleManager.getAllScales()){if(R.ori!==H.Horizontal||R.min==null||R.max==null)continue;const A=ee(x.left+v*x.width,R,x.width,x.left),F=ee(x.left+C*x.width,R,x.width,x.left);R.min=Math.min(A,F),R.max=Math.max(A,F),R.auto=!1,le(R)}e.renderer.clearCache()}function b(m){if(m.touches.length===2){const C=m.touches[0],R=m.touches[1],A=R.clientX-C.clientX,F=R.clientY-C.clientY;o={dist:Math.sqrt(A*A+F*F),midX:(C.clientX+R.clientX)/2,midY:(C.clientY+R.clientY)/2},n=null;return}const x=m.touches[0];if(x==null)return;const v=r(x);v!=null&&a(v.cx,v.cy)&&(n={x:v.cx,y:v.cy},l=!1)}function k(m){if(m.touches.length===2&&o!=null){m.preventDefault();const v=m.touches[0],C=m.touches[1],R=C.clientX-v.clientX,A=C.clientY-v.clientY,F=Math.sqrt(R*R+A*A),E=F/o.dist,G=t.getBoundingClientRect(),W=e.plotBox,X=o.midX-G.left-W.left;for(const j of e.scaleManager.getAllScales()){if(j.ori!==H.Horizontal||j.min==null||j.max==null)continue;const ne=ee(X+W.left,j,W.width,W.left),K=ne-(ne-j.min)/E,de=ne+(j.max-ne)/E;j.min=Math.min(K,de),j.max=Math.max(K,de),j.auto=!1,le(j)}o.dist=F,e.renderer.clearCache(),e.scheduleRedraw(),f();return}const x=m.touches[0];x!=null&&(d(x,m),n!=null&&m.preventDefault())}function D(m){if(o!=null){o=null;return}m.changedTouches[0]!=null&&p()}return t.addEventListener("mousemove",y),t.addEventListener("mousedown",M),t.addEventListener("mouseup",g),t.addEventListener("click",I),t.addEventListener("contextmenu",L),t.addEventListener("mouseleave",P),t.addEventListener("dblclick",T),t.addEventListener("wheel",S,{passive:!1}),t.addEventListener("touchstart",b,{passive:!0}),t.addEventListener("touchmove",k,{passive:!1}),t.addEventListener("touchend",D),()=>{t.removeEventListener("mousemove",y),t.removeEventListener("mousedown",M),t.removeEventListener("mouseup",g),t.removeEventListener("click",I),t.removeEventListener("contextmenu",L),t.removeEventListener("mouseleave",P),t.removeEventListener("dblclick",T),t.removeEventListener("wheel",S),t.removeEventListener("touchstart",b),t.removeEventListener("touchmove",k),t.removeEventListener("touchend",D)}}const _e=new Map;function _n(e){let t=_e.get(e);return t==null&&(t=new Gn(e),_e.set(e,t)),t}class Gn{constructor(t){this.members=new Set,this.publishing=!1,this.syncedStores=new WeakSet,this.key=t}join(t){this.members.add(t)}leave(t){this.members.delete(t),this.members.size===0&&_e.delete(this.key)}pub(t){if(this.publishing)return;if(this.syncedStores.has(t)){this.syncedStores.delete(t);return}this.publishing=!0;const n=t.cursorManager.state,{activeGroup:s,activeDataIdx:o}=n;if(s<0||o<0){for(const r of this.members)r!==t&&(this.syncedStores.add(r),r.cursorManager.hide(),r.scheduleCursorRedraw());this.publishing=!1;return}const l=t.dataStore.getXValues(s)[o];if(l==null){this.publishing=!1;return}for(const r of this.members)r!==t&&(this.syncedStores.add(r),r.cursorManager.syncToValue(l,r),r.scheduleCursorRedraw());this.publishing=!1}}function Hn(e,t){z.useEffect(()=>{if(t==null)return;const n=_n(t);n.join(e);let s=-1,o=-1;const i=e.subscribe(()=>{const{activeGroup:l,activeDataIdx:r}=e.cursorManager.state;l===s&&r===o||(s=l,o=r,n.pub(e))});return()=>{i(),n.leave(e)}},[e,t])}function Re({width:e,height:t,data:n,children:s,className:o,pxRatio:i,onDraw:l,onCursorDraw:r,syncKey:a,cursor:c,onClick:u,onContextMenu:h,onDblClick:f,onCursorMove:d,onCursorLeave:y,onScaleChange:M,onSelect:p}){var x;const g=zn(),[I,L]=z.useState(null),P=i??(typeof window<"u"&&window.devicePixelRatio||1),T=(c==null?void 0:c.wheelZoom)??!1,S=((x=c==null?void 0:c.focus)==null?void 0:x.alpha)??((c==null?void 0:c.focus)!=null?.15:1);z.useEffect(()=>{g.wheelZoom=T,g.focusAlpha=S},[g,T,S]),g.eventCallbacks.onClick=u,g.eventCallbacks.onContextMenu=h,g.eventCallbacks.onDblClick=f,g.eventCallbacks.onCursorMove=d,g.eventCallbacks.onCursorLeave=y,g.eventCallbacks.onScaleChange=M,g.eventCallbacks.onSelect=p,Fn(g,I),Hn(g,a);const w=z.useCallback(v=>{g.canvas=v,v&&g.scheduleRedraw()},[g]),b=z.useCallback(v=>{L(v)},[]);z.useEffect(()=>{g.pxRatio=P,g.setSize(e,t)},[g,e,t,P]),z.useEffect(()=>()=>{g.canvas=null,g.scheduler.cancel(),g.focusedSeries=null},[g]),z.useEffect(()=>{if(I==null||typeof ResizeObserver>"u")return;const v=new ResizeObserver(C=>{const R=C[0];if(R==null)return;const{width:A,height:F}=R.contentRect;A>0&&F>0&&(A!==g.width||F!==g.height)&&g.setSize(Math.round(A),Math.round(F))});return v.observe(I),()=>{v.disconnect()}},[g,I]);const k=z.useRef(n);z.useEffect(()=>{if(n===k.current&&g.dataStore.data.length>0)return;k.current=n,g.dataStore.setData(n),g.renderer.clearCache();const v="x";g.scaleManager.getScale(v)||g.registerScale({id:v,auto:!0});for(let C=0;C<n.length;C++)g.scaleManager.setGroupXScale(C,v);g.scheduleRedraw()},[g,n]);const D=z.useRef(l);D.current=l,z.useEffect(()=>{const v=C=>{var R;(R=D.current)==null||R.call(D,C)};return g.drawHooks.add(v),()=>{g.drawHooks.delete(v)}},[g]);const m=z.useRef(r);return m.current=r,z.useEffect(()=>{const v=(C,R)=>{var A;(A=m.current)==null||A.call(m,C,R)};return g.cursorDrawHooks.add(v),()=>{g.cursorDrawHooks.delete(v)}},[g]),_.jsx(St.Provider,{value:g,children:_.jsxs("div",{className:o,style:{position:"relative",display:"flex",flexDirection:"column",width:`${e}px`},children:[_.jsx("div",{ref:b,style:{position:"relative",width:`${e}px`,height:`${t}px`,cursor:"crosshair",order:0},children:_.jsx("canvas",{ref:w,style:{position:"absolute",left:0,top:0}})}),s]})})}function it(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function Vn(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of s)if(e[o]!==t[o])return!1;return!0}function We(e,t){if(e===null)return!1;const n=e,s=t,o=Object.keys(n),i=Object.keys(s);if(o.length!==i.length)return!1;for(const l of i){const r=n[l],a=s[l];if(r!==a)if(it(r)&&it(a)){if(!Vn(r,a))return!1}else return!1}return!0}function Te(e){const t=Q(),n=z.useRef(e);n.current=e,z.useEffect(()=>{const o=n.current;return t.registerScale({...o}),t.scheduleRedraw(),()=>{t.unregisterScale(o.id),t.scheduleRedraw()}},[t,e.id]);const s=z.useRef(null);return z.useEffect(()=>{We(s.current,e)||(s.current=e,t.scaleConfigs=t.scaleConfigs.map(o=>o.id===e.id?{...e}:o),t.scaleManager.addScale({...e}),t.scheduleRedraw())}),null}function je(e){const t=Q(),n=z.useRef(e);n.current=e,z.useEffect(()=>{const o=n.current;return t.registerSeries({...o,show:o.show??!0}),t.renderer.clearCache(),t.scheduleRedraw(),()=>{t.unregisterSeries(o.group,o.index),t.renderer.clearCache(),t.scheduleRedraw()}},[t,e.group,e.index]);const s=z.useRef(null);return z.useEffect(()=>{We(s.current,e)||(s.current=e,t.seriesConfigs=t.seriesConfigs.map(o=>o.group===e.group&&o.index===e.index?{...e,show:e.show??!0}:o),t.renderer.invalidateSeries(e.group,e.index),t.scheduleRedraw())}),null}function Bn(e){return{...e,side:e.side??(e.scale==="x"?$.Bottom:$.Left),show:e.show??!0}}function Ie(e){const t=Q(),n=Bn(e),s=z.useRef(n);s.current=n,z.useEffect(()=>{const i=s.current;return t.axisConfigs=t.axisConfigs.filter(l=>!(l.scale===i.scale&&l.side===i.side)),t.axisConfigs.push(i),t.scheduleRedraw(),()=>{t.axisConfigs=t.axisConfigs.filter(l=>!(l.scale===i.scale&&l.side===i.side)),t.scheduleRedraw()}},[t,n.scale,n.side]);const o=z.useRef(null);return z.useEffect(()=>{We(o.current,e)||(o.current=e,t.axisConfigs=t.axisConfigs.map(i=>i.scale===n.scale&&i.side===n.side?n:i),t.scheduleRedraw())}),null}function Wn({series:e,group:t,fill:n,dir:s}){const o=Q(),i=z.useRef(null),l=e[0],r=e[1];return z.useEffect(()=>{const a={series:[l,r],group:t,fill:n,dir:s};return i.current!=null&&(o.bandConfigs=o.bandConfigs.filter(c=>c!==i.current)),i.current=a,o.bandConfigs.push(a),o.scheduleRedraw(),()=>{o.bandConfigs=o.bandConfigs.filter(c=>c!==i.current),i.current=null,o.scheduleRedraw()}},[o,l,r,t,n,s]),null}const jn={width:12,height:3,borderRadius:1,display:"inline-block"},Xn={fontWeight:600},$n={display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",cursor:"pointer",fontSize:12,fontFamily:"sans-serif"},Yn=z.memo(function({group:t,index:n,label:s,color:o,isHidden:i,valueStr:l,store:r}){const a=z.useCallback(()=>{r.toggleSeries(t,n)},[r,t,n]);return _.jsxs("span",{onClick:a,style:{...$n,opacity:i?.4:1},children:[_.jsx("span",{style:{...jn,backgroundColor:o}}),_.jsx("span",{children:s}),l&&_.jsx("span",{style:Xn,children:l})]})});function On({show:e=!0,position:t="bottom",className:n}){const s=Q(),o=z.useRef({activeGroup:-1,activeDataIdx:-1,seriesCount:0,revision:-1}),i=z.useCallback(u=>s.subscribe(u),[s]),l=z.useCallback(()=>{const{activeGroup:u,activeDataIdx:h}=s.cursorManager.state,f=s.seriesConfigs.length,{revision:d}=s,y=o.current;if(y.activeGroup===u&&y.activeDataIdx===h&&y.seriesCount===f&&y.revision===d)return y;const M={activeGroup:u,activeDataIdx:h,seriesCount:f,revision:d};return o.current=M,M},[s]),r=z.useSyncExternalStore(i,l);if(!e)return null;const{activeGroup:a,activeDataIdx:c}=r;return _.jsx("div",{className:n,style:{display:"flex",flexWrap:"wrap",justifyContent:"center",order:t==="top"?-1:1,padding:"4px 0"},children:s.seriesConfigs.map(u=>{const h=typeof u.stroke=="string"?u.stroke:"#000";let f="";if(c>=0&&a>=0){const y=s.dataStore.getYValues(u.group,u.index)[c];y!=null&&(f=typeof y=="number"?y.toPrecision(4):String(y))}return _.jsx(Yn,{group:u.group,index:u.index,label:u.label??`Series ${u.index}`,color:h,isHidden:u.show===!1,valueStr:f,store:s},`${u.group}:${u.index}`)})})}const Un=160;function Nn({show:e=!0,className:t,children:n,offset:s={}}){const o=Q(),i=z.useRef({left:-10,top:-10,activeGroup:-1,activeDataIdx:-1,revision:-1}),l=z.useCallback(w=>o.subscribe(w),[o]),r=z.useCallback(()=>{const w=o.cursorManager.state,{revision:b}=o,k=i.current;if(k.left===w.left&&k.top===w.top&&k.activeGroup===w.activeGroup&&k.activeDataIdx===w.activeDataIdx&&k.revision===b)return k;const D={left:w.left,top:w.top,activeGroup:w.activeGroup,activeDataIdx:w.activeDataIdx,revision:b};return i.current=D,D},[o]),a=z.useSyncExternalStore(l,r);if(!e||a.activeDataIdx<0||a.activeGroup<0||a.left<0)return null;const{activeGroup:c,activeDataIdx:u}=a,h=o.plotBox,f=o.dataStore.data[c],d=f!=null?f.x[u]??null:null,y=d!=null?parseFloat(d.toPrecision(6)).toString():"",M=[];for(const w of o.seriesConfigs){if(w.show===!1)continue;const b=o.dataStore.getYValues(w.group,w.index),k=w.group===c?b[u]:null;M.push({label:w.label??`Series ${w.index}`,value:k,color:typeof w.stroke=="string"?w.stroke:"#000",group:w.group,index:w.index})}const p={x:d,xLabel:y,items:M,left:a.left+h.left,top:a.top+h.top},g=s.x??12,I=s.y??-12,L=a.left+h.left+g+Un>h.left+h.width,P=a.top+h.top+I<h.top,T=L?p.left-g:p.left+g,S=P?p.top+Math.abs(I):p.top+I;return n?_.jsx("div",{className:t,style:{position:"absolute",left:T,top:S,transform:L?"translateX(-100%)":void 0,pointerEvents:"none",zIndex:100},children:n(p)}):_.jsxs("div",{className:t,style:{position:"absolute",left:T,top:S,transform:L?"translateX(-100%)":void 0,pointerEvents:"none",zIndex:100,background:"rgba(0,0,0,0.85)",color:"#fff",padding:"6px 10px",borderRadius:4,fontSize:12,fontFamily:"sans-serif",whiteSpace:"nowrap",lineHeight:1.5},children:[_.jsx("div",{style:{fontWeight:600,marginBottom:2},children:y}),M.map(w=>_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[_.jsx("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:w.color,display:"inline-block"}}),_.jsxs("span",{children:[w.label,":"]}),_.jsx("span",{style:{fontWeight:600},children:w.value!=null?w.value.toPrecision(4):"—"})]},`${w.group}:${w.index}`))]})}function Kn({width:e,height:t,data:n,onRangeChange:s,initialRange:o,className:i,colors:l,grips:r=!1}){const a=z.useRef(null),[c,u]=z.useState(()=>{if(o!=null&&n.length>0){const T=n[0];if(T!=null&&T.x.length>1){const S=T.x[0],b=T.x[T.x.length-1]-S;if(b>0)return[Math.max(0,(o[0]-S)/b),Math.min(1,(o[1]-S)/b)]}}return[.25,.75]}),h=z.useRef(null);z.useEffect(()=>{if(s==null||n.length===0)return;const T=n[0];if(T==null||T.x.length<2)return;const S=T.x[0],b=T.x[T.x.length-1]-S,k=S+c[0]*b,D=S+c[1]*b,m=h.current,x=Math.max(1e-10,Math.abs(D-k)*1e-12);m!=null&&Math.abs(m[0]-k)<x&&Math.abs(m[1]-D)<x||(h.current=[k,D],s(k,D))},[c,n,s]);const f=z.useRef(null),d=z.useCallback(T=>{const S=a.current;if(S==null)return 0;const w=S.getBoundingClientRect();return Math.max(0,Math.min(1,(T-w.left)/w.width))},[]),y=z.useCallback(T=>{const S=a.current;if(S==null)return;const w=d(T.clientX),b=S.getBoundingClientRect().width,k=b>0?8/b:0;let D;if(Math.abs(w-c[0])<k)D="left";else if(Math.abs(w-c[1])<k)D="right";else if(w>=c[0]&&w<=c[1])D="move";else{const m=c[1]-c[0],x=m/2,v=Math.max(0,Math.min(1-m,w-x));u([v,v+m]),D="move"}f.current={mode:D,startX:T.clientX,startFrac:[...c]},S.setPointerCapture(T.pointerId),T.preventDefault()},[c,d]),M=z.useCallback(T=>{const S=f.current;if(S==null)return;const w=d(T.clientX),b=d(S.startX),k=w-b;if(S.mode==="move"){const D=S.startFrac[1]-S.startFrac[0];let m=S.startFrac[0]+k;m=Math.max(0,Math.min(1-D,m)),u([m,m+D])}else if(S.mode==="left"){const D=Math.max(0,Math.min(S.startFrac[1]-.01,S.startFrac[0]+k));u([D,S.startFrac[1]])}else{const D=Math.min(1,Math.max(S.startFrac[0]+.01,S.startFrac[1]+k));u([S.startFrac[0],D])}},[d]),p=z.useCallback(T=>{f.current=null;const S=a.current;S!=null&&S.releasePointerCapture(T.pointerId)},[]),g=`${c[0]*100}%`,I=`${(c[1]-c[0])*100}%`,L=n[0],P=L!=null?L.series.length:0;return _.jsxs("div",{className:i,style:{position:"relative",width:e,height:t},children:[_.jsxs(Re,{width:e,height:t,data:n,children:[_.jsx(Te,{id:"x"}),_.jsx(Te,{id:"y"}),_.jsx(Ie,{scale:"x",show:!1}),_.jsx(Ie,{scale:"y",show:!1}),Array.from({length:P},(T,S)=>_.jsx(je,{group:0,index:S,yScale:"y",stroke:l!=null&&l[S]!=null?l[S]:`hsl(${S*137}, 60%, 50%)`,width:1},S))]}),_.jsxs("div",{ref:a,onPointerDown:y,onPointerMove:M,onPointerUp:p,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:"default",touchAction:"none"},children:[_.jsx("div",{style:{position:"absolute",top:0,left:0,width:g,height:"100%",background:"rgba(0,0,0,0.3)",pointerEvents:"none"}}),_.jsx("div",{style:{position:"absolute",top:0,left:`${c[1]*100}%`,right:0,height:"100%",background:"rgba(0,0,0,0.3)",pointerEvents:"none"}}),_.jsx("div",{style:{position:"absolute",top:0,left:g,width:I,height:"100%",borderLeft:"2px solid rgba(0,100,255,0.8)",borderRight:"2px solid rgba(0,100,255,0.8)",boxSizing:"border-box",cursor:"grab",pointerEvents:"none"},children:r&&_.jsxs(_.Fragment,{children:[_.jsx("div",{style:{position:"absolute",left:-5,top:"50%",transform:"translateY(-50%)",width:8,height:24,borderRadius:3,background:"rgba(0,100,255,0.8)",cursor:"ew-resize",pointerEvents:"auto"}}),_.jsx("div",{style:{position:"absolute",right:-5,top:"50%",transform:"translateY(-50%)",width:8,height:24,borderRadius:3,background:"rgba(0,100,255,0.8)",cursor:"ew-resize",pointerEvents:"auto"}})]})})]})]})}function ve(e){const t=Q(),n=z.useRef(e);n.current=e,z.useEffect(()=>{const s=o=>n.current(o);return t.drawHooks.add(s),()=>{t.drawHooks.delete(s)}},[t])}function qn(e){const t=Q(),n=z.useRef(e);n.current=e,z.useEffect(()=>{const s=(o,i)=>n.current(o,i);return t.cursorDrawHooks.add(s),()=>{t.cursorDrawHooks.delete(s)}},[t])}function Zn({lanes:e,laneHeight:t=24,gap:n=2,scaleId:s="x"}){const o=Q();return ve(({ctx:i,plotBox:l,pxRatio:r})=>{const a=o.scaleManager.getScale(s);if(a==null||a.min==null||a.max==null)return;i.save(),i.beginPath(),i.rect(l.left*r,l.top*r,l.width*r,l.height*r),i.clip();const c=(t+n)*r,u=t*r,h=l.top*r;for(let f=0;f<e.length;f++){const d=e[f];if(d==null)continue;const y=h+f*c;i.fillStyle="#666",i.font=`${11*r}px sans-serif`,i.textAlign="right",i.textBaseline="middle",i.fillText(d.label,(l.left-6)*r,y+u/2);for(const M of d.segments){const p=V(M.start,a,l.width,l.left)*r,I=V(M.end,a,l.width,l.left)*r-p;I<=0||(i.fillStyle=M.color??"#4dabf7",i.fillRect(p,y,I,u),M.label!=null&&I>20*r&&(i.fillStyle="#fff",i.font=`${10*r}px sans-serif`,i.textAlign="center",i.textBaseline="middle",i.fillText(M.label,p+I/2,y+u/2,I-4*r)))}}i.restore()}),null}function Jn({data:e,width:t=150,height:n=30,stroke:s="#03a9f4",fill:o,lineWidth:i=1,paths:l,fillTo:r,className:a}){return _.jsx("div",{style:{pointerEvents:"none"},className:a,children:_.jsxs(Re,{width:t,height:n,data:e,children:[_.jsx(Te,{id:"x"}),_.jsx(Te,{id:"y"}),_.jsx(Ie,{scale:"x",show:!1}),_.jsx(Ie,{scale:"y",show:!1}),_.jsx(je,{group:0,index:0,yScale:"y",stroke:s,fill:o,width:i,paths:l,fillTo:r})]})})}function Qn({minWidth:e=100,minHeight:t=100,aspectRatio:n,initialHeight:s=300,...o}){const i=z.useRef(null),[l,r]=z.useState(null),a=z.useCallback(c=>{const u=Math.max(c.width,e);let h;return n!=null?h=Math.max(u/n,t):h=Math.max(c.height||s,t),{width:Math.round(u),height:Math.round(h)}},[e,t,n,s]);return z.useEffect(()=>{const c=i.current;if(c==null)return;const u=c.getBoundingClientRect();if(r(a({width:u.width,height:u.height})),typeof ResizeObserver>"u")return;const h=new ResizeObserver(f=>{const d=f[0];if(d==null)return;const{width:y,height:M}=d.contentRect;r(a({width:y,height:M}))});return h.observe(c),()=>h.disconnect()},[a]),_.jsx("div",{ref:i,style:{width:"100%",height:n!=null?"auto":"100%"},children:l!=null&&_.jsx(Re,{...o,width:l.width,height:l.height})})}function Mt(e,t,n,s={}){const{ctx:o,plotBox:i}=e,l=V(n,t,i.height,i.top);o.beginPath(),o.moveTo(i.left,l),o.lineTo(i.left+i.width,l),o.strokeStyle=s.stroke??"red",o.lineWidth=s.width??1,s.dash&&o.setLineDash(s.dash),o.stroke(),s.dash&&o.setLineDash([])}function bt(e,t,n,s={}){const{ctx:o,plotBox:i}=e,l=V(n,t,i.width,i.left);o.beginPath(),o.moveTo(l,i.top),o.lineTo(l,i.top+i.height),o.strokeStyle=s.stroke??"red",o.lineWidth=s.width??1,s.dash&&o.setLineDash(s.dash),o.stroke(),s.dash&&o.setLineDash([])}function es(e,t,n,s,o,i,l={}){const{ctx:r,plotBox:a}=e,c=V(s,t,a.width,a.left),u=V(o,n,a.height,a.top);r.font=l.font??"12px sans-serif",r.fillStyle=l.fill??"#000",r.textBaseline="bottom",r.fillText(i,c,u-4)}function yt(e,t,n,s,o={}){const{ctx:i,plotBox:l}=e,r=V(s,t,l.height,l.top),a=V(n,t,l.height,l.top);i.fillStyle=o.fill??"rgba(255,0,0,0.1)",i.fillRect(l.left,Math.min(r,a),l.width,Math.abs(a-r)),o.stroke&&(i.strokeStyle=o.stroke,i.lineWidth=o.width??1,o.dash&&i.setLineDash(o.dash),i.strokeRect(l.left,Math.min(r,a),l.width,Math.abs(a-r)),o.dash&&i.setLineDash([]))}function ts(e){const t=z.useRef(e);return z.useLayoutEffect(()=>{t.current=e}),ve(n=>{const s=t.current,o=s.yScale??"y",i=n.getScale(o);if(i!=null&&(Mt(n,i,s.value,{stroke:s.stroke,width:s.width,dash:s.dash}),s.label!=null)){const l=n.valToY(s.value,o);if(l==null)return;const{ctx:r,plotBox:a}=n;r.font=s.labelFont??"11px sans-serif",r.fillStyle=s.stroke??"red",r.textAlign="left",r.textBaseline="bottom",r.fillText(s.label,a.left+4,l-4)}}),null}function ns(e){const t=z.useRef(e);return z.useLayoutEffect(()=>{t.current=e}),ve(n=>{const s=t.current,o=s.xScale??"x",i=n.getScale(o);if(i!=null&&(bt(n,i,s.value,{stroke:s.stroke,width:s.width,dash:s.dash}),s.label!=null)){const l=n.valToX(s.value,o);if(l==null)return;const{ctx:r,plotBox:a}=n;r.font=s.labelFont??"11px sans-serif",r.fillStyle=s.stroke??"red",r.textAlign="center",r.textBaseline="bottom",r.fillText(s.label,l,a.top-4)}}),null}function ss(e){const t=z.useRef(e);return z.useLayoutEffect(()=>{t.current=e}),ve(n=>{const s=t.current,o=n.getScale(s.yScale??"y");o!=null&&yt(n,o,s.yMin,s.yMax,{fill:s.fill,stroke:s.stroke,width:s.strokeWidth,dash:s.dash})}),null}function os(e){const t=z.useRef(e);return z.useLayoutEffect(()=>{t.current=e}),ve(n=>{const s=t.current,o=n.valToX(s.x,s.xScale??"x"),i=n.valToY(s.y,s.yScale??"y");if(o==null||i==null)return;const{ctx:l}=n;l.font=s.font??"12px sans-serif",l.fillStyle=s.fill??"#000",l.textAlign=s.align??"left",l.textBaseline=s.baseline??"bottom",l.fillText(s.text,o,i-4)}),null}function ls(e,t){const{window:n,batchSize:s=1}=t,o=t.autoStart??!0,[i,l]=z.useState(e),[r,a]=z.useState(!1),[c,u]=z.useState(0),h=z.useRef(0),f=z.useRef(0),d=z.useRef(0),y=z.useCallback((g,...I)=>{l(L=>{const P=L[0];if(P==null)return L;const T=P.x,S=Math.max(0,T.length+g.length-n),w=S>0?T.slice(S).concat(g):T.concat(g),b=P.series.map((k,D)=>{const m=k,x=I[D]??[];return S>0?m.slice(S).concat(x):m.concat(x)});return[{x:w,series:b}]})},[n]),M=z.useCallback(()=>{a(!0)},[]),p=z.useCallback(()=>{a(!1)},[]);return z.useEffect(()=>{if(!r){h.current!==0&&(cancelAnimationFrame(h.current),h.current=0);return}d.current=performance.now(),f.current=0;const g=I=>{f.current++;const L=I-d.current;L>=1e3&&(u(Math.round(f.current*1e3/L)),f.current=0,d.current=I),h.current=requestAnimationFrame(g)};return h.current=requestAnimationFrame(g),()=>{h.current!==0&&(cancelAnimationFrame(h.current),h.current=0)}},[r]),z.useEffect(()=>{o&&a(!0)},[o]),{data:i,push:y,start:M,stop:p,running:r,fps:c}}function is(e){return(t,n,s,o,i,l,r,a,c,u,h,f,d)=>{const y=(d==null?void 0:d.align)??e??1,M=(d==null?void 0:d.spanGaps)??!1;if([c,u]=Ae(n,c,u),c===-1)return{stroke:new Path2D,fill:null,clip:null,band:null,gaps:null};const p=k=>f(V(k,s,i,r)),g=k=>f(V(k,o,l,a)),I=s.ori===H.Horizontal?Pe:Le,L={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null},P=L.stroke;let T=!1;const S=h===Y.Forward?c:u;let w=g(n[S]),b=p(t[S]);I(P,b,w);for(let k=S;k>=c&&k<=u;k+=h){const D=n[k];if(D==null){D===null&&!M&&(T=!0);continue}const m=p(t[k]),x=g(D);if(y===1)I(P,m,w);else if(y===-1)I(P,b,x);else{const v=f((b+m)/2);I(P,v,w),I(P,v,x)}I(P,m,x),w=x,b=m}{const k=L.fill=new Path2D(P),D=(d==null?void 0:d.fillTo)??o.min??0,m=g(D);let x=r,v=r+i;h===Y.Backward&&([v,x]=[x,v]),I(k,v,m),I(k,x,m)}if(T){const k=Ve(t,n,c,u,h,p);L.gaps=k,L.clip=Be(k,s.ori,r,a,i,l)}return L}}function rs(){return(e,t,n,s,o,i,l,r,a,c,u,h,f)=>{const d=(f==null?void 0:f.barWidth)??.6,y=(f==null?void 0:f.barGap)??0,M=(f==null?void 0:f.barRadius)??0,p=(f==null?void 0:f.barGroupIdx)??0,g=(f==null?void 0:f.barGroupCount)??1,I=v=>h(V(v,n,o,l)),L=v=>h(V(v,s,i,r));let P=o;if(c>a){let v=1/0,C=-1;for(let R=a;R<=c;R++)if(t[R]!=null){if(C>=0){const A=e[R],F=e[C],E=Math.abs(I(A)-I(F));E<v&&(v=E)}C=R}v<1/0&&(P=v)}const T=P*(1-d),S=Math.max(0,T+y),w=Math.max(1,h(P-S)),b=g>1?Math.max(1,h(w/Math.max(1,g))):w,k=(f==null?void 0:f.fillTo)??s.min??0,D=L(k),m=new Path2D,x=n.ori===H.Horizontal;for(let v=u===Y.Forward?a:c;v>=a&&v<=c;v+=u){const C=t[v];if(C==null)continue;const R=I(e[v]),A=L(C),F=g>1?(p-(g-1)/2)*b:0,E=h(R-b/2+F),G=Math.min(A,D),X=Math.max(A,D)-G;if(X!==0)if(M>0){const j=Math.min(M*b,X/2);as(m,x,E,G,b,X,j,C<k)}else x?m.rect(E,G,b,X):m.rect(G,E,X,b)}return{stroke:m,fill:m,clip:null,band:null,gaps:null}}}function as(e,t,n,s,o,i,l,r){l=Math.min(l,o/2,i/2),t?r?(e.moveTo(n,s),e.lineTo(n+o,s),e.lineTo(n+o,s+i-l),e.arc(n+o-l,s+i-l,l,0,Math.PI/2),e.lineTo(n+l,s+i),e.arc(n+l,s+i-l,l,Math.PI/2,Math.PI),e.closePath()):(e.moveTo(n,s+i),e.lineTo(n,s+l),e.arc(n+l,s+l,l,Math.PI,Math.PI*1.5),e.lineTo(n+o-l,s),e.arc(n+o-l,s+l,l,Math.PI*1.5,0),e.lineTo(n+o,s+i),e.closePath()):r?(e.moveTo(s,n),e.lineTo(s,n+o),e.lineTo(s+i-l,n+o),e.arc(s+i-l,n+o-l,l,Math.PI/2,0,!0),e.lineTo(s+i,n+l),e.arc(s+i-l,n+l,l,0,-Math.PI/2,!0),e.closePath()):(e.moveTo(s+i,n),e.lineTo(s+l,n),e.arc(s+l,n+l,l,-Math.PI/2,Math.PI,!0),e.lineTo(s,n+o-l),e.arc(s+l,n+o-l,l,Math.PI,Math.PI/2,!0),e.lineTo(s+i,n+o),e.closePath())}function kt(e){return(t,n,s,o,i,l,r,a,c,u,h,f,d)=>{const y=(d==null?void 0:d.spanGaps)??!1;if([c,u]=Ae(n,c,u),c===-1)return{stroke:new Path2D,fill:null,clip:null,band:null,gaps:null};const M=b=>f(V(b,s,i,r)),p=b=>f(V(b,o,l,a)),g=s.ori===H.Horizontal?Pe:Le,I=[],L=[];let P=!1;for(let b=h===Y.Forward?c:u;b>=c&&b<=u;b+=h){const k=n[b];k!=null?(I.push(M(t[b])),L.push(p(k))):k===null&&!y&&(P=!0)}const T=s.ori===H.Horizontal,S=e(I,L,T,f),w={stroke:S??new Path2D,fill:null,clip:null,band:null,gaps:null};if(S!=null){const b=w.fill=new Path2D(S),k=(d==null?void 0:d.fillTo)??o.min??0,D=p(k);let m=r,x=r+i;h===Y.Backward&&([x,m]=[m,x]),g(b,x,D),g(b,m,D)}if(P){const b=Ve(t,n,c,u,h,M);w.gaps=b,w.clip=Be(b,s.ori,r,a,i,l)}return w}}function cs(){return kt(us)}const us=(e,t,n,s)=>{const o=e.length;if(o<2)return null;const i=new Path2D,l=e[0]??0,r=t[0]??0;if(n?i.moveTo(l,r):i.moveTo(r,l),o===2){const f=e[1]??0,d=t[1]??0;return n?i.lineTo(f,d):i.lineTo(d,f),i}const a=new Array(o),c=new Array(o-1),u=new Array(o-1),h=new Array(o-1);for(let f=0;f<o-1;f++)u[f]=(t[f+1]??0)-(t[f]??0),h[f]=(e[f+1]??0)-(e[f]??0),c[f]=h[f]!==0?(u[f]??0)/(h[f]??1):0;a[0]=c[0]??0;for(let f=1;f<o-1;f++){const d=c[f]??0,y=c[f-1]??0;if(d===0||y===0||y>0!=d>0)a[f]=0;else{const M=h[f]??1,p=h[f-1]??1;a[f]=3*(p+M)/((2*M+p)/y+(M+2*p)/d),isFinite(a[f]??0)||(a[f]=0)}}a[o-1]=c[o-2]??0;for(let f=0;f<o-1;f++){const d=h[f]??1,y=e[f]??0,M=t[f]??0,p=e[f+1]??0,g=t[f+1]??0,I=a[f]??0,L=a[f+1]??0,P=y+d/3,T=M+I*d/3,S=p-d/3,w=g-L*d/3;n?i.bezierCurveTo(P,T,S,w,p,g):i.bezierCurveTo(T,P,w,S,g,p)}return i};function fs(){return kt(hs)}const hs=(e,t,n,s)=>{const o=e.length;if(o<2)return null;const i=new Path2D,l=s(e[0]??0),r=s(t[0]??0);if(n?i.moveTo(l,r):i.moveTo(r,l),o===2){const a=s(e[1]??0),c=s(t[1]??0);return n?i.lineTo(a,c):i.lineTo(c,a),i}for(let a=0;a<o-1;a++){const c=a===0?0:a-1,u=e[c]??0,h=t[c]??0,f=e[a]??0,d=t[a]??0,y=e[a+1]??0,M=t[a+1]??0,p=a+2<o?e[a+2]??0:y,g=a+2<o?t[a+2]??0:M,I=Math.hypot(u-f,h-d),L=Math.hypot(f-y,d-M),P=Math.hypot(y-p,M-g),T=Math.sqrt(P),S=P,w=Math.sqrt(L),b=L,k=Math.sqrt(I),D=I,m=2*D+3*k*w+b,x=2*S+3*T*w+b,v=3*k*(k+w),C=3*T*(T+w);let R,A,F,E;if(v>0){const G=1/v;R=(-b*u+m*f+D*y)*G,A=(-b*h+m*d+D*M)*G}else R=f,A=d;if(C>0){const G=1/C;F=(S*f+x*y-b*p)*G,E=(S*d+x*M-b*g)*G}else F=y,E=M;n?i.bezierCurveTo(R,A,F,E,y,M):i.bezierCurveTo(A,R,E,F,M,y)}return i};function ds(e=4){return(t,n,s,o,i,l,r,a,c,u,h,f,d)=>{const y=L=>f(V(L,s,i,r)),M=L=>f(V(L,o,l,a)),p=e/2,g=new Path2D,I=s.ori===H.Horizontal;for(let L=h===Y.Forward?c:u;L>=c&&L<=u;L+=h){const P=n[L];if(P==null)continue;const T=y(t[L]),S=M(P);I?(g.moveTo(T+p,S),g.arc(T,S,p,0,Math.PI*2)):(g.moveTo(S+p,T),g.arc(S,T,p,0,Math.PI*2))}return{stroke:g,fill:g,clip:null,band:null,gaps:null}}}function gs(e){return({ctx:t,plotBox:n,pxRatio:s})=>{const{xValues:o,open:i,high:l,low:r,close:a,xScale:c,yScale:u,upColor:h="#26a69a",downColor:f="#ef5350",bodyWidth:d=.6,wickWidth:y=1}=e;if(c.min==null||c.max==null||u.min==null||u.max==null)return;const M=o.length;if(M===0)return;const g=Math.max(2,n.width/M*d)*s/2;t.save();for(let I=0;I<M;I++){const L=o[I],P=i[I],T=l[I],S=r[I],w=a[I];if(L==null||P==null||T==null||S==null||w==null)continue;const b=V(L,c,n.width,n.left)*s,k=V(P,u,n.height,n.top)*s,D=V(T,u,n.height,n.top)*s,m=V(S,u,n.height,n.top)*s,x=V(w,u,n.height,n.top)*s,C=w>=P?h:f;t.strokeStyle=C,t.lineWidth=y*s,t.beginPath(),t.moveTo(b,D),t.lineTo(b,m),t.stroke();const R=Math.min(k,x),A=Math.abs(x-k);t.fillStyle=C,t.fillRect(b-g,R,g*2,Math.max(A,1*s))}t.restore()}}function ps(e,t,n=0){const s=t??e.series.map((c,u)=>u),o=e.x.length,i=[],l=new Float64Array(o);for(let c=0;c<s.length;c++){const u=s[c];if(u==null)continue;const h=e.series[u];if(h==null)continue;const f=new Array(o);for(let d=0;d<o;d++){const y=h[d];y!=null?(l[d]=l[d]+y,f[d]=l[d]):f[d]=null}i.push(f)}const r=[];for(let c=0;c<e.series.length;c++){const u=s.indexOf(c),h=u>=0?i[u]:void 0;h!=null?r.push(h):r.push(e.series[c]??[])}const a=[];for(let c=s.length-1;c>0;c--){const u=s[c],h=s[c-1];u!=null&&h!=null&&a.push({group:n,series:[u,h]})}return{group:{x:e.x,series:r},bands:a}}function ms(e){const t=new Set;for(const[i]of e)for(let l=0;l<i.length;l++){const r=i[l];r!=null&&t.add(r)}const n=Float64Array.from([...t].sort((i,l)=>i-l)),s=new Map;for(let i=0;i<n.length;i++){const l=n[i];l!=null&&s.set(l,i)}const o=[];for(const[i,l]of e){const r=new Array(n.length).fill(null);for(let a=0;a<i.length;a++){const c=i[a];if(c==null)continue;const u=s.get(c);u!=null&&(r[u]=l[a]??null)}o.push(r)}return[{x:n,series:o}]}function ws(e){const t=(e==null?void 0:e.decimals)??1;return n=>n.map(s=>{const o=Math.abs(s);return o>=1e9?(s/1e9).toFixed(t)+"B":o>=1e6?(s/1e6).toFixed(t)+"M":o>=1e3?(s/1e3).toFixed(t)+"K":s.toFixed(o>=1?0:t)})}function xs(e,t=0){return n=>n.map(s=>s.toFixed(t)+e)}function vs(e){const t=(e==null?void 0:e.utc)??!1;return n=>n.map(s=>t?J(s,{hour:"2-digit",minute:"2-digit",hour12:!1},"UTC"):J(s,{hour:"2-digit",minute:"2-digit",hour12:!1}))}function Ss(e){const t=e!=null&&e.utc?"UTC":void 0,n=(e==null?void 0:e.format)??"short";return s=>s.map(o=>J(o,{month:n},t))}function Ms(e){const{tz:t,...n}=e??{};return s=>s.map(o=>J(o,n,t))}function bs(e,t=0){return n=>n.map(s=>{const o=Math.round(s)-t;return e[o]??String(s)})}function Ct(e){const t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(e);if(t)return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];const n=/^#([0-9a-f])([0-9a-f])([0-9a-f])/i.exec(e);if(n)return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];const s=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return s?[Number(s[1]),Number(s[2]),Number(s[3])]:null}function ys(e,t=.8,n=0){const s=Ct(e);if(s==null)return{type:"linear",stops:[[0,e],[1,e]]};const[o,i,l]=s;return{type:"linear",stops:[[0,`rgba(${o},${i},${l},${t})`],[1,`rgba(${o},${i},${l},${n})`]]}}function ks(e,t){const n=Ct(e);if(n==null)return e;const[s,o,i]=n;return`rgba(${s},${o},${i},${t})`}function Cs(e,t=65,n=50){const s=[];for(let i=0;i<e;i++){const l=i*137.508%360;s.push(`hsl(${l.toFixed(1)},${t}%,${n}%)`)}return s}exports.AnnotationLabel=os;exports.Axis=Ie;exports.Band=Wn;exports.Chart=Re;exports.Direction=Y;exports.Distribution=O;exports.HLine=ts;exports.Legend=On;exports.Orientation=H;exports.Region=ss;exports.ResponsiveChart=Qn;exports.Scale=Te;exports.Series=je;exports.Side=$;exports.SortOrder=me;exports.Sparkline=Jn;exports.Timeline=Zn;exports.Tooltip=Nn;exports.VLine=ns;exports.ZoomRanger=Kn;exports.alignData=ms;exports.bars=rs;exports.catmullRom=fs;exports.drawCandlesticks=gs;exports.drawHLine=Mt;exports.drawLabel=es;exports.drawRegion=yt;exports.drawVLine=bt;exports.fadeGradient=ys;exports.fmtCompact=ws;exports.fmtDateStr=Ms;exports.fmtHourMin=vs;exports.fmtLabels=bs;exports.fmtMonthName=Ss;exports.fmtSuffix=xs;exports.linear=xt;exports.monotoneCubic=cs;exports.palette=Cs;exports.points=ds;exports.posToVal=ee;exports.sideOrientation=he;exports.stackGroup=ps;exports.stepped=is;exports.useChart=Q;exports.useCursorDrawHook=qn;exports.useDrawHook=ve;exports.useStreamingData=ls;exports.valToPos=V;exports.withAlpha=ks;
@@ -0,0 +1,47 @@
1
+ export { Chart } from './components/Chart';
2
+ export { Scale } from './components/Scale';
3
+ export { Series } from './components/Series';
4
+ export { Axis } from './components/Axis';
5
+ export { Band } from './components/Band';
6
+ export { Legend } from './components/Legend';
7
+ export { Tooltip } from './components/Tooltip';
8
+ export { ZoomRanger } from './components/ZoomRanger';
9
+ export { Timeline } from './components/Timeline';
10
+ export { Sparkline } from './components/Sparkline';
11
+ export { ResponsiveChart } from './components/ResponsiveChart';
12
+ export { HLine, VLine, Region, AnnotationLabel } from './components/annotations';
13
+ export { useChart } from './hooks/useChart';
14
+ export { useDrawHook, useCursorDrawHook } from './hooks/useDrawHook';
15
+ export { useStreamingData } from './hooks/useStreamingData';
16
+ export type { ChartProps, ChartData, XGroup, SeriesRef, ScaleConfig, SeriesConfig, AxisConfig, CursorState, SelectState, GridConfig, TickConfig, BorderConfig, PointsConfig, CursorConfig, FocusConfig, GradientConfig, ColorValue, } from './types';
17
+ export type { BandConfig } from './types/bands';
18
+ export type { LegendConfig } from './types/legend';
19
+ export type { TooltipProps, TooltipData, TooltipItem } from './types/tooltip';
20
+ export type { DrawContext, DrawCallback, CursorDrawCallback } from './types/hooks';
21
+ export type { ChartEventInfo, NearestPoint, SelectEventInfo, ScaleChangeCallback, SelectCallback, EventCallbacks } from './types/events';
22
+ export type { AnnotationStyle } from './annotations';
23
+ export type { ZoomRangerProps } from './components/ZoomRanger';
24
+ export type { TimelineProps, TimelineLane, TimelineSegment } from './types/timeline';
25
+ export type { CandlestickOpts } from './paths/candlestick';
26
+ export type { SparklineProps } from './components/Sparkline';
27
+ export type { ResponsiveChartProps } from './components/ResponsiveChart';
28
+ export type { HLineProps, VLineProps, RegionProps, AnnotationLabelProps } from './components/annotations';
29
+ export type { StreamingOptions, StreamingResult } from './hooks/useStreamingData';
30
+ export { linear } from './paths/linear';
31
+ export { stepped } from './paths/stepped';
32
+ export { bars } from './paths/bars';
33
+ export { monotoneCubic } from './paths/monotoneCubic';
34
+ export { catmullRom } from './paths/catmullRom';
35
+ export { points } from './paths/points';
36
+ export { drawCandlesticks } from './paths/candlestick';
37
+ export { stackGroup } from './math/stack';
38
+ export { alignData } from './math/align';
39
+ export { drawHLine, drawVLine, drawLabel, drawRegion } from './annotations';
40
+ export { valToPos, posToVal } from './core/Scale';
41
+ export { Side, Orientation, Direction, Distribution, SortOrder, sideOrientation } from './types';
42
+ export { fmtCompact, fmtSuffix, fmtHourMin, fmtMonthName, fmtDateStr, fmtLabels } from './formatters';
43
+ export type { AxisValueFormatter } from './formatters';
44
+ export { fadeGradient, withAlpha, palette } from './colors';
45
+ export type { CursorDrawConfig } from './rendering/drawCursor';
46
+ export type { SelectDrawConfig } from './rendering/drawSelect';
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGjF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,YAAY,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACN,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnF,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACzI,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrF,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC1G,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGlF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG5E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGjG,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtG,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAG5D,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}