@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
package/LICENSE ADDED
@@ -0,0 +1,151 @@
1
+ Mozilla Public License
2
+ Version 2.0
3
+ 1. Definitions
4
+ 1.1. “Contributor”
5
+ means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
6
+
7
+ 1.2. “Contributor Version”
8
+ means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.
9
+
10
+ 1.3. “Contribution”
11
+ means Covered Software of a particular Contributor.
12
+
13
+ 1.4. “Covered Software”
14
+ means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
15
+
16
+ 1.5. “Incompatible With Secondary Licenses”
17
+ means
18
+
19
+ that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
20
+
21
+ that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
22
+
23
+ 1.6. “Executable Form”
24
+ means any form of the work other than Source Code Form.
25
+
26
+ 1.7. “Larger Work”
27
+ means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.
28
+
29
+ 1.8. “License”
30
+ means this document.
31
+
32
+ 1.9. “Licensable”
33
+ means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.
34
+
35
+ 1.10. “Modifications”
36
+ means any of the following:
37
+
38
+ any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
39
+
40
+ any new file in Source Code Form that contains any Covered Software.
41
+
42
+ 1.11. “Patent Claims” of a Contributor
43
+ means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
44
+
45
+ 1.12. “Secondary License”
46
+ means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.
47
+
48
+ 1.13. “Source Code Form”
49
+ means the form of the work preferred for making modifications.
50
+
51
+ 1.14. “You” (or “Your”)
52
+ means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
53
+
54
+ 2. License Grants and Conditions
55
+ 2.1. Grants
56
+ Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
57
+
58
+ under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
59
+
60
+ under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
61
+
62
+ 2.2. Effective Date
63
+ The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.
64
+
65
+ 2.3. Limitations on Grant Scope
66
+ The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:
67
+
68
+ for any code that a Contributor has removed from Covered Software; or
69
+
70
+ for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
71
+
72
+ under Patent Claims infringed by Covered Software in the absence of its Contributions.
73
+
74
+ This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).
75
+
76
+ 2.4. Subsequent Licenses
77
+ No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).
78
+
79
+ 2.5. Representation
80
+ Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.
81
+
82
+ 2.6. Fair Use
83
+ This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.
84
+
85
+ 2.7. Conditions
86
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.
87
+
88
+ 3. Responsibilities
89
+ 3.1. Distribution of Source Form
90
+ All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.
91
+
92
+ 3.2. Distribution of Executable Form
93
+ If You distribute Covered Software in Executable Form then:
94
+
95
+ such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
96
+
97
+ You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.
98
+
99
+ 3.3. Distribution of a Larger Work
100
+ You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).
101
+
102
+ 3.4. Notices
103
+ You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.
104
+
105
+ 3.5. Application of Additional Terms
106
+ You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.
107
+
108
+ 4. Inability to Comply Due to Statute or Regulation
109
+ If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
110
+
111
+ 5. Termination
112
+ 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
113
+
114
+ 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
115
+
116
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.
117
+
118
+ 6. Disclaimer of Warranty
119
+ Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
120
+
121
+ 7. Limitation of Liability
122
+ Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
123
+
124
+ 8. Litigation
125
+ Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.
126
+
127
+ 9. Miscellaneous
128
+ This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
129
+
130
+ 10. Versions of the License
131
+ 10.1. New Versions
132
+ Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
133
+
134
+ 10.2. Effect of New Versions
135
+ You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.
136
+
137
+ 10.3. Modified Versions
138
+ If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).
139
+
140
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
141
+ If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
142
+
143
+ Exhibit A - Source Code Form License Notice
144
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
145
+
146
+ If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
147
+
148
+ You may add additional accurate notices of copyright ownership.
149
+
150
+ Exhibit B - “Incompatible With Secondary Licenses” Notice
151
+ This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.
package/README.md ADDED
@@ -0,0 +1,184 @@
1
+ <br>
2
+ <p align="center">
3
+ <img src="docs/images/logo.png" alt="devexperts-logo" width="294px" height="100px"/>
4
+ </p>
5
+
6
+ <h1 align="center">DXCharts Lite - one of the most powerful financial charting tools</h1>
7
+
8
+ <p align="center">
9
+ <i>
10
+ DXcharts Lite is a modern solution made for visualization financial data with full variety of charts.<br>
11
+ It's been created and tempered as a part of big tradings apps with millions of users.<br>
12
+ Now it's grown enough to be recognized as independent product capable to support any from your needs<br>
13
+ as a simple widget for blog and as a part of big enterprise solution for trading.
14
+ </i>
15
+ <br>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://opensource.org/licenses/MPL-2.0">
20
+ <img src="https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg" alt="License: MPL 2.0" />
21
+ </a>&nbsp;
22
+ <a href="https://devexperts.com/kb/dxcharts/docs/how-to-contribute">
23
+ <img src="https://img.shields.io/static/v1?label=PRs&message=Welcome&color=blue" alt="PRs: Welcome" />
24
+ </a>&nbsp;
25
+ <a href="https://devexperts.com/dxcharts-demo/?lang=en">
26
+ <img src="https://img.shields.io/static/v1?label=Latest%20version&message=1.0.0&color=blue" alt="Version" />
27
+ </a>
28
+ </p>
29
+
30
+ <br>
31
+
32
+ <p align="center">
33
+ <img src="docs/images/fourbasiccharts.png" width="1000px" alt="4 charts example"/>
34
+ </p>
35
+
36
+ <hr>
37
+
38
+ ## Overview
39
+
40
+ Get started with DXCharts Lite, install the library and configure it as you want.
41
+
42
+ - 🚀 [Quick start](#quick-start)
43
+ - 📦 [Installation](#installation)
44
+ - 🛠️ [Create Chart](#create-chart)
45
+ - 📈 [Set data](#set-data)
46
+ - 📄 [HTML markup](#html-markup)
47
+ - ⚙️ [Configuration](#configuration)
48
+ - 🔌 [API](#api)
49
+ - 📒 [Examples](#examples)
50
+ - 🧮 [Demo](#demo)
51
+
52
+ ## Quick-start
53
+
54
+ ### Installation
55
+
56
+ Install library to your project:
57
+
58
+ ```js
59
+ npm install @devexperts/dxcharts-lite
60
+ ```
61
+
62
+ Your `package.json` after installation:
63
+
64
+ ```json
65
+ "dependencies": {
66
+ "@devexperts/dxcharts-lite": "1.0.0",
67
+ ...
68
+ }
69
+ ```
70
+
71
+ ### Create chart
72
+
73
+ If you use webpack or any other bundler - import `createChart` method and pass element where the chart will be rendered as a first argument.
74
+
75
+ ```js
76
+ export const createChartInstance = () => {
77
+ const container = document.getElementById('chart_container');
78
+ const chartInstance = DXChart.createChart(container);
79
+ return chartInstance;
80
+ };
81
+ ```
82
+
83
+ `createChart` - method, that creates a new chart instance using ChartBootstrap class and returns it.
84
+
85
+ Method accepts 2 parameters:
86
+
87
+ - `element` - The HTML element where the chart will be rendered
88
+ - `config` (optional) - instance of [ChartConfig](/chart/chart-config/overview)
89
+
90
+ > Also, please, set `width: 100%` and `height: 100%` for parent container
91
+ > by default chart is auto-resizing to parent
92
+ > you can change it by setting `fixedSize` in config
93
+
94
+ Now you should have empty chart on screen.
95
+
96
+ ### Set data
97
+
98
+ Let's pass in some data i.e. `Candles`. You can use bundled function to generate some mock data.
99
+ Import `generateCandlesData` and call it to generate candles.
100
+ Also, you would need `Instrument` object - it is required to show instrument description on chart and show correct price precisions on Y axis.
101
+
102
+ ```js
103
+ export const generateMockData = () => {
104
+ const mockCandles = generateCandlesData();
105
+ const mockInstrument = {
106
+ symbol: 'AAPL',
107
+ priceIncrements: [0.01],
108
+ };
109
+ chartInstance.chartComponent.setMainSeries({ candles: mockCandles, instrument: mockInstrument });
110
+ };
111
+ ```
112
+
113
+ Now you should see chart just like image below:
114
+
115
+ <p align="center">
116
+ <img src="docs/images/basicchart.png" width="1000px" alt="Basic chart"/>
117
+ </p>
118
+
119
+ ### HTML-markup
120
+
121
+ Here is full quick-start code example:
122
+
123
+ ```markup
124
+ <html>
125
+ <head>
126
+ <script src="https://webdev.prosp.devexperts.com:8095/dxcharts-lite-cdn/dxchart.min.js"></script>
127
+ </head>
128
+ <body>
129
+ <div id="chart_container"></div>
130
+ </body>
131
+ <script type="module">
132
+ import generateCandlesData from 'https://webdev.prosp.devexperts.com:8095/dxcharts-lite-cdn/chart/utils/candles-generator.utils.js';
133
+
134
+ // create chart instance, pass parent container as 1st argument
135
+ const container = document.getElementById("chart_container");
136
+ const chartInstance = DXChart.createChart(container);
137
+ // create and set candles data
138
+ const mockCandles = generateCandlesData();
139
+ const mockInstrument = {
140
+ symbol: 'AAPL',
141
+ priceIncrements: [0.01],
142
+ };
143
+ chartInstance.chartComponent.setMainSeries({ candles: mockCandles, instrument: mockInstrument });
144
+ </script>
145
+ ```
146
+
147
+ ## Configuration
148
+
149
+ You can configure chart with `ChartConfig` object. It is optional.
150
+
151
+ `ChartConfig` is used to set initial properties for chart instance.
152
+ Below you can see full table of it, and other options, that `ChartConfig` consists of.
153
+
154
+ - [`FullChartConfig`](docs/generated/FullChartConfig.md)
155
+
156
+ ## API
157
+
158
+ Every chart component has an API allowing change a lot of params on the fly.
159
+ Change appearance at runtime.
160
+ Subscribe on different events in chart (like HOVER on candle)
161
+
162
+ Here are the links of the main components:
163
+
164
+ - [`ChartComponent`](docs/generated/ChartComponent.md) - set data, subscribe on data changes
165
+ - [`XAxisComponent`](docs/generated/XAxisComponent.md) - configure x-labels
166
+ - [`YAxisComponent`](docs/generated/YAxisComponent.md) - configure labels and set y-axis type
167
+ - [`CrossToolComponent`](docs/generated/CrossToolComponent.md) - cross-hair type, OHLC magnet
168
+ - [`EventsComponent`](docs/generated/EventsComponent.md) - set events data
169
+ - [`VolumesComponent`](docs/generated/VolumesComponent.md) - set volumes
170
+ - [`WaterMarkComponent`](docs/generated/WaterMarkComponent.md) - create and manage a watermark
171
+ - [`NavigationMapComponent`](docs/generated/NavigationMapComponent.md) - create a navigation map
172
+ - [`SnapshotComponent`](docs/generated/SnapshotComponent.md) - create a snapshot
173
+ - [`HighlightsComponent`](docs/generated/HighlightsComponent.md) - allows to draw highlights of some canvas objects such as labels
174
+ - [`PaneManager`](docs/generated/PaneManager.md) - create and manage panes
175
+ - [`PaneComponent`](docs/generated/PaneComponent.md) - create and manage panes data series
176
+
177
+ ## Examples
178
+
179
+ We have created a lot of examples with different chart configuration.
180
+ You can find them [here](https://github.com/devexperts/dxcharts-lite/tree/master/docs/how-to).
181
+
182
+ ## Demo
183
+
184
+ To show you how it's beautiful, we have created [Demo version](https://devexperts.com/dxcharts-demo/), based on DXCharts Lite. Feel all power of our library!
@@ -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 EventBus from '../events/event-bus';
7
+ import { Animation } from './types/animation';
8
+ import { ColorAlphaAnimationConfig, ColorAlphaAnimation } from './types/color-alpha-animation';
9
+ import { ColorTransitionAnimationConfig, ColorTransitionAnimation } from './types/color-transition-animation';
10
+ import { ViewportMovementAnimationConfig, ViewportMovementAnimation } from './types/viewport-movement-animation';
11
+ import { ViewportModel } from '../model/scaling/viewport.model';
12
+ import { StringTMap } from '../utils/object.utils';
13
+ export interface AnimationConfig {
14
+ duration: number;
15
+ timeLeft?: number;
16
+ }
17
+ export declare const VIEWPORT_ANIMATION_ID = "VIEWPORT_ANIMATION";
18
+ /**
19
+ * Singleton animation container for all chart animations.
20
+ * Does the following things:
21
+ * - registers animations and updates their state
22
+ * - fires only 1 DRAW event for all animations at once
23
+ *
24
+ * Add specific animation here as well with typed API.
25
+ * Like "color" animation which auto-updates color alpha channel.
26
+ *
27
+ * @doc-tags chart-core,animation
28
+ */
29
+ export declare class CanvasAnimation {
30
+ private eventBus;
31
+ animationIntervalId?: number;
32
+ animations: StringTMap<Animation>;
33
+ constructor(eventBus: EventBus);
34
+ /**
35
+ * Starts a viewport movement animation with the given configuration and adds it to the list of animations.
36
+ * @param {ViewportModel} viewportModel - The viewport model to animate.
37
+ * @param {ViewportMovementAnimationConfig} config - The configuration for the animation.
38
+ * @param {string} [uniqueAnimationId=VIEWPORT_ANIMATION_ID] - The unique ID for the animation.
39
+ * @param {Function} [onTickFunction] - The function to be called on each tick of the animation.
40
+ * @returns {ViewportMovementAnimation} The container for the created animation.
41
+ */
42
+ startViewportMovementAnimation(viewportModel: ViewportModel, config: ViewportMovementAnimationConfig, uniqueAnimationId?: string, onTickFunction?: () => void): ViewportMovementAnimation;
43
+ /**
44
+ * Starts a color alpha animation with the given configuration and adds it to the list of animations.
45
+ * @param {string} uniqueAnimationId - A unique identifier for the animation.
46
+ * @param {Array<ColorAlphaAnimationConfig>} colorConfigs - An array of color alpha animation configurations.
47
+ * @param {() => void} [onTickFunction] - A function to be called on each animation tick.
48
+ * @param {Partial<ACAnimationConfig>} [animationConfig] - An optional configuration for the animation.
49
+ * @returns {ColorAlphaAnimation} - The created animation container.
50
+ */
51
+ startColorAlphaAnimation(uniqueAnimationId: string, colorConfigs: Array<ColorAlphaAnimationConfig>, onTickFunction?: () => void, animationConfig?: Partial<AnimationConfig>): ColorAlphaAnimation;
52
+ /**
53
+ * Starts a color transition animation with the given configurations and duration.
54
+ * @param {string} uniqueAnimationId - A unique identifier for the animation.
55
+ * @param {Array<ColorTransitionAnimationConfig>} colorConfigs - An array of color transition configurations.
56
+ * @param {number} [duration=DEFAULT_ANIMATION_TIME] - The duration of the animation in milliseconds.
57
+ * @param {Function} [onTickFunction] - A function to be called on each tick of the animation.
58
+ * @returns {ColorTransitionAnimation} - The created animation container.
59
+ */
60
+ startColorTransitionAnimation(uniqueAnimationId: string, colorConfigs: Array<ColorTransitionAnimationConfig>, duration?: number, onTickFunction?: () => void): ColorTransitionAnimation;
61
+ /**
62
+ * This function takes an id as a string and returns an animation container object of type T. It retrieves the animation container object from the animations object using the provided id. The @ts-ignore comment is used to ignore any TypeScript errors that may occur due to the dynamic nature of the function.
63
+ */
64
+ getAnimation<T extends Animation>(id: string): T;
65
+ /**
66
+ * Returns a ColorAlphaAnimation object for the given animation ID.
67
+ *
68
+ * @param {string} id - The ID of the animation to retrieve.
69
+ * @returns {ColorAlphaAnimation} - The ColorAlphaAnimation object for the given ID.
70
+ */
71
+ getColorAlphaAnimation(id: string): ColorAlphaAnimation;
72
+ /**
73
+ * Returns a ColorTransitionAnimation object for the given id.
74
+ * @param {string} id - The id of the animation to retrieve.
75
+ * @returns {ColorTransitionAnimation} - The ColorTransitionAnimation object for the given id.
76
+ */
77
+ getColorTransitionAnimation(id: string): ColorTransitionAnimation;
78
+ /**
79
+ * Stops the animation with the given ID.
80
+ * @param {string} id - The ID of the animation to be stopped.
81
+ * @returns {void}
82
+ */
83
+ forceStopAnimation(id: string): void;
84
+ /**
85
+ * This method ensures that the animation interval is started. If the animation interval ID is not set, it sets it to a new interval ID using `window.setInterval()` with a callback function of `this.tick()` and a delay of 20 milliseconds.
86
+ */
87
+ private ensureIntervalStarted;
88
+ /**
89
+ * This is a private method that iterates through all the animations in the container and calls their tick method. If any animation is still in progress, it sets the allCompleted flag to false. If all animations are completed, it stops the interval. If not, it fires the draw event.
90
+ */
91
+ private tick;
92
+ /**
93
+ * Stops the interval for the animation.
94
+ */
95
+ private stopInterval;
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{ColorAlphaAnimation as r}from"./types/color-alpha-animation";import{ColorTransitionAnimation as s}from"./types/color-transition-animation";import{ViewportMovementAnimation as m}from"./types/viewport-movement-animation";const e=10;export const VIEWPORT_ANIMATION_ID="VIEWPORT_ANIMATION";export class CanvasAnimation{constructor(t){this.eventBus=t,this.animations={}}startViewportMovementAnimation(t,n,i=VIEWPORT_ANIMATION_ID,o){const a=new m(t,n,o);return this.animations[i]=a,this.ensureIntervalStarted(),a}startColorAlphaAnimation(t,n,i,o){const a=new r(Object.assign(Object.assign({},o),{duration:o&&o.duration||e}),n,i);return this.animations[t]=a,this.ensureIntervalStarted(),a}startColorTransitionAnimation(t,n,i=e,o){const a=new s({duration:i},n,o);return this.animations[t]=a,this.ensureIntervalStarted(),a}getAnimation(t){return this.animations[t]}getColorAlphaAnimation(t){return this.getAnimation(t)}getColorTransitionAnimation(t){return this.getAnimation(t)}forceStopAnimation(t){const n=this.animations[t];n&&(n.animationTimeLeft=-1,n.animationInProgress=!1)}ensureIntervalStarted(){this.animationIntervalId||(this.animationIntervalId=window.setInterval(()=>this.tick(),20))}tick(){let t=!0;for(const n of Object.keys(this.animations)){const i=this.animations[n];i.tick(),i.animationInProgress&&(t=!1)}t?this.stopInterval():this.eventBus.fireDraw()}stopInterval(){clearInterval(this.animationIntervalId),this.animationIntervalId=void 0}}
@@ -0,0 +1,35 @@
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 { AnimationConfig } from '../canvas-animation';
7
+ interface AnimationAware {
8
+ tick: () => void;
9
+ }
10
+ /**
11
+ * Basic animation. Holds current state: inProgress, timeLeft.
12
+ * Additional params are useful to pass data which helps animating.
13
+ */
14
+ export declare class Animation implements AnimationAware {
15
+ private onTickFunction?;
16
+ animationTime: number;
17
+ animationTimeLeft: number;
18
+ animationInProgress: boolean;
19
+ constructor(animationConfig: AnimationConfig, onTickFunction?: (() => void) | undefined);
20
+ /**
21
+ * Decrements the animation time left and executes the onTickFunction if it exists.
22
+ * If the animation time left reaches zero, sets the animationInProgress flag to false.
23
+ */
24
+ tick(): void;
25
+ /**
26
+ * Calculates the normalized progress of an animation.
27
+ * @returns {number} A value between 0 and 1 representing the progress of the animation.
28
+ */
29
+ getProgress(): number;
30
+ /**
31
+ * Sets the animationInProgress flag to false and resets the animationTimeLeft to 0.
32
+ */
33
+ finishAnimation(): void;
34
+ }
35
+ export {};
@@ -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
+ export class Animation{constructor(i,t){this.onTickFunction=t,this.animationTimeLeft=0,this.animationInProgress=!1,this.animationTime=i.duration,this.animationTimeLeft=i.timeLeft===void 0?i.duration:i.timeLeft,this.animationInProgress=!0}tick(){this.animationTimeLeft<=0?this.animationInProgress=!1:this.animationTimeLeft--,this.onTickFunction&&this.onTickFunction()}getProgress(){return 1-this.animationTimeLeft/this.animationTime}finishAnimation(){this.animationInProgress=!1,this.animationTimeLeft=0}}
@@ -0,0 +1,43 @@
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 { AnimationConfig } from '../canvas-animation';
7
+ import { Animation } from './animation';
8
+ import * as Color from 'color';
9
+ interface CustomColor extends Color {
10
+ readonly valpha?: number;
11
+ }
12
+ export interface ColorAlphaAnimationConfig {
13
+ color: string;
14
+ type: 'appearing' | 'fading';
15
+ }
16
+ interface ColorAlphaAnimationConfigInternal extends ColorAlphaAnimationConfig {
17
+ rgbColor?: CustomColor;
18
+ currentAnimationColor?: Color;
19
+ initialAlpha?: number;
20
+ }
21
+ /**
22
+ * Color animation automatically updates alpha channel of provided colors on each tick.
23
+ * Can be in 'appearing' and 'fading' state.
24
+ */
25
+ export declare class ColorAlphaAnimation extends Animation {
26
+ private colorConfigs;
27
+ constructor(animationConfig: AnimationConfig, colorConfigs: Array<ColorAlphaAnimationConfigInternal>, onTickFunction?: () => void);
28
+ /**
29
+ * Updates the current animation color of each color configuration based on the animation type and time left. If an animation is in progress, it iterates over each color configuration and updates its current animation color. If the configuration has an initial alpha and RGB color, it calculates the new alpha value based on the animation time left and updates the current animation color accordingly. The animation type can be either 'fading' or 'appearing'.
30
+ */
31
+ tick(): void;
32
+ /**
33
+ * Returns the color of the current animation for a given index.
34
+ * @param {number} index - The index of the color configuration to retrieve.
35
+ * @returns {string} - The color of the current animation for the given index, or white if not found.
36
+ */
37
+ getColor(index: number): string;
38
+ /**
39
+ * This function reverts the animation by changing the type of color configurations from 'fading' to 'appearing' and vice versa. It also ensures that the animationTimeLeft is not zero to avoid getting stuck in the middle of the animation.
40
+ */
41
+ revert(): void;
42
+ }
43
+ export {};
@@ -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{Animation as o}from"./animation";import*as e from"color";export class ColorAlphaAnimation extends o{constructor(i,t,a=()=>{}){super(i,a),this.colorConfigs=t,t.forEach(r=>{r.rgbColor=e.rgb(r.color),r.initialAlpha=r.rgbColor.valpha,r.currentAnimationColor=r.rgbColor})}tick(){super.tick(),this.animationInProgress&&this.colorConfigs.forEach(i=>{i.initialAlpha===void 0||i.rgbColor===void 0||(i.type==="fading"?i.currentAnimationColor=i.rgbColor.alpha(i.initialAlpha*this.animationTimeLeft/this.animationTime):i.type==="appearing"&&(i.currentAnimationColor=i.rgbColor.alpha(i.initialAlpha*(1-this.animationTimeLeft/this.animationTime))))})}getColor(i){var t,a;return(a=(t=this.colorConfigs[i].currentAnimationColor)===null||t===void 0?void 0:t.toString())!==null&&a!==void 0?a:"#FFFFFF"}revert(){this.animationTimeLeft=Math.max(this.animationTime-this.animationTimeLeft,1),this.colorConfigs.forEach(i=>{i.type==="fading"?i.type="appearing":i.type="fading"})}}
@@ -0,0 +1,59 @@
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 { AnimationConfig } from '../canvas-animation';
7
+ import { Animation } from './animation';
8
+ import * as Color from 'color';
9
+ export interface ColorTransitionAnimationConfig {
10
+ startColor: string;
11
+ endColor: string;
12
+ type: 'appearing' | 'fading';
13
+ }
14
+ interface ColorTransitionAnimationConfigInternal extends ColorTransitionAnimationConfig {
15
+ rgbStartColor?: Color;
16
+ rgbEndColor?: Color;
17
+ currentAnimationColor?: Color;
18
+ }
19
+ /**
20
+ * Color transition calculates color between start..end color for each tick.
21
+ * Can be in 'appearing' and 'fading' state; 'fading' is just reverting the colors order.
22
+ */
23
+ export declare class ColorTransitionAnimation extends Animation {
24
+ private colorConfigs;
25
+ constructor(animationConfig: AnimationConfig, colorConfigs: Array<ColorTransitionAnimationConfigInternal>, onTickFunction?: () => void);
26
+ /**
27
+ * Updates the current animation color for each color configuration based on the progress of the animation.
28
+ * If an animation is in progress, it calculates the transition color for each configuration based on the start and end colors and the current progress of the animation.
29
+ * If the configuration type is "fading", it transitions from the end color to the start color, and if the type is "appearing", it transitions from the start color to the end color.
30
+ * @function
31
+ * @returns {void}
32
+ */
33
+ tick(): void;
34
+ /**
35
+ * Returns the color of the current animation for a given index.
36
+ * @param {number} index - The index of the color configuration to retrieve.
37
+ * @returns {string} - The color of the current animation for the given index, or white if not found.
38
+ */
39
+ getColor(index: number): string;
40
+ /**
41
+ * Reverts the animation by changing the type of color configurations from 'fading' to 'appearing' and vice versa.
42
+ * It also ensures that the animation does not halt in the middle by setting the animationTimeLeft to the maximum of (animationTime - animationTimeLeft) and 1.
43
+ * @function
44
+ * @returns {void}
45
+ */
46
+ revert(): void;
47
+ /**
48
+ * Moves animation state to one last tick - instant-finishing animation as result.
49
+ */
50
+ moveToLastTick(): void;
51
+ /**
52
+ * Calculates new color in between of 2 colors.
53
+ * @param startColor - from color
54
+ * @param endColor - to color
55
+ * @param progress - number between 0..1
56
+ */
57
+ private calculateTransitionColor;
58
+ }
59
+ export {};
@@ -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{Animation as l}from"./animation";import*as e from"color";export class ColorTransitionAnimation extends l{constructor(r,t,o=()=>{}){super(r,o),this.colorConfigs=t,t.forEach(i=>{i.rgbStartColor=e.rgb(i.startColor),i.rgbEndColor=e.rgb(i.endColor),i.currentAnimationColor=i.type==="appearing"?i.rgbStartColor:i.rgbEndColor})}tick(){super.tick(),this.animationInProgress&&this.colorConfigs.forEach(r=>{const t=1-this.animationTimeLeft/this.animationTime;!r.rgbStartColor||!r.rgbEndColor||(r.type==="fading"?r.currentAnimationColor=this.calculateTransitionColor(r.rgbEndColor,r.rgbStartColor,t):r.type==="appearing"&&(r.currentAnimationColor=this.calculateTransitionColor(r.rgbStartColor,r.rgbEndColor,t)))})}getColor(r){var t,o;return(o=(t=this.colorConfigs[r].currentAnimationColor)===null||t===void 0?void 0:t.toString())!==null&&o!==void 0?o:"#FFFFFF"}revert(){this.animationTimeLeft=Math.max(this.animationTime-this.animationTimeLeft,1),this.colorConfigs.forEach(r=>{r.type==="fading"?r.type="appearing":r.type="fading"})}moveToLastTick(){this.animationTimeLeft=1}calculateTransitionColor(r,t,o){const i=r.red()-(r.red()-t.red())*o,a=r.green()-(r.green()-t.green())*o,n=r.blue()-(r.blue()-t.blue())*o;return e.rgb(i,a,n)}}