p1-charts 0.2.0 → 0.3.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 (150) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +100 -2
  3. package/dist/CategoryBarChart-1Kn3Vozc.js +580 -0
  4. package/dist/CategoryBarChart-1Kn3Vozc.js.map +1 -0
  5. package/dist/ChartFrame-B1bVFM2E.js +403 -0
  6. package/dist/ChartFrame-B1bVFM2E.js.map +1 -0
  7. package/dist/{Heatmap-C1XcTUg1.js → Heatmap-CFC753mV.js} +278 -272
  8. package/dist/Heatmap-CFC753mV.js.map +1 -0
  9. package/dist/{PieLegend-BZsv9IbF.js → PieLegend-CbpjaOJH.js} +94 -111
  10. package/dist/PieLegend-CbpjaOJH.js.map +1 -0
  11. package/dist/PolarChart-hcNTWKfJ.js +450 -0
  12. package/dist/PolarChart-hcNTWKfJ.js.map +1 -0
  13. package/dist/Sparkline-BApLVWfg.js +110 -0
  14. package/dist/Sparkline-BApLVWfg.js.map +1 -0
  15. package/dist/{TimeSeriesChart-BIwJxgnD.js → TimeSeriesChart-BzeHEtQl.js} +120 -119
  16. package/dist/{TimeSeriesChart-BIwJxgnD.js.map → TimeSeriesChart-BzeHEtQl.js.map} +1 -1
  17. package/dist/category.d.ts +1 -1
  18. package/dist/category.d.ts.map +1 -1
  19. package/dist/category.js +1 -1
  20. package/dist/charts/CategoryBarChart/index.d.ts +1 -1
  21. package/dist/charts/CategoryBarChart/index.d.ts.map +1 -1
  22. package/dist/charts/Heatmap/index.d.ts.map +1 -1
  23. package/dist/charts/PolarChart/index.d.ts.map +1 -1
  24. package/dist/charts/ScatterChart/index.d.ts +1 -1
  25. package/dist/charts/ScatterChart/index.d.ts.map +1 -1
  26. package/dist/charts/Sparkline/index.d.ts +5 -2
  27. package/dist/charts/Sparkline/index.d.ts.map +1 -1
  28. package/dist/components/ChartFrame/index.d.ts +7 -0
  29. package/dist/components/ChartFrame/index.d.ts.map +1 -0
  30. package/dist/components/ChartStory/index.d.ts +7 -0
  31. package/dist/components/ChartStory/index.d.ts.map +1 -0
  32. package/dist/components/HeatmapCells/index.d.ts +1 -1
  33. package/dist/components/HeatmapCells/index.d.ts.map +1 -1
  34. package/dist/{css-C-rsk7-l.js → css-BtFQ2bM4.js} +2 -2
  35. package/dist/{css-C-rsk7-l.js.map → css-BtFQ2bM4.js.map} +1 -1
  36. package/dist/heatmap.js +1 -1
  37. package/dist/hooks/useMarkMemory.d.ts +9 -0
  38. package/dist/hooks/useMarkMemory.d.ts.map +1 -0
  39. package/dist/hooks/usePieTween.d.ts.map +1 -1
  40. package/dist/hooks/useSteps.d.ts +4 -0
  41. package/dist/hooks/useSteps.d.ts.map +1 -0
  42. package/dist/hooks/useTween.d.ts +12 -0
  43. package/dist/hooks/useTween.d.ts.map +1 -0
  44. package/dist/index.d.ts +11 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +122 -118
  47. package/dist/index.js.map +1 -1
  48. package/dist/motion.utils-DFoqptDi.js +55 -0
  49. package/dist/motion.utils-DFoqptDi.js.map +1 -0
  50. package/dist/pie.js +1 -1
  51. package/dist/scatter.js +1 -1
  52. package/dist/series.js +1 -1
  53. package/dist/{tooltip.utils-D7xaBSUK.js → shared-C1pGJV4T.js} +3 -7
  54. package/dist/shared-C1pGJV4T.js.map +1 -0
  55. package/dist/sparkline.d.ts +1 -1
  56. package/dist/sparkline.d.ts.map +1 -1
  57. package/dist/sparkline.js +2 -2
  58. package/dist/story.d.ts +11 -0
  59. package/dist/story.d.ts.map +1 -0
  60. package/dist/story.js +7 -0
  61. package/dist/theme.js +3 -3
  62. package/dist/{theme.utils-CP1XtGIe.js → theme.utils-DgmWROoe.js} +40 -20
  63. package/dist/theme.utils-DgmWROoe.js.map +1 -0
  64. package/dist/tooltip.utils-CXD_NapA.js +9 -0
  65. package/dist/tooltip.utils-CXD_NapA.js.map +1 -0
  66. package/dist/types/category.d.ts +10 -0
  67. package/dist/types/category.d.ts.map +1 -1
  68. package/dist/types/heatmap.d.ts +3 -0
  69. package/dist/types/heatmap.d.ts.map +1 -1
  70. package/dist/types/heatmapParts.d.ts +2 -0
  71. package/dist/types/heatmapParts.d.ts.map +1 -1
  72. package/dist/types/motion.d.ts +31 -0
  73. package/dist/types/motion.d.ts.map +1 -0
  74. package/dist/types/pie.d.ts +3 -4
  75. package/dist/types/pie.d.ts.map +1 -1
  76. package/dist/types/polar.d.ts +3 -0
  77. package/dist/types/polar.d.ts.map +1 -1
  78. package/dist/types/scatter.d.ts +3 -0
  79. package/dist/types/scatter.d.ts.map +1 -1
  80. package/dist/types/sparkline.d.ts +3 -0
  81. package/dist/types/sparkline.d.ts.map +1 -1
  82. package/dist/types/story.d.ts +73 -0
  83. package/dist/types/story.d.ts.map +1 -0
  84. package/dist/{useChartTheme-B06p_jvu.js → useChartTheme-KKtc1C4K.js} +2 -2
  85. package/dist/{useChartTheme-B06p_jvu.js.map → useChartTheme-KKtc1C4K.js.map} +1 -1
  86. package/dist/useControllable-Crsr0byh.js +11 -0
  87. package/dist/useControllable-Crsr0byh.js.map +1 -0
  88. package/dist/useMarkMemory-CLNY6TtT.js +15 -0
  89. package/dist/useMarkMemory-CLNY6TtT.js.map +1 -0
  90. package/dist/useTween-B0G0CcvM.js +46 -0
  91. package/dist/useTween-B0G0CcvM.js.map +1 -0
  92. package/dist/utils/category.utils.d.ts +2 -0
  93. package/dist/utils/category.utils.d.ts.map +1 -1
  94. package/dist/utils/color.utils.d.ts +9 -0
  95. package/dist/utils/color.utils.d.ts.map +1 -1
  96. package/dist/utils/csv.utils.d.ts +6 -0
  97. package/dist/utils/csv.utils.d.ts.map +1 -0
  98. package/dist/utils/motion.utils.d.ts +25 -0
  99. package/dist/utils/motion.utils.d.ts.map +1 -1
  100. package/dist/utils/pieTween.utils.d.ts +1 -1
  101. package/dist/utils/pieTween.utils.d.ts.map +1 -1
  102. package/dist/utils/sparkline.utils.d.ts +15 -0
  103. package/dist/utils/sparkline.utils.d.ts.map +1 -1
  104. package/dist/{visibility.utils-nMI5a_Et.js → visibility.utils-wuc3ZS8D.js} +18 -25
  105. package/dist/visibility.utils-wuc3ZS8D.js.map +1 -0
  106. package/package.json +10 -3
  107. package/src/category.ts +1 -0
  108. package/src/charts/CategoryBarChart/index.tsx +203 -44
  109. package/src/charts/Heatmap/index.tsx +4 -0
  110. package/src/charts/PolarChart/index.tsx +98 -5
  111. package/src/charts/ScatterChart/index.tsx +96 -13
  112. package/src/charts/Sparkline/index.tsx +54 -7
  113. package/src/components/ChartFrame/index.tsx +180 -0
  114. package/src/components/ChartStory/index.tsx +184 -0
  115. package/src/components/HeatmapCells/index.tsx +5 -2
  116. package/src/hooks/useMarkMemory.ts +29 -0
  117. package/src/hooks/usePieTween.ts +9 -44
  118. package/src/hooks/useSteps.ts +77 -0
  119. package/src/hooks/useTween.ts +112 -0
  120. package/src/index.ts +19 -0
  121. package/src/sparkline.ts +1 -1
  122. package/src/story.ts +19 -0
  123. package/src/types/category.ts +11 -0
  124. package/src/types/heatmap.ts +3 -0
  125. package/src/types/heatmapParts.ts +2 -0
  126. package/src/types/motion.ts +35 -0
  127. package/src/types/pie.ts +3 -3
  128. package/src/types/polar.ts +3 -0
  129. package/src/types/scatter.ts +3 -0
  130. package/src/types/sparkline.ts +3 -0
  131. package/src/types/story.ts +103 -0
  132. package/src/utils/category.utils.ts +22 -0
  133. package/src/utils/color.utils.ts +48 -0
  134. package/src/utils/csv.utils.ts +28 -0
  135. package/src/utils/motion.utils.ts +124 -0
  136. package/src/utils/pieTween.utils.ts +1 -2
  137. package/src/utils/sparkline.utils.ts +69 -0
  138. package/dist/CategoryBarChart-YEJ9VB8h.js +0 -453
  139. package/dist/CategoryBarChart-YEJ9VB8h.js.map +0 -1
  140. package/dist/Heatmap-C1XcTUg1.js.map +0 -1
  141. package/dist/PieLegend-BZsv9IbF.js.map +0 -1
  142. package/dist/PolarChart-BUEhn3CI.js +0 -334
  143. package/dist/PolarChart-BUEhn3CI.js.map +0 -1
  144. package/dist/Sparkline-DtNhxGVo.js +0 -67
  145. package/dist/Sparkline-DtNhxGVo.js.map +0 -1
  146. package/dist/motion.utils-C1eaZJdQ.js +0 -9
  147. package/dist/motion.utils-C1eaZJdQ.js.map +0 -1
  148. package/dist/theme.utils-CP1XtGIe.js.map +0 -1
  149. package/dist/tooltip.utils-D7xaBSUK.js.map +0 -1
  150. package/dist/visibility.utils-nMI5a_Et.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,24 +1,28 @@
1
1
  "use client";
2
- import { _ as e, a as t, c as n, d as r, f as i, h as a, i as o, l as s, m as c, n as l, p as u, r as d, s as f, u as p } from "./theme.utils-CP1XtGIe.js";
3
- import { a as m, c as h, i as g, l as _, o as v, r as y, s as b } from "./visibility.utils-nMI5a_Et.js";
4
- import { a as x, c as S, d as ee, f as C, i as w, l as T, m as E, n as te, o as D, p as O, r as k, s as ne, t as re, u as A } from "./Heatmap-C1XcTUg1.js";
5
- import { n as j, t as ie } from "./useChartTheme-B06p_jvu.js";
6
- import { C as ae, S as M, _ as oe, a as N, b as P, c as F, d as I, f as L, g as R, h as z, i as B, l as se, m as V, n as ce, o as le, p as ue, r as de, s as fe, t as pe, u as me, v as H, w as U, x as W, y as he } from "./TimeSeriesChart-BIwJxgnD.js";
7
- import { a as ge, i as _e, n as ve, o as ye, r as be, t as xe } from "./PieLegend-BZsv9IbF.js";
8
- import { t as Se } from "./CategoryBarChart-YEJ9VB8h.js";
9
- import { r as Ce, t as we } from "./PolarChart-BUEhn3CI.js";
10
- import { t as Te } from "./Sparkline-DtNhxGVo.js";
11
- import { t as Ee } from "./bin.utils-Ch1y7YDn.js";
12
- import { i as De, n as Oe, r as ke, t as Ae } from "./css-C-rsk7-l.js";
13
- import { HistogramSeries as G } from "lightweight-charts";
14
- import { Children as je, forwardRef as K, isValidElement as q, useEffect as J, useImperativeHandle as Me, useMemo as Y, useRef as X, useState as Ne } from "react";
2
+ import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, p as d, r as f, s as p, u as m, y as h } from "./theme.utils-DgmWROoe.js";
3
+ import { a as g, c as _, i as v, n as y, o as b, r as x, s as S } from "./visibility.utils-wuc3ZS8D.js";
4
+ import { a as ee, c as C, d as w, f as T, i as E, l as te, m as D, n as O, o as k, p as ne, r as re, s as A, t as j, u as M } from "./Heatmap-CFC753mV.js";
5
+ import { i as N, n as P, r as F } from "./motion.utils-DFoqptDi.js";
6
+ import { n as I, t as L } from "./useChartTheme-KKtc1C4K.js";
7
+ import { C as ie, S as R, _ as ae, a as z, b as B, c as V, d as oe, f as se, g as ce, h as le, i as ue, l as de, m as H, n as fe, o as pe, p as me, r as he, s as ge, t as _e, u as ve, v as U, w as W, x as G, y as ye } from "./TimeSeriesChart-BzeHEtQl.js";
8
+ import { a as be, i as xe, n as Se, o as Ce, r as we, t as Te } from "./PieLegend-CbpjaOJH.js";
9
+ import { t as Ee } from "./useTween-B0G0CcvM.js";
10
+ import { t as De } from "./CategoryBarChart-1Kn3Vozc.js";
11
+ import { t as Oe } from "./useMarkMemory-CLNY6TtT.js";
12
+ import { r as ke, t as Ae } from "./PolarChart-hcNTWKfJ.js";
13
+ import { t as je } from "./Sparkline-BApLVWfg.js";
14
+ import { t as Me } from "./bin.utils-Ch1y7YDn.js";
15
+ import { i as Ne, n as Pe, r as Fe, t as Ie } from "./css-BtFQ2bM4.js";
16
+ import { a as Le, i as Re, n as ze, r as Be, t as Ve } from "./ChartFrame-B1bVFM2E.js";
17
+ import { HistogramSeries as K } from "lightweight-charts";
18
+ import { Children as He, forwardRef as q, isValidElement as Ue, useEffect as J, useImperativeHandle as We, useMemo as Y, useRef as X, useState as Ge } from "react";
15
19
  import { jsx as Z, jsxs as Q } from "react/jsx-runtime";
16
20
  //#region src/utils/squarify.utils.ts
17
- function Pe(e, t) {
18
- let n = b(e), [r, i] = g(e), a = t * t, o = n * n;
21
+ function Ke(e, t) {
22
+ let n = b(e), [r, i] = x(e), a = t * t, o = n * n;
19
23
  return Math.max(a * i / o, o / (a * r));
20
24
  }
21
- function Fe(e, t, n, r) {
25
+ function qe(e, t, n, r) {
22
26
  let i = b(e.map((e) => t[e])), a = n.width >= n.height, o = i / (a ? n.height : n.width), s = 0;
23
27
  for (let i of e) {
24
28
  let e = t[i] / o;
@@ -44,7 +48,7 @@ function Fe(e, t, n, r) {
44
48
  height: Math.max(0, n.height - o)
45
49
  };
46
50
  }
47
- function Ie(e, t) {
51
+ function Je(e, t) {
48
52
  y("squarify", e);
49
53
  let n = e.map(() => ({
50
54
  x: t.x,
@@ -56,18 +60,18 @@ function Ie(e, t) {
56
60
  let a = e.map((e) => e * i / r), o = a.map((e, t) => t).filter((e) => a[e] > 0).sort((e, t) => a[t] - a[e] || e - t), s = { ...t }, c = [], l = (e) => e.map((e) => a[e]);
57
61
  for (let e of o) {
58
62
  let t = Math.min(s.width, s.height), r = [...c, e];
59
- c.length === 0 || Pe(l(r), t) <= Pe(l(c), t) ? c = r : (s = Fe(c, a, s, n), c = [e]);
63
+ c.length === 0 || Ke(l(r), t) <= Ke(l(c), t) ? c = r : (s = qe(c, a, s, n), c = [e]);
60
64
  }
61
- return c.length > 0 && Fe(c, a, s, n), n;
65
+ return c.length > 0 && qe(c, a, s, n), n;
62
66
  }
63
67
  //#endregion
64
68
  //#region src/hooks/useNowLine.ts
65
- function Le(e, t, n) {
69
+ function Ye(e, t, n) {
66
70
  J(() => {
67
71
  let r = t.current;
68
72
  if (!e || !r) return;
69
73
  let { chart: i } = e, a = i.timeScale(), o = () => {
70
- let e = n === null ? null : U(a, n), t = e !== null && e >= 0 && e <= a.width();
74
+ let e = n === null ? null : W(a, n), t = e !== null && e >= 0 && e <= a.width();
71
75
  r.style.display = t ? "block" : "none", t && (r.style.transform = `translateX(${e + i.priceScale("left").width()}px)`);
72
76
  };
73
77
  return o(), a.subscribeVisibleLogicalRangeChange(o), a.subscribeSizeChange(o), () => {
@@ -86,14 +90,14 @@ function $(e) {
86
90
  }
87
91
  //#endregion
88
92
  //#region src/charts/HistogramPane/index.tsx
89
- function Re(e) {
93
+ function Xe(e) {
90
94
  return null;
91
95
  }
92
96
  //#endregion
93
97
  //#region src/utils/timeline.utils.ts
94
- var ze = 18, Be = 5e3;
95
- function Ve(e, t) {
96
- let { palette: n, typography: r, timeline: i } = e, a = i.barHeight ?? ze, o = (e) => ({
98
+ var Ze = 18, Qe = 5e3;
99
+ function $e(e, t) {
100
+ let { palette: n, typography: r, timeline: i } = e, a = i.barHeight ?? Ze, o = (e) => ({
97
101
  ...r.label,
98
102
  color: e
99
103
  }), s = [...t].reduce((e, t) => e + t.charCodeAt(0), 0);
@@ -133,10 +137,10 @@ function Ve(e, t) {
133
137
  text: o(n.background)
134
138
  };
135
139
  }
136
- function He(e, t = {}) {
137
- return (n) => u(e && Ve(e, n), e?.timeline.styles?.[n], t[n]);
140
+ function et(e, t = {}) {
141
+ return (n) => o(e && $e(e, n), e?.timeline.styles?.[n], t[n]);
138
142
  }
139
- function Ue(e) {
143
+ function tt(e) {
140
144
  return e.flatMap(({ start: e, end: t, eta: n, state: r, label: i, color: a }) => {
141
145
  let o = {
142
146
  from: e,
@@ -144,7 +148,7 @@ function Ue(e) {
144
148
  key: r,
145
149
  label: i,
146
150
  color: a
147
- }, s = n === void 0 ? null : M(n), c = M(e);
151
+ }, s = n === void 0 ? null : R(n), c = R(e);
148
152
  return s !== null && c !== null && s < c ? [{
149
153
  from: n,
150
154
  to: e,
@@ -152,62 +156,62 @@ function Ue(e) {
152
156
  }, o] : [o];
153
157
  });
154
158
  }
155
- function We(e) {
156
- let t = e.map(M).filter((e) => e !== null);
159
+ function nt(e) {
160
+ let t = e.map(R).filter((e) => e !== null);
157
161
  return [...new Set(t)].sort((e, t) => e - t);
158
162
  }
159
- function Ge(e, t = 3600) {
160
- let n = We(e), r = n[0], i = n[n.length - 1];
163
+ function rt(e, t = 3600) {
164
+ let n = nt(e), r = n[0], i = n[n.length - 1];
161
165
  if (r === void 0 || i === void 0 || !(t > 0)) return [];
162
- let a = Math.max(t, Math.ceil((i - r) / Be)), o = Math.floor(r / a) * a, s = Math.ceil(i / a) * a;
166
+ let a = Math.max(t, Math.ceil((i - r) / Qe)), o = Math.floor(r / a) * a, s = Math.ceil(i / a) * a;
163
167
  return Array.from({ length: Math.max(1, (s - o) / a + 1) }, (e, t) => o + t * a);
164
168
  }
165
169
  //#endregion
166
170
  //#region src/hooks/usePaneRanges.ts
167
- function Ke(t, n, r) {
168
- let i = X([]);
171
+ function it(e, t, n) {
172
+ let r = X([]);
169
173
  J(() => {
170
- i.current = [];
171
- }, [t]), J(() => {
172
- if (!t) return;
173
- let a = i.current, o = t.chart.panes(), s = (e) => e?.pane.detachPrimitive(e.primitive);
174
- n.forEach((t, n) => {
175
- let i = o[n], c = a[n];
176
- if (c && (!t || c.pane !== i) && (s(c), c = a[n] = void 0), !t || !i) return;
177
- let l = [
178
- t.items,
179
- t.styles,
180
- r
174
+ r.current = [];
175
+ }, [e]), J(() => {
176
+ if (!e) return;
177
+ let i = r.current, a = e.chart.panes(), o = (e) => e?.pane.detachPrimitive(e.primitive);
178
+ t.forEach((e, t) => {
179
+ let r = a[t], s = i[t];
180
+ if (s && (!e || s.pane !== r) && (o(s), s = i[t] = void 0), !e || !r) return;
181
+ let c = [
182
+ e.items,
183
+ e.styles,
184
+ n
181
185
  ];
182
- if (c && e(c.inputs, l)) return;
183
- let u = {
184
- items: Ue(t.items),
185
- style: He(r, t.styles)
186
+ if (s && h(s.inputs, c)) return;
187
+ let l = {
188
+ items: tt(e.items),
189
+ style: et(n, e.styles)
186
190
  };
187
- if (c) {
188
- c.primitive.applyOptions(u), c.inputs = l;
191
+ if (s) {
192
+ s.primitive.applyOptions(l), s.inputs = c;
189
193
  return;
190
194
  }
191
- let d = new H(u);
192
- i.attachPrimitive(d), a[n] = {
193
- pane: i,
194
- primitive: d,
195
- inputs: l
195
+ let u = new U(l);
196
+ r.attachPrimitive(u), i[t] = {
197
+ pane: r,
198
+ primitive: u,
199
+ inputs: c
196
200
  };
197
- }), a.splice(n.length).forEach(s);
201
+ }), i.splice(t.length).forEach(o);
198
202
  });
199
203
  }
200
204
  //#endregion
201
205
  //#region src/hooks/usePaneSeries.ts
202
- function qe(n, r, i) {
203
- let o = X([]);
206
+ function at(n, r, i) {
207
+ let s = X([]);
204
208
  return J(() => {
205
- o.current = [];
209
+ s.current = [];
206
210
  }, [n]), J(() => {
207
211
  if (!n) return;
208
- let { chart: s } = n, l = o.current, d = (e, t, r) => {
209
- let i = e === 0 ? n.series : s.addSeries(G, {}, e), a = u(i.options());
210
- return e > 0 && (i.applyOptions(t), s.panes()[e]?.setPreserveEmptyPane(!0)), {
212
+ let { chart: c } = n, l = s.current, u = (e, t, r) => {
213
+ let i = e === 0 ? n.series : c.addSeries(K, {}, e), a = o(i.options());
214
+ return e > 0 && (i.applyOptions(t), c.panes()[e]?.setPreserveEmptyPane(!0)), {
211
215
  series: i,
212
216
  defaults: a,
213
217
  options: t,
@@ -215,108 +219,108 @@ function qe(n, r, i) {
215
219
  dataInputs: [],
216
220
  lineInputs: [],
217
221
  lines: [],
218
- normalized: W([])
222
+ normalized: G([])
219
223
  };
220
224
  };
221
225
  r.forEach((n, r) => {
222
- let o = n.mode ?? "plain", m = [o, n.seriesOptions], h = V(o, n.seriesOptions), g = l[r];
223
- g && r > 0 && !e(g.optionInputs, m) && (a(g.defaults, g.options, h) ? (s.removeSeries(g.series), g = void 0) : (g.series.applyOptions(u(c(g.defaults, g.options), h)), g.options = h, g.optionInputs = m)), g || (l[r] = g = d(r, h, m));
224
- let { bar: _, over: v, positive: y, negative: b } = u(t(i), n.colors), x = [
226
+ let s = n.mode ?? "plain", d = [s, n.seriesOptions], f = H(s, n.seriesOptions), g = l[r];
227
+ g && r > 0 && !h(g.optionInputs, d) && (e(g.defaults, g.options, f) ? (c.removeSeries(g.series), g = void 0) : (g.series.applyOptions(o(a(g.defaults, g.options), f)), g.options = f, g.optionInputs = d)), g || (l[r] = g = u(r, f, d));
228
+ let { bar: _, over: v, positive: y, negative: b } = o(t(i), n.colors), x = [
225
229
  n.data,
226
230
  n.whitespace,
227
- o,
231
+ s,
228
232
  n.threshold,
229
233
  _,
230
234
  v,
231
235
  y,
232
236
  b
233
237
  ];
234
- e(g.dataInputs, x) || (g.normalized = W(n.data), g.series.setData(n.whitespace ? We(n.whitespace).map((e) => ({ time: e })) : ue(g.normalized.data, o, n.threshold, {
238
+ h(g.dataInputs, x) || (g.normalized = G(n.data), g.series.setData(n.whitespace ? nt(n.whitespace).map((e) => ({ time: e })) : me(g.normalized.data, s, n.threshold, {
235
239
  bar: _,
236
240
  over: v,
237
241
  positive: y,
238
242
  negative: b
239
243
  })), g.dataInputs = x);
240
244
  let S = [
241
- o,
245
+ s,
242
246
  n.threshold,
243
247
  n.thresholdLine,
244
248
  n.zeroLine,
245
249
  i
246
250
  ];
247
- if (!e(g.lineInputs, S)) {
251
+ if (!h(g.lineInputs, S)) {
248
252
  let { series: e } = g;
249
- g.lines.forEach((t) => e.removePriceLine(t)), g.lines = z(o, n.threshold, p(f(i, i?.histogram.threshold, "dashed"), n.thresholdLine), p(f(i, i?.histogram.zero, "solid"), n.zeroLine)).map((t) => e.createPriceLine(t)), g.lineInputs = S;
253
+ g.lines.forEach((t) => e.removePriceLine(t)), g.lines = le(s, n.threshold, m(p(i, i?.histogram.threshold, "dashed"), n.thresholdLine), m(p(i, i?.histogram.zero, "solid"), n.zeroLine)).map((t) => e.createPriceLine(t)), g.lineInputs = S;
250
254
  }
251
- s.panes()[r]?.setStretchFactor(n.height);
255
+ c.panes()[r]?.setStretchFactor(n.height);
252
256
  }), l.splice(r.length).forEach((e) => {
253
257
  if (e.series !== n.series) {
254
- s.removeSeries(e.series);
258
+ c.removeSeries(e.series);
255
259
  return;
256
260
  }
257
261
  e.lines.forEach((t) => e.series.removePriceLine(t)), e.series.setData([]);
258
262
  });
259
- for (let e = s.panes().length - 1; e >= Math.max(r.length, 1); e--) s.removePane(e);
260
- }), o;
263
+ for (let e = c.panes().length - 1; e >= Math.max(r.length, 1); e--) c.removePane(e);
264
+ }), s;
261
265
  }
262
266
  //#endregion
263
267
  //#region src/charts/ChartPanes/index.tsx
264
- var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
268
+ var ot = { display: "flex" }, st = { flex: "none" }, ct = {
265
269
  boxSizing: "border-box",
266
270
  overflow: "hidden"
267
- }, Ze = {
271
+ }, lt = {
268
272
  position: "relative",
269
273
  flex: 1,
270
274
  minWidth: 0
271
- }, Qe = {
275
+ }, ut = {
272
276
  position: "absolute",
273
277
  inset: 0
274
- }, $e = {
278
+ }, dt = {
275
279
  position: "absolute",
276
280
  top: 0,
277
281
  left: 0,
278
282
  width: 1,
279
283
  display: "none",
280
284
  pointerEvents: "none"
281
- }, et = { layout: { panes: { enableResize: !1 } } }, tt = [], nt = (e) => e.value.toLocaleString(), rt = K(function({ children: e, now: t = null, axisLabel: r, chartOptions: i, ctrlWheelZoom: a = !0, ariaLabel: s = "Chart panes", className: c, classNames: d = {}, styles: f = {}, onPaneClick: p, onPaneHover: m, onPaneLeave: h, theme: g, unstyled: _ }, v) {
285
+ }, ft = { layout: { panes: { enableResize: !1 } } }, pt = [], mt = (e) => e.value.toLocaleString(), ht = q(function({ children: e, now: t = null, axisLabel: r, chartOptions: i, ctrlWheelZoom: a = !0, ariaLabel: c = "Chart panes", className: l, classNames: d = {}, styles: f = {}, onPaneClick: p, onPaneHover: m, onPaneLeave: h, theme: g, unstyled: _ }, v) {
282
286
  let y = X(null), b = X(null), x = X({
283
287
  onPaneClick: p,
284
288
  onPaneHover: m,
285
289
  onPaneLeave: h
286
- }), [S, ee] = Ne(0), [C, w] = Ne(null);
290
+ }), [S, ee] = Ge(0), [C, w] = Ge(null);
287
291
  x.current = {
288
292
  onPaneClick: p,
289
293
  onPaneHover: m,
290
294
  onPaneLeave: h
291
295
  };
292
- let T = ie({
296
+ let T = L({
293
297
  theme: g,
294
298
  unstyled: _
295
- }), E = T?.sizes.paneHeight ?? o.sizes.paneHeight, te = T?.sizes.laneHeight ?? E, D = [], O = [];
296
- je.forEach(e, (e) => {
297
- if (q(e) && e.type === Re && (D.push(null), O.push({
299
+ }), E = T?.sizes.paneHeight ?? s.sizes.paneHeight, te = T?.sizes.laneHeight ?? E, D = [], O = [];
300
+ He.forEach(e, (e) => {
301
+ if (Ue(e) && e.type === Xe && (D.push(null), O.push({
298
302
  ...e.props,
299
303
  height: e.props.height ?? E
300
- })), q(e) && e.type === $) {
304
+ })), Ue(e) && e.type === $) {
301
305
  let { label: t, meta: n, height: r = te, times: i } = e.props;
302
306
  D.push(e.props), O.push({
303
307
  label: t,
304
308
  meta: n,
305
309
  height: r,
306
- data: tt,
310
+ data: pt,
307
311
  whitespace: i
308
312
  });
309
313
  }
310
314
  });
311
- let k = O[0], ne = Y(() => V(k?.mode ?? "plain", k?.seriesOptions), [k?.mode, k?.seriesOptions]), re = Y(() => u(l(T), et, a && {
315
+ let k = O[0], ne = Y(() => H(k?.mode ?? "plain", k?.seriesOptions), [k?.mode, k?.seriesOptions]), re = Y(() => o(u(T), ft, a && {
312
316
  handleScale: { mouseWheel: !1 },
313
317
  handleScroll: { mouseWheel: !1 }
314
318
  }, i), [
315
319
  T,
316
320
  a,
317
321
  i
318
- ]), A = ae(y, G, re, ne), j = qe(A, O, T);
319
- Ke(A, D, T), oe(A, y, a), J(() => {
322
+ ]), A = ie(y, K, re, ne), j = at(A, O, T);
323
+ it(A, D, T), ae(A, y, a), J(() => {
320
324
  if (!A) return;
321
325
  let e = A.chart.timeScale(), t = () => ee(e.height());
322
326
  return t(), e.subscribeSizeChange(t), () => e.unsubscribeSizeChange(t);
@@ -347,25 +351,25 @@ var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
347
351
  return e.subscribeCrosshairMove(r), e.subscribeClick(i), () => {
348
352
  e.unsubscribeCrosshairMove(r), e.unsubscribeClick(i);
349
353
  };
350
- }, [A, j]), Le(A, b, t === null ? null : M(t)), Me(v, () => A ? {
354
+ }, [A, j]), Ye(A, b, t === null ? null : R(t)), We(v, () => A ? {
351
355
  chart: A.chart,
352
356
  get series() {
353
357
  return j.current.map((e) => e.series);
354
358
  }
355
359
  } : null, [A, j]);
356
- let N = O.map((e) => e.height), P = T && u({ color: T.palette.now }, T.panes.now), F = P ? {
360
+ let M = O.map((e) => e.height), N = T && o({ color: T.palette.now }, T.panes.now), P = N ? {
357
361
  width: 0,
358
- borderLeft: `${P.width ?? 1}px ${P.style ?? "solid"} ${P.color}`
359
- } : {}, I = { width: T?.sizes.paneLabel }, L = { padding: T?.spacing.paneLabel }, R = n(T ? u(T.typography.title, T.panes.title) : void 0), z = n(T ? u(T.typography.value, T.panes.meta) : void 0), B = N.reduce((e, t) => e + t, 0) + Math.max(0, O.length - 1) + S;
362
+ borderLeft: `${N.width ?? 1}px ${N.style ?? "solid"} ${N.color}`
363
+ } : {}, F = { width: T?.sizes.paneLabel }, I = { padding: T?.spacing.paneLabel }, z = n(T ? o(T.typography.title, T.panes.title) : void 0), B = n(T ? o(T.typography.value, T.panes.meta) : void 0), V = M.reduce((e, t) => e + t, 0) + Math.max(0, O.length - 1) + S;
360
364
  return /* @__PURE__ */ Q("div", {
361
- className: c,
362
- style: Je,
365
+ className: l,
366
+ style: ot,
363
367
  children: [/* @__PURE__ */ Q("div", {
364
368
  "data-part": "labels",
365
369
  className: d.labels,
366
370
  style: {
367
- ...Ye,
368
- ...I,
371
+ ...st,
372
+ ...F,
369
373
  ...f.labels
370
374
  },
371
375
  children: [O.map((e, t) => {
@@ -374,16 +378,16 @@ var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
374
378
  "data-part": "label",
375
379
  className: d.label,
376
380
  style: {
377
- ...Xe,
378
- ...L,
379
- height: N[t] + +(t > 0),
381
+ ...ct,
382
+ ...I,
383
+ height: M[t] + +(t > 0),
380
384
  ...f.label
381
385
  },
382
386
  children: [/* @__PURE__ */ Z("div", {
383
387
  "data-part": "title",
384
388
  className: d.title,
385
389
  style: {
386
- ...R,
390
+ ...z,
387
391
  ...f.title
388
392
  },
389
393
  children: e.label
@@ -391,17 +395,17 @@ var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
391
395
  "data-part": "meta",
392
396
  className: d.meta,
393
397
  style: {
394
- ...z,
398
+ ...B,
395
399
  ...f.meta
396
400
  },
397
- children: n ? (e.format ?? nt)(n) : e.meta
401
+ children: n ? (e.format ?? mt)(n) : e.meta
398
402
  })]
399
403
  }, t);
400
404
  }), /* @__PURE__ */ Z("div", {
401
405
  "data-part": "axis",
402
406
  className: d.axis,
403
407
  style: {
404
- ...Xe,
408
+ ...ct,
405
409
  height: S,
406
410
  ...f.axis
407
411
  },
@@ -411,22 +415,22 @@ var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
411
415
  "data-part": "plot",
412
416
  className: d.plot,
413
417
  style: {
414
- ...Ze,
415
- height: B,
418
+ ...lt,
419
+ height: V,
416
420
  ...f.plot
417
421
  },
418
422
  children: [/* @__PURE__ */ Z("div", {
419
423
  ref: y,
420
- style: Qe,
424
+ style: ut,
421
425
  role: "img",
422
- "aria-label": s
426
+ "aria-label": c
423
427
  }), /* @__PURE__ */ Z("div", {
424
428
  ref: b,
425
429
  "data-part": "now",
426
430
  className: d.now,
427
431
  style: {
428
- ...$e,
429
- ...F,
432
+ ...dt,
433
+ ...P,
430
434
  bottom: S,
431
435
  ...f.now
432
436
  },
@@ -434,13 +438,13 @@ var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
434
438
  })]
435
439
  })]
436
440
  });
437
- }), it = K(function({ lanes: e, step: t, ...n }, r) {
438
- let i = Y(() => Ge(e.flatMap((e) => e.items.flatMap(({ start: e, end: t, eta: n }) => n === void 0 ? [e, t] : [
441
+ }), gt = q(function({ lanes: e, step: t, ...n }, r) {
442
+ let i = Y(() => rt(e.flatMap((e) => e.items.flatMap(({ start: e, end: t, eta: n }) => n === void 0 ? [e, t] : [
439
443
  n,
440
444
  e,
441
445
  t
442
446
  ])), t), [e, t]);
443
- return /* @__PURE__ */ Z(rt, {
447
+ return /* @__PURE__ */ Z(ht, {
444
448
  ref: r,
445
449
  ...n,
446
450
  children: e.map(({ id: e, ...t }, n) => /* @__PURE__ */ Z($, {
@@ -450,6 +454,6 @@ var Je = { display: "flex" }, Ye = { flex: "none" }, Xe = {
450
454
  });
451
455
  });
452
456
  //#endregion
453
- export { me as BarChart, N as CandlestickChart, Se as CategoryBarChart, rt as ChartPanes, j as ChartThemeProvider, re as Heatmap, w as HeatmapLegend, le as HistogramChart, Re as HistogramPane, se as LineChart, ve as PieChart, xe as PieLegend, we as PolarChart, B as RibbonPrimitive, Ce as ScatterChart, R as SeriesChart, Te as Sparkline, H as TimeRangePrimitive, pe as TimeSeriesChart, it as TimelineChart, $ as TimelinePane, fe as aggregate, I as aggregatePoints, _e as arcPath, he as bandAt, Ee as bin, D as cellAt, d as createTheme, o as defaultTheme, ce as editorialChartOptions, ne as extremes, S as heatmapGrid, T as heatmapLayout, A as inRange, F as isUp, ee as normaliseRange, ke as p1Accents, Ae as p1CssVariables, De as p1Theme, Oe as p1ThemeFromCss, de as patchSquareCanvasLabels, m as pieArcs, ge as pieSlices, ye as placeLabels, C as pointerCell, v as quantize, O as rangeStats, P as resolveBandStyles, Ie as squarify, E as stepColor, h as symmetricExtent, s as themeFromCssVariables, _ as tidyTree, U as timeToX, L as toLinePoints, r as toSrgb, ie as useChartTheme, te as useHeatmapSelection, k as useHeatmapState, x as useHeatmapSteps, be as usePieState, i as withAlpha };
457
+ export { ve as BarChart, z as CandlestickChart, De as CategoryBarChart, Ve as ChartFrame, ht as ChartPanes, Re as ChartStory, I as ChartThemeProvider, j as Heatmap, E as HeatmapLegend, pe as HistogramChart, Xe as HistogramPane, de as LineChart, Se as PieChart, Te as PieLegend, Ae as PolarChart, ue as RibbonPrimitive, ke as ScatterChart, ce as SeriesChart, je as Sparkline, U as TimeRangePrimitive, _e as TimeSeriesChart, gt as TimelineChart, $ as TimelinePane, ge as aggregate, oe as aggregatePoints, xe as arcPath, ye as bandAt, Me as bin, k as cellAt, r as contrastRatio, f as createTheme, s as defaultTheme, ze as downloadCsv, P as easeInOutCubic, F as easeOutCubic, fe as editorialChartOptions, A as extremes, C as heatmapGrid, te as heatmapLayout, M as inRange, V as isUp, N as linear, w as normaliseRange, Fe as p1Accents, Ie as p1CssVariables, Ne as p1Theme, Pe as p1ThemeFromCss, he as patchSquareCanvasLabels, v as pieArcs, be as pieSlices, Ce as placeLabels, T as pointerCell, g as quantize, ne as rangeStats, i as readableInk, B as resolveBandStyles, Je as squarify, D as stepColor, S as symmetricExtent, c as themeFromCssVariables, _ as tidyTree, W as timeToX, Be as toCsv, se as toLinePoints, d as toSrgb, L as useChartTheme, O as useHeatmapSelection, re as useHeatmapState, ee as useHeatmapSteps, Oe as useMarkMemory, we as usePieState, Le as useSteps, Ee as useTween, l as withAlpha };
454
458
 
455
459
  //# sourceMappingURL=index.js.map