@devexperts/dxcharts-lite 1.0.1

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 (364) hide show
  1. package/LICENSE +151 -0
  2. package/README.md +184 -0
  3. package/dist/chart/animation/canvas-animation.d.ts +96 -0
  4. package/dist/chart/animation/canvas-animation.js +6 -0
  5. package/dist/chart/animation/types/animation.d.ts +35 -0
  6. package/dist/chart/animation/types/animation.js +6 -0
  7. package/dist/chart/animation/types/color-alpha-animation.d.ts +43 -0
  8. package/dist/chart/animation/types/color-alpha-animation.js +6 -0
  9. package/dist/chart/animation/types/color-transition-animation.d.ts +59 -0
  10. package/dist/chart/animation/types/color-transition-animation.js +6 -0
  11. package/dist/chart/animation/types/viewport-movement-animation.d.ts +44 -0
  12. package/dist/chart/animation/types/viewport-movement-animation.js +6 -0
  13. package/dist/chart/animation/viewport-model-animation.d.ts +15 -0
  14. package/dist/chart/animation/viewport-model-animation.js +6 -0
  15. package/dist/chart/bootstrap.d.ts +266 -0
  16. package/dist/chart/bootstrap.js +6 -0
  17. package/dist/chart/canvas/canvas-bounds-container.d.ts +347 -0
  18. package/dist/chart/canvas/canvas-bounds-container.js +6 -0
  19. package/dist/chart/canvas/canvas-chart-html.d.ts +7 -0
  20. package/dist/chart/canvas/canvas-chart-html.js +23 -0
  21. package/dist/chart/canvas/chart-elements.d.ts +22 -0
  22. package/dist/chart/canvas/chart-elements.js +6 -0
  23. package/dist/chart/canvas/cursor.handler.d.ts +71 -0
  24. package/dist/chart/canvas/cursor.handler.js +6 -0
  25. package/dist/chart/canvas/layout-creator.d.ts +20 -0
  26. package/dist/chart/canvas/layout-creator.js +6 -0
  27. package/dist/chart/canvas/y-axis-bounds.container.d.ts +54 -0
  28. package/dist/chart/canvas/y-axis-bounds.container.js +6 -0
  29. package/dist/chart/chart-container.d.ts +18 -0
  30. package/dist/chart/chart-container.js +6 -0
  31. package/dist/chart/chart.config.d.ts +774 -0
  32. package/dist/chart/chart.config.js +6 -0
  33. package/dist/chart/components/chart/basic-scale.d.ts +22 -0
  34. package/dist/chart/components/chart/basic-scale.js +6 -0
  35. package/dist/chart/components/chart/candle-transformer.functions.d.ts +11 -0
  36. package/dist/chart/components/chart/candle-transformer.functions.js +6 -0
  37. package/dist/chart/components/chart/candle-width-calculator.functions.d.ts +7 -0
  38. package/dist/chart/components/chart/candle-width-calculator.functions.js +6 -0
  39. package/dist/chart/components/chart/candle.functions.d.ts +19 -0
  40. package/dist/chart/components/chart/candle.functions.js +6 -0
  41. package/dist/chart/components/chart/chart-area-pan.handler.d.ts +88 -0
  42. package/dist/chart/components/chart/chart-area-pan.handler.js +6 -0
  43. package/dist/chart/components/chart/chart-base.model.d.ts +55 -0
  44. package/dist/chart/components/chart/chart-base.model.js +6 -0
  45. package/dist/chart/components/chart/chart.component.d.ts +251 -0
  46. package/dist/chart/components/chart/chart.component.js +6 -0
  47. package/dist/chart/components/chart/chart.model.d.ts +448 -0
  48. package/dist/chart/components/chart/chart.model.js +6 -0
  49. package/dist/chart/components/chart/data-series.high-low-provider.d.ts +25 -0
  50. package/dist/chart/components/chart/data-series.high-low-provider.js +6 -0
  51. package/dist/chart/components/chart/fake-candles.d.ts +18 -0
  52. package/dist/chart/components/chart/fake-candles.js +6 -0
  53. package/dist/chart/components/chart/price.formatter.d.ts +12 -0
  54. package/dist/chart/components/chart/price.formatter.js +6 -0
  55. package/dist/chart/components/chart/secondary-chart-colors-pool.d.ts +43 -0
  56. package/dist/chart/components/chart/secondary-chart-colors-pool.js +6 -0
  57. package/dist/chart/components/cross_tool/cross-tool.component.d.ts +69 -0
  58. package/dist/chart/components/cross_tool/cross-tool.component.js +6 -0
  59. package/dist/chart/components/cross_tool/cross-tool.drawer.d.ts +32 -0
  60. package/dist/chart/components/cross_tool/cross-tool.drawer.js +6 -0
  61. package/dist/chart/components/cross_tool/cross-tool.model.d.ts +63 -0
  62. package/dist/chart/components/cross_tool/cross-tool.model.js +6 -0
  63. package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.d.ts +44 -0
  64. package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.js +6 -0
  65. package/dist/chart/components/cross_tool/types/none.drawer.d.ts +9 -0
  66. package/dist/chart/components/cross_tool/types/none.drawer.js +6 -0
  67. package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.d.ts +27 -0
  68. package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +6 -0
  69. package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.d.ts +23 -0
  70. package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +6 -0
  71. package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.d.ts +46 -0
  72. package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +6 -0
  73. package/dist/chart/components/events/events-hit-test.drawer.d.ts +34 -0
  74. package/dist/chart/components/events/events-hit-test.drawer.js +6 -0
  75. package/dist/chart/components/events/events.component.d.ts +45 -0
  76. package/dist/chart/components/events/events.component.js +6 -0
  77. package/dist/chart/components/events/events.drawer.d.ts +87 -0
  78. package/dist/chart/components/events/events.drawer.js +6 -0
  79. package/dist/chart/components/events/events.model.d.ts +64 -0
  80. package/dist/chart/components/events/events.model.js +6 -0
  81. package/dist/chart/components/grid/grid.component.d.ts +34 -0
  82. package/dist/chart/components/grid/grid.component.js +6 -0
  83. package/dist/chart/components/grid/grid.drawer.d.ts +55 -0
  84. package/dist/chart/components/grid/grid.drawer.js +6 -0
  85. package/dist/chart/components/high_low/high-low.component.d.ts +17 -0
  86. package/dist/chart/components/high_low/high-low.component.js +6 -0
  87. package/dist/chart/components/high_low/high-low.drawer.d.ts +69 -0
  88. package/dist/chart/components/high_low/high-low.drawer.js +6 -0
  89. package/dist/chart/components/highlights/highlights.component.d.ts +42 -0
  90. package/dist/chart/components/highlights/highlights.component.js +6 -0
  91. package/dist/chart/components/highlights/highlights.drawer.d.ts +56 -0
  92. package/dist/chart/components/highlights/highlights.drawer.js +6 -0
  93. package/dist/chart/components/highlights/highlights.model.d.ts +66 -0
  94. package/dist/chart/components/highlights/highlights.model.js +6 -0
  95. package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +63 -0
  96. package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +6 -0
  97. package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +36 -0
  98. package/dist/chart/components/navigation_map/navigation-map-move.handler.js +6 -0
  99. package/dist/chart/components/navigation_map/navigation-map.component.d.ts +52 -0
  100. package/dist/chart/components/navigation_map/navigation-map.component.js +6 -0
  101. package/dist/chart/components/navigation_map/navigation-map.drawer.d.ts +96 -0
  102. package/dist/chart/components/navigation_map/navigation-map.drawer.js +6 -0
  103. package/dist/chart/components/navigation_map/navigation-map.model.d.ts +25 -0
  104. package/dist/chart/components/navigation_map/navigation-map.model.js +7 -0
  105. package/dist/chart/components/pan/chart-pan.component.d.ts +52 -0
  106. package/dist/chart/components/pan/chart-pan.component.js +6 -0
  107. package/dist/chart/components/pane/extent/y-extent-component.d.ts +91 -0
  108. package/dist/chart/components/pane/extent/y-extent-component.js +6 -0
  109. package/dist/chart/components/pane/pane-hit-test.controller.d.ts +39 -0
  110. package/dist/chart/components/pane/pane-hit-test.controller.js +6 -0
  111. package/dist/chart/components/pane/pane-manager.component.d.ts +87 -0
  112. package/dist/chart/components/pane/pane-manager.component.js +6 -0
  113. package/dist/chart/components/pane/pane.component.d.ts +193 -0
  114. package/dist/chart/components/pane/pane.component.js +6 -0
  115. package/dist/chart/components/resizer/bar-resizer.component.d.ts +72 -0
  116. package/dist/chart/components/resizer/bar-resizer.component.js +6 -0
  117. package/dist/chart/components/resizer/bar-resizer.drawer.d.ts +34 -0
  118. package/dist/chart/components/resizer/bar-resizer.drawer.js +6 -0
  119. package/dist/chart/components/snapshot/snapshot.component.d.ts +31 -0
  120. package/dist/chart/components/snapshot/snapshot.component.js +6 -0
  121. package/dist/chart/components/volumes/separate-volumes.component.d.ts +45 -0
  122. package/dist/chart/components/volumes/separate-volumes.component.js +6 -0
  123. package/dist/chart/components/volumes/volume-color-resolvers.functions.d.ts +11 -0
  124. package/dist/chart/components/volumes/volume-color-resolvers.functions.js +6 -0
  125. package/dist/chart/components/volumes/volumes.component.d.ts +59 -0
  126. package/dist/chart/components/volumes/volumes.component.js +6 -0
  127. package/dist/chart/components/volumes/volumes.drawer.d.ts +71 -0
  128. package/dist/chart/components/volumes/volumes.drawer.js +6 -0
  129. package/dist/chart/components/volumes/volumes.formatter.d.ts +6 -0
  130. package/dist/chart/components/volumes/volumes.formatter.js +6 -0
  131. package/dist/chart/components/volumes/volumes.model.d.ts +32 -0
  132. package/dist/chart/components/volumes/volumes.model.js +6 -0
  133. package/dist/chart/components/watermark/water-mark.component.d.ts +75 -0
  134. package/dist/chart/components/watermark/water-mark.component.js +6 -0
  135. package/dist/chart/components/watermark/water-mark.drawer.d.ts +68 -0
  136. package/dist/chart/components/watermark/water-mark.drawer.js +6 -0
  137. package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.d.ts +25 -0
  138. package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.js +6 -0
  139. package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.d.ts +55 -0
  140. package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.js +6 -0
  141. package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.d.ts +23 -0
  142. package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.js +6 -0
  143. package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.d.ts +28 -0
  144. package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.js +6 -0
  145. package/dist/chart/components/x_axis/time/parser/time-formats.model.d.ts +33 -0
  146. package/dist/chart/components/x_axis/time/parser/time-formats.model.js +6 -0
  147. package/dist/chart/components/x_axis/time/x-axis-weights.functions.d.ts +62 -0
  148. package/dist/chart/components/x_axis/time/x-axis-weights.functions.js +6 -0
  149. package/dist/chart/components/x_axis/time/x-axis-weights.generator.d.ts +33 -0
  150. package/dist/chart/components/x_axis/time/x-axis-weights.generator.js +6 -0
  151. package/dist/chart/components/x_axis/x-axis-draw.functions.d.ts +17 -0
  152. package/dist/chart/components/x_axis/x-axis-draw.functions.js +6 -0
  153. package/dist/chart/components/x_axis/x-axis-labels.drawer.d.ts +42 -0
  154. package/dist/chart/components/x_axis/x-axis-labels.drawer.js +6 -0
  155. package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +141 -0
  156. package/dist/chart/components/x_axis/x-axis-labels.generator.js +6 -0
  157. package/dist/chart/components/x_axis/x-axis-labels.model.d.ts +39 -0
  158. package/dist/chart/components/x_axis/x-axis-labels.model.js +6 -0
  159. package/dist/chart/components/x_axis/x-axis-scale.handler.d.ts +38 -0
  160. package/dist/chart/components/x_axis/x-axis-scale.handler.js +6 -0
  161. package/dist/chart/components/x_axis/x-axis-time-labels.drawer.d.ts +54 -0
  162. package/dist/chart/components/x_axis/x-axis-time-labels.drawer.js +6 -0
  163. package/dist/chart/components/x_axis/x-axis.component.d.ts +73 -0
  164. package/dist/chart/components/x_axis/x-axis.component.js +6 -0
  165. package/dist/chart/components/y_axis/label-color.functions.d.ts +18 -0
  166. package/dist/chart/components/y_axis/label-color.functions.js +6 -0
  167. package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +22 -0
  168. package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +6 -0
  169. package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.d.ts +33 -0
  170. package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.js +6 -0
  171. package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.d.ts +27 -0
  172. package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.js +6 -0
  173. package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.d.ts +35 -0
  174. package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +6 -0
  175. package/dist/chart/components/y_axis/price_labels/price-label.drawer.d.ts +23 -0
  176. package/dist/chart/components/y_axis/price_labels/price-label.drawer.js +6 -0
  177. package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.d.ts +159 -0
  178. package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.js +6 -0
  179. package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.d.ts +23 -0
  180. package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.js +6 -0
  181. package/dist/chart/components/y_axis/y-axis-base-labels.model.d.ts +31 -0
  182. package/dist/chart/components/y_axis/y-axis-base-labels.model.js +6 -0
  183. package/dist/chart/components/y_axis/y-axis-labels.drawer.d.ts +70 -0
  184. package/dist/chart/components/y_axis/y-axis-labels.drawer.js +6 -0
  185. package/dist/chart/components/y_axis/y-axis-scale.handler.d.ts +32 -0
  186. package/dist/chart/components/y_axis/y-axis-scale.handler.js +6 -0
  187. package/dist/chart/components/y_axis/y-axis.component.d.ts +158 -0
  188. package/dist/chart/components/y_axis/y-axis.component.js +6 -0
  189. package/dist/chart/components/y_axis/y-axis.drawer.d.ts +72 -0
  190. package/dist/chart/components/y_axis/y-axis.drawer.js +6 -0
  191. package/dist/chart/components/y_axis/y-axis.model.d.ts +33 -0
  192. package/dist/chart/components/y_axis/y-axis.model.js +6 -0
  193. package/dist/chart/drawers/chart-background.drawer.d.ts +19 -0
  194. package/dist/chart/drawers/chart-background.drawer.js +6 -0
  195. package/dist/chart/drawers/chart-type-drawers/area.drawer.d.ts +13 -0
  196. package/dist/chart/drawers/chart-type-drawers/area.drawer.js +6 -0
  197. package/dist/chart/drawers/chart-type-drawers/bar.drawer.d.ts +14 -0
  198. package/dist/chart/drawers/chart-type-drawers/bar.drawer.js +6 -0
  199. package/dist/chart/drawers/chart-type-drawers/baseline.drawer.d.ts +15 -0
  200. package/dist/chart/drawers/chart-type-drawers/baseline.drawer.js +6 -0
  201. package/dist/chart/drawers/chart-type-drawers/candle.drawer.d.ts +25 -0
  202. package/dist/chart/drawers/chart-type-drawers/candle.drawer.js +6 -0
  203. package/dist/chart/drawers/chart-type-drawers/histogram.drawer.d.ts +13 -0
  204. package/dist/chart/drawers/chart-type-drawers/histogram.drawer.js +6 -0
  205. package/dist/chart/drawers/chart-type-drawers/line.drawer.d.ts +13 -0
  206. package/dist/chart/drawers/chart-type-drawers/line.drawer.js +6 -0
  207. package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.d.ts +13 -0
  208. package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.js +6 -0
  209. package/dist/chart/drawers/clear-canvas.drawer.d.ts +16 -0
  210. package/dist/chart/drawers/clear-canvas.drawer.js +6 -0
  211. package/dist/chart/drawers/composite.drawer.d.ts +25 -0
  212. package/dist/chart/drawers/composite.drawer.js +6 -0
  213. package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.d.ts +23 -0
  214. package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.js +6 -0
  215. package/dist/chart/drawers/data-series-drawers/color-candle.drawer.d.ts +17 -0
  216. package/dist/chart/drawers/data-series-drawers/color-candle.drawer.js +6 -0
  217. package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.d.ts +8 -0
  218. package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.js +6 -0
  219. package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.d.ts +21 -0
  220. package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +6 -0
  221. package/dist/chart/drawers/data-series-drawers/histogram.drawer.d.ts +11 -0
  222. package/dist/chart/drawers/data-series-drawers/histogram.drawer.js +6 -0
  223. package/dist/chart/drawers/data-series-drawers/linear.drawer.d.ts +12 -0
  224. package/dist/chart/drawers/data-series-drawers/linear.drawer.js +6 -0
  225. package/dist/chart/drawers/data-series-drawers/points.drawer.d.ts +11 -0
  226. package/dist/chart/drawers/data-series-drawers/points.drawer.js +6 -0
  227. package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.d.ts +9 -0
  228. package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.js +6 -0
  229. package/dist/chart/drawers/data-series-drawers/text.drawer.d.ts +13 -0
  230. package/dist/chart/drawers/data-series-drawers/text.drawer.js +6 -0
  231. package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.d.ts +12 -0
  232. package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.js +6 -0
  233. package/dist/chart/drawers/data-series-drawers/triangle.drawer.d.ts +12 -0
  234. package/dist/chart/drawers/data-series-drawers/triangle.drawer.js +6 -0
  235. package/dist/chart/drawers/data-series.drawer.d.ts +39 -0
  236. package/dist/chart/drawers/data-series.drawer.js +6 -0
  237. package/dist/chart/drawers/drawing-manager.d.ts +61 -0
  238. package/dist/chart/drawers/drawing-manager.js +6 -0
  239. package/dist/chart/drawers/ht-data-series.drawer.d.ts +22 -0
  240. package/dist/chart/drawers/ht-data-series.drawer.js +6 -0
  241. package/dist/chart/events/event-bus.d.ts +48 -0
  242. package/dist/chart/events/event-bus.js +6 -0
  243. package/dist/chart/events/events.d.ts +8 -0
  244. package/dist/chart/events/events.js +6 -0
  245. package/dist/chart/inputhandlers/candle-tap.handler.d.ts +27 -0
  246. package/dist/chart/inputhandlers/candle-tap.handler.js +6 -0
  247. package/dist/chart/inputhandlers/chart-resize.handler.d.ts +67 -0
  248. package/dist/chart/inputhandlers/chart-resize.handler.js +6 -0
  249. package/dist/chart/inputhandlers/cross-event-producer.component.d.ts +44 -0
  250. package/dist/chart/inputhandlers/cross-event-producer.component.js +6 -0
  251. package/dist/chart/inputhandlers/hover-producer.component.d.ts +140 -0
  252. package/dist/chart/inputhandlers/hover-producer.component.js +6 -0
  253. package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +54 -0
  254. package/dist/chart/inputhandlers/main-canvas-touch.handler.js +6 -0
  255. package/dist/chart/inputlisteners/canvas-input-listener.component.d.ts +311 -0
  256. package/dist/chart/inputlisteners/canvas-input-listener.component.js +6 -0
  257. package/dist/chart/model/baseline.model.d.ts +54 -0
  258. package/dist/chart/model/baseline.model.js +6 -0
  259. package/dist/chart/model/bounds.model.d.ts +16 -0
  260. package/dist/chart/model/bounds.model.js +6 -0
  261. package/dist/chart/model/candle-hover.d.ts +35 -0
  262. package/dist/chart/model/candle-hover.js +6 -0
  263. package/dist/chart/model/candle-series-high-low.provider.d.ts +20 -0
  264. package/dist/chart/model/candle-series-high-low.provider.js +6 -0
  265. package/dist/chart/model/candle-series.model.d.ts +150 -0
  266. package/dist/chart/model/candle-series.model.js +6 -0
  267. package/dist/chart/model/candle.model.d.ts +46 -0
  268. package/dist/chart/model/candle.model.js +6 -0
  269. package/dist/chart/model/canvas.model.d.ts +131 -0
  270. package/dist/chart/model/canvas.model.js +6 -0
  271. package/dist/chart/model/chart-base-element.d.ts +103 -0
  272. package/dist/chart/model/chart-base-element.js +6 -0
  273. package/dist/chart/model/compare-series-hover.d.ts +22 -0
  274. package/dist/chart/model/compare-series-hover.js +6 -0
  275. package/dist/chart/model/data-series-view.d.ts +58 -0
  276. package/dist/chart/model/data-series-view.js +6 -0
  277. package/dist/chart/model/data-series.config.d.ts +31 -0
  278. package/dist/chart/model/data-series.config.js +6 -0
  279. package/dist/chart/model/data-series.model.d.ts +172 -0
  280. package/dist/chart/model/data-series.model.js +6 -0
  281. package/dist/chart/model/date-time.formatter.d.ts +23 -0
  282. package/dist/chart/model/date-time.formatter.js +6 -0
  283. package/dist/chart/model/hit-test-canvas.model.d.ts +128 -0
  284. package/dist/chart/model/hit-test-canvas.model.js +6 -0
  285. package/dist/chart/model/main-candle-series.model.d.ts +27 -0
  286. package/dist/chart/model/main-candle-series.model.js +6 -0
  287. package/dist/chart/model/scale.model.d.ts +180 -0
  288. package/dist/chart/model/scale.model.js +6 -0
  289. package/dist/chart/model/scaling/auto-scale.model.d.ts +79 -0
  290. package/dist/chart/model/scaling/auto-scale.model.js +6 -0
  291. package/dist/chart/model/scaling/constrait.functions.d.ts +43 -0
  292. package/dist/chart/model/scaling/constrait.functions.js +6 -0
  293. package/dist/chart/model/scaling/lock-ratio.model.d.ts +16 -0
  294. package/dist/chart/model/scaling/lock-ratio.model.js +6 -0
  295. package/dist/chart/model/scaling/move-chart.functions.d.ts +20 -0
  296. package/dist/chart/model/scaling/move-chart.functions.js +6 -0
  297. package/dist/chart/model/scaling/viewport.model.d.ts +223 -0
  298. package/dist/chart/model/scaling/viewport.model.js +6 -0
  299. package/dist/chart/model/scaling/x-zooming.functions.d.ts +26 -0
  300. package/dist/chart/model/scaling/x-zooming.functions.js +6 -0
  301. package/dist/chart/model/time-zone.model.d.ts +65 -0
  302. package/dist/chart/model/time-zone.model.js +6 -0
  303. package/dist/chart/model/visual-candle.d.ts +106 -0
  304. package/dist/chart/model/visual-candle.js +6 -0
  305. package/dist/chart/utils/__tests__/array.utils.test.d.ts +6 -0
  306. package/dist/chart/utils/__tests__/array.utils.test.js +6 -0
  307. package/dist/chart/utils/__tests__/object.utils.test.d.ts +6 -0
  308. package/dist/chart/utils/__tests__/object.utils.test.js +6 -0
  309. package/dist/chart/utils/__tests__/priceIncrementsUtils.test.d.ts +6 -0
  310. package/dist/chart/utils/__tests__/priceIncrementsUtils.test.js +6 -0
  311. package/dist/chart/utils/array.utils.d.ts +101 -0
  312. package/dist/chart/utils/array.utils.js +6 -0
  313. package/dist/chart/utils/auto-period-detector.utils.d.ts +16 -0
  314. package/dist/chart/utils/auto-period-detector.utils.js +6 -0
  315. package/dist/chart/utils/candles-generator-ts.utils.d.ts +41 -0
  316. package/dist/chart/utils/candles-generator-ts.utils.js +6 -0
  317. package/dist/chart/utils/candles-generator.utils.d.ts +13 -0
  318. package/dist/chart/utils/candles-generator.utils.js +6 -0
  319. package/dist/chart/utils/candles.utils.d.ts +8 -0
  320. package/dist/chart/utils/candles.utils.js +6 -0
  321. package/dist/chart/utils/canvas/canvas-drawing-functions.utils.d.ts +68 -0
  322. package/dist/chart/utils/canvas/canvas-drawing-functions.utils.js +6 -0
  323. package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.d.ts +20 -0
  324. package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.js +6 -0
  325. package/dist/chart/utils/canvas/canvas-text-functions.utils.d.ts +76 -0
  326. package/dist/chart/utils/canvas/canvas-text-functions.utils.js +6 -0
  327. package/dist/chart/utils/color.utils.d.ts +6 -0
  328. package/dist/chart/utils/color.utils.js +6 -0
  329. package/dist/chart/utils/device/browser.utils.d.ts +9 -0
  330. package/dist/chart/utils/device/browser.utils.js +6 -0
  331. package/dist/chart/utils/device/device-detector.utils.d.ts +12 -0
  332. package/dist/chart/utils/device/device-detector.utils.js +6 -0
  333. package/dist/chart/utils/device/device-pixel-ratio.utils.d.ts +16 -0
  334. package/dist/chart/utils/device/device-pixel-ratio.utils.js +6 -0
  335. package/dist/chart/utils/device/touchpad.utils.d.ts +30 -0
  336. package/dist/chart/utils/device/touchpad.utils.js +6 -0
  337. package/dist/chart/utils/dom.utils.d.ts +13 -0
  338. package/dist/chart/utils/dom.utils.js +6 -0
  339. package/dist/chart/utils/function.utils.d.ts +13 -0
  340. package/dist/chart/utils/function.utils.js +6 -0
  341. package/dist/chart/utils/math.utils.d.ts +40 -0
  342. package/dist/chart/utils/math.utils.js +6 -0
  343. package/dist/chart/utils/merge.utils.d.ts +27 -0
  344. package/dist/chart/utils/merge.utils.js +6 -0
  345. package/dist/chart/utils/object.utils.d.ts +46 -0
  346. package/dist/chart/utils/object.utils.js +6 -0
  347. package/dist/chart/utils/perfomance/animation-frame-cache.utils.d.ts +53 -0
  348. package/dist/chart/utils/perfomance/animation-frame-cache.utils.js +6 -0
  349. package/dist/chart/utils/perfomance/debounce.utils.d.ts +6 -0
  350. package/dist/chart/utils/perfomance/debounce.utils.js +6 -0
  351. package/dist/chart/utils/perfomance/memoize.utils.d.ts +21 -0
  352. package/dist/chart/utils/perfomance/memoize.utils.js +6 -0
  353. package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.d.ts +15 -0
  354. package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.js +6 -0
  355. package/dist/chart/utils/perfomance/throttle.utils.d.ts +15 -0
  356. package/dist/chart/utils/perfomance/throttle.utils.js +6 -0
  357. package/dist/chart/utils/price-increments.utils.d.ts +44 -0
  358. package/dist/chart/utils/price-increments.utils.js +6 -0
  359. package/dist/chart/utils/uuid.utils.d.ts +6 -0
  360. package/dist/chart/utils/uuid.utils.js +6 -0
  361. package/dist/dxchart.min.js +26 -0
  362. package/dist/index.d.ts +9 -0
  363. package/dist/index.js +6 -0
  364. package/package.json +103 -0
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { FullChartConfig } from '../../chart.config';
7
+ import { ChartBaseElement } from '../../model/chart-base-element';
8
+ import EventBus from '../../events/event-bus';
9
+ import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
10
+ import { CursorHandler } from '../../canvas/cursor.handler';
11
+ import { CanvasModel } from '../../model/canvas.model';
12
+ import { DrawingManager } from '../../drawers/drawing-manager';
13
+ import { CanvasInputListenerComponent } from '../../inputlisteners/canvas-input-listener.component';
14
+ import { DateTimeFormatterFactory } from '../../model/date-time.formatter';
15
+ import { ChartModel } from '../chart/chart.model';
16
+ import { ChartPanComponent } from '../pan/chart-pan.component';
17
+ import { NavigationMapMoveHandler } from './navigation-map-move.handler';
18
+ /**
19
+ * Navigation map component for chart.
20
+ * Controls navigation map in the bottom.
21
+ */
22
+ export declare class NavigationMapComponent extends ChartBaseElement {
23
+ protected eventBus: EventBus;
24
+ private chartModel;
25
+ private canvasModel;
26
+ private config;
27
+ private canvasInputListeners;
28
+ private canvasBoundsContainer;
29
+ private chartPanComponent;
30
+ private visualCandles;
31
+ navigationMapMoveHandler: NavigationMapMoveHandler;
32
+ constructor(eventBus: EventBus, chartModel: ChartModel, canvasModel: CanvasModel, config: FullChartConfig, canvasInputListeners: CanvasInputListenerComponent, canvasBoundsContainer: CanvasBoundsContainer, drawingManager: DrawingManager, formatterFactory: DateTimeFormatterFactory, chartPanComponent: ChartPanComponent, cursorHandler: CursorHandler);
33
+ /**
34
+ * Method to activate the chart. It subscribes to the observables of the chartModel and canvasBoundsContainer.
35
+ * It also subscribes to the xChanged observable of the chartModel's scaleModel and filters the values to check
36
+ * if the previous viewport had no-candles area and current viewport contains only candles or if the current viewport
37
+ * has no-candles area. If the navigationMap component is visible, it makes visual candles and fires the draw event
38
+ * of the canvasModel.
39
+ */
40
+ protected doActivate(): void;
41
+ /**
42
+ * This function generates an array of visual candles based on the data provided by the chartModel.
43
+ * It calculates the maximum and minimum values of the candles and maps them to the canvas bounds.
44
+ * @returns {Array<[number, number]>} An array of tuples containing the x and y coordinates of each visual candle.
45
+ */
46
+ private makeVisualCandles;
47
+ /**
48
+ * Sets the visibility of the navigation map component.
49
+ * @param {boolean} visible - Whether the navigation map component should be visible or not. Default is true.
50
+ */
51
+ setVisible(visible?: boolean): void;
52
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{merge as C}from"rxjs";import{filter as _,pairwise as N}from"rxjs/operators";import{ChartBaseElement as f}from"../../model/chart-base-element";import{CanvasElement as n}from"../../canvas/canvas-bounds-container";import{EVENT_RESIZED as g}from"../../events/events";import{NavigationMapDrawer as I}from"./navigation-map.drawer";import{NavigationMapMoveHandler as E}from"./navigation-map-move.handler";import{floor as A}from"../../utils/math.utils";export class NavigationMapComponent extends f{constructor(a,t,c,s,i,m,o,h,l,e){super(),this.eventBus=a,this.chartModel=t,this.canvasModel=c,this.config=s,this.canvasInputListeners=i,this.canvasBoundsContainer=m,this.chartPanComponent=l,this.visualCandles=[];const d=new I(s,t,c,m,h,()=>this.visualCandles);o.addDrawer(d,n.N_MAP_CHART),this.navigationMapMoveHandler=new E(this.eventBus,this.chartModel,this.chartModel.scaleModel,this.canvasInputListeners,this.canvasBoundsContainer,this.chartPanComponent),e.setCursorForCanvasEl(n.N_MAP_CHART,s.components.navigationMap.cursors.chart),e.setCursorForCanvasEl(n.N_MAP_BTN_L,s.components.navigationMap.cursors.buttonLeft),e.setCursorForCanvasEl(n.N_MAP_BTN_R,s.components.navigationMap.cursors.buttonRight),e.setCursorForCanvasEl(n.N_MAP_KNOT_L,s.components.navigationMap.cursors.leftResizer),e.setCursorForCanvasEl(n.N_MAP_KNOT_R,s.components.navigationMap.cursors.rightResizer),e.setCursorForCanvasEl(n.N_MAP_SLIDER_WINDOW,s.components.navigationMap.cursors.slider)}doActivate(){super.doActivate(),this.addRxSubscription(C(this.chartModel.observeCandlesChanged(),this.canvasBoundsContainer.observeBoundsChanged(n.N_MAP),this.chartModel.scaleModel.xChanged.pipe(N(),_(([a,t])=>{const s=a.start<0||a.end>0,i=t.start<0||t.end>0;return s&&!i||i}))).subscribe(()=>{this.config.components.navigationMap.visible&&(this.visualCandles=this.makeVisualCandles(),this.canvasModel.fireDraw())}))}makeVisualCandles(){var a;const t=this.chartModel.getCandles();if(!t.length)return[];const c=this.chartModel.mainCandleSeries.dataIdxStart,s=this.chartModel.mainCandleSeries.dataIdxEnd,i=Math.round(Math.max(-c,0)),m=Math.max(this.chartModel.getCandlesCountWithRightOffset(),s)+i;let o=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;const l=this.canvasBoundsContainer.getBounds(n.N_MAP_CHART),e=l.width,d=[];let v=0,r,p;for(r=0;r<e;r++)p=A(r*m/e)-i,p in t?(d[r]=t[p].close,v=(a=d[r])!==null&&a!==void 0?a:0,o=Math.max(o,v),h=Math.min(h,v)):d[r]=0;return o-=h,d.map((u,M)=>[M+l.x,(o+h-u)*l.height/o+l.y])}setVisible(a=!0){var t;!((t=this.config.components)===null||t===void 0)&&t.navigationMap&&(this.config.components.navigationMap.visible=a,this.eventBus.fire(g),this.canvasModel.fireDraw())}}
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { FullChartConfig } from '../../chart.config';
7
+ import { ChartModel } from '../chart/chart.model';
8
+ import { CanvasModel } from '../../model/canvas.model';
9
+ import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
10
+ import { Drawer } from '../../drawers/drawing-manager';
11
+ import { DateTimeFormatterFactory } from '../../model/date-time.formatter';
12
+ export declare class NavigationMapDrawer implements Drawer {
13
+ private config;
14
+ private chartModel;
15
+ private canvasModel;
16
+ private canvasBoundsContainer;
17
+ private formatterFactory;
18
+ private visualCandlesProvider;
19
+ constructor(config: FullChartConfig, chartModel: ChartModel, canvasModel: CanvasModel, canvasBoundsContainer: CanvasBoundsContainer, formatterFactory: DateTimeFormatterFactory, visualCandlesProvider: () => Array<[number, number]>);
20
+ /**
21
+ * Draws the navigation map on the canvas if it is visible in the configuration.
22
+ * It first gets the bounds of all the necessary elements on the canvas.
23
+ * Then it fills the background of the navigation map with the configured color.
24
+ * Draws a line at the top of the navigation map with the configured color.
25
+ * Draws the left and right arrow buttons if their width is not zero.
26
+ * Draws the chart with the configured colors and fills it with a gradient if the gradient colors are configured.
27
+ * Draws the slider with the left and right knots and the slider window.
28
+ * Draws the time labels.
29
+ * @returns {void}
30
+ */
31
+ draw(): void;
32
+ /**
33
+ * Moves the left knot and the slider to the right of the left arrow button if the left knot is to the left of the button.
34
+ * @param {Bounds} knotL - The bounds of the left knot.
35
+ * @param {Bounds} knotR - The bounds of the right knot.
36
+ * @param {Bounds} btnL - The bounds of the left arrow button.
37
+ * @param {Bounds} slider - The bounds of the slider.
38
+ */
39
+ private blockDrawSliderOnLeftArrow;
40
+ /**
41
+ * Draws a slider on a canvas context with given bounds for knots, button and slider.
42
+ * @param {CanvasRenderingContext2D} ctx - The canvas context to draw on.
43
+ * @param {Bounds} knotL - The bounds for the left knot.
44
+ * @param {Bounds} knotR - The bounds for the right knot.
45
+ * @param {Bounds} btnL - The bounds for the left button.
46
+ * @param {Bounds} slider - The bounds for the slider.
47
+ * @returns {void}
48
+ */
49
+ private drawSlider;
50
+ /**
51
+ * Draws a left arrow button on a canvas context with the provided bounds and configuration
52
+ * @param {CanvasRenderingContext2D} ctx - The canvas context to draw on
53
+ * @param {Bounds} bounds - The bounds of the button to be drawn
54
+ * @param {FullChartConfig} config - The configuration object containing the colors to be used for the button and arrow
55
+ * @returns {void}
56
+ */
57
+ private drawLeftArrowButton;
58
+ /**
59
+ * Draws a right arrow button on a canvas context with the provided bounds and configuration
60
+ * @param {CanvasRenderingContext2D} ctx - The canvas context to draw on
61
+ * @param {Bounds} bounds - The bounds of the button to be drawn
62
+ * @param {FullChartConfig} config - The configuration object containing the colors to be used for the button and arrow
63
+ * @returns {void}
64
+ */
65
+ private drawRightArrowButton;
66
+ /**
67
+ * Draws a knot button on a canvas context with the given bounds and configuration.
68
+ * @param {CanvasRenderingContext2D} ctx - The canvas context to draw on.
69
+ * @param {Bounds} bounds - The bounds of the knot button.
70
+ * @param {FullChartConfig} config - The configuration for the chart.
71
+ * @param {boolean} isLeft - Whether the knot button is on the left side of the chart.
72
+ * @returns {void}
73
+ */
74
+ private drawKnotButton;
75
+ /**
76
+ * Draws time labels on the navigation map canvas.
77
+ * @param {CanvasRenderingContext2D} ctx - The 2D rendering context for the canvas.
78
+ * @returns {void}
79
+ */
80
+ private drawTimeLabels;
81
+ /**
82
+ * Draws a time label on a canvas context.
83
+ * @private
84
+ * @param {CanvasRenderingContext2D} ctx - The canvas context to draw on.
85
+ * @param {Bounds} bounds - The bounds of the label.
86
+ * @param {number} timestamp - The timestamp to display.
87
+ * @param {NMapTimeLabelProperties} config - The configuration for the label.
88
+ * @returns {void}
89
+ */
90
+ private drawTimeLabel;
91
+ /**
92
+ * Returns an array of string containing the canvas ID.
93
+ * @returns {Array<string>} An array of string containing the canvas ID.
94
+ */
95
+ getCanvasIds(): Array<string>;
96
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{CanvasElement as h}from"../../canvas/canvas-bounds-container";import{getTextLines as m,drawText as f,getTextLineHeight as v,prepareTextForFill as w}from"../../utils/canvas/canvas-text-functions.utils";import{getFormattedTimeLabel as M}from"./navigation-map.model";import{flat as T}from"../../utils/array.utils";const g=4;export class NavigationMapDrawer{constructor(i,t,o,e,a,l){this.config=i,this.chartModel=t,this.canvasModel=o,this.canvasBoundsContainer=e,this.formatterFactory=a,this.visualCandlesProvider=l}draw(){if(this.config.components.navigationMap.visible){const i=this.visualCandlesProvider();if(i.length){const t=this.canvasBoundsContainer.getBounds(h.N_MAP),o=this.canvasBoundsContainer.getBounds(h.N_MAP_BTN_L),e=this.canvasBoundsContainer.getBounds(h.N_MAP_BTN_R),a=this.canvasBoundsContainer.getBounds(h.N_MAP_KNOT_L),l=this.canvasBoundsContainer.getBounds(h.N_MAP_KNOT_R),d=this.canvasBoundsContainer.getBounds(h.N_MAP_SLIDER_WINDOW),r=this.canvasBoundsContainer.getBounds(h.N_MAP_CHART),n=this.canvasModel.ctx;n.fillStyle=this.config.colors.navigationMap.backgroundColor,n.fillRect(t.x,t.y,t.width,t.height),n.strokeStyle=this.config.colors.paneResizer.lineColor,n.lineWidth=1,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(t.x+t.width,t.y),n.closePath(),n.stroke(),o.width!==0&&this.drawLeftArrowButton(n,o,this.config),e.width!==0&&this.drawRightArrowButton(n,e,this.config),n.fillStyle=this.config.colors.navigationMap.mapFillColor,n.beginPath(),n.moveTo(r.x,r.y+r.height);for(const s of i)n.lineTo(s[0],s[1]);if(n.lineTo(r.x+r.width,r.y+r.height),n.lineTo(r.x,r.y+r.height),n.closePath(),this.config.colors.navigationMap.mapGradientTopColor&&this.config.colors.navigationMap.mapGradientBottomColor){const s=n.createLinearGradient(r.x,r.y,r.x,r.y+r.height);s.addColorStop(0,this.config.colors.navigationMap.mapGradientTopColor),s.addColorStop(1,this.config.colors.navigationMap.mapGradientBottomColor),n.fillStyle=s}n.fill(),this.config.colors.navigationMap.mapColor&&(n.strokeStyle=this.config.colors.navigationMap.mapColor,n.stroke()),this.drawSlider(n,a,l,o,d),this.drawTimeLabels(n)}}}blockDrawSliderOnLeftArrow(i,t,o,e){i.x<=o.x+o.width&&(i.x=o.x+o.width,e.x=i.x+i.width,t.x=e.x+e.width)}drawSlider(i,t,o,e,a){this.blockDrawSliderOnLeftArrow(t,o,e,a),this.drawKnotButton(i,t,this.config,!0),this.drawKnotButton(i,o,this.config,!1),i.fillStyle=this.config.colors.navigationMap.sliderColor,i.fillRect(a.x,a.y,a.width,a.height)}drawLeftArrowButton(i,t,o){i.fillStyle=o.colors.navigationMap.buttonColor,i.fillRect(t.x,t.y,t.width,t.height),i.beginPath();const e=Math.round(t.x+t.width/2-g/2),a=Math.round(t.y+t.height/2);i.moveTo(e,a),i.lineTo(e+g,a+g),i.lineTo(e+g,a-g),i.fillStyle=o.colors.navigationMap.buttonArrowColor,i.fill()}drawRightArrowButton(i,t,o){i.fillStyle=o.colors.navigationMap.buttonColor,i.fillRect(t.x,t.y,t.width,t.height),i.beginPath();const e=Math.round(t.x+t.width/2-g/2),a=Math.round(t.y+t.height/2);i.moveTo(e,a-g),i.lineTo(e,a+g),i.lineTo(e+g,a),i.fillStyle=o.colors.navigationMap.buttonArrowColor,i.fill()}drawKnotButton(i,t,o,e){const a=o.components.navigationMap.knots.border;i.fillStyle=o.colors.navigationMap.knotColor;const l=e?t.x-a:t.x+a;i.fillRect(l,t.y,t.width,t.height),i.lineWidth=o.components.navigationMap.knots.lineWidth,a>0&&(i.beginPath(),i.moveTo(l,t.y),i.lineTo(l,t.y+t.height),i.lineTo(l+t.width,t.y+t.height),i.lineTo(l+t.width,t.y),i.lineTo(l,t.y),i.lineWidth=a,i.strokeStyle=o.colors.navigationMap.knotBorderColor,i.stroke()),i.beginPath(),i.moveTo(l+t.width/2,t.y+t.height/4),i.lineTo(l+t.width/2,t.y+3*t.height/4),i.strokeStyle=o.colors.navigationMap.knotLineColor,i.stroke()}drawTimeLabels(i){const t=T(this.chartModel.mainCandleSeries.getSeriesInViewport()),o=this.config.components.navigationMap.timeLabels,e=o.visible;if(t.length&&e){const a=t[0].candle.timestamp,l=t[t.length-1].candle.timestamp,d=this.canvasBoundsContainer.getBounds(h.N_MAP_LABEL_L),r=this.canvasBoundsContainer.getBounds(h.N_MAP_LABEL_R),s={textFill:this.config.colors.navigationMap.timeLabelsTextColor,textFontFamily:o.fontFamily,textSize:`${o.fontSize}px`},c={dateFormat:o.dateFormat,padding:o.padding,textProperties:Object.assign(Object.assign({},s),{textAlign:"left"})},p={dateFormat:o.dateFormat,padding:o.padding,textProperties:Object.assign(Object.assign({},s),{textAlign:"right"})};this.drawTimeLabel(i,d,a,c),this.drawTimeLabel(i,r,l,p)}}drawTimeLabel(i,t,o,e){const a=e.padding,l=M(o,e.dateFormat,this.formatterFactory);w(i,e.textProperties);const d=v(i),r=m(l);f(i,r,t.x+a.x,t.y+d+a.y,e.textProperties)}getCanvasIds(){return[this.canvasModel.canvasId]}}
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { FullChartConfig } from '../../chart.config';
7
+ import { DateTimeFormatterFactory } from '../../model/date-time.formatter';
8
+ /**
9
+ * Calculates the bounds of a time label based on the provided timestamp, formatterFactory, and config.
10
+ * @param {CanvasRenderingContext2D} ctx - The canvas rendering context.
11
+ * @param {number} timestamp - The timestamp to be formatted.
12
+ * @param {DateTimeFormatterFactory} formatterFactory - The factory used to create the formatter for the timestamp.
13
+ * @param {FullChartConfig} config - The configuration object for the chart.
14
+ * @returns {[number, number]} - An array containing the width and height of the time label, including padding.
15
+ */
16
+ export declare function calcTimeLabelBounds(ctx: CanvasRenderingContext2D, timestamp: number, formatterFactory: DateTimeFormatterFactory, config: FullChartConfig): [number, number];
17
+ /**
18
+ * Returns a formatted time label.
19
+ *
20
+ * @param {number} timestamp - The timestamp to format.
21
+ * @param {string} format - The format to use for the timestamp.
22
+ * @param {DateTimeFormatterFactory} formatterFactory - The factory function to create a formatter for the given format.
23
+ * @returns {string} The formatted time label with line breaks instead of spaces.
24
+ */
25
+ export declare function getFormattedTimeLabel(timestamp: number, format: string, formatterFactory: DateTimeFormatterFactory): string;
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{getTextBounds as p,getTextLines as d}from"../../utils/canvas/canvas-text-functions.utils";export function calcTimeLabelBounds(e,n,o,i){const t=i.components.navigationMap.timeLabels,s=t.padding,a=getFormattedTimeLabel(n,t.dateFormat,o),x=d(a),c={textFontFamily:t.fontFamily,textSize:`${t.fontSize}px`},[r,m]=p(e,x,c);return[r+s.x*2,m+s.y*2]}export function getFormattedTimeLabel(e,n,o){return o(n)(e).split(" ").join(`
7
+ `)}
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { CanvasAnimation } from '../../animation/canvas-animation';
7
+ import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
8
+ import { FullChartConfig } from '../../chart.config';
9
+ import EventBus from '../../events/event-bus';
10
+ import { ChartBaseElement, ChartEntity } from '../../model/chart-base-element';
11
+ import { CanvasInputListenerComponent } from '../../inputlisteners/canvas-input-listener.component';
12
+ import { ScaleModel } from '../../model/scale.model';
13
+ import { ChartAreaPanHandler } from '../chart/chart-area-pan.handler';
14
+ import { BaseType, ChartBaseModel } from '../chart/chart-base.model';
15
+ export declare class ChartPanComponent extends ChartBaseElement {
16
+ private eventBus;
17
+ private mainScaleModel;
18
+ private canvasBoundsContainer;
19
+ private config;
20
+ private canvasAnimation;
21
+ private canvasInputListener;
22
+ private mainCanvasParent;
23
+ chartBaseModel: ChartBaseModel<BaseType>;
24
+ chartPanComponents: Array<ChartEntity>;
25
+ chartAreaPanHandler: ChartAreaPanHandler;
26
+ constructor(eventBus: EventBus, mainScaleModel: ScaleModel, canvasBoundsContainer: CanvasBoundsContainer, config: FullChartConfig, canvasAnimation: CanvasAnimation, canvasInputListener: CanvasInputListenerComponent, mainCanvasParent: Element, chartBaseModel: ChartBaseModel<BaseType>);
27
+ /**
28
+ * Activates the chart pan handlers.
29
+ * @protected
30
+ * @returns {void}
31
+ */
32
+ protected doActivate(): void;
33
+ /**
34
+ * This method is used to deactivate the pan handlers.
35
+ * @returns {void}
36
+ * @protected
37
+ */
38
+ protected doDeactivate(): void;
39
+ /**
40
+ * Activates user mouse handlers on main chart view.
41
+ * @function
42
+ * @name activateChartPanHandlers
43
+ * @memberof [object Object]
44
+ * @instance
45
+ * @returns {void}
46
+ */
47
+ activateChartPanHandlers(): void;
48
+ /**
49
+ * Deactivates all the pan handlers of the chart.
50
+ */
51
+ deactivatePanHandlers(): void;
52
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{ChartBaseElement as o}from"../../model/chart-base-element";import{ChartAreaPanHandler as c}from"../chart/chart-area-pan.handler";export class ChartPanComponent extends o{constructor(a,t,n,s,e,i,h,r){super(),this.eventBus=a,this.mainScaleModel=t,this.canvasBoundsContainer=n,this.config=s,this.canvasAnimation=e,this.canvasInputListener=i,this.mainCanvasParent=h,this.chartBaseModel=r,this.chartPanComponents=[],this.chartAreaPanHandler=new c(this.eventBus,this.config,this.mainScaleModel,this.mainCanvasParent,this.canvasInputListener,this.canvasBoundsContainer,this.canvasAnimation,this),this.chartPanComponents.push(this.chartAreaPanHandler)}doActivate(){this.activateChartPanHandlers()}doDeactivate(){this.deactivatePanHandlers()}activateChartPanHandlers(){this.chartPanComponents.forEach(a=>a.activate())}deactivatePanHandlers(){this.chartPanComponents.forEach(a=>a.deactivate())}}
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { CanvasBoundsContainer } from '../../../canvas/canvas-bounds-container';
7
+ import { Bounds } from '../../../model/bounds.model';
8
+ import { CanvasModel } from '../../../model/canvas.model';
9
+ import { ChartBaseElement } from '../../../model/chart-base-element';
10
+ import { DataSeriesModel } from '../../../model/data-series.model';
11
+ import { ScaleModel } from '../../../model/scale.model';
12
+ import { HighLowProvider } from '../../../model/scaling/auto-scale.model';
13
+ import { Unit } from '../../../model/scaling/viewport.model';
14
+ import { ChartBaseModel } from '../../chart/chart-base.model';
15
+ import { DragNDropYComponent } from '../../dran-n-drop_helper/drag-n-drop-y.component';
16
+ import { PriceAxisType } from '../../labels_generator/numeric-axis-labels.generator';
17
+ import { PaneHitTestController } from '../pane-hit-test.controller';
18
+ import { ExtentYAxis, PaneComponent, YExtentFormatters } from '../pane.component';
19
+ export interface YExtentCreationOptions {
20
+ scaleModel: ScaleModel;
21
+ order: number;
22
+ useDefaultHighLow: boolean;
23
+ useDefaultYAxis: boolean;
24
+ cursor: string;
25
+ paneFormatters: YExtentFormatters;
26
+ increment: number | null;
27
+ }
28
+ export declare class YExtentComponent extends ChartBaseElement {
29
+ paneUuid: string;
30
+ idx: number;
31
+ paneComponent: PaneComponent;
32
+ private chartBaseModel;
33
+ private canvasBoundsContainer;
34
+ private hitTestController;
35
+ dataSeriesCanvasModel: CanvasModel;
36
+ readonly scaleModel: ScaleModel;
37
+ readonly yAxisComponent: ExtentYAxis | undefined;
38
+ readonly dragNDrop: DragNDropYComponent;
39
+ dataSeries: Set<DataSeriesModel>;
40
+ formatters: YExtentFormatters;
41
+ private mainDataSeries?;
42
+ constructor(paneUuid: string, idx: number, paneComponent: PaneComponent, chartBaseModel: ChartBaseModel<'candle'>, canvasBoundsContainer: CanvasBoundsContainer, hitTestController: PaneHitTestController, dataSeriesCanvasModel: CanvasModel, scaleModel: ScaleModel, yAxisComponent: ExtentYAxis | undefined, dragNDrop: DragNDropYComponent, dataSeries?: Set<DataSeriesModel>, formatters?: YExtentFormatters);
43
+ protected doDeactivate(): void;
44
+ getYAxisBounds: () => Bounds;
45
+ yAxisHT: import("../../../canvas/canvas-bounds-container").HitBoundsTest;
46
+ /**
47
+ * Returns the bounds of the scale model.
48
+ * @returns {Bounds} The bounds of the scale model.
49
+ */
50
+ getBounds(): Bounds;
51
+ private toVisualPoints;
52
+ /**
53
+ * Creates a new DataSeriesModel object.
54
+ * @returns {DataSeriesModel} - The newly created DataSeriesModel object.
55
+ */
56
+ createDataSeries(): DataSeriesModel;
57
+ /**
58
+ * Adds a new data series to the chart.
59
+ * @param {DataSeriesModel} series - The data series to be added.
60
+ * @returns {void}
61
+ */
62
+ addDataSeries(series: DataSeriesModel): void;
63
+ /**
64
+ * Removes a data series from the chart.
65
+ *
66
+ * @param {DataSeriesModel} series - The data series to be removed.
67
+ * @returns {void}
68
+ */
69
+ removeDataSeries(series: DataSeriesModel): void;
70
+ /**
71
+ * Returns the type of the y-axis component for the current pane.
72
+ *
73
+ * @returns {PriceAxisType} The 'regular' type of the y-axis component for the current pane.
74
+ *
75
+ */
76
+ getAxisType(): PriceAxisType;
77
+ valueFormatter: (value: Unit, dataSeries?: DataSeriesModel) => string;
78
+ get regularFormatter(): (value: number) => string;
79
+ /**
80
+ * Sets the pane value formatters for the current instance.
81
+ * @param {YExtentFormatters} formatters - The pane value formatters to be set.
82
+ */
83
+ setValueFormatters(formatters: YExtentFormatters): void;
84
+ /**
85
+ * Returns the regular value from Y coordinate.
86
+ * @param {number} y - The Y coordinate.
87
+ * @returns {number} - The regular value.
88
+ */
89
+ regularValueFromY(y: number): number;
90
+ }
91
+ export declare const createDefaultYExtentHighLowProvider: (extent: YExtentComponent) => HighLowProvider;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{CanvasElement as d}from"../../../canvas/canvas-bounds-container";import{ChartBaseElement as f}from"../../../model/chart-base-element";import{DataSeriesModel as S,VisualSeriesPoint as w,defaultValueFormatter as x}from"../../../model/data-series.model";import{mergeHighLow as A}from"../../../model/scaling/auto-scale.model";import{createYExtentFormatters as B}from"../../chart/price.formatter";export class YExtentComponent extends f{constructor(t,i,e,u,l,m,c,h,a,g,v=new Set,p={regular:x}){if(super(),this.paneUuid=t,this.idx=i,this.paneComponent=e,this.chartBaseModel=u,this.canvasBoundsContainer=l,this.hitTestController=m,this.dataSeriesCanvasModel=c,this.scaleModel=h,this.yAxisComponent=a,this.dragNDrop=g,this.dataSeries=v,this.formatters=p,this.getYAxisBounds=()=>this.canvasBoundsContainer.getBounds(d.PANE_UUID_Y_AXIS(this.paneUuid,this.idx)),this.yAxisHT=this.canvasBoundsContainer.getBoundsHitTest(d.PANE_UUID_Y_AXIS(this.paneUuid,this.idx)),this.toVisualPoints=s=>s.map(r=>new w(this.chartBaseModel.dataFromTimestamp(r.timestamp).centerUnit,r.close)),this.valueFormatter=(s,r)=>{var o;return((o=this.formatters[this.getAxisType()])!==null&&o!==void 0?o:this.formatters.regular)(s,r)},this.addChildEntity(h),a!==void 0){this.addChildEntity(a.yAxisScaleHandler),this.addSubscription(a.unsub);const s={getLargestLabel:()=>{var r;return(r=a.labelsGenerator.getLargestLabel())!==null&&r!==void 0?r:""},getYAxisIndex:()=>i,getYAxisAlign:()=>a.state.align,getPaneUUID:()=>e.uuid};this.canvasBoundsContainer.yAxisBoundsContainer.registerYAxisWidthContributor(s),this.addSubscription(()=>this.canvasBoundsContainer.yAxisBoundsContainer.removeYAxisWidthContributor(s))}this.setValueFormatters(B(this))}doDeactivate(){super.doDeactivate(),this.dataSeries.forEach(t=>t.deactivate())}getBounds(){return this.scaleModel.getBounds()}createDataSeries(){const t=new S(this,this.hitTestController.getNewDataSeriesHitTestId());return t.toVisualPoints=this.toVisualPoints,t}addDataSeries(t){this.dataSeries.add(t),this.dataSeries.size===1&&(this.mainDataSeries=t),this.paneComponent.updateView()}removeDataSeries(t){this.dataSeries.delete(t),this.paneComponent.updateView()}getAxisType(){return"regular"}get regularFormatter(){return this.formatters.regular}setValueFormatters(t){this.formatters=t}regularValueFromY(t){var i,e;return(e=(i=this.mainDataSeries)===null||i===void 0?void 0:i.view.priceFromY(t))!==null&&e!==void 0?e:this.scaleModel.fromY(t)}}export const createDefaultYExtentHighLowProvider=n=>({isHighLowActive:()=>!0,calculateHighLow:t=>{const i=Array.from(n.dataSeries).filter(e=>e.highLowProvider.isHighLowActive()).map(e=>e.highLowProvider.calculateHighLow(t));return A(i)}});
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { CanvasModel } from '../../model/canvas.model';
7
+ import { DataSeriesModel, DataSeriesPoint, VisualSeriesPoint } from '../../model/data-series.model';
8
+ import { HitTestSubscriber } from '../../model/hit-test-canvas.model';
9
+ import { PaneComponent } from './pane.component';
10
+ export declare class PaneHitTestController implements HitTestSubscriber<DataSeriesModel> {
11
+ private readonly paneComponents;
12
+ private canvasModel;
13
+ private dataSeriesIdCounter;
14
+ constructor(paneComponents: Record<string, PaneComponent>, canvasModel: CanvasModel);
15
+ getNewDataSeriesHitTestId: () => number;
16
+ /**
17
+ * Returns an array with two numbers representing the range of IDs for data series.
18
+ * @returns {Array<number>} An array with two numbers representing the range of IDs for data series.
19
+ */
20
+ getIdRange(): [number, number];
21
+ get allDataSeries(): DataSeriesModel[];
22
+ /**
23
+ * Looks up a data series by its ID.
24
+ *
25
+ * @param {number} id - The ID of the data series to look up.
26
+ * @returns {DataSeriesModel | undefined} - The data series with the given ID, or undefined if it does not exist.
27
+ */
28
+ lookup(id: number): DataSeriesModel | undefined;
29
+ /**
30
+ * Changes the hovered property of all data series to true if their id matches the id of the provided model.
31
+ * @param {DataSeriesModel | null} model - The model to compare the id with.
32
+ * @returns {void}
33
+ */
34
+ onHover(model: DataSeriesModel | null): void;
35
+ onMouseDown(model: DataSeriesModel<DataSeriesPoint, VisualSeriesPoint>): void;
36
+ onMouseUp(): void;
37
+ handleYExtentDragStart(model: DataSeriesModel<DataSeriesPoint, VisualSeriesPoint>): void;
38
+ handleYExtentDragEnd(): void;
39
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{HIT_TEST_ID_RANGE as n}from"../../model/hit-test-canvas.model";import{flatMap as r}from"../../utils/array.utils";export class PaneHitTestController{constructor(t,e){this.paneComponents=t,this.canvasModel=e,this.dataSeriesIdCounter=n.DATA_SERIES[0],this.getNewDataSeriesHitTestId=()=>this.dataSeriesIdCounter++}getIdRange(){return n.DATA_SERIES}get allDataSeries(){return r(r(Object.values(this.paneComponents),t=>t.yExtentComponents),t=>Array.from(t.dataSeries))}lookup(t){return this.allDataSeries.find(a=>a.id===t)}onHover(t){this.allDataSeries.forEach(e=>e.hovered=e.id===(t==null?void 0:t.id)),this.canvasModel.fireDraw()}onMouseDown(t){t&&this.handleYExtentDragStart(t)}onMouseUp(){this.handleYExtentDragEnd()}handleYExtentDragStart(t){Object.values(this.paneComponents).forEach(e=>e.yExtentComponents.forEach(a=>a.dragNDrop.deactivate())),t.extentComponent.dragNDrop.activate()}handleYExtentDragEnd(){Object.values(this.paneComponents).forEach(t=>t.yExtentComponents.forEach(e=>e.dragNDrop.activate()))}}
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import { Subject } from 'rxjs';
7
+ import { CanvasAnimation } from '../../animation/canvas-animation';
8
+ import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
9
+ import { CursorHandler } from '../../canvas/cursor.handler';
10
+ import { FullChartConfig } from '../../chart.config';
11
+ import { DrawingManager } from '../../drawers/drawing-manager';
12
+ import EventBus from '../../events/event-bus';
13
+ import { CrossEventProducerComponent } from '../../inputhandlers/cross-event-producer.component';
14
+ import { CanvasInputListenerComponent, Point } from '../../inputlisteners/canvas-input-listener.component';
15
+ import { CanvasModel } from '../../model/canvas.model';
16
+ import { ChartBaseElement, ChartEntity } from '../../model/chart-base-element';
17
+ import { ScaleModel } from '../../model/scale.model';
18
+ import { AtLeastOne } from '../../utils/object.utils';
19
+ import { ChartBaseModel } from '../chart/chart-base.model';
20
+ import { ChartPanComponent } from '../pan/chart-pan.component';
21
+ import { YExtentCreationOptions } from './extent/y-extent-component';
22
+ import { PaneHitTestController } from './pane-hit-test.controller';
23
+ import { PaneComponent } from './pane.component';
24
+ export declare class PaneManager extends ChartBaseElement {
25
+ private chartBaseModel;
26
+ private userInputListenerComponents;
27
+ private eventBus;
28
+ private mainScaleModel;
29
+ private canvasBoundsContainer;
30
+ private config;
31
+ private canvasAnimation;
32
+ private canvasInputListener;
33
+ private drawingManager;
34
+ private dataSeriesCanvasModel;
35
+ private cursorHandler;
36
+ private crossEventProducer;
37
+ chartPanComponent: ChartPanComponent;
38
+ private mainCanvasModel;
39
+ paneComponents: Record<string, PaneComponent>;
40
+ panesChangedSubject: Subject<Record<string, PaneComponent>>;
41
+ hitTestController: PaneHitTestController;
42
+ /**
43
+ * Returns order of panes in the chart from top to bottom.
44
+ */
45
+ get panesOrder(): string[];
46
+ constructor(chartBaseModel: ChartBaseModel<'candle'>, userInputListenerComponents: ChartEntity[], eventBus: EventBus, mainScaleModel: ScaleModel, canvasBoundsContainer: CanvasBoundsContainer, config: FullChartConfig, canvasAnimation: CanvasAnimation, canvasInputListener: CanvasInputListenerComponent, drawingManager: DrawingManager, dataSeriesCanvasModel: CanvasModel, cursorHandler: CursorHandler, crossEventProducer: CrossEventProducerComponent, chartPanComponent: ChartPanComponent, mainCanvasModel: CanvasModel);
47
+ private addBounds;
48
+ /**
49
+ * Adds a resizer to the canvas bounds container for the given uuid.
50
+ * @param {string} uuid - The uuid of the pane to which the resizer is to be added.
51
+ * @returns {BarResizerComponent} - The BarResizerComponent instance that was added to the userInputListenerComponents array.
52
+ */
53
+ private addResizer;
54
+ /**
55
+ * Returns the pane component that contains the given point.
56
+ * @param {Point} point - The point to check.
57
+ * @returns {PaneComponent | undefined} - The pane component that contains the point or undefined if no pane contains it.
58
+ */
59
+ getPaneIfHit(point: Point): PaneComponent | undefined;
60
+ /**
61
+ * Creates sub-plot on the chart with y-axis
62
+ * @param uuid
63
+ * @returns
64
+ */
65
+ createPane(uuid?: string, options?: AtLeastOne<YExtentCreationOptions>): PaneComponent;
66
+ /**
67
+ * Removes pane from the chart and all related components
68
+ * @param uuid
69
+ */
70
+ removePane(uuid: string): void;
71
+ /**
72
+ * Adds cursors to the chart elements based on the provided uuid and cursor type.
73
+ * @private
74
+ * @param {string} uuid - The unique identifier for the chart element.
75
+ * @param {string} [cursor=this.config.components.chart.cursor] - The type of cursor to be added to the chart element.
76
+ * @returns {void}
77
+ */
78
+ private addCursors;
79
+ /**
80
+ * Recalculates the zoom Y of all pane components and fires a draw event on the event bus.
81
+ * @function
82
+ * @name recalculateState
83
+ * @memberof PaneManager
84
+ * @returns {void}
85
+ */
86
+ recalculateState(): void;
87
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (C) 2002 - 2023 Devexperts LLC
3
+ * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
+ * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ */
6
+ import{Subject as v}from"rxjs";import{CHART_UUID as f,CanvasElement as a}from"../../canvas/canvas-bounds-container";import{ChartBaseElement as g}from"../../model/chart-base-element";import{uuid as E}from"../../utils/uuid.utils";import{createHighLowOffsetCalculator as P}from"../chart/data-series.high-low-provider";import{BarResizerComponent as B}from"../resizer/bar-resizer.component";import{createDefaultYExtentHighLowProvider as M}from"./extent/y-extent-component";import{PaneHitTestController as S}from"./pane-hit-test.controller";import{PaneComponent as I}from"./pane.component";export class PaneManager extends g{get panesOrder(){return this.canvasBoundsContainer.panesOrder}constructor(e,s,n,t,o,r,c,h,d,p,l,m,u,C){super(),this.chartBaseModel=e,this.userInputListenerComponents=s,this.eventBus=n,this.mainScaleModel=t,this.canvasBoundsContainer=o,this.config=r,this.canvasAnimation=c,this.canvasInputListener=h,this.drawingManager=d,this.dataSeriesCanvasModel=p,this.cursorHandler=l,this.crossEventProducer=m,this.chartPanComponent=u,this.mainCanvasModel=C,this.paneComponents={},this.panesChangedSubject=new v,this.hitTestController=new S(this.paneComponents,this.dataSeriesCanvasModel);const i=this.createPane(f,{useDefaultHighLow:!1,scaleModel:this.mainScaleModel,useDefaultYAxis:!1});i.mainYExtentComponent.scaleModel.autoScaleModel.setHighLowProvider("series",M(i.mainYExtentComponent)),t.autoScaleModel.setHighLowPostProcessor("offsets",P(()=>this.mainScaleModel.getOffsets()))}addBounds(e,s){return this.canvasBoundsContainer.addPaneBounds(e,s),()=>this.canvasBoundsContainer.removedPaneBounds(e)}addResizer(e){const s=this.canvasBoundsContainer.getBoundsHitTest(a.PANE_UUID_RESIZER(e),{extensionY:this.config.components.paneResizer.dragZone}),n=()=>{this.canvasBoundsContainer.resizePaneVertically(e,this.canvasInputListener.getCurrentPoint().y),this.eventBus.fireDraw([this.mainCanvasModel.canvasId,"overDataSeriesCanvas"])},t=a.PANE_UUID_RESIZER(e),o=new B(t,()=>this.canvasBoundsContainer.getBounds(t),s,n,this.chartPanComponent,this.mainCanvasModel,this.drawingManager,this.canvasInputListener,this.canvasAnimation,this.config,this.canvasBoundsContainer);return this.userInputListenerComponents.push(o),o}getPaneIfHit(e){return Object.values(this.paneComponents).find(n=>this.canvasBoundsContainer.getBoundsHitTest(a.PANE_UUID(n.uuid))(e.x,e.y))}createPane(e=E(),s){if(this.paneComponents[e]!==void 0)return this.paneComponents[e];const n=new I(this.chartBaseModel,this.hitTestController,this.config,this.mainScaleModel,this.drawingManager,this.chartPanComponent,this.mainCanvasModel,this.canvasInputListener,this.userInputListenerComponents,this.canvasAnimation,this.cursorHandler,this.eventBus,this.canvasBoundsContainer,e,this.dataSeriesCanvasModel,s);return this.config.components.paneResizer.visible&&n.addChildEntity(this.addResizer(e)),n.addSubscription(this.addBounds(e,s==null?void 0:s.order)),n.addSubscription(this.addCursors(e)),n.addSubscription(this.crossEventProducer.subscribeMouseOverHT(e,n.ht)),this.paneComponents[e]=n,n.activate(),this.recalculateState(),n.mainYExtentComponent.scaleModel.autoScale(!0),this.panesChangedSubject.next(this.paneComponents),n}removePane(e){const s=this.paneComponents[e];s!==void 0&&(s.disable(),s.yExtentComponents.forEach(n=>n.disable()),delete this.paneComponents[e],this.recalculateState(),this.panesChangedSubject.next(this.paneComponents))}addCursors(e,s=this.config.components.chart.cursor){const n=a.PANE_UUID(e),t=a.PANE_UUID_RESIZER(e);return this.cursorHandler.setCursorForCanvasEl(n,s),this.config.components.paneResizer.visible&&this.cursorHandler.setCursorForCanvasEl(t,this.config.components.paneResizer.cursor,this.config.components.paneResizer.dragZone),()=>{this.cursorHandler.removeCursorForCanvasEl(n),this.config.components.paneResizer.visible&&this.cursorHandler.removeCursorForCanvasEl(t)}}recalculateState(){Object.values(this.paneComponents).forEach(e=>e.scaleModel.recalculateZoomY()),this.eventBus.fireDraw([this.mainCanvasModel.canvasId,"overDataSeriesCanvas"])}}