@oanda/labs-crowd-view-widget 1.0.52 → 1.0.54

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 (312) hide show
  1. package/CHANGELOG.md +436 -0
  2. package/dist/main/CrowdViewWidget/Main.js +4 -6
  3. package/dist/main/CrowdViewWidget/Main.js.map +1 -1
  4. package/dist/main/CrowdViewWidget/components/Chart/Chart.js +18 -31
  5. package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
  6. package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +7 -5
  7. package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
  8. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +18 -0
  9. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -0
  10. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +30 -0
  11. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -0
  12. package/dist/main/CrowdViewWidget/components/Chart/{utils → chartOptions}/getGridLines.js +5 -52
  13. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
  14. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +54 -0
  15. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
  16. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +65 -0
  17. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
  18. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +60 -0
  19. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
  20. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +53 -0
  21. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -0
  22. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +31 -0
  23. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -0
  24. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +42 -0
  25. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
  26. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +75 -0
  27. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
  28. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js +116 -0
  29. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
  30. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +18 -0
  31. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -0
  32. package/dist/main/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.js +4 -4
  33. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -0
  34. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +14 -0
  35. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -0
  36. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +42 -0
  37. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -0
  38. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +14 -0
  39. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -0
  40. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +108 -0
  41. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
  42. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js +83 -0
  43. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -0
  44. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +15 -0
  45. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -0
  46. package/dist/main/CrowdViewWidget/{utils/instrumentUtils.js → components/Chart/dataUtils/getInstrumentConfigForDivision.js} +3 -3
  47. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map +1 -0
  48. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +18 -0
  49. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -0
  50. package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.js +8 -41
  51. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
  52. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +65 -0
  53. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
  54. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +65 -0
  55. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
  56. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +43 -0
  57. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
  58. package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +8 -2
  59. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
  60. package/dist/main/CrowdViewWidget/components/Chart/getOption.js +103 -0
  61. package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +1 -0
  62. package/dist/main/CrowdViewWidget/components/Chart/index.js +11 -11
  63. package/dist/main/CrowdViewWidget/components/Chart/index.js.map +1 -1
  64. package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
  65. package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +53 -30
  66. package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
  67. package/dist/main/CrowdViewWidget/components/Legend/Legend.js +15 -13
  68. package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
  69. package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +5 -16
  70. package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
  71. package/dist/main/CrowdViewWidget/constants.js +12 -18
  72. package/dist/main/CrowdViewWidget/constants.js.map +1 -1
  73. package/dist/main/gql/getOrderPositionBooks.js +1 -1
  74. package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
  75. package/dist/main/gql/getPriceCandles.js +1 -1
  76. package/dist/main/gql/getPriceCandles.js.map +1 -1
  77. package/dist/main/gql/types/gql.js +2 -2
  78. package/dist/main/gql/types/gql.js.map +1 -1
  79. package/dist/main/gql/types/graphql.js +111 -18
  80. package/dist/main/gql/types/graphql.js.map +1 -1
  81. package/dist/main/translations/sources/en.json +2 -1
  82. package/dist/module/CrowdViewWidget/Main.js +3 -5
  83. package/dist/module/CrowdViewWidget/Main.js.map +1 -1
  84. package/dist/module/CrowdViewWidget/components/Chart/Chart.js +20 -33
  85. package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
  86. package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +7 -5
  87. package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
  88. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +11 -0
  89. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -0
  90. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +23 -0
  91. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -0
  92. package/dist/module/CrowdViewWidget/components/Chart/{utils → chartOptions}/getGridLines.js +5 -52
  93. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
  94. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +46 -0
  95. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
  96. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +58 -0
  97. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
  98. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +53 -0
  99. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
  100. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +46 -0
  101. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -0
  102. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +24 -0
  103. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -0
  104. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +35 -0
  105. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
  106. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +68 -0
  107. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
  108. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js +11 -0
  109. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
  110. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +11 -0
  111. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -0
  112. package/dist/module/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.js +4 -4
  113. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -0
  114. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +6 -0
  115. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -0
  116. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +35 -0
  117. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -0
  118. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +7 -0
  119. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -0
  120. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +101 -0
  121. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
  122. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +8 -0
  123. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -0
  124. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +8 -0
  125. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -0
  126. package/dist/module/CrowdViewWidget/{utils/instrumentUtils.js → components/Chart/dataUtils/getInstrumentConfigForDivision.js} +3 -3
  127. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map +1 -0
  128. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +11 -0
  129. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -0
  130. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js +7 -0
  131. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
  132. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +58 -0
  133. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
  134. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +58 -0
  135. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
  136. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +36 -0
  137. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
  138. package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +8 -2
  139. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
  140. package/dist/module/CrowdViewWidget/components/Chart/getOption.js +96 -0
  141. package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -0
  142. package/dist/module/CrowdViewWidget/components/Chart/index.js +1 -1
  143. package/dist/module/CrowdViewWidget/components/Chart/index.js.map +1 -1
  144. package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
  145. package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +50 -27
  146. package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
  147. package/dist/module/CrowdViewWidget/components/Legend/Legend.js +15 -13
  148. package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
  149. package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +5 -16
  150. package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
  151. package/dist/module/CrowdViewWidget/constants.js +10 -17
  152. package/dist/module/CrowdViewWidget/constants.js.map +1 -1
  153. package/dist/module/gql/getOrderPositionBooks.js +1 -1
  154. package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
  155. package/dist/module/gql/getPriceCandles.js +1 -1
  156. package/dist/module/gql/getPriceCandles.js.map +1 -1
  157. package/dist/module/gql/types/gql.js +2 -2
  158. package/dist/module/gql/types/gql.js.map +1 -1
  159. package/dist/module/gql/types/graphql.js +111 -18
  160. package/dist/module/gql/types/graphql.js.map +1 -1
  161. package/dist/module/translations/sources/en.json +2 -1
  162. package/dist/types/CrowdViewWidget/components/Chart/Chart.d.ts +1 -1
  163. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.d.ts +2 -0
  164. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.d.ts +6 -0
  165. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridLines.d.ts +6 -0
  166. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts +9 -0
  167. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.d.ts +11 -0
  168. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts +7 -0
  169. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.d.ts +16 -0
  170. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.d.ts +7 -0
  171. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.d.ts +7 -0
  172. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.d.ts +9 -0
  173. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/index.d.ts +10 -0
  174. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.d.ts +1 -0
  175. package/dist/types/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.d.ts +2 -2
  176. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.d.ts +1 -0
  177. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getLabelData.d.ts +17 -0
  178. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getRectColor.d.ts +1 -0
  179. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +10 -0
  180. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/index.d.ts +7 -0
  181. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.d.ts +1 -0
  182. package/dist/types/CrowdViewWidget/{utils/instrumentUtils.d.ts → components/Chart/dataUtils/getInstrumentConfigForDivision.d.ts} +2 -2
  183. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.d.ts +2 -0
  184. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/index.d.ts +6 -0
  185. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.d.ts +11 -0
  186. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.d.ts +12 -0
  187. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processSentiments.d.ts +6 -0
  188. package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.d.ts +1 -1
  189. package/dist/types/CrowdViewWidget/components/Chart/index.d.ts +1 -1
  190. package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +28 -11
  191. package/dist/types/CrowdViewWidget/components/Legend/Legend.d.ts +1 -4
  192. package/dist/types/CrowdViewWidget/components/Legend/LegendBar.d.ts +1 -3
  193. package/dist/types/CrowdViewWidget/constants.d.ts +4 -12
  194. package/dist/types/gql/types/gql.d.ts +6 -4
  195. package/dist/types/gql/types/graphql.d.ts +30 -11
  196. package/package.json +3 -3
  197. package/src/CrowdViewWidget/Main.tsx +3 -4
  198. package/src/CrowdViewWidget/components/Chart/Chart.tsx +25 -40
  199. package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +8 -4
  200. package/src/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.ts +13 -0
  201. package/src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts +29 -0
  202. package/src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts +84 -0
  203. package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts +52 -0
  204. package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts +82 -0
  205. package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts +63 -0
  206. package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +63 -0
  207. package/src/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.ts +32 -0
  208. package/src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts +43 -0
  209. package/src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts +77 -0
  210. package/src/CrowdViewWidget/components/Chart/chartOptions/index.ts +10 -0
  211. package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts +16 -0
  212. package/src/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.ts +9 -6
  213. package/src/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.ts +16 -0
  214. package/src/CrowdViewWidget/components/Chart/chartUtils/getLabelData.ts +42 -0
  215. package/src/CrowdViewWidget/components/Chart/chartUtils/getRectColor.ts +27 -0
  216. package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +183 -0
  217. package/src/CrowdViewWidget/components/Chart/chartUtils/index.ts +7 -0
  218. package/src/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.ts +13 -0
  219. package/src/CrowdViewWidget/{utils/instrumentUtils.ts → components/Chart/dataUtils/getInstrumentConfigForDivision.ts} +2 -2
  220. package/src/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.ts +14 -0
  221. package/src/CrowdViewWidget/components/Chart/dataUtils/index.ts +6 -0
  222. package/src/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.ts +92 -0
  223. package/src/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.ts +67 -0
  224. package/src/CrowdViewWidget/components/Chart/dataUtils/processSentiments.ts +55 -0
  225. package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.ts +10 -2
  226. package/src/CrowdViewWidget/components/Chart/getOption.ts +114 -0
  227. package/src/CrowdViewWidget/components/Chart/index.ts +1 -1
  228. package/src/CrowdViewWidget/components/Chart/types.ts +30 -19
  229. package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +84 -67
  230. package/src/CrowdViewWidget/components/Legend/Legend.tsx +24 -23
  231. package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +13 -26
  232. package/src/CrowdViewWidget/constants.ts +21 -23
  233. package/src/gql/getOrderPositionBooks.ts +13 -5
  234. package/src/gql/getPriceCandles.ts +1 -0
  235. package/src/gql/types/gql.ts +6 -6
  236. package/src/gql/types/graphql.ts +98 -16
  237. package/src/translations/sources/en.json +2 -1
  238. package/test/components/Chart/utils/chartUtils.test.ts +39 -21
  239. package/test/components/Chart/utils/getChartStyles.test.ts +10 -10
  240. package/test/components/Chart/utils/processSentiments.test.ts +138 -30
  241. package/test/components/Legend.test.tsx +13 -21
  242. package/test/components/LegendBar.test.tsx +31 -51
  243. package/test/utils/instrumentUtils.test.ts +1 -1
  244. package/test/utils/processOrderPositionBooks.test.ts +201 -84
  245. package/test/utils/processPriceCandles.test.ts +93 -67
  246. package/test/utils/validateData.test.ts +136 -38
  247. package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js +0 -359
  248. package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
  249. package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -37
  250. package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
  251. package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -127
  252. package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
  253. package/dist/main/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
  254. package/dist/main/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
  255. package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js +0 -14
  256. package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
  257. package/dist/main/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
  258. package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -29
  259. package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
  260. package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +0 -23
  261. package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
  262. package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +0 -43
  263. package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
  264. package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js +0 -28
  265. package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
  266. package/dist/main/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
  267. package/dist/main/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
  268. package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js +0 -351
  269. package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
  270. package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -29
  271. package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
  272. package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -114
  273. package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
  274. package/dist/module/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
  275. package/dist/module/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
  276. package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js +0 -7
  277. package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
  278. package/dist/module/CrowdViewWidget/components/Chart/utils/index.js +0 -10
  279. package/dist/module/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
  280. package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -22
  281. package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
  282. package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +0 -16
  283. package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
  284. package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +0 -36
  285. package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
  286. package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js +0 -21
  287. package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
  288. package/dist/module/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
  289. package/dist/module/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
  290. package/dist/types/CrowdViewWidget/components/Chart/utils/aggregateBuckets.d.ts +0 -2
  291. package/dist/types/CrowdViewWidget/components/Chart/utils/chartUtils.d.ts +0 -31
  292. package/dist/types/CrowdViewWidget/components/Chart/utils/getGridLines.d.ts +0 -97
  293. package/dist/types/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.d.ts +0 -3
  294. package/dist/types/CrowdViewWidget/components/Chart/utils/index.d.ts +0 -9
  295. package/dist/types/CrowdViewWidget/components/Chart/utils/processBuckets.d.ts +0 -3
  296. package/dist/types/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.d.ts +0 -8
  297. package/dist/types/CrowdViewWidget/components/Chart/utils/processPriceCandles.d.ts +0 -27
  298. package/dist/types/CrowdViewWidget/components/Chart/utils/processSentiments.d.ts +0 -3
  299. package/src/CrowdViewWidget/components/Chart/chartOptions.ts +0 -401
  300. package/src/CrowdViewWidget/components/Chart/utils/aggregateBuckets.ts +0 -44
  301. package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +0 -216
  302. package/src/CrowdViewWidget/components/Chart/utils/getGridLines.ts +0 -148
  303. package/src/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.ts +0 -13
  304. package/src/CrowdViewWidget/components/Chart/utils/index.ts +0 -9
  305. package/src/CrowdViewWidget/components/Chart/utils/processBuckets.ts +0 -43
  306. package/src/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.ts +0 -30
  307. package/src/CrowdViewWidget/components/Chart/utils/processPriceCandles.ts +0 -53
  308. package/src/CrowdViewWidget/components/Chart/utils/processSentiments.ts +0 -42
  309. package/test/utils/aggregateBuckets.test.ts +0 -82
  310. package/test/utils/getTargetBucketWidth.test.ts +0 -37
  311. package/test/utils/processBuckets.test.ts +0 -153
  312. /package/dist/types/CrowdViewWidget/components/Chart/{chartOptions.d.ts → getOption.d.ts} +0 -0
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getYAxisConfig = void 0;
7
+ var _constants = require("../../../constants");
8
+ const getYAxisConfig = _ref => {
9
+ let {
10
+ bucketWidth,
11
+ displayPrecision,
12
+ isDesktop,
13
+ labelCallback
14
+ } = _ref;
15
+ return [{
16
+ type: 'value',
17
+ gridIndex: 0,
18
+ position: 'right',
19
+ min: val => val.min - bucketWidth * _constants.BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,
20
+ max: val => val.max + bucketWidth * _constants.BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,
21
+ axisLine: {
22
+ show: false
23
+ },
24
+ axisTick: {
25
+ show: false
26
+ },
27
+ axisLabel: {
28
+ showMinLabel: false,
29
+ showMaxLabel: false,
30
+ formatter: value => value.toFixed(displayPrecision - 1)
31
+ }
32
+ }, {
33
+ type: 'value',
34
+ gridIndex: 1,
35
+ position: 'left',
36
+ min: _constants.CHART_CONFIG.SENTIMENT_MIN,
37
+ max: _constants.CHART_CONFIG.SENTIMENT_MAX,
38
+ axisLine: {
39
+ show: false
40
+ },
41
+ axisTick: {
42
+ show: false
43
+ },
44
+ axisPointer: {
45
+ show: false
46
+ },
47
+ axisLabel: {
48
+ margin: isDesktop ? 4 : 2,
49
+ lineHeight: 20,
50
+ verticalAlignMinLabel: 'bottom',
51
+ verticalAlignMaxLabel: 'top',
52
+ customValues: [_constants.CHART_CONFIG.SENTIMENT_MIN, _constants.CHART_CONFIG.SENTIMENT_MAX / 5, _constants.CHART_CONFIG.SENTIMENT_MAX / 2, _constants.CHART_CONFIG.SENTIMENT_MAX * 4 / 5, _constants.CHART_CONFIG.SENTIMENT_MAX],
53
+ formatter: value => {
54
+ if (value === _constants.CHART_CONFIG.SENTIMENT_MIN) {
55
+ return "".concat(labelCallback('short'));
56
+ }
57
+ if (value === _constants.CHART_CONFIG.SENTIMENT_MAX) {
58
+ return "".concat(labelCallback('long'));
59
+ }
60
+ if (value === _constants.CHART_CONFIG.SENTIMENT_MAX / 2) {
61
+ return '50%';
62
+ }
63
+ if (value === _constants.CHART_CONFIG.SENTIMENT_MAX / 5) {
64
+ return '80%';
65
+ }
66
+ if (value === _constants.CHART_CONFIG.SENTIMENT_MAX * 4 / 5) {
67
+ return '20%';
68
+ }
69
+ return '';
70
+ }
71
+ }
72
+ }];
73
+ };
74
+ exports.getYAxisConfig = getYAxisConfig;
75
+ //# sourceMappingURL=getYAxisConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getYAxisConfig.js","names":["_constants","require","getYAxisConfig","_ref","bucketWidth","displayPrecision","isDesktop","labelCallback","type","gridIndex","position","min","val","BUCKET_CONFIG","PRICE_MARGIN_MULTIPLIER","max","axisLine","show","axisTick","axisLabel","showMinLabel","showMaxLabel","formatter","value","toFixed","CHART_CONFIG","SENTIMENT_MIN","SENTIMENT_MAX","axisPointer","margin","lineHeight","verticalAlignMinLabel","verticalAlignMaxLabel","customValues","concat","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts"],"sourcesContent":["import type { YAXisComponentOption } from 'echarts';\n\nimport { BUCKET_CONFIG, CHART_CONFIG } from '../../../constants';\n\ninterface GetYAxisConfigParams {\n bucketWidth: number;\n displayPrecision: number;\n isDesktop: boolean;\n labelCallback: (key: string, params?: Record<string, unknown>) => string;\n}\n\nexport const getYAxisConfig = ({\n bucketWidth,\n displayPrecision,\n isDesktop,\n labelCallback,\n}: GetYAxisConfigParams): YAXisComponentOption[] => [\n {\n type: 'value',\n gridIndex: 0,\n position: 'right',\n min: (val: { min: number }) =>\n val.min - bucketWidth * BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,\n max: (val: { max: number }) =>\n val.max + bucketWidth * BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n showMinLabel: false,\n showMaxLabel: false,\n formatter: (value: number) => value.toFixed(displayPrecision - 1),\n },\n },\n {\n type: 'value',\n gridIndex: 1,\n position: 'left',\n min: CHART_CONFIG.SENTIMENT_MIN,\n max: CHART_CONFIG.SENTIMENT_MAX,\n axisLine: { show: false },\n axisTick: { show: false },\n axisPointer: {\n show: false,\n },\n axisLabel: {\n margin: isDesktop ? 4 : 2,\n lineHeight: 20,\n verticalAlignMinLabel: 'bottom',\n verticalAlignMaxLabel: 'top',\n customValues: [\n CHART_CONFIG.SENTIMENT_MIN,\n CHART_CONFIG.SENTIMENT_MAX / 5,\n CHART_CONFIG.SENTIMENT_MAX / 2,\n (CHART_CONFIG.SENTIMENT_MAX * 4) / 5,\n CHART_CONFIG.SENTIMENT_MAX,\n ],\n formatter: (value: number) => {\n if (value === CHART_CONFIG.SENTIMENT_MIN) {\n return `${labelCallback('short')}`;\n }\n if (value === CHART_CONFIG.SENTIMENT_MAX) {\n return `${labelCallback('long')}`;\n }\n if (value === CHART_CONFIG.SENTIMENT_MAX / 2) {\n return '50%';\n }\n if (value === CHART_CONFIG.SENTIMENT_MAX / 5) {\n return '80%';\n }\n if (value === (CHART_CONFIG.SENTIMENT_MAX * 4) / 5) {\n return '20%';\n }\n return '';\n },\n },\n },\n];\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AASO,MAAMC,cAAc,GA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AAC,EAC7BF,uBAAY,CAACE,aAAa,GAAG,CAAC,GAAI,CAAC,EACpCF,uBAAY,CAACE,aAAa,CAC3B;MACDL,SAAS,EAAGC,KAAa,IAAK;QAC5B,IAAIA,KAAK,KAAKE,uBAAY,CAACC,aAAa,EAAE;UACxC,UAAAQ,MAAA,CAAU3B,aAAa,CAAC,OAAO,CAAC;QAClC;QACA,IAAIgB,KAAK,KAAKE,uBAAY,CAACE,aAAa,EAAE;UACxC,UAAAO,MAAA,CAAU3B,aAAa,CAAC,MAAM,CAAC;QACjC;QACA,IAAIgB,KAAK,KAAKE,uBAAY,CAACE,aAAa,GAAG,CAAC,EAAE;UAC5C,OAAO,KAAK;QACd;QACA,IAAIJ,KAAK,KAAKE,uBAAY,CAACE,aAAa,GAAG,CAAC,EAAE;UAC5C,OAAO,KAAK;QACd;QACA,IAAIJ,KAAK,KAAME,uBAAY,CAACE,aAAa,GAAG,CAAC,GAAI,CAAC,EAAE;UAClD,OAAO,KAAK;QACd;QACA,OAAO,EAAE;MACX;IACF;EACF,CAAC,CACF;AAAA;AAACQ,OAAA,CAAAjC,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _getDataZoomConfig = require("./getDataZoomConfig");
7
+ Object.keys(_getDataZoomConfig).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _getDataZoomConfig[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _getDataZoomConfig[key];
14
+ }
15
+ });
16
+ });
17
+ var _getGridConfig = require("./getGridConfig");
18
+ Object.keys(_getGridConfig).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _getGridConfig[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _getGridConfig[key];
25
+ }
26
+ });
27
+ });
28
+ var _getGridLines = require("./getGridLines");
29
+ Object.keys(_getGridLines).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _getGridLines[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _getGridLines[key];
36
+ }
37
+ });
38
+ });
39
+ var _getSeriesCandlestickConfig = require("./getSeriesCandlestickConfig");
40
+ Object.keys(_getSeriesCandlestickConfig).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _getSeriesCandlestickConfig[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _getSeriesCandlestickConfig[key];
47
+ }
48
+ });
49
+ });
50
+ var _getSeriesHeatmapConfig = require("./getSeriesHeatmapConfig");
51
+ Object.keys(_getSeriesHeatmapConfig).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _getSeriesHeatmapConfig[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _getSeriesHeatmapConfig[key];
58
+ }
59
+ });
60
+ });
61
+ var _getSeriesSentimentConfig = require("./getSeriesSentimentConfig");
62
+ Object.keys(_getSeriesSentimentConfig).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _getSeriesSentimentConfig[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _getSeriesSentimentConfig[key];
69
+ }
70
+ });
71
+ });
72
+ var _getTooltipConfig = require("./getTooltipConfig");
73
+ Object.keys(_getTooltipConfig).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _getTooltipConfig[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _getTooltipConfig[key];
80
+ }
81
+ });
82
+ });
83
+ var _getVisualMapConfig = require("./getVisualMapConfig");
84
+ Object.keys(_getVisualMapConfig).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _getVisualMapConfig[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _getVisualMapConfig[key];
91
+ }
92
+ });
93
+ });
94
+ var _getXAxisConfig = require("./getXAxisConfig");
95
+ Object.keys(_getXAxisConfig).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _getXAxisConfig[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _getXAxisConfig[key];
102
+ }
103
+ });
104
+ });
105
+ var _getYAxisConfig = require("./getYAxisConfig");
106
+ Object.keys(_getYAxisConfig).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _getYAxisConfig[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _getYAxisConfig[key];
113
+ }
114
+ });
115
+ });
116
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_getDataZoomConfig","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getGridConfig","_getGridLines","_getSeriesCandlestickConfig","_getSeriesHeatmapConfig","_getSeriesSentimentConfig","_getTooltipConfig","_getVisualMapConfig","_getXAxisConfig","_getYAxisConfig"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/index.ts"],"sourcesContent":["export * from './getDataZoomConfig';\nexport * from './getGridConfig';\nexport * from './getGridLines';\nexport * from './getSeriesCandlestickConfig';\nexport * from './getSeriesHeatmapConfig';\nexport * from './getSeriesSentimentConfig';\nexport * from './getTooltipConfig';\nexport * from './getVisualMapConfig';\nexport * from './getXAxisConfig';\nexport * from './getYAxisConfig';\n"],"mappings":";;;;;AAA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perty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatXAxisLabel = void 0;
7
+ var _constants = require("../../../constants");
8
+ const formatXAxisLabel = (value, isGreaterThanTwoWeeks) => {
9
+ const date = new Date(value);
10
+ return isGreaterThanTwoWeeks ? "".concat(date.toLocaleTimeString(undefined, {
11
+ hour: '2-digit',
12
+ minute: '2-digit'
13
+ })) : "".concat(_constants.CHART_CONFIG.X_AXIS_DATE_PADDING).concat(date.toLocaleDateString(undefined, {
14
+ day: 'numeric'
15
+ })).concat(_constants.CHART_CONFIG.X_AXIS_DATE_PADDING);
16
+ };
17
+ exports.formatXAxisLabel = formatXAxisLabel;
18
+ //# sourceMappingURL=formatXAxisLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatXAxisLabel.js","names":["_constants","require","formatXAxisLabel","value","isGreaterThanTwoWeeks","date","Date","concat","toLocaleTimeString","undefined","hour","minute","CHART_CONFIG","X_AXIS_DATE_PADDING","toLocaleDateString","day","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts"],"sourcesContent":["import { CHART_CONFIG } from '../../../constants';\n\nexport const formatXAxisLabel = (\n value: unknown,\n isGreaterThanTwoWeeks: boolean\n) => {\n const date = new Date(value as string);\n return isGreaterThanTwoWeeks\n ? `${date.toLocaleTimeString(undefined, {\n hour: '2-digit',\n minute: '2-digit',\n })}`\n : `${CHART_CONFIG.X_AXIS_DATE_PADDING}${date.toLocaleDateString(undefined, {\n day: 'numeric',\n })}${CHART_CONFIG.X_AXIS_DATE_PADDING}`;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAGA,CAC9BC,KAAc,EACdC,qBAA8B,KAC3B;EACH,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACH,KAAe,CAAC;EACtC,OAAOC,qBAAqB,MAAAG,MAAA,CACrBF,IAAI,CAACG,kBAAkB,CAACC,SAAS,EAAE;IACpCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC,CAAC,OAAAJ,MAAA,CACCK,uBAAY,CAACC,mBAAmB,EAAAN,MAAA,CAAGF,IAAI,CAACS,kBAAkB,CAACL,SAAS,EAAE;IACvEM,GAAG,EAAE;EACP,CAAC,CAAC,EAAAR,MAAA,CAAGK,uBAAY,CAACC,mBAAmB,CAAE;AAC7C,CAAC;AAACG,OAAA,CAAAd,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -8,19 +8,19 @@ var _labsWidgetCommon = require("@oanda/labs-widget-common");
8
8
  const getChartStyles = isDark => {
9
9
  const sentimentLongColor = isDark ? _labsWidgetCommon.colorPalette.darkBlue90 : _labsWidgetCommon.colorPalette.lightBlue90;
10
10
  const sentimentShortColor = isDark ? _labsWidgetCommon.colorPalette.darkYellow90 : _labsWidgetCommon.colorPalette.lightYellow90;
11
+ const sentimentOutlineColor = isDark ? _labsWidgetCommon.colorPalette.black : _labsWidgetCommon.colorPalette.white;
12
+ const sentimentOutlineWidth = isDark ? 3 : 2;
11
13
  const candleLongColor = isDark ? _labsWidgetCommon.colorPalette.bottleGreenDark : _labsWidgetCommon.colorPalette.bottleGreenLight;
12
14
  const candleShortColor = isDark ? _labsWidgetCommon.colorPalette.orange : _labsWidgetCommon.colorPalette.raspberryLight;
13
- const sentimentAreaOpacity = isDark ? 0.5 : 0.2;
14
15
  const tooltipLinesColor = isDark ? _labsWidgetCommon.colorPalette.orange : _labsWidgetCommon.colorPalette.bottleGreenLight;
15
- const sentimentLabelColor = isDark ? _labsWidgetCommon.colorPalette.white : _labsWidgetCommon.colorPalette.black;
16
16
  return {
17
17
  sentimentLongColor,
18
18
  sentimentShortColor,
19
+ sentimentOutlineColor,
19
20
  candleLongColor,
20
21
  candleShortColor,
21
- sentimentAreaOpacity,
22
22
  tooltipLinesColor,
23
- sentimentLabelColor
23
+ sentimentOutlineWidth
24
24
  };
25
25
  };
26
26
  exports.getChartStyles = getChartStyles;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getChartStyles.js","names":["_labsWidgetCommon","require","getChartStyles","isDark","sentimentLongColor","colorPalette","darkBlue90","lightBlue90","sentimentShortColor","darkYellow90","lightYellow90","sentimentOutlineColor","black","white","sentimentOutlineWidth","candleLongColor","bottleGreenDark","bottleGreenLight","candleShortColor","orange","raspberryLight","tooltipLinesColor","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\n\nexport interface ChartStyles {\n sentimentLongColor: string;\n sentimentShortColor: string;\n sentimentOutlineColor: string;\n candleLongColor: string;\n candleShortColor: string;\n tooltipLinesColor: string;\n sentimentOutlineWidth: number;\n}\n\nexport const getChartStyles = (isDark: boolean): ChartStyles => {\n const sentimentLongColor = isDark\n ? colorPalette.darkBlue90\n : colorPalette.lightBlue90;\n const sentimentShortColor = isDark\n ? colorPalette.darkYellow90\n : colorPalette.lightYellow90;\n\n const sentimentOutlineColor = isDark\n ? colorPalette.black\n : colorPalette.white;\n const sentimentOutlineWidth = isDark ? 3 : 2;\n\n const candleLongColor = isDark\n ? colorPalette.bottleGreenDark\n : colorPalette.bottleGreenLight;\n const candleShortColor = isDark\n ? colorPalette.orange\n : colorPalette.raspberryLight;\n const tooltipLinesColor = isDark\n ? colorPalette.orange\n : colorPalette.bottleGreenLight;\n\n return {\n sentimentLongColor,\n sentimentShortColor,\n sentimentOutlineColor,\n candleLongColor,\n candleShortColor,\n tooltipLinesColor,\n sentimentOutlineWidth,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAYO,MAAMC,cAAc,GAAIC,MAAe,IAAkB;EAC9D,MAAMC,kBAAkB,GAAGD,MAAM,GAC7BE,8BAAY,CAACC,UAAU,GACvBD,8BAAY,CAACE,WAAW;EAC5B,MAAMC,mBAAmB,GAAGL,MAAM,GAC9BE,8BAAY,CAACI,YAAY,GACzBJ,8BAAY,CAACK,aAAa;EAE9B,MAAMC,qBAAqB,GAAGR,MAAM,GAChCE,8BAAY,CAACO,KAAK,GAClBP,8BAAY,CAACQ,KAAK;EACtB,MAAMC,qBAAqB,GAAGX,MAAM,GAAG,CAAC,GAAG,CAAC;EAE5C,MAAMY,eAAe,GAAGZ,MAAM,GAC1BE,8BAAY,CAACW,eAAe,GAC5BX,8BAAY,CAACY,gBAAgB;EACjC,MAAMC,gBAAgB,GAAGf,MAAM,GAC3BE,8BAAY,CAACc,MAAM,GACnBd,8BAAY,CAACe,cAAc;EAC/B,MAAMC,iBAAiB,GAAGlB,MAAM,GAC5BE,8BAAY,CAACc,MAAM,GACnBd,8BAAY,CAACY,gBAAgB;EAEjC,OAAO;IACLb,kBAAkB;IAClBI,mBAAmB;IACnBG,qBAAqB;IACrBI,eAAe;IACfG,gBAAgB;IAChBG,iBAAiB;IACjBP;EACF,CAAC;AACH,CAAC;AAACQ,OAAA,CAAApB,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getGradientColor = void 0;
7
+ var _chromaJs = _interopRequireDefault(require("chroma-js"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const getGradientColor = (value, startColor, targetColor, minThreshold, maxThreshold) => {
10
+ const colorScale = _chromaJs.default.scale([startColor, targetColor]).domain([minThreshold, maxThreshold]).mode('rgb');
11
+ return colorScale(value).hex();
12
+ };
13
+ exports.getGradientColor = getGradientColor;
14
+ //# sourceMappingURL=getGradientColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGradientColor.js","names":["_chromaJs","_interopRequireDefault","require","e","__esModule","default","getGradientColor","value","startColor","targetColor","minThreshold","maxThreshold","colorScale","chroma","scale","domain","mode","hex","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.ts"],"sourcesContent":["import chroma from 'chroma-js';\n\nexport const getGradientColor = (\n value: number,\n startColor: string,\n targetColor: string,\n minThreshold: number,\n maxThreshold: number\n): string => {\n const colorScale = chroma\n .scale([startColor, targetColor])\n .domain([minThreshold, maxThreshold])\n .mode('rgb');\n\n return colorScale(value).hex();\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExB,MAAMG,gBAAgB,GAAGA,CAC9BC,KAAa,EACbC,UAAkB,EAClBC,WAAmB,EACnBC,YAAoB,EACpBC,YAAoB,KACT;EACX,MAAMC,UAAU,GAAGC,iBAAM,CACtBC,KAAK,CAAC,CAACN,UAAU,EAAEC,WAAW,CAAC,CAAC,CAChCM,MAAM,CAAC,CAACL,YAAY,EAAEC,YAAY,CAAC,CAAC,CACpCK,IAAI,CAAC,KAAK,CAAC;EAEd,OAAOJ,UAAU,CAACL,KAAK,CAAC,CAACU,GAAG,CAAC,CAAC;AAChC,CAAC;AAACC,OAAA,CAAAZ,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLabelData = void 0;
7
+ var _constants = require("../../../constants");
8
+ const getLabelData = _ref => {
9
+ let {
10
+ dates,
11
+ isGreaterThanTwoWeeks
12
+ } = _ref;
13
+ return dates.filter((record, index, arr) => {
14
+ if (index === 0) {
15
+ return false;
16
+ }
17
+ const previousTimestamp = arr[index - 1];
18
+ const currentDate = new Date(record);
19
+ const previousDate = new Date(previousTimestamp);
20
+ return isGreaterThanTwoWeeks ? currentDate.getDate() !== previousDate.getDate() : currentDate.getMonth() !== previousDate.getMonth();
21
+ }).map(item => ({
22
+ name: new Date(item).toLocaleDateString(undefined, {
23
+ month: isGreaterThanTwoWeeks ? 'short' : 'long',
24
+ day: isGreaterThanTwoWeeks ? 'numeric' : undefined
25
+ }),
26
+ xAxis: item,
27
+ y: _constants.CHART_CONFIG.MAIN_HEIGHT + _constants.CHART_CONFIG.X_LABEL_SIZE - 22,
28
+ silent: true,
29
+ emphasis: {
30
+ disabled: true
31
+ },
32
+ label: {
33
+ fontFamily: 'Sofia W03',
34
+ fontSize: 10,
35
+ position: 'bottom',
36
+ align: 'center',
37
+ formatter: '{b}'
38
+ }
39
+ }));
40
+ };
41
+ exports.getLabelData = getLabelData;
42
+ //# sourceMappingURL=getLabelData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLabelData.js","names":["_constants","require","getLabelData","_ref","dates","isGreaterThanTwoWeeks","filter","record","index","arr","previousTimestamp","currentDate","Date","previousDate","getDate","getMonth","map","item","name","toLocaleDateString","undefined","month","day","xAxis","y","CHART_CONFIG","MAIN_HEIGHT","X_LABEL_SIZE","silent","emphasis","disabled","label","fontFamily","fontSize","position","align","formatter","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getLabelData.ts"],"sourcesContent":["import { CHART_CONFIG } from '../../../constants';\nimport type { GetLabelsDataProps } from '../types';\n\nexport const getLabelData = ({\n dates,\n isGreaterThanTwoWeeks,\n}: GetLabelsDataProps) =>\n dates\n .filter((record, index, arr) => {\n if (index === 0) {\n return false;\n }\n const previousTimestamp = arr[index - 1];\n const currentDate = new Date(record);\n const previousDate = new Date(previousTimestamp);\n\n return isGreaterThanTwoWeeks\n ? currentDate.getDate() !== previousDate.getDate()\n : currentDate.getMonth() !== previousDate.getMonth();\n })\n .map(\n (item) =>\n ({\n name: new Date(item).toLocaleDateString(undefined, {\n month: isGreaterThanTwoWeeks ? 'short' : 'long',\n day: isGreaterThanTwoWeeks ? 'numeric' : undefined,\n }),\n xAxis: item,\n y: CHART_CONFIG.MAIN_HEIGHT + CHART_CONFIG.X_LABEL_SIZE - 22,\n silent: true,\n emphasis: {\n disabled: true,\n },\n label: {\n fontFamily: 'Sofia W03',\n fontSize: 10,\n position: 'bottom' as const,\n align: 'center' as const,\n formatter: '{b}',\n },\n }) as const\n );\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGO,MAAMC,YAAY,GAAGC,IAAA;EAAA,IAAC;IAC3BC,KAAK;IACLC;EACkB,CAAC,GAAAF,IAAA;EAAA,OACnBC,KAAK,CACFE,MAAM,CAAC,CAACC,MAAM,EAAEC,KAAK,EAAEC,GAAG,KAAK;IAC9B,IAAID,KAAK,KAAK,CAAC,EAAE;MACf,OAAO,KAAK;IACd;IACA,MAAME,iBAAiB,GAAGD,GAAG,CAACD,KAAK,GAAG,CAAC,CAAC;IACxC,MAAMG,WAAW,GAAG,IAAIC,IAAI,CAACL,MAAM,CAAC;IACpC,MAAMM,YAAY,GAAG,IAAID,IAAI,CAACF,iBAAiB,CAAC;IAEhD,OAAOL,qBAAqB,GACxBM,WAAW,CAACG,OAAO,CAAC,CAAC,KAAKD,YAAY,CAACC,OAAO,CAAC,CAAC,GAChDH,WAAW,CAACI,QAAQ,CAAC,CAAC,KAAKF,YAAY,CAACE,QAAQ,CAAC,CAAC;EACxD,CAAC,CAAC,CACDC,GAAG,CACDC,IAAI,KACF;IACCC,IAAI,EAAE,IAAIN,IAAI,CAACK,IAAI,CAAC,CAACE,kBAAkB,CAACC,SAAS,EAAE;MACjDC,KAAK,EAAEhB,qBAAqB,GAAG,OAAO,GAAG,MAAM;MAC/CiB,GAAG,EAAEjB,qBAAqB,GAAG,SAAS,GAAGe;IAC3C,CAAC,CAAC;IACFG,KAAK,EAAEN,IAAI;IACXO,CAAC,EAAEC,uBAAY,CAACC,WAAW,GAAGD,uBAAY,CAACE,YAAY,GAAG,EAAE;IAC5DC,MAAM,EAAE,IAAI;IACZC,QAAQ,EAAE;MACRC,QAAQ,EAAE;IACZ,CAAC;IACDC,KAAK,EAAE;MACLC,UAAU,EAAE,WAAW;MACvBC,QAAQ,EAAE,EAAE;MACZC,QAAQ,EAAE,QAAiB;MAC3BC,KAAK,EAAE,QAAiB;MACxBC,SAAS,EAAE;IACb;EACF,CAAC,CACL,CAAC;AAAA;AAACC,OAAA,CAAAnC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getRectColor = void 0;
7
+ var _constants = require("../../../constants");
8
+ var _getGradientColor = require("./getGradientColor");
9
+ const getRectColor = (sentiment, isDark, minThreshold, maxThreshold) => {
10
+ const colorPalette = isDark ? _constants.COLOR_MAP.dark : _constants.COLOR_MAP.light;
11
+ return sentiment < 0 ? (0, _getGradientColor.getGradientColor)(sentiment * -1, colorPalette.short[0], colorPalette.short[1], minThreshold, maxThreshold) : (0, _getGradientColor.getGradientColor)(sentiment, colorPalette.long[0], colorPalette.long[1], minThreshold, maxThreshold);
12
+ };
13
+ exports.getRectColor = getRectColor;
14
+ //# sourceMappingURL=getRectColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRectColor.js","names":["_constants","require","_getGradientColor","getRectColor","sentiment","isDark","minThreshold","maxThreshold","colorPalette","COLOR_MAP","dark","light","getGradientColor","short","long","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getRectColor.ts"],"sourcesContent":["import { COLOR_MAP } from '../../../constants';\nimport { getGradientColor } from './getGradientColor';\n\nexport const getRectColor = (\n sentiment: number,\n isDark: boolean,\n minThreshold: number,\n maxThreshold: number\n) => {\n const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;\n\n return sentiment < 0\n ? getGradientColor(\n sentiment * -1,\n colorPalette.short[0],\n colorPalette.short[1],\n minThreshold,\n maxThreshold\n )\n : getGradientColor(\n sentiment,\n colorPalette.long[0],\n colorPalette.long[1],\n minThreshold,\n maxThreshold\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,MAAME,YAAY,GAAGA,CAC1BC,SAAiB,EACjBC,MAAe,EACfC,YAAoB,EACpBC,YAAoB,KACjB;EACH,MAAMC,YAAY,GAAGH,MAAM,GAAGI,oBAAS,CAACC,IAAI,GAAGD,oBAAS,CAACE,KAAK;EAE9D,OAAOP,SAAS,GAAG,CAAC,GAChB,IAAAQ,kCAAgB,EACdR,SAAS,GAAG,CAAC,CAAC,EACdI,YAAY,CAACK,KAAK,CAAC,CAAC,CAAC,EACrBL,YAAY,CAACK,KAAK,CAAC,CAAC,CAAC,EACrBP,YAAY,EACZC,YACF,CAAC,GACD,IAAAK,kCAAgB,EACdR,SAAS,EACTI,YAAY,CAACM,IAAI,CAAC,CAAC,CAAC,EACpBN,YAAY,CAACM,IAAI,CAAC,CAAC,CAAC,EACpBR,YAAY,EACZC,YACF,CAAC;AACP,CAAC;AAACQ,OAAA,CAAAZ,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTooltipFormatter = void 0;
7
+ var _graphql = require("../../../../gql/types/graphql");
8
+ const DATE_FORMAT_OPTIONS = {
9
+ hour: '2-digit',
10
+ minute: '2-digit',
11
+ year: 'numeric',
12
+ day: 'numeric',
13
+ month: 'numeric',
14
+ timeZoneName: 'short'
15
+ };
16
+ const SENTIMENT_DISPLAY_PRECISION = 2;
17
+ const calculateBucketDisplayPrecision = bucketWidth => {
18
+ var _bucketWidth$toString;
19
+ return ((_bucketWidth$toString = bucketWidth.toString().split('.')[1]) === null || _bucketWidth$toString === void 0 ? void 0 : _bucketWidth$toString.length) || 0;
20
+ };
21
+ const findSeriesParam = (params, seriesId) => {
22
+ return params.find(series => series.seriesId === seriesId);
23
+ };
24
+ const getSentimentOverbalanceLabel = (sentiment, bookType) => {
25
+ if (sentiment < 0) {
26
+ return bookType === _graphql.BookType.Order ? 'sell_overbalance' : 'short_overbalance';
27
+ }
28
+ return bookType === _graphql.BookType.Order ? 'buy_overbalance' : 'long_overbalance';
29
+ };
30
+ const formatCandleData = (candleData, labelCallback) => {
31
+ const [, open, close, low, high] = candleData;
32
+ return "<p><b>".concat(labelCallback('candle'), ":</b></p>\n<p>").concat(labelCallback('open_price'), ": ").concat(open, " </p>\n<p>").concat(labelCallback('close_price'), ": ").concat(close, " </p>\n<p>").concat(labelCallback('low'), ": ").concat(low, " </p>\n<p>").concat(labelCallback('high'), ": ").concat(high, " </p>\n");
33
+ };
34
+ const formatBookData = _ref => {
35
+ let {
36
+ matchedBucket,
37
+ bucketWidth,
38
+ bucketDisplayPrecision,
39
+ bookType,
40
+ labelCallback
41
+ } = _ref;
42
+ const bookLabelKey = bookType === _graphql.BookType.Order ? 'orders' : 'positions';
43
+ const priceRangeStart = matchedBucket.price.toFixed(bucketDisplayPrecision);
44
+ const priceRangeEnd = (matchedBucket.price + bucketWidth).toFixed(bucketDisplayPrecision);
45
+ const sentimentLabel = getSentimentOverbalanceLabel(matchedBucket.sentiment, bookType);
46
+ const sentimentValue = Math.abs(matchedBucket.sentiment).toFixed(bucketDisplayPrecision);
47
+ return "<br /><p><b>".concat(labelCallback(bookLabelKey), ":</b></p>\n<p>").concat(labelCallback('price_range'), ": ").concat(priceRangeStart, " - ").concat(priceRangeEnd, " </p>\n<p>").concat(labelCallback(sentimentLabel), ": ").concat(sentimentValue, "% </p>");
48
+ };
49
+ const formatSentimentData = (sentimentParam, labelCallback) => {
50
+ const [, shortPercent, longPercent] = sentimentParam.value;
51
+ return "<br /><p><b>".concat(labelCallback('sentiment'), ":</b></p>\n<p>").concat(labelCallback('long'), ": ").concat(longPercent.toFixed(SENTIMENT_DISPLAY_PRECISION), "% </p>\n<p>").concat(labelCallback('short'), ": ").concat(shortPercent.toFixed(SENTIMENT_DISPLAY_PRECISION), "% </p>");
52
+ };
53
+ const hasValidCandleData = candleData => !!candleData[1] && !!candleData[2] && !!candleData[3] && !!candleData[3];
54
+ const hasValidSentimentData = sentimentParam => !!(sentimentParam !== null && sentimentParam !== void 0 && sentimentParam.value[1]) && !!(sentimentParam !== null && sentimentParam !== void 0 && sentimentParam.value[2]);
55
+ const findMatchingBucket = (buckets, bucketsIndex, selectedPrice, bucketWidth) => {
56
+ if (bucketsIndex === undefined) {
57
+ return undefined;
58
+ }
59
+ const selectedBuckets = buckets[bucketsIndex];
60
+ return selectedBuckets === null || selectedBuckets === void 0 ? void 0 : selectedBuckets.find(_ref2 => {
61
+ let {
62
+ price
63
+ } = _ref2;
64
+ return selectedPrice >= price && selectedPrice < price + bucketWidth;
65
+ });
66
+ };
67
+ const getTooltipFormatter = _ref3 => {
68
+ let {
69
+ params,
70
+ buckets,
71
+ bucketWidth,
72
+ selectedPrice,
73
+ bookType,
74
+ labelCallback
75
+ } = _ref3;
76
+ if (!params || !Array.isArray(params) || params.length === 0) {
77
+ return '';
78
+ }
79
+ const candleParam = findSeriesParam(params, 'candlestick');
80
+ const booksParam = findSeriesParam(params, 'heatmap');
81
+ const sentimentParam = findSeriesParam(params, 'sentiment');
82
+ if (!candleParam) {
83
+ return '';
84
+ }
85
+ const bucketDisplayPrecision = calculateBucketDisplayPrecision(bucketWidth);
86
+ const time = new Date(candleParam.axisValue);
87
+ const candleData = candleParam.value;
88
+ const bucketsIndex = booksParam === null || booksParam === void 0 ? void 0 : booksParam.value[2];
89
+ const matchedBucket = findMatchingBucket(buckets, bucketsIndex, selectedPrice, bucketWidth);
90
+ const showCandles = hasValidCandleData(candleData);
91
+ const showSentiment = hasValidSentimentData(sentimentParam);
92
+ if (!showCandles && !matchedBucket) {
93
+ return '';
94
+ }
95
+ const timeFormatted = time.toLocaleString(undefined, DATE_FORMAT_OPTIONS);
96
+ const candleSection = showCandles ? formatCandleData(candleData, labelCallback) : '';
97
+ const bookSection = matchedBucket ? formatBookData({
98
+ matchedBucket,
99
+ bucketWidth,
100
+ bucketDisplayPrecision,
101
+ bookType,
102
+ labelCallback
103
+ }) : '';
104
+ const sentimentSection = showSentiment && sentimentParam ? formatSentimentData(sentimentParam, labelCallback) : '';
105
+ return "<p>".concat(timeFormatted, "</p><br />\n").concat(candleSection, "\n").concat(bookSection, "\n").concat(sentimentSection);
106
+ };
107
+ exports.getTooltipFormatter = getTooltipFormatter;
108
+ //# sourceMappingURL=getTooltipFormatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTooltipFormatter.js","names":["_graphql","require","DATE_FORMAT_OPTIONS","hour","minute","year","day","month","timeZoneName","SENTIMENT_DISPLAY_PRECISION","calculateBucketDisplayPrecision","bucketWidth","_bucketWidth$toString","toString","split","length","findSeriesParam","params","seriesId","find","series","getSentimentOverbalanceLabel","sentiment","bookType","BookType","Order","formatCandleData","candleData","labelCallback","open","close","low","high","concat","formatBookData","_ref","matchedBucket","bucketDisplayPrecision","bookLabelKey","priceRangeStart","price","toFixed","priceRangeEnd","sentimentLabel","sentimentValue","Math","abs","formatSentimentData","sentimentParam","shortPercent","longPercent","value","hasValidCandleData","hasValidSentimentData","findMatchingBucket","buckets","bucketsIndex","selectedPrice","undefined","selectedBuckets","_ref2","getTooltipFormatter","_ref3","Array","isArray","candleParam","booksParam","time","Date","axisValue","showCandles","showSentiment","timeFormatted","toLocaleString","candleSection","bookSection","sentimentSection","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts"],"sourcesContent":["import { BookType } from '../../../../gql/types/graphql';\nimport type { Bucket, TooltipParam } from '../types';\n\nconst DATE_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n day: 'numeric',\n month: 'numeric',\n timeZoneName: 'short',\n};\n\nconst SENTIMENT_DISPLAY_PRECISION = 2;\n\nconst calculateBucketDisplayPrecision = (bucketWidth: number): number => {\n return bucketWidth.toString().split('.')[1]?.length || 0;\n};\n\nconst findSeriesParam = <T extends TooltipParam['seriesId']>(\n params: TooltipParam[],\n seriesId: T\n): Extract<TooltipParam, { seriesId: T }> | undefined => {\n return params.find(\n (series): series is Extract<TooltipParam, { seriesId: T }> =>\n series.seriesId === seriesId\n );\n};\n\nconst getSentimentOverbalanceLabel = (\n sentiment: number,\n bookType: BookType\n): string => {\n if (sentiment < 0) {\n return bookType === BookType.Order\n ? 'sell_overbalance'\n : 'short_overbalance';\n }\n return bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance';\n};\n\nconst formatCandleData = (\n candleData: [number, number, number, number, number],\n labelCallback: (key: string) => string\n): string => {\n const [, open, close, low, high] = candleData;\n return `<p><b>${labelCallback('candle')}:</b></p>\n<p>${labelCallback('open_price')}: ${open} </p>\n<p>${labelCallback('close_price')}: ${close} </p>\n<p>${labelCallback('low')}: ${low} </p>\n<p>${labelCallback('high')}: ${high} </p>\n`;\n};\n\nconst formatBookData = ({\n matchedBucket,\n bucketWidth,\n bucketDisplayPrecision,\n bookType,\n labelCallback,\n}: {\n matchedBucket: Bucket;\n bucketWidth: number;\n bucketDisplayPrecision: number;\n bookType: BookType;\n labelCallback: (key: string) => string;\n}): string => {\n const bookLabelKey = bookType === BookType.Order ? 'orders' : 'positions';\n const priceRangeStart = matchedBucket.price.toFixed(bucketDisplayPrecision);\n const priceRangeEnd = (matchedBucket.price + bucketWidth).toFixed(\n bucketDisplayPrecision\n );\n const sentimentLabel = getSentimentOverbalanceLabel(\n matchedBucket.sentiment,\n bookType\n );\n const sentimentValue = Math.abs(matchedBucket.sentiment).toFixed(\n bucketDisplayPrecision\n );\n\n return `<br /><p><b>${labelCallback(bookLabelKey)}:</b></p>\n<p>${labelCallback('price_range')}: ${priceRangeStart} - ${priceRangeEnd} </p>\n<p>${labelCallback(sentimentLabel)}: ${sentimentValue}% </p>`;\n};\n\nconst formatSentimentData = (\n sentimentParam: Extract<TooltipParam, { seriesId: 'sentiment' }>,\n labelCallback: (key: string) => string\n): string => {\n const [, shortPercent, longPercent] = sentimentParam.value;\n return `<br /><p><b>${labelCallback('sentiment')}:</b></p>\n<p>${labelCallback('long')}: ${longPercent.toFixed(SENTIMENT_DISPLAY_PRECISION)}% </p>\n<p>${labelCallback('short')}: ${shortPercent.toFixed(SENTIMENT_DISPLAY_PRECISION)}% </p>`;\n};\n\nconst hasValidCandleData = (\n candleData: [number, number, number, number, number]\n): boolean =>\n !!candleData[1] && !!candleData[2] && !!candleData[3] && !!candleData[3];\nconst hasValidSentimentData = (\n sentimentParam: Extract<TooltipParam, { seriesId: 'sentiment' }> | undefined\n): boolean => !!sentimentParam?.value[1] && !!sentimentParam?.value[2];\nconst findMatchingBucket = (\n buckets: Bucket[][],\n bucketsIndex: number | undefined,\n selectedPrice: number,\n bucketWidth: number\n): Bucket | undefined => {\n if (bucketsIndex === undefined) {\n return undefined;\n }\n const selectedBuckets = buckets[bucketsIndex];\n return selectedBuckets?.find(\n ({ price }) => selectedPrice >= price && selectedPrice < price + bucketWidth\n );\n};\n\nexport const getTooltipFormatter = ({\n params,\n buckets,\n bucketWidth,\n selectedPrice,\n bookType,\n labelCallback,\n}: {\n params: TooltipParam[];\n buckets: Bucket[][];\n bucketWidth: number;\n selectedPrice: number;\n bookType: BookType;\n labelCallback: (key: string) => string;\n}) => {\n if (!params || !Array.isArray(params) || params.length === 0) {\n return '';\n }\n\n const candleParam = findSeriesParam(params, 'candlestick');\n const booksParam = findSeriesParam(params, 'heatmap');\n const sentimentParam = findSeriesParam(params, 'sentiment');\n\n if (!candleParam) {\n return '';\n }\n\n const bucketDisplayPrecision = calculateBucketDisplayPrecision(bucketWidth);\n const time = new Date(candleParam.axisValue as string);\n const candleData = candleParam.value;\n const bucketsIndex = booksParam?.value[2];\n const matchedBucket = findMatchingBucket(\n buckets,\n bucketsIndex,\n selectedPrice,\n bucketWidth\n );\n const showCandles = hasValidCandleData(candleData);\n const showSentiment = hasValidSentimentData(sentimentParam);\n\n if (!showCandles && !matchedBucket) {\n return '';\n }\n\n const timeFormatted = time.toLocaleString(undefined, DATE_FORMAT_OPTIONS);\n const candleSection = showCandles\n ? formatCandleData(candleData, labelCallback)\n : '';\n const bookSection = matchedBucket\n ? formatBookData({\n matchedBucket,\n bucketWidth,\n bucketDisplayPrecision,\n bookType,\n labelCallback,\n })\n : '';\n const sentimentSection =\n showSentiment && sentimentParam\n ? formatSentimentData(sentimentParam, labelCallback)\n : '';\n\n return `<p>${timeFormatted}</p><br />\n${candleSection}\n${bookSection}\n${sentimentSection}`;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGA,MAAMC,mBAA+C,GAAG;EACtDC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE,SAAS;EACfC,GAAG,EAAE,SAAS;EACdC,KAAK,EAAE,SAAS;EAChBC,YAAY,EAAE;AAChB,CAAC;AAED,MAAMC,2BAA2B,GAAG,CAAC;AAErC,MAAMC,+BAA+B,GAAIC,WAAmB,IAAa;EAAA,IAAAC,qBAAA;EACvE,OAAO,EAAAA,qBAAA,GAAAD,WAAW,CAACE,QAAQ,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAAF,qBAAA,uBAApCA,qBAAA,CAAsCG,MAAM,KAAI,CAAC;AAC1D,CAAC;AAED,MAAMC,eAAe,GAAGA,CACtBC,MAAsB,EACtBC,QAAW,KAC4C;EACvD,OAAOD,MAAM,CAACE,IAAI,CACfC,MAAM,IACLA,MAAM,CAACF,QAAQ,KAAKA,QACxB,CAAC;AACH,CAAC;AAED,MAAMG,4BAA4B,GAAGA,CACnCC,SAAiB,EACjBC,QAAkB,KACP;EACX,IAAID,SAAS,GAAG,CAAC,EAAE;IACjB,OAAOC,QAAQ,KAAKC,iBAAQ,CAACC,KAAK,GAC9B,kBAAkB,GAClB,mBAAmB;EACzB;EACA,OAAOF,QAAQ,KAAKC,iBAAQ,CAACC,KAAK,GAAG,iBAAiB,GAAG,kBAAkB;AAC7E,CAAC;AAED,MAAMC,gBAAgB,GAAGA,C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GL,IAAI,CAACM,cAAc,CAACf,SAAS,EAAExD,mBAAmB,CAAC;EACzE,MAAMwE,aAAa,GAAGJ,WAAW,GAC7B5C,gBAAgB,CAACC,UAAU,EAAEC,aAAa,CAAC,GAC3C,EAAE;EACN,MAAM+C,WAAW,GAAGvC,aAAa,GAC7BF,cAAc,CAAC;IACbE,aAAa;IACbzB,WAAW;IACX0B,sBAAsB;IACtBd,QAAQ;IACRK;EACF,CAAC,CAAC,GACF,EAAE;EACN,MAAMgD,gBAAgB,GACpBL,aAAa,IAAIvB,cAAc,GAC3BD,mBAAmB,CAACC,cAAc,EAAEpB,aAAa,CAAC,GAClD,EAAE;EAER,aAAAK,MAAA,CAAauC,aAAa,kBAAAvC,MAAA,CAC1ByC,aAAa,QAAAzC,MAAA,CACb0C,WAAW,QAAA1C,MAAA,CACX2C,gBAAgB;AAClB,CAAC;AAACC,OAAA,CAAAhB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _formatXAxisLabel = require("./formatXAxisLabel");
7
+ Object.keys(_formatXAxisLabel).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _formatXAxisLabel[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _formatXAxisLabel[key];
14
+ }
15
+ });
16
+ });
17
+ var _getChartStyles = require("./getChartStyles");
18
+ Object.keys(_getChartStyles).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _getChartStyles[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _getChartStyles[key];
25
+ }
26
+ });
27
+ });
28
+ var _getGradientColor = require("./getGradientColor");
29
+ Object.keys(_getGradientColor).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _getGradientColor[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _getGradientColor[key];
36
+ }
37
+ });
38
+ });
39
+ var _getLabelData = require("./getLabelData");
40
+ Object.keys(_getLabelData).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _getLabelData[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _getLabelData[key];
47
+ }
48
+ });
49
+ });
50
+ var _getRectColor = require("./getRectColor");
51
+ Object.keys(_getRectColor).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _getRectColor[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _getRectColor[key];
58
+ }
59
+ });
60
+ });
61
+ var _getTooltipFormatter = require("./getTooltipFormatter");
62
+ Object.keys(_getTooltipFormatter).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _getTooltipFormatter[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _getTooltipFormatter[key];
69
+ }
70
+ });
71
+ });
72
+ var _isDifferenceGreaterThanTwoWeeks = require("./isDifferenceGreaterThanTwoWeeks");
73
+ Object.keys(_isDifferenceGreaterThanTwoWeeks).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _isDifferenceGreaterThanTwoWeeks[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _isDifferenceGreaterThanTwoWeeks[key];
80
+ }
81
+ });
82
+ });
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_formatXAxisLabel","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getChartStyles","_getGradientColor","_getLabelData","_getRectColor","_getTooltipFormatter","_isDifferenceGreaterThanTwoWeeks"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/index.ts"],"sourcesContent":["export * from './formatXAxisLabel';\nexport * from './getChartStyles';\nexport * from './getGradientColor';\nexport * from './getLabelData';\nexport * from './getRectColor';\nexport * from './getTooltipFormatter';\nexport * from './isDifferenceGreaterThanTwoWeeks';\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,eAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,iBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,iBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,iBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,O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AAC,MAAA,CAAAC,IAAA,CAAAY,gCAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,gCAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,gCAAA,CAAAV,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isDifferenceGreaterThanTwoWeeks = void 0;
7
+ var _constants = require("../../../constants");
8
+ const isDifferenceGreaterThanTwoWeeks = (startDate, endDate) => {
9
+ const date1 = new Date(startDate);
10
+ const date2 = new Date(endDate);
11
+ const differenceInMs = Math.abs(date2.getTime() - date1.getTime());
12
+ return differenceInMs < _constants.TIME_THRESHOLDS.TWO_WEEKS_MS;
13
+ };
14
+ exports.isDifferenceGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks;
15
+ //# sourceMappingURL=isDifferenceGreaterThanTwoWeeks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDifferenceGreaterThanTwoWeeks.js","names":["_constants","require","isDifferenceGreaterThanTwoWeeks","startDate","endDate","date1","Date","date2","differenceInMs","Math","abs","getTime","TIME_THRESHOLDS","TWO_WEEKS_MS","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.ts"],"sourcesContent":["import { TIME_THRESHOLDS } from '../../../constants';\n\nexport const isDifferenceGreaterThanTwoWeeks = (\n startDate: string,\n endDate: string\n) => {\n const date1 = new Date(startDate);\n const date2 = new Date(endDate);\n\n const differenceInMs = Math.abs(date2.getTime() - date1.getTime());\n\n return differenceInMs < TIME_THRESHOLDS.TWO_WEEKS_MS;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,+BAA+B,GAAGA,CAC7CC,SAAiB,EACjBC,OAAe,KACZ;EACH,MAAMC,KAAK,GAAG,IAAIC,IAAI,CAACH,SAAS,CAAC;EACjC,MAAMI,KAAK,GAAG,IAAID,IAAI,CAACF,OAAO,CAAC;EAE/B,MAAMI,cAAc,GAAGC,IAAI,CAACC,GAAG,CAACH,KAAK,CAACI,OAAO,CAAC,CAAC,GAAGN,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC;EAElE,OAAOH,cAAc,GAAGI,0BAAe,CAACC,YAAY;AACtD,CAAC;AAACC,OAAA,CAAAZ,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getInstrumentConfigForDivision = void 0;
7
- var _graphql = require("../../gql/types/graphql");
8
- var _selectConfig = require("../selectConfig");
7
+ var _graphql = require("../../../../gql/types/graphql");
8
+ var _selectConfig = require("../../../selectConfig");
9
9
  const getInstrumentConfigForDivision = division => {
10
10
  return division === _graphql.Division.Oc ? _selectConfig.instrumentSelectConfigOC : _selectConfig.instrumentSelectConfig;
11
11
  };
12
12
  exports.getInstrumentConfigForDivision = getInstrumentConfigForDivision;
13
- //# sourceMappingURL=instrumentUtils.js.map
13
+ //# sourceMappingURL=getInstrumentConfigForDivision.js.map