velo-plot 2.20.0 → 3.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 (287) hide show
  1. package/README.md +26 -12
  2. package/dist/ChartCore-AnR_3Xkb.js +7338 -0
  3. package/dist/ChartCore-AnR_3Xkb.js.map +1 -0
  4. package/dist/GpuChartRenderer-Dxc0hrQA.js +75 -0
  5. package/dist/GpuChartRenderer-Dxc0hrQA.js.map +1 -0
  6. package/dist/{index.core-COREBDNq.js → PluginRegistry-CzMHebYP.js} +24 -38
  7. package/dist/PluginRegistry-CzMHebYP.js.map +1 -0
  8. package/dist/a11y-Bw6urYpr.js +105 -0
  9. package/dist/a11y-Bw6urYpr.js.map +1 -0
  10. package/dist/angular/hooks-entry.d.ts +1 -0
  11. package/dist/angular/hooks.d.ts +26 -0
  12. package/dist/angular/index.d.ts +8 -0
  13. package/dist/angular/velo-plot.component.d.ts +46 -0
  14. package/dist/angular-hooks.d.ts +1 -0
  15. package/dist/angular-hooks.js +9 -0
  16. package/dist/angular-hooks.js.map +1 -0
  17. package/dist/angular.d.ts +1 -0
  18. package/dist/angular.js +166 -0
  19. package/dist/angular.js.map +1 -0
  20. package/dist/assets/indicator.worker-bv0zC4EX.js.map +1 -1
  21. package/dist/astro/StackedPlot.astro +19 -0
  22. package/dist/astro/VeloPlot.astro +23 -0
  23. package/dist/{axisFormat-CzumxpCL.js → axisFormat-Sz4WIJfQ.js} +2 -2
  24. package/dist/{axisFormat-CzumxpCL.js.map → axisFormat-Sz4WIJfQ.js.map} +1 -1
  25. package/dist/bindings/shared/a11y.d.ts +26 -0
  26. package/dist/bindings/shared/chartLifecycle.d.ts +16 -0
  27. package/dist/bindings/shared/chartSyncBridge.d.ts +8 -0
  28. package/dist/bindings/shared/dimensions.d.ts +1 -0
  29. package/dist/bindings/shared/index.d.ts +9 -0
  30. package/dist/bindings/shared/indicatorBridge.d.ts +11 -0
  31. package/dist/bindings/shared/optionsSync.d.ts +7 -0
  32. package/dist/bindings/shared/seriesDiff.d.ts +8 -0
  33. package/dist/bindings/shared/stackedSync.d.ts +9 -0
  34. package/dist/bindings/shared/types.d.ts +46 -0
  35. package/dist/bindings/test-utils/index.d.ts +35 -0
  36. package/dist/bindings/test-utils/mockLifecycle.d.ts +120 -0
  37. package/dist/bindings/test-utils/vitestSveltePlugin.d.ts +3 -0
  38. package/dist/chartSyncBridge-D_rCtbFq.js +58 -0
  39. package/dist/chartSyncBridge-D_rCtbFq.js.map +1 -0
  40. package/dist/core/Chart.d.ts +1 -1
  41. package/dist/core/ChartStatistics.d.ts +1 -1
  42. package/dist/core/InteractionManager.d.ts +7 -1
  43. package/dist/core/OverlayRenderer.d.ts +5 -0
  44. package/dist/core/annotations/types.d.ts +1 -1
  45. package/dist/core/chart/ChartCore.d.ts +14 -19
  46. package/dist/core/chart/ChartFeatureHooks.d.ts +7 -0
  47. package/dist/core/chart/chartExportPatch.d.ts +2 -0
  48. package/dist/core/chart/overlaySeriesRegistry.d.ts +7 -0
  49. package/dist/core/chart/series/SeriesActions.d.ts +1 -0
  50. package/dist/core/chart/series/SeriesBufferLite.d.ts +13 -0
  51. package/dist/core/chart/series/seriesOptionsRegistry.d.ts +8 -0
  52. package/dist/core/chart/series/seriesTypeRegistry.d.ts +5 -0
  53. package/dist/core/chart/types.d.ts +1 -1
  54. package/dist/core/clipboard/index.d.ts +1 -1
  55. package/dist/core/debug/index.d.ts +1 -1
  56. package/dist/core/keybindings/index.d.ts +1 -1
  57. package/dist/core/loading/index.d.ts +1 -1
  58. package/dist/core/locale/index.d.ts +1 -1
  59. package/dist/core/stacked/paneResize.d.ts +3 -0
  60. package/dist/core/stacked/types.d.ts +10 -0
  61. package/dist/core/theme-editor/index.d.ts +1 -1
  62. package/dist/createStackedChart-DqcLCFGS.js +1338 -0
  63. package/dist/createStackedChart-DqcLCFGS.js.map +1 -0
  64. package/dist/examples/PluginDemonstration.d.ts +1 -1
  65. package/dist/hooks-DH-3bewj.js +69 -0
  66. package/dist/hooks-DH-3bewj.js.map +1 -0
  67. package/dist/{index-BBpJwOct.js → index-0InEyj0q.js} +119 -121
  68. package/dist/index-0InEyj0q.js.map +1 -0
  69. package/dist/{index-qunX30Xu.js → index-B7PTX94B.js} +2133 -2133
  70. package/dist/index-B7PTX94B.js.map +1 -0
  71. package/dist/{index-BMiZoKmm.js → index-BgrvqltV.js} +67 -67
  72. package/dist/index-BgrvqltV.js.map +1 -0
  73. package/dist/{index-DoYxf1cV.js → index-CWxIHdwX.js} +38 -98
  74. package/dist/index-CWxIHdwX.js.map +1 -0
  75. package/dist/index-CaXWSOTk.js.map +1 -1
  76. package/dist/{mockDatafeed-927foCM4.js → index-Cv6ZDLWf.js} +227 -217
  77. package/dist/index-Cv6ZDLWf.js.map +1 -0
  78. package/dist/index-Dag88bW4.js.map +1 -1
  79. package/dist/index-qhscKTDy.js.map +1 -1
  80. package/dist/index.core.d.ts +9 -7
  81. package/dist/index.d.ts +2 -15
  82. package/dist/indicators--eJGmVox.js.map +1 -1
  83. package/dist/optionsSync-QUiN4Inw.js +119 -0
  84. package/dist/optionsSync-QUiN4Inw.js.map +1 -0
  85. package/dist/plugins/3d/index.d.ts +2 -2
  86. package/dist/plugins/3d.d.ts +2 -2
  87. package/dist/plugins/3d.js +3 -1
  88. package/dist/plugins/3d.js.map +1 -1
  89. package/dist/plugins/analysis/index.d.ts +1 -1
  90. package/dist/plugins/analysis/indicators.d.ts +1 -1
  91. package/dist/plugins/analysis.d.ts +2 -2
  92. package/dist/plugins/analysis.js +2 -2
  93. package/dist/plugins/analysis.js.map +1 -1
  94. package/dist/plugins/annotations/index.d.ts +1 -1
  95. package/dist/plugins/annotations.d.ts +2 -2
  96. package/dist/plugins/annotations.js.map +1 -1
  97. package/dist/plugins/anomaly-detection.js +1 -1
  98. package/dist/plugins/anomaly-detection.js.map +1 -1
  99. package/dist/plugins/broken-axis.d.ts +2 -2
  100. package/dist/plugins/builtins/crosshair/CrosshairPlugin.d.ts +1 -1
  101. package/dist/plugins/builtins/index.d.ts +1 -1
  102. package/dist/plugins/caching.d.ts +2 -2
  103. package/dist/plugins/clipboard/index.d.ts +2 -2
  104. package/dist/plugins/clipboard.d.ts +2 -2
  105. package/dist/plugins/clipboard.js.map +1 -1
  106. package/dist/plugins/context-menu/index.d.ts +1 -1
  107. package/dist/plugins/context-menu.d.ts +2 -2
  108. package/dist/plugins/context-menu.js +1 -1
  109. package/dist/plugins/context-menu.js.map +1 -1
  110. package/dist/plugins/createPlugin.d.ts +8 -0
  111. package/dist/plugins/data-export/index.d.ts +1 -1
  112. package/dist/plugins/data-export.d.ts +2 -2
  113. package/dist/plugins/data-export.js +2 -2
  114. package/dist/plugins/data-export.js.map +1 -1
  115. package/dist/plugins/data-transform.d.ts +2 -2
  116. package/dist/plugins/data-transform.js +19 -19
  117. package/dist/plugins/data-transform.js.map +1 -1
  118. package/dist/plugins/debug/index.d.ts +2 -2
  119. package/dist/plugins/debug.d.ts +2 -2
  120. package/dist/plugins/debug.js +33 -33
  121. package/dist/plugins/debug.js.map +1 -1
  122. package/dist/plugins/forecasting/index.d.ts +1 -1
  123. package/dist/plugins/forecasting.js.map +1 -1
  124. package/dist/plugins/gpu/index.d.ts +2 -2
  125. package/dist/plugins/gpu.d.ts +2 -2
  126. package/dist/plugins/gpu.js +2033 -209
  127. package/dist/plugins/gpu.js.map +1 -1
  128. package/dist/plugins/i18n/index.d.ts +2 -2
  129. package/dist/plugins/i18n.d.ts +2 -2
  130. package/dist/plugins/i18n.js +286 -23
  131. package/dist/plugins/i18n.js.map +1 -1
  132. package/dist/plugins/index.d.ts +1 -1
  133. package/dist/plugins/keyboard.d.ts +2 -2
  134. package/dist/plugins/keyboard.js +65 -5
  135. package/dist/plugins/keyboard.js.map +1 -1
  136. package/dist/plugins/latex.js +766 -207
  137. package/dist/plugins/latex.js.map +1 -1
  138. package/dist/plugins/lazy-load.d.ts +2 -2
  139. package/dist/plugins/loading/index.d.ts +2 -3
  140. package/dist/plugins/loading.d.ts +2 -2
  141. package/dist/plugins/loading.js +3 -4
  142. package/dist/plugins/ml-integration.d.ts +2 -2
  143. package/dist/plugins/ml-integration.js +5 -5
  144. package/dist/plugins/ml-integration.js.map +1 -1
  145. package/dist/plugins/offscreen.d.ts +2 -2
  146. package/dist/plugins/offscreen.js +11 -10
  147. package/dist/plugins/offscreen.js.map +1 -1
  148. package/dist/plugins/pattern-recognition.d.ts +2 -2
  149. package/dist/plugins/pattern-recognition.js +1 -1
  150. package/dist/plugins/pattern-recognition.js.map +1 -1
  151. package/dist/plugins/radar.d.ts +2 -2
  152. package/dist/plugins/regression.d.ts +2 -2
  153. package/dist/plugins/regression.js +255 -257
  154. package/dist/plugins/regression.js.map +1 -1
  155. package/dist/plugins/roi.js +9 -9
  156. package/dist/plugins/roi.js.map +1 -1
  157. package/dist/plugins/snapshot/index.d.ts +1 -1
  158. package/dist/plugins/snapshot/types.d.ts +1 -1
  159. package/dist/plugins/snapshot.d.ts +2 -2
  160. package/dist/plugins/snapshot.js.map +1 -1
  161. package/dist/plugins/streaming/index.d.ts +2 -2
  162. package/dist/plugins/streaming.d.ts +2 -2
  163. package/dist/plugins/streaming.js +1 -1
  164. package/dist/plugins/sync/index.d.ts +3 -2
  165. package/dist/plugins/sync.d.ts +2 -2
  166. package/dist/plugins/sync.js.map +1 -1
  167. package/dist/plugins/theme-editor/index.d.ts +1 -1
  168. package/dist/plugins/theme-editor.d.ts +2 -2
  169. package/dist/plugins/tools/index.d.ts +1 -1
  170. package/dist/plugins/tools/tooltip/index.d.ts +1 -1
  171. package/dist/plugins/tools.d.ts +2 -2
  172. package/dist/plugins/tools.js +1 -1
  173. package/dist/plugins/types.d.ts +1 -1
  174. package/dist/plugins/video-recorder.d.ts +2 -2
  175. package/dist/plugins/virtualization.d.ts +2 -2
  176. package/dist/plugins/virtualization.js +1 -1
  177. package/dist/pool-DZ8shSqv.js +109 -0
  178. package/dist/pool-DZ8shSqv.js.map +1 -0
  179. package/dist/react/StackedPlot.d.ts +31 -0
  180. package/dist/react/VeloPlot.d.ts +29 -0
  181. package/dist/react/index.d.ts +25 -3
  182. package/dist/react/useChartSync.d.ts +8 -0
  183. package/dist/react/useIndicator.d.ts +12 -0
  184. package/dist/react/useVeloPlot.d.ts +19 -0
  185. package/dist/react.js +325 -24
  186. package/dist/react.js.map +1 -1
  187. package/dist/renderer/NativeWebGLRenderer.d.ts +2 -1
  188. package/dist/renderer/native/NativeWebGLRenderer.d.ts +5 -1
  189. package/dist/renderer/native/draw.d.ts +2 -47
  190. package/dist/renderer/native/drawCore.d.ts +27 -0
  191. package/dist/renderer/native/drawExtended.d.ts +29 -0
  192. package/dist/renderer/native/frameRenderExtended.d.ts +1 -0
  193. package/dist/renderer/native/frameRenderRegistry.d.ts +27 -0
  194. package/dist/renderer/native/programFactoryCore.d.ts +6 -0
  195. package/dist/renderer/native/programFactoryExtended.d.ts +4 -0
  196. package/dist/renderer/native/utils.d.ts +3 -29
  197. package/dist/renderer/native/utilsCore.d.ts +14 -0
  198. package/dist/renderer/native/utilsExtended.d.ts +17 -0
  199. package/dist/renderer/overlaySeriesExtended.d.ts +1 -0
  200. package/dist/renderer/registerExtendedSeries.d.ts +1 -0
  201. package/dist/renderer/registerWebGPU.d.ts +2 -0
  202. package/dist/renderer/seriesBufferExtended.d.ts +4 -0
  203. package/dist/scientific/index.d.ts +44 -0
  204. package/dist/scientific/registerScientific.d.ts +1 -0
  205. package/dist/scientific.d.ts +1 -0
  206. package/dist/scientific.js +91 -0
  207. package/dist/scientific.js.map +1 -0
  208. package/dist/solid/VeloPlot.d.ts +16 -0
  209. package/dist/solid/index.d.ts +13 -0
  210. package/dist/solid/useChartSync.d.ts +6 -0
  211. package/dist/solid/useIndicator.d.ts +11 -0
  212. package/dist/solid/useStackedPlot.d.ts +14 -0
  213. package/dist/solid/useVeloPlot.d.ts +18 -0
  214. package/dist/solid.d.ts +1 -0
  215. package/dist/solid.js +169 -0
  216. package/dist/solid.js.map +1 -0
  217. package/dist/stackedSync-tnrunZMt.js +100 -0
  218. package/dist/stackedSync-tnrunZMt.js.map +1 -0
  219. package/dist/svelte/StackedPlot.svelte +29 -0
  220. package/dist/svelte/StackedPlot.test.ts +114 -0
  221. package/dist/svelte/VeloPlot.svelte +44 -0
  222. package/dist/svelte/VeloPlot.test.ts +105 -0
  223. package/dist/svelte/index.d.ts +11 -0
  224. package/dist/svelte/index.test.ts +20 -0
  225. package/dist/svelte/index.ts +15 -0
  226. package/dist/svelte/useChartSync.d.ts +8 -0
  227. package/dist/svelte/useChartSync.test.ts +49 -0
  228. package/dist/svelte/useChartSync.ts +29 -0
  229. package/dist/svelte/useIndicator.d.ts +13 -0
  230. package/dist/svelte/useIndicator.test.ts +67 -0
  231. package/dist/svelte/useIndicator.ts +43 -0
  232. package/dist/svelte/useStackedPlot.d.ts +16 -0
  233. package/dist/svelte/useStackedPlot.test.ts +76 -0
  234. package/dist/svelte/useStackedPlot.ts +54 -0
  235. package/dist/svelte/useVeloPlot.d.ts +21 -0
  236. package/dist/svelte/useVeloPlot.test.ts +100 -0
  237. package/dist/svelte/useVeloPlot.ts +81 -0
  238. package/dist/svelte.d.ts +1 -0
  239. package/dist/svelte.js +140 -0
  240. package/dist/svelte.js.map +1 -0
  241. package/dist/testing/index.d.ts +1 -1
  242. package/dist/theme/index.d.ts +2 -1
  243. package/dist/trading/index.d.ts +1 -4
  244. package/dist/trading/registerTrading.d.ts +3 -0
  245. package/dist/trading.js +42 -42
  246. package/dist/types.d.ts +4 -4
  247. package/dist/{utils-BK5UUXxj.js → utils-Dx0h0bgQ.js} +9 -9
  248. package/dist/{utils-BK5UUXxj.js.map → utils-Dx0h0bgQ.js.map} +1 -1
  249. package/dist/velo-plot.full.js +2216 -1346
  250. package/dist/velo-plot.full.js.map +1 -1
  251. package/dist/velo-plot.js +33 -28
  252. package/dist/velo-plot.js.map +1 -1
  253. package/dist/vue/StackedPlot.vue.d.ts +48 -0
  254. package/dist/vue/VeloPlot.vue.d.ts +64 -0
  255. package/dist/vue/index.d.ts +250 -0
  256. package/dist/vue/useChartSync.d.ts +52 -0
  257. package/dist/vue/useIndicator.d.ts +23 -0
  258. package/dist/vue/useStackedPlot.d.ts +15 -0
  259. package/dist/vue/useVeloPlot.d.ts +20 -0
  260. package/dist/vue.d.ts +1 -0
  261. package/dist/vue.js +309 -0
  262. package/dist/vue.js.map +1 -0
  263. package/dist/workers/indicatorsAsync.d.ts +2 -0
  264. package/dist/workers/pool.d.ts +9 -0
  265. package/package.json +96 -10
  266. package/dist/ChartCore-ivzLqxVb.js +0 -8350
  267. package/dist/ChartCore-ivzLqxVb.js.map +0 -1
  268. package/dist/SciPlot-CEU4ApgD.js +0 -463
  269. package/dist/SciPlot-CEU4ApgD.js.map +0 -1
  270. package/dist/createStackedChart-DxNW0VkF.js +0 -705
  271. package/dist/createStackedChart-DxNW0VkF.js.map +0 -1
  272. package/dist/gpuRenderer-BpaMYz-k.js +0 -1848
  273. package/dist/gpuRenderer-BpaMYz-k.js.map +0 -1
  274. package/dist/index-BBpJwOct.js.map +0 -1
  275. package/dist/index-BMiZoKmm.js.map +0 -1
  276. package/dist/index-DoYxf1cV.js.map +0 -1
  277. package/dist/index-qunX30Xu.js.map +0 -1
  278. package/dist/index-x4stH3jD.js +0 -282
  279. package/dist/index-x4stH3jD.js.map +0 -1
  280. package/dist/index.core-COREBDNq.js.map +0 -1
  281. package/dist/mockDatafeed-927foCM4.js.map +0 -1
  282. package/dist/pool-15HMCNv8.js +0 -88
  283. package/dist/pool-15HMCNv8.js.map +0 -1
  284. package/dist/react/SciPlot.d.ts +0 -60
  285. package/dist/react/useSciPlot.d.ts +0 -56
  286. package/dist/symbols-DT0eLlpW.js +0 -568
  287. package/dist/symbols-DT0eLlpW.js.map +0 -1
@@ -1,67 +1,139 @@
1
- function j(r, e) {
1
+ function it(r) {
2
+ const e = r.close.length, s = new Float32Array(e), n = new Float32Array(e), i = new Float32Array(e), c = new Float32Array(e);
3
+ for (let l = 0; l < e; l++) {
4
+ const d = r.open[l], h = r.high[l], u = r.low[l], x = r.close[l];
5
+ c[l] = (d + h + u + x) / 4, s[l] = l === 0 ? (d + x) / 2 : (s[l - 1] + c[l - 1]) / 2, n[l] = Math.max(h, s[l], c[l]), i[l] = Math.min(u, s[l], c[l]);
6
+ }
7
+ return { open: s, high: n, low: i, close: c };
8
+ }
9
+ function lt(r) {
10
+ const e = r.length, s = new Float64Array(e), n = new Float32Array(e), i = new Float32Array(e), c = new Float32Array(e), l = new Float32Array(e), d = new Float32Array(e);
11
+ for (let h = 0; h < e; h++) {
12
+ const u = r[h];
13
+ s[h] = u.time, n[h] = u.open, i[h] = u.high, c[h] = u.low, l[h] = u.close, d[h] = u.volume ?? 0;
14
+ }
15
+ return { x: s, open: n, high: i, low: c, close: l, volume: d };
16
+ }
17
+ function j(r) {
18
+ let e = r;
19
+ return () => (e = e * 16807 % 2147483647, (e - 1) / 2147483646);
20
+ }
21
+ function J(r, e, s, n, i) {
22
+ const c = [];
23
+ let l = n;
24
+ for (let d = r; d <= e; d += s) {
25
+ const h = l, u = (i() - 0.48) * 2, x = Math.max(1, h + u), y = Math.max(h, x) + i() * 1.5, k = Math.min(h, x) - i() * 1.5;
26
+ c.push({
27
+ time: d,
28
+ open: h,
29
+ high: y,
30
+ low: k,
31
+ close: x,
32
+ volume: 1e3 + i() * 5e3
33
+ }), l = x;
34
+ }
35
+ return c;
36
+ }
37
+ function ct(r = {}) {
38
+ const e = r.barMs ?? 6e4, s = r.basePrice ?? 100, n = j(r.seed ?? 42), i = /* @__PURE__ */ new Map();
39
+ return {
40
+ async resolveSymbol(c) {
41
+ return {
42
+ symbol: c,
43
+ name: c,
44
+ description: `Mock symbol ${c}`,
45
+ timezone: "UTC",
46
+ session: "24x7",
47
+ pricescale: 100
48
+ };
49
+ },
50
+ async getBars(c) {
51
+ const l = `${c.symbol}:${c.from}:${c.to}`;
52
+ return i.has(l) || i.set(
53
+ l,
54
+ J(c.from, c.to, e, s, n)
55
+ ), i.get(l);
56
+ },
57
+ subscribeBars(c) {
58
+ let l = s + n() * 5;
59
+ const d = setInterval(() => {
60
+ const h = l, u = Math.max(1, h + (n() - 0.5) * 2), x = Math.max(h, u) + n(), y = Math.min(h, u) - n();
61
+ c.onBar({
62
+ time: Date.now(),
63
+ open: h,
64
+ high: x,
65
+ low: y,
66
+ close: u,
67
+ volume: 1e3 + n() * 3e3
68
+ }), l = u;
69
+ }, e);
70
+ return () => clearInterval(d);
71
+ }
72
+ };
73
+ }
74
+ function K(r, e) {
2
75
  if (r.length === 0) return -1;
3
76
  let s = 0, n = Math.abs(r[0] - e);
4
77
  for (let i = 1; i < r.length; i++) {
5
- const f = Math.abs(r[i] - e);
6
- f < n && (n = f, s = i);
78
+ const c = Math.abs(r[i] - e);
79
+ c < n && (n = c, s = i);
7
80
  }
8
81
  return s;
9
82
  }
10
- function J(r) {
83
+ function Q(r) {
11
84
  if (r.barX.length === 0)
12
85
  return { x: r.x, y: r.y };
13
- const e = j(r.barX, r.x);
86
+ const e = K(r.barX, r.x);
14
87
  if (e < 0) return { x: r.x, y: r.y };
15
88
  const s = r.barX[e], n = [
16
89
  r.open[e],
17
90
  r.high[e],
18
91
  r.low[e],
19
92
  r.close[e]
20
- ], i = r.dataToPixelY(r.y), f = r.pixelThreshold ?? 12;
21
- let m = r.y, d = 1 / 0;
22
- for (const c of n) {
23
- const h = r.dataToPixelY(c), x = Math.abs(h - i);
24
- x < d && x <= f && (d = x, m = c);
93
+ ], i = r.dataToPixelY(r.y), c = r.pixelThreshold ?? 12;
94
+ let l = r.y, d = 1 / 0;
95
+ for (const h of n) {
96
+ const u = r.dataToPixelY(h), x = Math.abs(u - i);
97
+ x < d && x <= c && (d = x, l = h);
25
98
  }
26
- return { x: s, y: m };
99
+ return { x: s, y: l };
27
100
  }
28
- function $(r, e) {
29
- const s = e.y - r.y, n = Math.abs(r.y), i = n > 0 ? s / n * 100 : 0, f = Math.round(Math.abs(e.x - r.x));
30
- return { change: s, percent: i, bars: f, up: s >= 0 };
101
+ function L(r, e) {
102
+ const s = e.y - r.y, n = Math.abs(r.y), i = n > 0 ? s / n * 100 : 0, c = Math.round(Math.abs(e.x - r.x));
103
+ return { change: s, percent: i, bars: c, up: s >= 0 };
31
104
  }
32
- function L(r) {
105
+ function U(r) {
33
106
  const e = r.change >= 0 ? "+" : "";
34
107
  return `${e}${r.change.toFixed(2)} (${e}${r.percent.toFixed(2)}%) · ${r.bars} bars`;
35
108
  }
36
- function U(r) {
109
+ function Y(r) {
37
110
  const e = Math.abs(r), s = e >= 1e3 ? 0 : e >= 1 ? 2 : 4;
38
111
  return r.toLocaleString("en-US", {
39
112
  minimumFractionDigits: s,
40
113
  maximumFractionDigits: s
41
114
  });
42
115
  }
43
- const Y = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1], K = 4, Q = "#26a69a", Z = "#ef5350";
44
- function E(r, e) {
116
+ const E = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1], Z = 4, C = "#26a69a", tt = "#ef5350";
117
+ function B(r, e) {
45
118
  return r.startsWith("#") && r.length === 7 ? r + e : r;
46
119
  }
47
- const C = {
120
+ const et = {
48
121
  name: "velo-plot-drawing-tools",
49
122
  version: "1.0.0",
50
123
  description: "Interactive trendline, horizontal, vertical, rectangle, and fibonacci drawing",
51
124
  provides: ["drawing"],
52
125
  tags: ["drawing", "annotations", "trading"]
53
126
  };
54
- function B(r) {
127
+ function W(r) {
55
128
  return r !== "none" && r !== "pan";
56
129
  }
57
- function tt(r) {
130
+ function nt(r) {
58
131
  for (const e of r.data.getAllSeries())
59
132
  if (e.getType() === "candlestick") return e;
60
133
  }
61
- function it(r = {}) {
134
+ function ht(r = {}) {
62
135
  let e = null;
63
- const s = r.autoDeselect !== !1;
64
- let n = {
136
+ const s = r.autoDeselect !== !1, n = {
65
137
  mode: "none",
66
138
  pending: null,
67
139
  start: null,
@@ -72,52 +144,51 @@ function it(r = {}) {
72
144
  magnet: r.magnet ?? !1,
73
145
  undoStack: [],
74
146
  redoStack: []
75
- };
76
- const i = r.color ?? "#38bdf8", f = r.measureUpColor ?? Q, m = r.measureDownColor ?? Z;
147
+ }, i = r.color ?? "#38bdf8", c = r.measureUpColor ?? C, l = r.measureDownColor ?? tt;
77
148
  function d() {
78
149
  var t, o;
79
150
  return ((o = e == null ? void 0 : (t = e.chart).getAnnotations) == null ? void 0 : o.call(t)) ?? [];
80
151
  }
81
- function c() {
152
+ function h() {
82
153
  n.undoStack.push(d()), n.redoStack = [];
83
154
  }
84
- function h() {
155
+ function u() {
85
156
  n.pending = null, n.start = null, n.dragging = !1, n.dragMoved = !1, n.dragStartPixel = null;
86
157
  }
87
158
  function x(t) {
88
159
  var o, a;
89
- n.mode = t, h(), (o = r.onModeChange) == null || o.call(r, t), (a = e == null ? void 0 : e.requestRender) == null || a.call(e);
160
+ n.mode = t, u(), (o = r.onModeChange) == null || o.call(r, t), (a = e == null ? void 0 : e.requestRender) == null || a.call(e);
90
161
  }
91
- function u() {
162
+ function y() {
92
163
  var t;
93
- h(), s ? x("none") : (t = e == null ? void 0 : e.requestRender) == null || t.call(e);
164
+ u(), s ? x("none") : (t = e == null ? void 0 : e.requestRender) == null || t.call(e);
94
165
  }
95
- function T(t, o) {
166
+ function k(t, o) {
96
167
  if (!e || !n.magnet) return { x: t, y: o };
97
- const a = tt(e);
168
+ const a = nt(e);
98
169
  if (!a) return { x: t, y: o };
99
- const l = a.getData();
100
- return !l.open || !l.high || !l.low || !l.close ? { x: t, y: o } : J({
170
+ const f = a.getData();
171
+ return !f.open || !f.high || !f.low || !f.close ? { x: t, y: o } : Q({
101
172
  x: t,
102
173
  y: o,
103
- barX: l.x,
104
- open: l.open,
105
- high: l.high,
106
- low: l.low,
107
- close: l.close,
174
+ barX: f.x,
175
+ open: f.open,
176
+ high: f.high,
177
+ low: f.low,
178
+ close: f.close,
108
179
  dataToPixelX: e.coords.dataToPixelX,
109
- dataToPixelY: (y) => e.coords.dataToPixelY(y),
180
+ dataToPixelY: (m) => e.coords.dataToPixelY(m),
110
181
  enabled: !0
111
182
  });
112
183
  }
113
- function k(t, o) {
114
- return T(
184
+ function b(t, o) {
185
+ return k(
115
186
  t.coords.pixelToDataX(o.pixelX),
116
187
  t.coords.pixelToDataY(o.pixelY)
117
188
  );
118
189
  }
119
- function W(t) {
120
- e && (c(), e.chart.addAnnotation({
190
+ function D(t) {
191
+ e && (h(), e.chart.addAnnotation({
121
192
  type: "horizontal-line",
122
193
  y: t,
123
194
  color: i,
@@ -125,7 +196,7 @@ function it(r = {}) {
125
196
  }));
126
197
  }
127
198
  function z(t) {
128
- e && (c(), e.chart.addAnnotation({
199
+ e && (h(), e.chart.addAnnotation({
129
200
  type: "vertical-line",
130
201
  x: t,
131
202
  color: i,
@@ -134,46 +205,46 @@ function it(r = {}) {
134
205
  }
135
206
  function _(t, o) {
136
207
  if (!e) return;
137
- c();
138
- const a = $(t, o), l = a.up ? f : m, y = (t.x + o.x) / 2;
208
+ h();
209
+ const a = L(t, o), f = a.up ? c : l, m = (t.x + o.x) / 2;
139
210
  e.chart.addAnnotation({
140
211
  type: "rectangle",
141
212
  xMin: Math.min(t.x, o.x),
142
213
  xMax: Math.max(t.x, o.x),
143
214
  yMin: Math.min(t.y, o.y),
144
215
  yMax: Math.max(t.y, o.y),
145
- strokeColor: l,
146
- fillColor: E(l, "33"),
216
+ strokeColor: f,
217
+ fillColor: B(f, "33"),
147
218
  interactive: !0
148
219
  }), e.chart.addAnnotation({
149
220
  type: "arrow",
150
- x1: y,
221
+ x1: m,
151
222
  y1: t.y,
152
- x2: y,
223
+ x2: m,
153
224
  y2: o.y,
154
- color: l,
225
+ color: f,
155
226
  headStyle: "filled",
156
227
  interactive: !0
157
228
  }), e.chart.addAnnotation({
158
229
  type: "text",
159
- x: y,
230
+ x: m,
160
231
  y: o.y,
161
- text: L(a),
232
+ text: U(a),
162
233
  color: "#ffffff",
163
- backgroundColor: l,
234
+ backgroundColor: f,
164
235
  padding: 4,
165
236
  fontWeight: "bold",
166
237
  anchor: a.up ? "bottom-center" : "top-center",
167
238
  interactive: !0
168
239
  });
169
240
  }
170
- function F(t, o) {
241
+ function I(t, o) {
171
242
  if (e) {
172
243
  if (n.mode === "measure") {
173
244
  _(t, o);
174
245
  return;
175
246
  }
176
- if (c(), n.mode === "trendline")
247
+ if (h(), n.mode === "trendline")
177
248
  e.chart.addAnnotation({
178
249
  type: "arrow",
179
250
  x1: t.x,
@@ -195,15 +266,15 @@ function it(r = {}) {
195
266
  interactive: !0
196
267
  });
197
268
  else if (n.mode === "fibonacci") {
198
- const a = Math.min(t.y, o.y), l = Math.max(t.y, o.y);
199
- for (const y of Y) {
200
- const M = l - (l - a) * y;
269
+ const a = Math.min(t.y, o.y), f = Math.max(t.y, o.y);
270
+ for (const m of E) {
271
+ const M = f - (f - a) * m;
201
272
  e.chart.addAnnotation({
202
273
  type: "horizontal-line",
203
274
  y: M,
204
275
  color: i,
205
- lineDash: y === 0 || y === 1 ? void 0 : [4, 4],
206
- label: `${(y * 100).toFixed(1)}% ${U(M)}`,
276
+ lineDash: m === 0 || m === 1 ? void 0 : [4, 4],
277
+ label: `${(m * 100).toFixed(1)}% ${Y(M)}`,
207
278
  labelPosition: "right",
208
279
  interactive: !0
209
280
  });
@@ -212,94 +283,94 @@ function it(r = {}) {
212
283
  }
213
284
  }
214
285
  function H(t, o, a) {
215
- const l = n.mode;
216
- if (!B(l) || !n.cursor) return;
217
- const y = n.cursor, M = n.pending ?? n.start;
286
+ const f = n.mode;
287
+ if (!W(f) || !n.cursor) return;
288
+ const m = n.cursor, M = n.pending ?? n.start;
218
289
  t.save(), t.strokeStyle = i, t.lineWidth = 1.5, t.setLineDash([6, 4]), t.globalAlpha = 0.85;
219
- const b = (g, v) => ({
290
+ const v = (g, w) => ({
220
291
  px: a.dataToPixelX(g),
221
- py: a.dataToPixelY(v)
292
+ py: a.dataToPixelY(w)
222
293
  });
223
- if (l === "horizontal") {
224
- const { py: g } = b(0, y.y);
294
+ if (f === "horizontal") {
295
+ const { py: g } = v(0, m.y);
225
296
  t.beginPath(), t.moveTo(o.x, g), t.lineTo(o.x + o.width, g), t.stroke();
226
- } else if (l === "vertical") {
227
- const { px: g } = b(y.x, 0);
297
+ } else if (f === "vertical") {
298
+ const { px: g } = v(m.x, 0);
228
299
  t.beginPath(), t.moveTo(g, o.y), t.lineTo(g, o.y + o.height), t.stroke();
229
300
  } else if (M) {
230
- const g = b(M.x, M.y), v = b(y.x, y.y);
231
- if (l === "trendline")
232
- t.beginPath(), t.moveTo(g.px, g.py), t.lineTo(v.px, v.py), t.stroke();
233
- else if (l === "rectangle") {
234
- const S = Math.min(g.px, v.px), w = Math.min(g.py, v.py), p = Math.abs(v.px - g.px), P = Math.abs(v.py - g.py);
235
- t.strokeRect(S, w, p, P), t.fillStyle = i + "22", t.fillRect(S, w, p, P);
236
- } else if (l === "fibonacci") {
237
- const S = Math.min(M.y, y.y), w = Math.max(M.y, y.y);
301
+ const g = v(M.x, M.y), w = v(m.x, m.y);
302
+ if (f === "trendline")
303
+ t.beginPath(), t.moveTo(g.px, g.py), t.lineTo(w.px, w.py), t.stroke();
304
+ else if (f === "rectangle") {
305
+ const A = Math.min(g.px, w.px), P = Math.min(g.py, w.py), p = Math.abs(w.px - g.px), S = Math.abs(w.py - g.py);
306
+ t.strokeRect(A, P, p, S), t.fillStyle = i + "22", t.fillRect(A, P, p, S);
307
+ } else if (f === "fibonacci") {
308
+ const A = Math.min(M.y, m.y), P = Math.max(M.y, m.y);
238
309
  t.font = "11px sans-serif", t.textAlign = "left", t.textBaseline = "bottom";
239
- for (const p of Y) {
240
- const P = w - (w - S) * p, { py: A } = b(0, P);
241
- t.beginPath(), t.moveTo(o.x, A), t.lineTo(o.x + o.width, A), t.stroke(), t.save(), t.setLineDash([]), t.globalAlpha = 1, t.fillStyle = i, t.fillText(
242
- `${(p * 100).toFixed(1)}% ${U(P)}`,
310
+ for (const p of E) {
311
+ const S = P - (P - A) * p, { py: T } = v(0, S);
312
+ t.beginPath(), t.moveTo(o.x, T), t.lineTo(o.x + o.width, T), t.stroke(), t.save(), t.setLineDash([]), t.globalAlpha = 1, t.fillStyle = i, t.fillText(
313
+ `${(p * 100).toFixed(1)}% ${Y(S)}`,
243
314
  o.x + 4,
244
- A - 2
315
+ T - 2
245
316
  ), t.restore();
246
317
  }
247
- } else l === "measure" && O(t, g, v, M, y);
318
+ } else f === "measure" && O(t, g, w, M, m);
248
319
  }
249
320
  t.restore();
250
321
  }
251
- function O(t, o, a, l, y) {
252
- const M = $(l, y), b = M.up ? f : m, g = Math.min(o.px, a.px), v = Math.min(o.py, a.py), S = Math.abs(a.px - o.px), w = Math.abs(a.py - o.py);
253
- t.setLineDash([]), t.globalAlpha = 0.9, t.fillStyle = E(b, "33"), t.fillRect(g, v, S, w), t.strokeStyle = b, t.lineWidth = 1.5, t.strokeRect(g, v, S, w);
322
+ function O(t, o, a, f, m) {
323
+ const M = L(f, m), v = M.up ? c : l, g = Math.min(o.px, a.px), w = Math.min(o.py, a.py), A = Math.abs(a.px - o.px), P = Math.abs(a.py - o.py);
324
+ t.setLineDash([]), t.globalAlpha = 0.9, t.fillStyle = B(v, "33"), t.fillRect(g, w, A, P), t.strokeStyle = v, t.lineWidth = 1.5, t.strokeRect(g, w, A, P);
254
325
  const p = (o.px + a.px) / 2;
255
326
  t.beginPath(), t.moveTo(p, o.py), t.lineTo(p, a.py), t.stroke();
256
- const P = 7, A = a.py >= o.py ? 1 : -1;
257
- t.beginPath(), t.moveTo(p, a.py), t.lineTo(p - 4, a.py - A * P), t.lineTo(p + 4, a.py - A * P), t.closePath(), t.fillStyle = b, t.fill();
258
- const I = L(M);
327
+ const S = 7, T = a.py >= o.py ? 1 : -1;
328
+ t.beginPath(), t.moveTo(p, a.py), t.lineTo(p - 4, a.py - T * S), t.lineTo(p + 4, a.py - T * S), t.closePath(), t.fillStyle = v, t.fill();
329
+ const R = U(M);
259
330
  t.font = "12px sans-serif";
260
- const R = t.measureText(I).width + 6 * 2, D = 20, G = p - R / 2, X = M.up ? a.py - D - 8 : a.py + 8;
261
- t.globalAlpha = 1, t.fillStyle = b, t.fillRect(G, X, R, D), t.fillStyle = "#ffffff", t.textAlign = "center", t.textBaseline = "middle", t.fillText(I, p, X + D / 2);
331
+ const X = t.measureText(R).width + 6 * 2, F = 20, G = p - X / 2, $ = M.up ? a.py - F - 8 : a.py + 8;
332
+ t.globalAlpha = 1, t.fillStyle = v, t.fillRect(G, $, X, F), t.fillStyle = "#ffffff", t.textAlign = "center", t.textBaseline = "middle", t.fillText(R, p, $ + F / 2);
262
333
  }
263
334
  function N(t, o) {
264
- var l;
335
+ var f;
265
336
  if (!o.inPlotArea) return;
266
337
  o.preventDefault();
267
- const a = k(t, o);
338
+ const a = b(t, o);
268
339
  if (n.mode === "horizontal") {
269
- W(a.y), u();
340
+ D(a.y), y();
270
341
  return;
271
342
  }
272
343
  if (n.mode === "vertical") {
273
- z(a.x), u();
344
+ z(a.x), y();
274
345
  return;
275
346
  }
276
347
  if (n.pending) {
277
- F(n.pending, a), u();
348
+ I(n.pending, a), y();
278
349
  return;
279
350
  }
280
- n.start = a, n.dragging = !0, n.dragMoved = !1, n.dragStartPixel = { x: o.pixelX, y: o.pixelY }, n.cursor = a, (l = t.requestRender) == null || l.call(t);
351
+ n.start = a, n.dragging = !0, n.dragMoved = !1, n.dragStartPixel = { x: o.pixelX, y: o.pixelY }, n.cursor = a, (f = t.requestRender) == null || f.call(t);
281
352
  }
282
353
  function V(t, o) {
283
- var l;
284
- const a = k(t, o);
354
+ var f;
355
+ const a = b(t, o);
285
356
  if (n.cursor = a, n.dragging && n.dragStartPixel) {
286
- const y = o.pixelX - n.dragStartPixel.x, M = o.pixelY - n.dragStartPixel.y;
287
- Math.hypot(y, M) >= K && (n.dragMoved = !0);
357
+ const m = o.pixelX - n.dragStartPixel.x, M = o.pixelY - n.dragStartPixel.y;
358
+ Math.hypot(m, M) >= Z && (n.dragMoved = !0);
288
359
  }
289
- o.preventDefault(), (l = t.requestRender) == null || l.call(t);
360
+ o.preventDefault(), (f = t.requestRender) == null || f.call(t);
290
361
  }
291
362
  function q(t, o) {
292
- var y;
363
+ var m;
293
364
  if (!n.dragging || !n.start) return;
294
- const a = k(t, o), l = n.start;
365
+ const a = b(t, o), f = n.start;
295
366
  if (n.dragging = !1, n.dragStartPixel = null, n.dragMoved) {
296
- F(l, a), u();
367
+ I(f, a), y();
297
368
  return;
298
369
  }
299
- n.pending = l, n.start = null, n.cursor = a, (y = t.requestRender) == null || y.call(t);
370
+ n.pending = f, n.start = null, n.cursor = a, (m = t.requestRender) == null || m.call(t);
300
371
  }
301
372
  return {
302
- manifest: C,
373
+ manifest: et,
303
374
  api: {
304
375
  setMode(t) {
305
376
  x(t);
@@ -331,7 +402,7 @@ function it(r = {}) {
331
402
  },
332
403
  clear() {
333
404
  if (e) {
334
- c();
405
+ h();
335
406
  for (const t of d()) e.chart.removeAnnotation(t.id);
336
407
  }
337
408
  }
@@ -343,7 +414,7 @@ function it(r = {}) {
343
414
  e = null;
344
415
  },
345
416
  onInteraction(t, o) {
346
- if (B(n.mode)) {
417
+ if (W(n.mode)) {
347
418
  if (o.type === "mousedown") {
348
419
  N(t, o);
349
420
  return;
@@ -361,46 +432,49 @@ function it(r = {}) {
361
432
  }
362
433
  };
363
434
  }
364
- const et = {
435
+ const ot = {
365
436
  name: "velo-plot-replay",
366
437
  version: "1.0.0",
367
438
  description: "Bar-by-bar chart replay with speed control",
368
439
  provides: ["replay"],
369
440
  tags: ["replay", "trading"]
370
441
  };
371
- function lt(r) {
372
- let e = null, s = null, n = 0, i = null, f = 1;
373
- const m = r.frameMs ?? 250;
374
- function d(h) {
375
- if (!e || !s) return;
376
- const x = Math.min(h + 1, s.x.length), u = (T) => T ? T.subarray(0, x) : void 0;
377
- e.chart.updateSeries(r.seriesId, {
378
- x: u(s.x),
379
- y: u(s.y),
380
- open: u(s.open),
381
- high: u(s.high),
382
- low: u(s.low),
383
- close: u(s.close)
442
+ function ft(r) {
443
+ let e = null, s = null, n = 0, i = null, c = 1;
444
+ const l = r.frameMs ?? 250;
445
+ function d(u) {
446
+ const x = e, y = s, k = Math.min(u + 1, y.x.length), b = (D) => D ? D.subarray(0, k) : void 0;
447
+ x.chart.updateSeries(r.seriesId, {
448
+ x: b(y.x),
449
+ y: b(y.y),
450
+ open: b(y.open),
451
+ high: b(y.high),
452
+ low: b(y.low),
453
+ close: b(y.close)
384
454
  });
385
455
  }
386
- const c = {
387
- play(h = 1) {
388
- s && (f = Math.max(0.1, h), i && clearInterval(i), i = setInterval(() => {
456
+ const h = {
457
+ play(u = 1) {
458
+ s && (c = Math.max(0.1, u), i && clearInterval(i), i = setInterval(() => {
459
+ if (!e || !s) {
460
+ h.pause();
461
+ return;
462
+ }
389
463
  if (n >= s.x.length - 1) {
390
- c.pause();
464
+ h.pause();
391
465
  return;
392
466
  }
393
467
  n++, d(n);
394
- }, m / f));
468
+ }, l / c));
395
469
  },
396
470
  pause() {
397
471
  i && (clearInterval(i), i = null);
398
472
  },
399
- step(h = 1) {
400
- s && (n = Math.min(s.x.length - 1, n + h), d(n));
473
+ step(u = 1) {
474
+ s && (n = Math.min(s.x.length - 1, n + u), d(n));
401
475
  },
402
- seek(h) {
403
- s && (n = Math.max(0, Math.min(s.x.length - 1, h)), d(n));
476
+ seek(u) {
477
+ s && (n = Math.max(0, Math.min(s.x.length - 1, u)), d(n));
404
478
  },
405
479
  getIndex() {
406
480
  return n;
@@ -413,99 +487,35 @@ function lt(r) {
413
487
  }
414
488
  };
415
489
  return {
416
- manifest: et,
417
- api: c,
418
- onInit(h) {
419
- e = h;
490
+ manifest: ot,
491
+ api: h,
492
+ onInit(u) {
493
+ e = u;
420
494
  const x = e.chart.getSeries(r.seriesId);
421
495
  if (!x) {
422
496
  console.warn(`[PluginReplay] Series "${r.seriesId}" not found`);
423
497
  return;
424
498
  }
425
- const u = x.getData();
499
+ const y = x.getData();
426
500
  s = {
427
- x: Float32Array.from(u.x),
428
- y: u.y ? Float32Array.from(u.y) : void 0,
429
- open: u.open ? Float32Array.from(u.open) : void 0,
430
- high: u.high ? Float32Array.from(u.high) : void 0,
431
- low: u.low ? Float32Array.from(u.low) : void 0,
432
- close: u.close ? Float32Array.from(u.close) : void 0
501
+ x: Float32Array.from(y.x),
502
+ y: y.y ? Float32Array.from(y.y) : void 0,
503
+ open: y.open ? Float32Array.from(y.open) : void 0,
504
+ high: y.high ? Float32Array.from(y.high) : void 0,
505
+ low: y.low ? Float32Array.from(y.low) : void 0,
506
+ close: y.close ? Float32Array.from(y.close) : void 0
433
507
  }, n = Math.max(0, s.x.length - 1);
434
508
  },
435
509
  onDestroy() {
436
- c.pause(), e = null, s = null;
437
- }
438
- };
439
- }
440
- function ct(r) {
441
- const e = r.length, s = new Float64Array(e), n = new Float32Array(e), i = new Float32Array(e), f = new Float32Array(e), m = new Float32Array(e), d = new Float32Array(e);
442
- for (let c = 0; c < e; c++) {
443
- const h = r[c];
444
- s[c] = h.time, n[c] = h.open, i[c] = h.high, f[c] = h.low, m[c] = h.close, d[c] = h.volume ?? 0;
445
- }
446
- return { x: s, open: n, high: i, low: f, close: m, volume: d };
447
- }
448
- function nt(r) {
449
- let e = r;
450
- return () => (e = e * 16807 % 2147483647, (e - 1) / 2147483646);
451
- }
452
- function ot(r, e, s, n, i) {
453
- const f = [];
454
- let m = n;
455
- for (let d = r; d <= e; d += s) {
456
- const c = m, h = (i() - 0.48) * 2, x = Math.max(1, c + h), u = Math.max(c, x) + i() * 1.5, T = Math.min(c, x) - i() * 1.5;
457
- f.push({
458
- time: d,
459
- open: c,
460
- high: u,
461
- low: T,
462
- close: x,
463
- volume: 1e3 + i() * 5e3
464
- }), m = x;
465
- }
466
- return f;
467
- }
468
- function ft(r = {}) {
469
- const e = r.barMs ?? 6e4, s = r.basePrice ?? 100, n = nt(r.seed ?? 42), i = /* @__PURE__ */ new Map();
470
- return {
471
- async resolveSymbol(f) {
472
- return {
473
- symbol: f,
474
- name: f,
475
- description: `Mock symbol ${f}`,
476
- timezone: "UTC",
477
- session: "24x7",
478
- pricescale: 100
479
- };
480
- },
481
- async getBars(f) {
482
- const m = `${f.symbol}:${f.from}:${f.to}`;
483
- return i.has(m) || i.set(
484
- m,
485
- ot(f.from, f.to, e, s, n)
486
- ), i.get(m);
487
- },
488
- subscribeBars(f) {
489
- let m = s + n() * 5;
490
- const d = setInterval(() => {
491
- const c = m, h = Math.max(1, c + (n() - 0.5) * 2), x = Math.max(c, h) + n(), u = Math.min(c, h) - n();
492
- f.onBar({
493
- time: Date.now(),
494
- open: c,
495
- high: x,
496
- low: u,
497
- close: h,
498
- volume: 1e3 + n() * 3e3
499
- }), m = h;
500
- }, e);
501
- return () => clearInterval(d);
510
+ h.pause(), e = null, s = null;
502
511
  }
503
512
  };
504
513
  }
505
514
  export {
506
- it as P,
507
- lt as a,
508
- ct as b,
509
- ft as c
515
+ ht as P,
516
+ ft as a,
517
+ lt as b,
518
+ it as c,
519
+ ct as d
510
520
  };
511
- //# sourceMappingURL=mockDatafeed-927foCM4.js.map
521
+ //# sourceMappingURL=index-Cv6ZDLWf.js.map