@devexperts/dxcharts-lite 1.0.2 → 2.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 (258) hide show
  1. package/README.md +2 -2
  2. package/dist/chart/animation/canvas-animation.js +134 -1
  3. package/dist/chart/animation/types/animation.js +43 -1
  4. package/dist/chart/animation/types/color-alpha-animation.d.ts +1 -1
  5. package/dist/chart/animation/types/color-alpha-animation.js +60 -1
  6. package/dist/chart/animation/types/color-transition-animation.d.ts +1 -1
  7. package/dist/chart/animation/types/color-transition-animation.js +86 -1
  8. package/dist/chart/animation/types/viewport-movement-animation.js +63 -1
  9. package/dist/chart/animation/viewport-model-animation.js +20 -1
  10. package/dist/chart/bootstrap.d.ts +51 -48
  11. package/dist/chart/bootstrap.js +449 -1
  12. package/dist/chart/canvas/canvas-bounds-container.d.ts +0 -5
  13. package/dist/chart/canvas/canvas-bounds-container.js +815 -1
  14. package/dist/chart/canvas/canvas-chart-html.js +16 -18
  15. package/dist/chart/canvas/chart-elements.d.ts +1 -4
  16. package/dist/chart/canvas/chart-elements.js +22 -1
  17. package/dist/chart/canvas/cursor.handler.js +122 -1
  18. package/dist/chart/canvas/layout-creator.js +34 -1
  19. package/dist/chart/canvas/y-axis-bounds.container.d.ts +2 -2
  20. package/dist/chart/canvas/y-axis-bounds.container.js +67 -1
  21. package/dist/chart/chart-container.js +1 -1
  22. package/dist/chart/chart.config.d.ts +4 -5
  23. package/dist/chart/chart.config.js +645 -1
  24. package/dist/chart/chart.d.ts +62 -0
  25. package/dist/chart/chart.js +106 -0
  26. package/dist/chart/components/chart/basic-scale.d.ts +2 -2
  27. package/dist/chart/components/chart/basic-scale.js +31 -1
  28. package/dist/chart/components/chart/candle-transformer.functions.js +15 -1
  29. package/dist/chart/components/chart/candle-width-calculator.functions.js +2 -1
  30. package/dist/chart/components/chart/candle.functions.js +44 -1
  31. package/dist/chart/components/chart/chart-area-pan.handler.d.ts +3 -3
  32. package/dist/chart/components/chart/chart-area-pan.handler.js +197 -1
  33. package/dist/chart/components/chart/chart-base.model.js +66 -1
  34. package/dist/chart/components/chart/chart.component.d.ts +7 -3
  35. package/dist/chart/components/chart/chart.component.js +408 -1
  36. package/dist/chart/components/chart/chart.model.d.ts +4 -11
  37. package/dist/chart/components/chart/chart.model.js +954 -1
  38. package/dist/chart/components/chart/data-series.high-low-provider.js +34 -1
  39. package/dist/chart/components/chart/fake-candles.js +97 -1
  40. package/dist/chart/components/chart/price.formatter.js +35 -1
  41. package/dist/chart/components/chart/secondary-chart-colors-pool.js +68 -1
  42. package/dist/chart/components/cross_tool/cross-tool.component.js +85 -1
  43. package/dist/chart/components/cross_tool/cross-tool.drawer.js +32 -1
  44. package/dist/chart/components/cross_tool/cross-tool.model.js +107 -1
  45. package/dist/chart/components/cross_tool/types/cross-and-labels.drawer.js +137 -1
  46. package/dist/chart/components/cross_tool/types/none.drawer.js +3 -1
  47. package/dist/chart/components/dran-n-drop_helper/drag-n-drop-x.component.js +28 -1
  48. package/dist/chart/components/dran-n-drop_helper/drag-n-drop-y.component.js +24 -1
  49. package/dist/chart/components/dran-n-drop_helper/drag-n-drop.component.js +53 -1
  50. package/dist/chart/components/dynamic-objects/dynamic-objects.component.d.ts +13 -0
  51. package/dist/chart/components/dynamic-objects/dynamic-objects.component.js +20 -0
  52. package/dist/chart/components/dynamic-objects/dynamic-objects.drawer.d.ts +18 -0
  53. package/dist/chart/components/dynamic-objects/dynamic-objects.drawer.js +23 -0
  54. package/dist/chart/components/dynamic-objects/dynamic-objects.model.d.ts +63 -0
  55. package/dist/chart/components/dynamic-objects/dynamic-objects.model.js +136 -0
  56. package/dist/chart/components/events/events-hit-test.drawer.js +63 -1
  57. package/dist/chart/components/events/events.component.js +61 -1
  58. package/dist/chart/components/events/events.drawer.js +195 -1
  59. package/dist/chart/components/events/events.model.js +69 -1
  60. package/dist/chart/components/grid/grid.component.d.ts +2 -2
  61. package/dist/chart/components/grid/grid.component.js +31 -1
  62. package/dist/chart/components/grid/grid.drawer.d.ts +4 -3
  63. package/dist/chart/components/grid/grid.drawer.js +106 -1
  64. package/dist/chart/components/high_low/high-low.component.js +12 -1
  65. package/dist/chart/components/high_low/high-low.drawer.js +126 -1
  66. package/dist/chart/components/highlights/highlights.component.js +46 -1
  67. package/dist/chart/components/highlights/highlights.drawer.js +154 -1
  68. package/dist/chart/components/highlights/highlights.model.js +75 -1
  69. package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +1 -1
  70. package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +199 -1
  71. package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +2 -2
  72. package/dist/chart/components/navigation_map/navigation-map-move.handler.js +108 -1
  73. package/dist/chart/components/navigation_map/navigation-map.component.js +112 -1
  74. package/dist/chart/components/navigation_map/navigation-map.drawer.js +244 -1
  75. package/dist/chart/components/navigation_map/navigation-map.model.js +33 -2
  76. package/dist/chart/components/pan/chart-pan.component.d.ts +2 -2
  77. package/dist/chart/components/pan/chart-pan.component.js +51 -1
  78. package/dist/chart/components/pane/extent/y-extent-component.d.ts +12 -18
  79. package/dist/chart/components/pane/extent/y-extent-component.js +120 -1
  80. package/dist/chart/components/pane/pane-hit-test.controller.d.ts +2 -2
  81. package/dist/chart/components/pane/pane-hit-test.controller.js +55 -1
  82. package/dist/chart/components/pane/pane-manager.component.d.ts +12 -6
  83. package/dist/chart/components/pane/pane-manager.component.js +149 -1
  84. package/dist/chart/components/pane/pane.component.d.ts +16 -32
  85. package/dist/chart/components/pane/pane.component.js +278 -1
  86. package/dist/chart/components/resizer/bar-resizer.component.js +139 -1
  87. package/dist/chart/components/resizer/bar-resizer.drawer.js +46 -1
  88. package/dist/chart/components/snapshot/snapshot.component.js +48 -1
  89. package/dist/chart/components/volumes/separate-volumes.component.d.ts +6 -10
  90. package/dist/chart/components/volumes/separate-volumes.component.js +63 -1
  91. package/dist/chart/components/volumes/volume-color-resolvers.functions.js +18 -1
  92. package/dist/chart/components/volumes/volumes.component.d.ts +6 -7
  93. package/dist/chart/components/volumes/volumes.component.js +94 -1
  94. package/dist/chart/components/volumes/volumes.drawer.d.ts +5 -12
  95. package/dist/chart/components/volumes/volumes.drawer.js +140 -1
  96. package/dist/chart/components/volumes/volumes.formatter.js +31 -1
  97. package/dist/chart/components/volumes/volumes.model.d.ts +2 -2
  98. package/dist/chart/components/volumes/volumes.model.js +43 -1
  99. package/dist/chart/components/watermark/water-mark.component.js +103 -1
  100. package/dist/chart/components/watermark/water-mark.drawer.js +187 -1
  101. package/dist/chart/components/x_axis/numeric-x-axis-labels.generator.js +27 -1
  102. package/dist/chart/components/x_axis/time/parser/time-formats-matchers.functions.js +187 -1
  103. package/dist/chart/components/x_axis/time/parser/time-formats-parser.functions.js +76 -1
  104. package/dist/chart/components/x_axis/time/parser/time-formats-validators.functions.js +79 -1
  105. package/dist/chart/components/x_axis/time/parser/time-formats.model.js +14 -1
  106. package/dist/chart/components/x_axis/time/x-axis-weights.functions.d.ts +1 -1
  107. package/dist/chart/components/x_axis/time/x-axis-weights.functions.js +143 -1
  108. package/dist/chart/components/x_axis/time/x-axis-weights.generator.js +73 -1
  109. package/dist/chart/components/x_axis/x-axis-draw.functions.js +49 -1
  110. package/dist/chart/components/x_axis/x-axis-labels.drawer.js +70 -1
  111. package/dist/chart/components/x_axis/x-axis-labels.generator.d.ts +2 -2
  112. package/dist/chart/components/x_axis/x-axis-labels.generator.js +332 -1
  113. package/dist/chart/components/x_axis/x-axis-labels.model.js +35 -1
  114. package/dist/chart/components/x_axis/x-axis-scale.handler.d.ts +2 -2
  115. package/dist/chart/components/x_axis/x-axis-scale.handler.js +60 -1
  116. package/dist/chart/components/x_axis/x-axis-time-labels.drawer.js +82 -1
  117. package/dist/chart/components/x_axis/x-axis.component.d.ts +2 -2
  118. package/dist/chart/components/x_axis/x-axis.component.js +119 -1
  119. package/dist/chart/components/y_axis/label-color.functions.js +53 -1
  120. package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +4 -4
  121. package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +33 -1
  122. package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.d.ts +3 -3
  123. package/dist/chart/components/y_axis/price_labels/data-series-y-axis-labels.provider.js +67 -1
  124. package/dist/chart/components/y_axis/price_labels/labels-positions-calculator.js +56 -1
  125. package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.d.ts +4 -3
  126. package/dist/chart/components/y_axis/price_labels/last-candle-labels.provider.js +96 -1
  127. package/dist/chart/components/y_axis/price_labels/price-label.drawer.d.ts +2 -2
  128. package/dist/chart/components/y_axis/price_labels/price-label.drawer.js +119 -1
  129. package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.d.ts +9 -8
  130. package/dist/chart/components/y_axis/price_labels/y-axis-labels.model.js +201 -1
  131. package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.d.ts +6 -7
  132. package/dist/chart/components/y_axis/price_labels/y-axis-price-labels.drawer.js +58 -1
  133. package/dist/chart/components/y_axis/y-axis-base-labels.model.d.ts +6 -4
  134. package/dist/chart/components/y_axis/y-axis-base-labels.model.js +47 -1
  135. package/dist/chart/components/y_axis/y-axis-labels.drawer.d.ts +4 -4
  136. package/dist/chart/components/y_axis/y-axis-labels.drawer.js +161 -1
  137. package/dist/chart/components/y_axis/y-axis-scale.handler.d.ts +2 -2
  138. package/dist/chart/components/y_axis/y-axis-scale.handler.js +72 -1
  139. package/dist/chart/components/y_axis/y-axis.component.d.ts +32 -41
  140. package/dist/chart/components/y_axis/y-axis.component.js +220 -1
  141. package/dist/chart/components/y_axis/y-axis.drawer.d.ts +9 -12
  142. package/dist/chart/components/y_axis/y-axis.drawer.js +96 -1
  143. package/dist/chart/components/y_axis/y-axis.model.d.ts +10 -17
  144. package/dist/chart/components/y_axis/y-axis.model.js +34 -1
  145. package/dist/chart/drawers/chart-background.drawer.js +69 -1
  146. package/dist/chart/drawers/chart-type-drawers/area.drawer.js +69 -1
  147. package/dist/chart/drawers/chart-type-drawers/bar.drawer.js +57 -1
  148. package/dist/chart/drawers/chart-type-drawers/baseline.drawer.js +84 -1
  149. package/dist/chart/drawers/chart-type-drawers/candle.drawer.js +162 -1
  150. package/dist/chart/drawers/chart-type-drawers/histogram.drawer.js +57 -1
  151. package/dist/chart/drawers/chart-type-drawers/line.drawer.js +38 -1
  152. package/dist/chart/drawers/chart-type-drawers/scatter-plot.drawer.js +19 -1
  153. package/dist/chart/drawers/clear-canvas.drawer.js +14 -1
  154. package/dist/chart/drawers/composite.drawer.js +67 -1
  155. package/dist/chart/drawers/data-series-drawers/candle-series-wrapper.js +50 -1
  156. package/dist/chart/drawers/data-series-drawers/color-candle.drawer.js +35 -1
  157. package/dist/chart/drawers/data-series-drawers/data-series-drawers.utils.js +16 -1
  158. package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +106 -1
  159. package/dist/chart/drawers/data-series-drawers/histogram.drawer.js +23 -1
  160. package/dist/chart/drawers/data-series-drawers/linear.drawer.js +19 -1
  161. package/dist/chart/drawers/data-series-drawers/points.drawer.js +19 -1
  162. package/dist/chart/drawers/data-series-drawers/rectangular-tool.drawer.js +7 -1
  163. package/dist/chart/drawers/data-series-drawers/text.drawer.js +25 -1
  164. package/dist/chart/drawers/data-series-drawers/trend-histogram.drawer.js +35 -1
  165. package/dist/chart/drawers/data-series-drawers/triangle.drawer.js +22 -1
  166. package/dist/chart/drawers/data-series.drawer.d.ts +5 -7
  167. package/dist/chart/drawers/data-series.drawer.js +56 -1
  168. package/dist/chart/drawers/drawing-manager.d.ts +1 -1
  169. package/dist/chart/drawers/drawing-manager.js +177 -1
  170. package/dist/chart/drawers/ht-data-series.drawer.js +37 -1
  171. package/dist/chart/events/event-bus.js +73 -1
  172. package/dist/chart/events/events.js +3 -1
  173. package/dist/chart/inputhandlers/candle-tap.handler.js +46 -1
  174. package/dist/chart/inputhandlers/chart-resize.handler.js +98 -1
  175. package/dist/chart/inputhandlers/cross-event-producer.component.js +67 -1
  176. package/dist/chart/inputhandlers/hover-producer.component.d.ts +2 -2
  177. package/dist/chart/inputhandlers/hover-producer.component.js +228 -1
  178. package/dist/chart/inputhandlers/main-canvas-touch.handler.d.ts +2 -2
  179. package/dist/chart/inputhandlers/main-canvas-touch.handler.js +80 -1
  180. package/dist/chart/inputlisteners/canvas-input-listener.component.js +629 -1
  181. package/dist/chart/model/baseline.model.js +88 -1
  182. package/dist/chart/model/bounds.model.js +1 -1
  183. package/dist/chart/model/candle-hover.js +70 -1
  184. package/dist/chart/model/candle-series-high-low.provider.js +45 -1
  185. package/dist/chart/model/candle-series.model.d.ts +3 -3
  186. package/dist/chart/model/candle-series.model.js +245 -1
  187. package/dist/chart/model/candle.model.js +69 -1
  188. package/dist/chart/model/canvas.model.js +228 -1
  189. package/dist/chart/model/chart-base-element.js +129 -1
  190. package/dist/chart/model/compare-series-hover.js +25 -1
  191. package/dist/chart/model/data-series-view.d.ts +5 -5
  192. package/dist/chart/model/data-series-view.js +111 -1
  193. package/dist/chart/model/data-series.config.js +14 -1
  194. package/dist/chart/model/data-series.model.d.ts +4 -4
  195. package/dist/chart/model/data-series.model.js +281 -1
  196. package/dist/chart/model/date-time.formatter.js +151 -1
  197. package/dist/chart/model/hit-test-canvas.model.d.ts +1 -1
  198. package/dist/chart/model/hit-test-canvas.model.js +256 -1
  199. package/dist/chart/model/main-candle-series.model.d.ts +1 -1
  200. package/dist/chart/model/main-candle-series.model.js +29 -1
  201. package/dist/chart/model/scale.model.d.ts +3 -2
  202. package/dist/chart/model/scale.model.js +316 -1
  203. package/dist/chart/model/scaling/auto-scale.model.d.ts +2 -4
  204. package/dist/chart/model/scaling/auto-scale.model.js +91 -1
  205. package/dist/chart/model/scaling/constrait.functions.js +61 -1
  206. package/dist/chart/model/scaling/lock-ratio.model.js +17 -1
  207. package/dist/chart/model/scaling/move-chart.functions.js +22 -1
  208. package/dist/chart/model/scaling/viewport.model.d.ts +2 -2
  209. package/dist/chart/model/scaling/viewport.model.js +279 -1
  210. package/dist/chart/model/scaling/x-zooming.functions.js +35 -1
  211. package/dist/chart/model/time-zone.model.js +109 -1
  212. package/dist/chart/model/visual-candle.js +134 -1
  213. package/dist/chart/utils/__tests__/array.utils.test.js +135 -1
  214. package/dist/chart/utils/__tests__/math.utils.test.js +14 -1
  215. package/dist/chart/utils/__tests__/object.utils.test.js +11 -1
  216. package/dist/chart/utils/__tests__/priceIncrementsUtils.test.js +29 -1
  217. package/dist/chart/utils/array.utils.d.ts +1 -1
  218. package/dist/chart/utils/array.utils.js +269 -1
  219. package/dist/chart/utils/auto-period-detector.utils.js +39 -1
  220. package/dist/chart/utils/candles-generator-ts.utils.js +20 -1
  221. package/dist/chart/utils/candles-generator.utils.js +161 -1
  222. package/dist/chart/utils/candles.utils.js +42 -1
  223. package/dist/chart/utils/canvas/canvas-drawing-functions.utils.js +144 -1
  224. package/dist/chart/utils/canvas/canvas-font-measure-tool.utils.js +51 -1
  225. package/dist/chart/utils/canvas/canvas-text-functions.utils.js +156 -1
  226. package/dist/chart/utils/color.utils.js +31 -1
  227. package/dist/chart/utils/device/browser.utils.js +10 -1
  228. package/dist/chart/utils/device/device-detector.utils.js +24 -1
  229. package/dist/chart/utils/device/device-pixel-ratio.utils.js +21 -1
  230. package/dist/chart/utils/device/touchpad.utils.js +91 -1
  231. package/dist/chart/utils/dom.utils.js +15 -1
  232. package/dist/chart/utils/function.utils.js +16 -1
  233. package/dist/chart/utils/linkedList.utils.d.ts +28 -0
  234. package/dist/chart/utils/linkedList.utils.js +138 -0
  235. package/dist/chart/utils/math.utils.js +115 -1
  236. package/dist/chart/utils/merge.utils.js +56 -1
  237. package/dist/chart/utils/object.utils.js +43 -1
  238. package/dist/chart/utils/performance/animation-frame-cache.utils.js +77 -0
  239. package/dist/chart/utils/{perfomance → performance}/debounce.utils.js +7 -1
  240. package/dist/chart/utils/performance/memoize.utils.js +74 -0
  241. package/dist/chart/utils/performance/request-animation-frame-throttle.utils.js +43 -0
  242. package/dist/chart/utils/performance/throttle.utils.js +26 -0
  243. package/dist/chart/utils/price-increments.utils.d.ts +1 -0
  244. package/dist/chart/utils/price-increments.utils.js +127 -1
  245. package/dist/chart/utils/uuid.utils.js +4 -1
  246. package/dist/dxchart.min.js +9 -12
  247. package/dist/index.d.ts +3 -3
  248. package/dist/index.js +20 -1
  249. package/package.json +4 -4
  250. package/dist/chart/utils/perfomance/animation-frame-cache.utils.js +0 -6
  251. package/dist/chart/utils/perfomance/memoize.utils.js +0 -6
  252. package/dist/chart/utils/perfomance/request-animation-frame-throttle.utils.js +0 -6
  253. package/dist/chart/utils/perfomance/throttle.utils.js +0 -6
  254. /package/dist/chart/utils/{perfomance → performance}/animation-frame-cache.utils.d.ts +0 -0
  255. /package/dist/chart/utils/{perfomance → performance}/debounce.utils.d.ts +0 -0
  256. /package/dist/chart/utils/{perfomance → performance}/memoize.utils.d.ts +0 -0
  257. /package/dist/chart/utils/{perfomance → performance}/request-animation-frame-throttle.utils.d.ts +0 -0
  258. /package/dist/chart/utils/{perfomance → performance}/throttle.utils.d.ts +0 -0
@@ -3,4 +3,648 @@
3
3
  * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
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
5
  */
6
- import{DEFAULT_MERGE_OPTIONS as n,merge as i}from"./utils/merge.utils";export const MAIN_FONT="Open Sans Semibold, sans-serif",LastBarRedrawableBarTypes=["candle","bar","scatterPlot","trend","hollow","histogram"],availableBarTypes=["candle","line","area","bar","scatterPlot","trend","hollow","histogram","baseline"],isLastBarRedrawAvailable=r=>LastBarRedrawableBarTypes.find(o=>o===r)!==void 0,getDefaultConfig=()=>({devexpertsPromoLink:!0,useUTCTimeOverride:!1,shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rtl:!1,scale:{keepZoomXOnYAxisChange:!0,auto:!0,zoomToCursor:!1,lockPriceToBarRatio:!1,autoScaleOnCandles:!0,autoScaleDisableOnDrag:{enabled:!0,edgeAngle:Math.PI/15,yDiff:80},inverse:!1,zoomSensitivity:.25,defaultViewportItems:100},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,components:{chart:{type:"candle",showCandlesBorder:!0,showActiveCandlesBorder:!0,showWicks:!0,candleLineWidth:1,lineWidth:1,areaLineWidth:1,barLineWidth:1,minWidth:.5,minCandles:10,candlePaddingPercent:.25,highlightActiveCandle:!0,cursor:"default",selectedWidth:3,minCandlesOffset:2,defaultZoomCandleWidth:7,zoomStep:0,histogram:{barCapSize:1}},yAxis:{type:"regular",visible:!0,labelHeight:23,zeroPercentLine:!0,customScale:!0,customScaleDblClick:!0,align:"right",fontSize:12,fontFamily:MAIN_FONT,cursor:"ns-resize",resizeDisabledCursor:"default",labelBoxMargin:{top:4,bottom:4,end:8,start:10},typeConfig:{badge:{rounded:!0,paddings:{top:4,bottom:4,end:4,start:4}},plain:{},rectangle:{rounded:!1,paddings:{top:4,bottom:4,end:4,start:4}}},labels:{descriptions:!1,settings:{lastPrice:{mode:"label",type:"badge"},countdownToBarClose:{mode:"none",type:"rectangle"}}}},xAxis:{visible:!0,formatsForLabelsConfig:{lessThanSecond:"HH:mm:ss",second_1:"HH:mm:ss",minute_1:"HH:mm",minute_5:"HH:mm",minute_30:"HH:mm",hour_1:"HH:mm",day_1:"dd.MM",month_1:"MMM",year_1:"YYYY"},fontSize:12,fontFamily:MAIN_FONT,cursor:"ew-resize",padding:{top:8,bottom:16},fontStyle:""},events:{visible:!1,eventsVisibility:{"conference-calls":!0,dividends:!0,splits:!0,earnings:!0},height:20,cursor:"default",xAxisLabelFormat:[{format:"d MMM"}],icons:{earnings:{normal:'<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.06066 6.5L6.5 1.06066L11.9393 6.5L6.5 11.9393L1.06066 6.5Z" stroke="#D92C40" stroke-width="1.5"/></svg>',hover:'<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.06066 6.5L6.5 1.06066L11.9393 6.5L6.5 11.9393L1.06066 6.5Z" fill="#D92C40" stroke="#D92C40" stroke-width="1.5"/></svg>'}}},offsets:{visible:!0,right:10,top:10,bottom:20,left:0},waterMark:{visible:!1,fontFamily:"Open Sans, sans-serif",firstRowFontSize:80,firstRowBottomPadding:10,secondRowFontSize:40,secondRowBottomPadding:25,thirdRowFontSize:40,thirdRowBottomPadding:15,position:"center",offsetX:20,offsetY:20,logoWidth:20,logoHeight:20},highLow:{visible:!1,font:"12px sans-serif"},highlights:{visible:!1,fontFamily:"Open Sans",fontSize:13,border:{width:1,dash:[8,4]}},crossTool:{type:"cross-and-labels",discrete:!1,magnetTarget:"none",lineDash:[4,6],xAxisLabelFormat:[{format:"dd.MM.YYYY",showWhen:{periodMoreThen:846e5}},{format:"dd.MM.YYYY HH:mm",showWhen:{periodLessThen:846e5,periodMoreThen:6e3}},{format:"dd.MM.YYYY HH:mm:ss",showWhen:{periodLessThen:6e3}}],xLabel:{padding:{top:4,bottom:4,right:8,left:8},margin:{top:4}},yLabel:{padding:{top:4,bottom:4,end:4,start:4},type:"badge"}},grid:{visible:!0,horizontal:!1,vertical:!0,width:1,dash:[0,0],color:"#FFFFFF"},volumes:{visible:!0,showSeparately:!1,valueLines:15,barCapSize:1,volumeBarSpace:0,volumeFillColor:"#FFFFFF"},navigationMap:{visible:!1,allCandlesHistory:!0,timeLabels:{visible:!1,dateFormat:"dd.MM.YYYY HH:mm",fontFamily:"Open Sans",fontSize:13,padding:{x:10,y:1}},minSliderWindowWidth:10,cursors:{chart:"default",buttonLeft:"pointer",buttonRight:"pointer",leftResizer:"ew-resize",rightResizer:"ew-resize",slider:"grab"},knots:{height:35,width:7,border:0,lineWidth:1}},baseline:{cursor:"ns-resize",dragZone:3,height:1},paneResizer:{cursor:"ns-resize",height:1,visible:!0,fixedMode:!1,dragZone:3}},colors:{candleTheme:{upColor:"rgba(77,153,83,1)",downColor:"rgba(217,44,64,1)",noneColor:"rgba(255,255,255,1)",upWickColor:"rgba(77,153,83,1)",downWickColor:"rgba(217,44,64,1)",noneWickColor:"rgba(255,255,255,1)",borderOpacity:1},barTheme:{upColor:"rgba(77,153,83,1)",downColor:"rgba(217,44,64,1)",noneColor:"rgba(255,255,255,1)"},lineTheme:{upColor:"rgba(77,153,83,1)",downColor:"rgba(217,44,64,1)",noneColor:"rgba(255,255,255,1)"},chartAreaTheme:{backgroundMode:"regular",backgroundColor:"rgba(20,20,19,1)",backgroundGradientTopColor:"red",backgroundGradientBottomColor:"blue",axisColor:"rgba(128,128,128,1)",gridColor:"rgba(37,37,36,1)"},scatterPlot:{mainColor:"rgba(255,255,255,1)"},areaTheme:{lineColor:"rgba(127,120,214,1)",startColor:"rgba(169,38,251,1)",stopColor:"rgba(169,38,251,0.8)"},baseLineTheme:{lowerSectionStrokeColor:"rgba(217,44,64,1)",upperSectionStrokeColor:"rgba(77,153,83,1)",lowerSectionFillColor:"rgba(217, 44, 64, 0.07)",upperSectionFillColor:"rgba(77, 153, 83, 0.07)",baselineColor:"rgba(55,55,54,1)"},histogram:{upCap:"rgba(77,153,83,1)",upBottom:"rgba(77,153,83,0.1)",upBright:"rgba(77,153,83,0.4)",downCap:"rgba(217,44,64,1)",downBottom:"rgba(217,44,64,0.1)",downBright:"rgba(217,44,64,0.4)",noneCap:"rgba(255,255,255,1)",noneBottom:"rgba(255,255,255,0.1)",noneBright:"rgba(255,255,255,0.4)"},crossTool:{lineColor:"rgba(107,96,86,1)",labelBoxColor:"rgba(107,96,86,1)",labelTextColor:"rgba(255,255,255,1)"},waterMarkTheme:{firstRowColor:"rgba(255,255,255,0.2)",secondRowColor:"rgba(255,255,255,0.2)",thirdRowColor:"rgba(255,255,255,0.2)"},highlights:{NO_TRADING:{border:"rgba(107,96,86,1)",background:"transparent",label:"transparent"},AFTER_MARKET:{border:"rgba(107,96,86,1)",background:"rgba(38, 251, 149, 0.05)",label:"transparent"},PRE_MARKET:{border:"rgba(107,96,86,1)",background:"rgba(255, 170, 0, 0.05)",label:"transparent"},REGULAR:{border:"rgba(107,96,86,1)",background:"transparent",label:"transparent"}},activeCandleTheme:{upColor:"rgba(98,201,93,1)",downColor:"rgba(255,47,47,1)",noneColor:"rgba(255,255,255,1)",upWickColor:"rgba(98,201,93,1)",downWickColor:"rgba(255,47,47,1)",noneWickColor:"rgba(255,255,255,1)",borderOpacity:.5},volume:{downBarColor:"rgba(99,30,37,1)",upBarColor:"rgba(42,72,44,1)",noneBarColor:"rgba(255,255,255,0.4)",upCapColor:"rgba(42,72,44,1)",downCapColor:"rgba(99,30,37,1)",noneCapColor:"rgba(255,255,255,0.4)"},highLowTheme:{highColor:"rgba(223,222,223,1)",lowColor:"rgba(223,222,223,1)"},instrumentInfo:{textColor:"#aeb1b3"},paneResizer:{lineColor:"rgba(55,55,54,1)",bgColor:"rgba(20,20,19,1)",bgHoverColor:"rgba(55,55,54,0.6)"},events:{earnings:{color:"rgba(217,44,64,1)"},dividends:{color:"rgba(169,38,251,1)"},splits:{color:"rgba(244,187,63,1)"},"conference-calls":{color:"rgba(48,194,97,1)"}},secondaryChartTheme:[{lineTheme:{upColor:"rgba(226,61,25,1)",downColor:"rgba(226,61,25,1)",noneColor:"rgba(226,61,25,1)"},areaTheme:{lineColor:"rgba(226,61,25,1)",startColor:"rgba(226,61,25,0.8)",stopColor:"rgba(226,61,25,0)"}},{lineTheme:{upColor:"rgba(250,191,64,1)",downColor:"rgba(250,191,64,1)",noneColor:"rgba(250,191,64,1)"},areaTheme:{lineColor:"rgba(250,191,64,1)",startColor:"rgba(250,191,64,0.8)",stopColor:"rgba(250,191,64,0)"}},{lineTheme:{upColor:"rgba(169,38,251,1)",downColor:"rgba(169,38,251,1)",noneColor:"rgba(169,38,251,1)"},areaTheme:{lineColor:"rgba(169,38,251,1)",startColor:"rgba(169,38,251,0.8)",stopColor:"rgba(169,38,251,0)"}},{lineTheme:{upColor:"rgba(77,211,240,1)",downColor:"rgba(77,211,240,1)",noneColor:"rgba(77,211,240,1)"},areaTheme:{lineColor:"rgba(77,211,240,1)",startColor:"rgba(77,211,240,0.8)",stopColor:"rgba(77,211,240,0)"}},{lineTheme:{upColor:"rgba(59,203,91,1)",downColor:"rgba(59,203,91,1)",noneColor:"rgba(59,203,91,1)"},areaTheme:{lineColor:"rgba(59,203,91,1)",startColor:"rgba(59,203,91,0.8)",stopColor:"rgba(59,203,91,0)"}}],yAxis:{backgroundColor:"transparent",backgroundHoverColor:"rgba(20,20,19,1)",labelBoxColor:"rgba(20,20,19,1)",labelTextColor:"rgba(128,128,128,1)",labelInvertedTextColor:"rgba(20,20,19,1)",rectLabelTextColor:"rgba(255,255,255,1)",rectLabelInvertedTextColor:"rgba(20,20,19,1)",zeroPercentLine:"rgba(55,55,54,1)"},labels:{lastPrice:{textNegative:"rgba(255,255,255,1)",textPositive:"rgba(255,255,255,1)",textSelected:"rgba(0,0,0,1)",boxNegative:"rgba(217,44,64,1)",boxPositive:"rgba(77,153,83,1)",boxSelected:"rgba(255,255,255,1)"},countdownToBarClose:{textNegative:"rgba(255,255,255,1)",textPositive:"rgba(255,255,255,1)",textSelected:"rgba(255,255,255,1)",boxNegative:"rgba(217,44,64,1)",boxPositive:"rgba(77,153,83,1)",boxSelected:"rgba(255,255,255,1)"},highLow:{high:{boxColor:"rgba(107,96,86,1)",textColor:"rgba(255,255,255,1)",descriptionText:"High"},low:{boxColor:"rgba(107,96,86,1)",textColor:"rgba(255,255,255,1)",descriptionText:"Low"}},bidAsk:{bid:{boxColor:"rgba(77,153,83,1)",textColor:"rgba(255,255,255,1)",descriptionText:"Bid"},ask:{boxColor:"rgba(217,44,64,1)",textColor:"rgba(255,255,255,1)",descriptionText:"Ask"}},prePostMarket:{post:{boxColor:"rgba(38,251,149,1)",textColor:"rgba(20,20,19,1)",descriptionText:"Post"},pre:{boxColor:"rgba(255,170,0,1)",textColor:"rgba(20,20,19,1)",descriptionText:"Pre"}},prevDayClose:{boxColor:"rgba(107,96,86,1)",textColor:"rgba(255,255,255,1)"}},xAxis:{backgroundColor:"transparent",labelTextColor:"rgba(128,128,128,1)"},navigationMap:{backgroundColor:"transparent",buttonColor:"rgba(255,255,255,0.1)",buttonArrowColor:"rgba(212,212,211,1)",knotColor:"rgba(255,255,255,0.1)",knotLineColor:"rgba(212,212,211,1)",sliderColor:"rgba(255,255,255,0.08)",knotBorderColor:"#0b0d1a",timeLabelsTextColor:"rgba(128,128,128,1)",mapColor:"rgba(255,255,255,0.1)",mapFillColor:"rgba(255,255,255,0.1)",mapGradientTopColor:"rgba(255,255,255,0.1)",mapGradientBottomColor:"rgba(255,255,255,0.1)"}},animation:{moveDuration:1e3,candleDuration:200,paneResizer:{bgMode:!0,enabled:!0,duration:40},yAxis:{background:{enabled:!1,duration:40}}},drawingOrder:["OVER_SERIES_CLEAR","MAIN_CLEAR","SERIES_CLEAR","GRID","X_AXIS","Y_AXIS","UNDERLAY_VOLUMES_AREA","VOLUMES","DATA_SERIES","DRAWINGS","WATERMARK","N_MAP_CHART","EVENTS"]});export function mergeWithDefaultConfig(r,o=getDefaultConfig()){return i(r,o,n),r}export function mergeWithDefaultConfigCopy(r,o=getDefaultConfig()){const e=Object.assign({},r);return i(e,o,n),e}export function rewrite(r,o){Object.keys(r).forEach(e=>delete r[e]),Object.keys(o).forEach(e=>r[e]=o[e])}function s(r){return typeof r=="object"&&r!==null}function b(r,o){return[...r].map(a=>l(a,o))}const g=r=>Array.isArray(r);function l(r,o){if(!s(r))return r;if(g(r))return b(r,o);{const e=immutableMerge({},r,o);return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),e}}export function immutableMerge(r,o,e){if(!s(r))return e.overrideExisting?o:r;if(Array.isArray(r)&&Array.isArray(o)){const t=e.overrideExisting?o:r;return b(t,e)}const a=Object.create(Object.getPrototypeOf(r));return Object.keys(r).forEach(t=>a[t]=l(r[t],e)),Object.keys(o).forEach(t=>{t in r?a[t]=immutableMerge(r[t],o[t],e):e.addIfMissing&&(a[t]=l(o[t],e))}),a}export const getFontFromConfig=r=>`${r.fontSize}px ${r.fontFamily}`;
6
+ import { DEFAULT_MERGE_OPTIONS, merge } from './utils/merge.utils';
7
+ export const MAIN_FONT = 'Open Sans Semibold, sans-serif';
8
+ export const LastBarRedrawableBarTypes = ['candle', 'bar', 'scatterPlot', 'trend', 'hollow', 'histogram'];
9
+ export const availableBarTypes = [
10
+ 'candle',
11
+ 'line',
12
+ 'area',
13
+ 'bar',
14
+ 'scatterPlot',
15
+ 'trend',
16
+ 'hollow',
17
+ 'histogram',
18
+ 'baseline',
19
+ ];
20
+ export const isLastBarRedrawAvailable = (type) => LastBarRedrawableBarTypes.find(t => t === type) !== undefined;
21
+ /**
22
+ * Full chart-core default config.
23
+ * @doc-tags chart-core,default-config
24
+ * @doc-tags-name getDefaultConfig=xl
25
+ */
26
+ export const getDefaultConfig = () => ({
27
+ devexpertsPromoLink: true,
28
+ useUTCTimeOverride: false,
29
+ shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
30
+ shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
31
+ rtl: false,
32
+ scale: {
33
+ keepZoomXOnYAxisChange: true,
34
+ auto: true,
35
+ zoomToCursor: false,
36
+ lockPriceToBarRatio: false,
37
+ autoScaleOnCandles: true,
38
+ autoScaleDisableOnDrag: {
39
+ enabled: true,
40
+ edgeAngle: Math.PI / 15,
41
+ yDiff: 80,
42
+ },
43
+ inverse: false,
44
+ zoomSensitivity: 0.25,
45
+ defaultViewportItems: 100,
46
+ },
47
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
48
+ components: {
49
+ chart: {
50
+ type: 'candle',
51
+ showCandlesBorder: true,
52
+ showActiveCandlesBorder: true,
53
+ showWicks: true,
54
+ candleLineWidth: 1,
55
+ lineWidth: 1,
56
+ areaLineWidth: 1,
57
+ barLineWidth: 1,
58
+ minWidth: 0.5,
59
+ minCandles: 10,
60
+ candlePaddingPercent: 0.25,
61
+ highlightActiveCandle: true,
62
+ cursor: 'default',
63
+ selectedWidth: 3,
64
+ minCandlesOffset: 2,
65
+ defaultZoomCandleWidth: 7,
66
+ zoomStep: 0,
67
+ histogram: {
68
+ barCapSize: 1,
69
+ },
70
+ },
71
+ yAxis: {
72
+ type: 'regular',
73
+ visible: true,
74
+ labelHeight: 23,
75
+ zeroPercentLine: true,
76
+ customScale: true,
77
+ customScaleDblClick: true,
78
+ align: 'right',
79
+ fontSize: 12,
80
+ fontFamily: MAIN_FONT,
81
+ cursor: 'ns-resize',
82
+ resizeDisabledCursor: 'default',
83
+ labelBoxMargin: {
84
+ top: 4,
85
+ bottom: 4,
86
+ end: 8,
87
+ start: 10,
88
+ },
89
+ typeConfig: {
90
+ badge: {
91
+ rounded: true,
92
+ paddings: {
93
+ top: 4,
94
+ bottom: 4,
95
+ end: 4,
96
+ start: 4,
97
+ },
98
+ },
99
+ plain: {},
100
+ rectangle: {
101
+ rounded: false,
102
+ paddings: {
103
+ top: 4,
104
+ bottom: 4,
105
+ end: 4,
106
+ start: 4,
107
+ },
108
+ },
109
+ },
110
+ labels: {
111
+ descriptions: false,
112
+ settings: {
113
+ lastPrice: {
114
+ mode: 'label',
115
+ type: 'badge',
116
+ },
117
+ countdownToBarClose: {
118
+ mode: 'none',
119
+ type: 'rectangle',
120
+ },
121
+ },
122
+ },
123
+ },
124
+ xAxis: {
125
+ visible: true,
126
+ formatsForLabelsConfig: {
127
+ lessThanSecond: 'HH:mm:ss',
128
+ second_1: 'HH:mm:ss',
129
+ minute_1: 'HH:mm',
130
+ minute_5: 'HH:mm',
131
+ minute_30: 'HH:mm',
132
+ hour_1: 'HH:mm',
133
+ day_1: 'dd.MM',
134
+ month_1: 'MMM',
135
+ year_1: 'YYYY',
136
+ },
137
+ fontSize: 12,
138
+ fontFamily: MAIN_FONT,
139
+ cursor: 'ew-resize',
140
+ padding: {
141
+ top: 8,
142
+ bottom: 16,
143
+ },
144
+ fontStyle: '',
145
+ },
146
+ events: {
147
+ visible: false,
148
+ eventsVisibility: {
149
+ 'conference-calls': true,
150
+ dividends: true,
151
+ splits: true,
152
+ earnings: true,
153
+ },
154
+ height: 20,
155
+ cursor: 'default',
156
+ xAxisLabelFormat: [
157
+ {
158
+ format: 'd MMM',
159
+ },
160
+ ],
161
+ icons: {
162
+ earnings: {
163
+ normal: '<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.06066 6.5L6.5 1.06066L11.9393 6.5L6.5 11.9393L1.06066 6.5Z" stroke="#D92C40" stroke-width="1.5"/></svg>',
164
+ hover: '<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.06066 6.5L6.5 1.06066L11.9393 6.5L6.5 11.9393L1.06066 6.5Z" fill="#D92C40" stroke="#D92C40" stroke-width="1.5"/></svg>',
165
+ },
166
+ },
167
+ },
168
+ offsets: {
169
+ visible: true,
170
+ right: 10,
171
+ top: 10,
172
+ bottom: 20,
173
+ left: 0,
174
+ },
175
+ waterMark: {
176
+ visible: false,
177
+ fontFamily: 'Open Sans, sans-serif',
178
+ firstRowFontSize: 80,
179
+ firstRowBottomPadding: 10,
180
+ secondRowFontSize: 40,
181
+ secondRowBottomPadding: 25,
182
+ thirdRowFontSize: 40,
183
+ thirdRowBottomPadding: 15,
184
+ position: 'center',
185
+ offsetX: 20,
186
+ offsetY: 20,
187
+ logoWidth: 20,
188
+ logoHeight: 20,
189
+ },
190
+ highLow: { visible: false, font: '12px sans-serif' },
191
+ highlights: {
192
+ visible: false,
193
+ fontFamily: 'Open Sans',
194
+ fontSize: 13,
195
+ border: {
196
+ width: 1,
197
+ dash: [8, 4],
198
+ },
199
+ },
200
+ crossTool: {
201
+ type: 'cross-and-labels',
202
+ discrete: false,
203
+ magnetTarget: 'none',
204
+ lineDash: [4, 6],
205
+ xAxisLabelFormat: [
206
+ {
207
+ format: 'dd.MM.YYYY',
208
+ showWhen: {
209
+ periodMoreThen: 84600000,
210
+ },
211
+ },
212
+ {
213
+ format: 'dd.MM.YYYY HH:mm',
214
+ showWhen: {
215
+ periodLessThen: 84600000,
216
+ periodMoreThen: 6000,
217
+ },
218
+ },
219
+ {
220
+ format: 'dd.MM.YYYY HH:mm:ss',
221
+ showWhen: {
222
+ periodLessThen: 6000,
223
+ },
224
+ },
225
+ ],
226
+ xLabel: {
227
+ padding: {
228
+ top: 4,
229
+ bottom: 4,
230
+ right: 8,
231
+ left: 8,
232
+ },
233
+ margin: {
234
+ top: 4,
235
+ },
236
+ },
237
+ yLabel: {
238
+ padding: {
239
+ top: 4,
240
+ bottom: 4,
241
+ end: 4,
242
+ start: 4,
243
+ },
244
+ type: 'badge',
245
+ },
246
+ },
247
+ grid: {
248
+ visible: true,
249
+ horizontal: false,
250
+ vertical: true,
251
+ width: 1,
252
+ dash: [0, 0],
253
+ color: '#FFFFFF',
254
+ },
255
+ volumes: {
256
+ visible: true,
257
+ showSeparately: false,
258
+ valueLines: 15,
259
+ barCapSize: 1,
260
+ volumeBarSpace: 0,
261
+ volumeFillColor: '#FFFFFF',
262
+ },
263
+ navigationMap: {
264
+ visible: false,
265
+ allCandlesHistory: true,
266
+ timeLabels: {
267
+ visible: false,
268
+ dateFormat: 'dd.MM.YYYY HH:mm',
269
+ fontFamily: 'Open Sans',
270
+ fontSize: 13,
271
+ padding: {
272
+ x: 10,
273
+ y: 1,
274
+ },
275
+ },
276
+ minSliderWindowWidth: 10,
277
+ cursors: {
278
+ chart: 'default',
279
+ buttonLeft: 'pointer',
280
+ buttonRight: 'pointer',
281
+ leftResizer: 'ew-resize',
282
+ rightResizer: 'ew-resize',
283
+ slider: 'grab',
284
+ },
285
+ knots: {
286
+ height: 35,
287
+ width: 7,
288
+ border: 0,
289
+ lineWidth: 1,
290
+ },
291
+ },
292
+ baseline: {
293
+ cursor: 'ns-resize',
294
+ dragZone: 3,
295
+ height: 1,
296
+ },
297
+ paneResizer: {
298
+ cursor: 'ns-resize',
299
+ height: 1,
300
+ visible: true,
301
+ fixedMode: false,
302
+ dragZone: 3,
303
+ },
304
+ },
305
+ colors: {
306
+ candleTheme: {
307
+ upColor: 'rgba(77,153,83,1)',
308
+ downColor: 'rgba(217,44,64,1)',
309
+ noneColor: 'rgba(255,255,255,1)',
310
+ upWickColor: 'rgba(77,153,83,1)',
311
+ downWickColor: 'rgba(217,44,64,1)',
312
+ noneWickColor: 'rgba(255,255,255,1)',
313
+ borderOpacity: 1,
314
+ },
315
+ barTheme: { upColor: 'rgba(77,153,83,1)', downColor: 'rgba(217,44,64,1)', noneColor: 'rgba(255,255,255,1)' },
316
+ lineTheme: { upColor: 'rgba(77,153,83,1)', downColor: 'rgba(217,44,64,1)', noneColor: 'rgba(255,255,255,1)' },
317
+ chartAreaTheme: {
318
+ backgroundMode: 'regular',
319
+ backgroundColor: 'rgba(20,20,19,1)',
320
+ backgroundGradientTopColor: 'red',
321
+ backgroundGradientBottomColor: 'blue',
322
+ gridColor: 'rgba(37,37,36,1)',
323
+ },
324
+ scatterPlot: { mainColor: 'rgba(255,255,255,1)' },
325
+ areaTheme: {
326
+ lineColor: 'rgba(127,120,214,1)',
327
+ startColor: 'rgba(169,38,251,1)',
328
+ stopColor: 'rgba(169,38,251,0.8)',
329
+ },
330
+ baseLineTheme: {
331
+ lowerSectionStrokeColor: 'rgba(217,44,64,1)',
332
+ upperSectionStrokeColor: 'rgba(77,153,83,1)',
333
+ lowerSectionFillColor: 'rgba(217, 44, 64, 0.07)',
334
+ upperSectionFillColor: 'rgba(77, 153, 83, 0.07)',
335
+ baselineColor: 'rgba(55,55,54,1)',
336
+ },
337
+ histogram: {
338
+ upCap: 'rgba(77,153,83,1)',
339
+ upBottom: 'rgba(77,153,83,0.1)',
340
+ upBright: 'rgba(77,153,83,0.4)',
341
+ downCap: 'rgba(217,44,64,1)',
342
+ downBottom: 'rgba(217,44,64,0.1)',
343
+ downBright: 'rgba(217,44,64,0.4)',
344
+ noneCap: 'rgba(255,255,255,1)',
345
+ noneBottom: 'rgba(255,255,255,0.1)',
346
+ noneBright: 'rgba(255,255,255,0.4)',
347
+ },
348
+ crossTool: {
349
+ lineColor: 'rgba(107,96,86,1)',
350
+ labelBoxColor: 'rgba(107,96,86,1)',
351
+ labelTextColor: 'rgba(255,255,255,1)',
352
+ },
353
+ waterMarkTheme: {
354
+ firstRowColor: 'rgba(255,255,255,0.2)',
355
+ secondRowColor: 'rgba(255,255,255,0.2)',
356
+ thirdRowColor: 'rgba(255,255,255,0.2)',
357
+ },
358
+ highlights: {
359
+ NO_TRADING: { border: 'rgba(107,96,86,1)', background: 'transparent', label: 'transparent' },
360
+ AFTER_MARKET: { border: 'rgba(107,96,86,1)', background: 'rgba(38, 251, 149, 0.05)', label: 'transparent' },
361
+ PRE_MARKET: { border: 'rgba(107,96,86,1)', background: 'rgba(255, 170, 0, 0.05)', label: 'transparent' },
362
+ REGULAR: { border: 'rgba(107,96,86,1)', background: 'transparent', label: 'transparent' },
363
+ },
364
+ activeCandleTheme: {
365
+ upColor: 'rgba(98,201,93,1)',
366
+ downColor: 'rgba(255,47,47,1)',
367
+ noneColor: 'rgba(255,255,255,1)',
368
+ upWickColor: 'rgba(98,201,93,1)',
369
+ downWickColor: 'rgba(255,47,47,1)',
370
+ noneWickColor: 'rgba(255,255,255,1)',
371
+ borderOpacity: 0.5,
372
+ },
373
+ volume: {
374
+ downBarColor: 'rgba(99,30,37,1)',
375
+ upBarColor: 'rgba(42,72,44,1)',
376
+ noneBarColor: 'rgba(255,255,255,0.4)',
377
+ upCapColor: 'rgba(42,72,44,1)',
378
+ downCapColor: 'rgba(99,30,37,1)',
379
+ noneCapColor: 'rgba(255,255,255,0.4)',
380
+ },
381
+ highLowTheme: { highColor: 'rgba(223,222,223,1)', lowColor: 'rgba(223,222,223,1)' },
382
+ instrumentInfo: { textColor: '#aeb1b3' },
383
+ paneResizer: {
384
+ lineColor: 'rgba(55,55,54,1)',
385
+ bgColor: 'rgba(20,20,19,1)',
386
+ bgHoverColor: 'rgba(55,55,54,0.6)',
387
+ },
388
+ events: {
389
+ earnings: { color: 'rgba(217,44,64,1)' },
390
+ dividends: { color: 'rgba(169,38,251,1)' },
391
+ splits: { color: 'rgba(244,187,63,1)' },
392
+ 'conference-calls': { color: 'rgba(48,194,97,1)' },
393
+ },
394
+ secondaryChartTheme: [
395
+ {
396
+ lineTheme: {
397
+ upColor: 'rgba(226,61,25,1)',
398
+ downColor: 'rgba(226,61,25,1)',
399
+ noneColor: 'rgba(226,61,25,1)',
400
+ },
401
+ areaTheme: {
402
+ lineColor: 'rgba(226,61,25,1)',
403
+ startColor: 'rgba(226,61,25,0.8)',
404
+ stopColor: 'rgba(226,61,25,0)',
405
+ },
406
+ },
407
+ {
408
+ lineTheme: {
409
+ upColor: 'rgba(250,191,64,1)',
410
+ downColor: 'rgba(250,191,64,1)',
411
+ noneColor: 'rgba(250,191,64,1)',
412
+ },
413
+ areaTheme: {
414
+ lineColor: 'rgba(250,191,64,1)',
415
+ startColor: 'rgba(250,191,64,0.8)',
416
+ stopColor: 'rgba(250,191,64,0)',
417
+ },
418
+ },
419
+ {
420
+ lineTheme: {
421
+ upColor: 'rgba(169,38,251,1)',
422
+ downColor: 'rgba(169,38,251,1)',
423
+ noneColor: 'rgba(169,38,251,1)',
424
+ },
425
+ areaTheme: {
426
+ lineColor: 'rgba(169,38,251,1)',
427
+ startColor: 'rgba(169,38,251,0.8)',
428
+ stopColor: 'rgba(169,38,251,0)',
429
+ },
430
+ },
431
+ {
432
+ lineTheme: {
433
+ upColor: 'rgba(77,211,240,1)',
434
+ downColor: 'rgba(77,211,240,1)',
435
+ noneColor: 'rgba(77,211,240,1)',
436
+ },
437
+ areaTheme: {
438
+ lineColor: 'rgba(77,211,240,1)',
439
+ startColor: 'rgba(77,211,240,0.8)',
440
+ stopColor: 'rgba(77,211,240,0)',
441
+ },
442
+ },
443
+ {
444
+ lineTheme: {
445
+ upColor: 'rgba(59,203,91,1)',
446
+ downColor: 'rgba(59,203,91,1)',
447
+ noneColor: 'rgba(59,203,91,1)',
448
+ },
449
+ areaTheme: {
450
+ lineColor: 'rgba(59,203,91,1)',
451
+ startColor: 'rgba(59,203,91,0.8)',
452
+ stopColor: 'rgba(59,203,91,0)',
453
+ },
454
+ },
455
+ ],
456
+ yAxis: {
457
+ backgroundColor: 'transparent',
458
+ backgroundHoverColor: 'rgba(20,20,19,1)',
459
+ labelBoxColor: 'rgba(20,20,19,1)',
460
+ labelTextColor: 'rgba(128,128,128,1)',
461
+ labelInvertedTextColor: 'rgba(20,20,19,1)',
462
+ rectLabelTextColor: 'rgba(255,255,255,1)',
463
+ rectLabelInvertedTextColor: 'rgba(20,20,19,1)',
464
+ zeroPercentLine: 'rgba(55,55,54,1)',
465
+ },
466
+ labels: {
467
+ lastPrice: {
468
+ textNegative: 'rgba(255,255,255,1)',
469
+ textPositive: 'rgba(255,255,255,1)',
470
+ textSelected: 'rgba(0,0,0,1)',
471
+ boxNegative: 'rgba(217,44,64,1)',
472
+ boxPositive: 'rgba(77,153,83,1)',
473
+ boxSelected: 'rgba(255,255,255,1)',
474
+ },
475
+ countdownToBarClose: {
476
+ textNegative: 'rgba(255,255,255,1)',
477
+ textPositive: 'rgba(255,255,255,1)',
478
+ textSelected: 'rgba(255,255,255,1)',
479
+ boxNegative: 'rgba(217,44,64,1)',
480
+ boxPositive: 'rgba(77,153,83,1)',
481
+ boxSelected: 'rgba(255,255,255,1)',
482
+ },
483
+ highLow: {
484
+ high: { boxColor: 'rgba(107,96,86,1)', textColor: 'rgba(255,255,255,1)', descriptionText: 'High' },
485
+ low: { boxColor: 'rgba(107,96,86,1)', textColor: 'rgba(255,255,255,1)', descriptionText: 'Low' },
486
+ },
487
+ bidAsk: {
488
+ bid: { boxColor: 'rgba(77,153,83,1)', textColor: 'rgba(255,255,255,1)', descriptionText: 'Bid' },
489
+ ask: { boxColor: 'rgba(217,44,64,1)', textColor: 'rgba(255,255,255,1)', descriptionText: 'Ask' },
490
+ },
491
+ prePostMarket: {
492
+ post: { boxColor: 'rgba(38,251,149,1)', textColor: 'rgba(20,20,19,1)', descriptionText: 'Post' },
493
+ pre: { boxColor: 'rgba(255,170,0,1)', textColor: 'rgba(20,20,19,1)', descriptionText: 'Pre' },
494
+ },
495
+ prevDayClose: { boxColor: 'rgba(107,96,86,1)', textColor: 'rgba(255,255,255,1)' },
496
+ },
497
+ xAxis: {
498
+ backgroundColor: 'transparent',
499
+ labelTextColor: 'rgba(128,128,128,1)',
500
+ },
501
+ navigationMap: {
502
+ backgroundColor: 'transparent',
503
+ buttonColor: 'rgba(255,255,255,0.1)',
504
+ buttonArrowColor: 'rgba(212,212,211,1)',
505
+ knotColor: 'rgba(255,255,255,0.1)',
506
+ knotLineColor: 'rgba(212,212,211,1)',
507
+ sliderColor: 'rgba(255,255,255,0.08)',
508
+ knotBorderColor: '#0b0d1a',
509
+ timeLabelsTextColor: 'rgba(128,128,128,1)',
510
+ mapColor: 'rgba(255,255,255,0.1)',
511
+ mapFillColor: 'rgba(255,255,255,0.1)',
512
+ mapGradientTopColor: 'rgba(255,255,255,0.1)',
513
+ mapGradientBottomColor: 'rgba(255,255,255,0.1)',
514
+ },
515
+ },
516
+ animation: {
517
+ moveDuration: 1000,
518
+ candleDuration: 200,
519
+ paneResizer: {
520
+ bgMode: true,
521
+ enabled: true,
522
+ duration: 40,
523
+ },
524
+ yAxis: {
525
+ background: {
526
+ enabled: false,
527
+ duration: 40,
528
+ },
529
+ },
530
+ },
531
+ drawingOrder: [
532
+ 'OVER_SERIES_CLEAR',
533
+ 'MAIN_CLEAR',
534
+ 'SERIES_CLEAR',
535
+ 'GRID',
536
+ 'X_AXIS',
537
+ 'Y_AXIS',
538
+ 'UNDERLAY_VOLUMES_AREA',
539
+ 'DYNAMIC_OBJECTS',
540
+ 'WATERMARK',
541
+ 'N_MAP_CHART',
542
+ 'EVENTS',
543
+ ],
544
+ });
545
+ /**
546
+ * Merges a partial chart configuration object with a default chart configuration object.
547
+ * @param {PartialChartConfig} config - The partial chart configuration object to merge.
548
+ * @param {FullChartConfig} defaultConfig - The default chart configuration object to merge with.
549
+ * @returns {FullChartConfig} - The merged chart configuration object.
550
+ */
551
+ export function mergeWithDefaultConfig(config, defaultConfig = getDefaultConfig()) {
552
+ merge(config, defaultConfig, DEFAULT_MERGE_OPTIONS);
553
+ // eslint-disable-next-line no-restricted-syntax
554
+ return config;
555
+ }
556
+ /**
557
+ * Merges a partial chart configuration object with the default configuration object and returns a new object with the merged values.
558
+ * @param {PartialChartConfig} config - The partial chart configuration object to merge with the default configuration object.
559
+ * @param {FullChartConfig} defaultConfig - The default chart configuration object to merge with the partial configuration object. If not provided, the default configuration object will be retrieved using getDefaultConfig() function.
560
+ * @returns {FullChartConfig} - A new object with the merged values of the partial and default configuration objects.
561
+ * @todo Implement deep copy of the partial configuration object before merging.
562
+ */
563
+ export function mergeWithDefaultConfigCopy(config, defaultConfig = getDefaultConfig()) {
564
+ // TODO deep copy
565
+ // @ts-ignore
566
+ const result = Object.assign({}, config);
567
+ merge(result, defaultConfig, DEFAULT_MERGE_OPTIONS);
568
+ return result;
569
+ }
570
+ /**
571
+ * This function rewrites the properties of an object with the properties of another object.
572
+ * @param {object} current - The object to be rewritten.
573
+ * @param {object} newObj - The object containing the new properties.
574
+ * @returns {void}
575
+ */
576
+ export function rewrite(current, newObj) {
577
+ Object.keys(current).forEach(key => delete current[key]);
578
+ Object.keys(newObj).forEach(key => (current[key] = newObj[key]));
579
+ }
580
+ /**
581
+ * Checks if a value is a non-null object.
582
+ * @param {unknown} value - The value to check.
583
+ * @returns {boolean} - True if the value is a non-null object, false otherwise.
584
+ */
585
+ function isNonNullObject(value) {
586
+ return typeof value === 'object' && value !== null;
587
+ }
588
+ /**
589
+ * Creates a new array with the same elements as the provided array.
590
+ *
591
+ * @param {unknown[]} arr - The array to be copied.
592
+ * @param {MergeOptions} options - The options to be used when cloning the elements of the array.
593
+ * @returns {unknown[]} A new array with the same elements as the provided array.
594
+ */
595
+ function copyArray(arr, options) {
596
+ const arrWithoutHoles = [...arr]; // destructuring converts holes to undefined
597
+ return arrWithoutHoles.map(item => clone(item, options));
598
+ }
599
+ const isArray = (value) => Array.isArray(value);
600
+ /**
601
+ * Clones an object or array using the provided options.
602
+ *
603
+ * @param {unknown} value - The value to clone.
604
+ * @param {MergeOptions} options - The options to use when cloning.
605
+ * @returns {unknown} - The cloned object or array.
606
+ */
607
+ function clone(value, options) {
608
+ if (!isNonNullObject(value)) {
609
+ return value;
610
+ }
611
+ if (isArray(value)) {
612
+ return copyArray(value, options);
613
+ }
614
+ else {
615
+ const copy = immutableMerge({}, value, options);
616
+ Object.setPrototypeOf(copy, Object.getPrototypeOf(value));
617
+ return copy;
618
+ }
619
+ }
620
+ /**
621
+ * This function performs an immutable merge of two objects, `base` and `override`, and returns a new object with the merged properties. If `base` is not a non-null object, it returns either `override` or `base`, depending on the value of `options.overrideExisting`. If both `base` and `override` are arrays, it returns a new array with the merged elements. If `base` and `override` are objects, it creates a new object with the prototype of `base` and copies all properties of `base` to the new object. Then, it iterates over all properties of `override` and performs a recursive merge of the corresponding properties in `base` and `override`. If a property exists only in `override` and `options.addIfMissing` is true, it adds the property to the new object. The function uses the `clone` and `copyArray` functions to create copies of objects and arrays, respectively.
622
+ *
623
+ * @param {object} base - The base object to merge.
624
+ * @param {object} override - The object to merge into `base`.
625
+ * @param {object} options - An object with options for the merge operation.
626
+ * @param {boolean} options.overrideExisting - If true, override existing properties in `base`. If false, keep the properties in `base`.
627
+ * @param {boolean} options.addIfMissing - If true, add properties from `override` that do not exist in `base`.
628
+ * @returns {object} - A new object with the merged properties.
629
+ */
630
+ export function immutableMerge(base, override, options) {
631
+ if (!isNonNullObject(base)) {
632
+ return options.overrideExisting ? override : base;
633
+ }
634
+ if (Array.isArray(base) && Array.isArray(override)) {
635
+ const arr = options.overrideExisting ? override : base;
636
+ return copyArray(arr, options);
637
+ }
638
+ const result = Object.create(Object.getPrototypeOf(base));
639
+ Object.keys(base).forEach(key => (result[key] = clone(base[key], options)));
640
+ Object.keys(override).forEach(key => {
641
+ if (key in base) {
642
+ result[key] = immutableMerge(base[key], override[key], options);
643
+ }
644
+ else if (options.addIfMissing) {
645
+ result[key] = clone(override[key], options);
646
+ }
647
+ });
648
+ return result;
649
+ }
650
+ export const getFontFromConfig = (config) => `${config.fontSize}px ${config.fontFamily}`;