@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
@@ -14,16 +14,14 @@ import type {
14
14
  } from '../../../gql/types/graphql';
15
15
  import { BookType, DataSource, Division } from '../../../gql/types/graphql';
16
16
  import { BUCKET_CONFIG, INSTRUMENTS_CONFIG } from '../../constants';
17
- import type { UseCrowdViewDataProps, UseCrowdViewDataReturn } from './types';
18
17
  import {
19
- getTargetBucketWidth,
20
18
  getTimeSpanForGranularity,
21
- processBuckets,
22
19
  processOrderPositionBooks,
23
20
  processPriceCandles,
24
21
  processSentiments,
25
22
  validateData,
26
- } from './utils';
23
+ } from './dataUtils';
24
+ import type { UseCrowdViewDataProps, UseCrowdViewDataReturn } from './types';
27
25
 
28
26
  export const useCrowdViewData = ({
29
27
  instrument,
@@ -35,6 +33,8 @@ export const useCrowdViewData = ({
35
33
  division === Division.Ogm || division === Division.Oj
36
34
  ? DataSource.Mt5
37
35
  : DataSource.V20;
36
+
37
+ // Get price candles data
38
38
  const {
39
39
  loading: priceCandlesLoading,
40
40
  data: priceCandlesData,
@@ -56,26 +56,19 @@ export const useCrowdViewData = ({
56
56
  }
57
57
  );
58
58
 
59
- const priceCandlesProcessed = useMemo(
60
- () => processPriceCandles(priceCandlesData),
61
- [priceCandlesData]
62
- );
63
-
64
- const { minPrice, maxPrice, hasValidCandles, candleMap, candles } =
65
- priceCandlesProcessed;
66
-
67
- const targetBucketWidth = getTargetBucketWidth(granularity, instrument);
68
-
69
- const maxBookPrice = useMemo(
70
- () => maxPrice + targetBucketWidth * BUCKET_CONFIG.PRICE_PADDING_MULTIPLIER,
71
- [maxPrice, targetBucketWidth]
72
- );
73
-
74
- const minBookPrice = useMemo(
75
- () => minPrice - targetBucketWidth * BUCKET_CONFIG.PRICE_PADDING_MULTIPLIER,
76
- [minPrice, targetBucketWidth]
77
- );
78
-
59
+ const {
60
+ minPrice,
61
+ maxPrice,
62
+ hasValidCandles,
63
+ dates,
64
+ candlesOpen,
65
+ candlesClose,
66
+ candlesLow,
67
+ candlesHigh,
68
+ pipsLocation,
69
+ } = useMemo(() => processPriceCandles(priceCandlesData), [priceCandlesData]);
70
+
71
+ // Get order position books data
79
72
  const {
80
73
  loading: orderPositionLoading,
81
74
  data: orderPositionData,
@@ -88,14 +81,30 @@ export const useCrowdViewData = ({
88
81
  bookType: bookType || BookType.Order,
89
82
  timeSpan: getTimeSpanForGranularity(granularity),
90
83
  granularity,
91
- maxBookPrice,
92
- minBookPrice,
84
+ maxBookPrice: maxPrice,
85
+ minBookPrice: minPrice,
86
+ bucketMultiplier: 2,
87
+ bucketMargin: BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,
93
88
  },
94
89
  fetchPolicy: 'no-cache',
95
90
  skip: priceCandlesLoading || !!priceCandlesError,
96
91
  }
97
92
  );
98
93
 
94
+ const {
95
+ bookPrices,
96
+ bookIndexes,
97
+ buckets,
98
+ bucketWidth,
99
+ sentimentThresholdMin,
100
+ sentimentThresholdMax,
101
+ hasValidBooks,
102
+ } = useMemo(
103
+ () => processOrderPositionBooks(orderPositionData, dates),
104
+ [orderPositionData, dates]
105
+ );
106
+
107
+ // Get sentiments data
99
108
  const {
100
109
  loading: sentimentsLoading,
101
110
  data: sentimentsData,
@@ -110,24 +119,14 @@ export const useCrowdViewData = ({
110
119
  skip: priceCandlesLoading || !!priceCandlesError,
111
120
  });
112
121
 
113
- const loading =
114
- priceCandlesLoading || orderPositionLoading || sentimentsLoading;
115
- const xAxisData = candles.map((candle) => candle?.point || '');
116
-
117
- const orderPositionBooks = useMemo(
118
- () => processOrderPositionBooks(orderPositionData, candleMap),
119
- [orderPositionData, candleMap]
120
- );
121
-
122
- const buckets = useMemo(
123
- () => processBuckets(orderPositionData, targetBucketWidth),
124
- [orderPositionData, targetBucketWidth]
122
+ const { sentimentLongs, sentimentShorts, hasValidSentiments } = useMemo(
123
+ () => processSentiments(sentimentsData, dates),
124
+ [sentimentsData, dates]
125
125
  );
126
126
 
127
- const sentiments = useMemo(
128
- () => processSentiments(sentimentsData, xAxisData),
129
- [sentimentsData, xAxisData]
130
- );
127
+ // Gather all results
128
+ const loading =
129
+ priceCandlesLoading || orderPositionLoading || sentimentsLoading;
131
130
 
132
131
  const error = useMemo((): Error | null => {
133
132
  if (priceCandlesError) {
@@ -142,7 +141,13 @@ export const useCrowdViewData = ({
142
141
  if (loading) {
143
142
  return null;
144
143
  }
145
- return validateData(priceCandlesData, orderPositionData, hasValidCandles);
144
+ return validateData(
145
+ priceCandlesData,
146
+ orderPositionData,
147
+ hasValidCandles,
148
+ hasValidBooks,
149
+ hasValidSentiments
150
+ );
146
151
  }, [
147
152
  priceCandlesError,
148
153
  orderPositionError,
@@ -151,6 +156,8 @@ export const useCrowdViewData = ({
151
156
  priceCandlesData,
152
157
  orderPositionData,
153
158
  hasValidCandles,
159
+ hasValidBooks,
160
+ hasValidSentiments,
154
161
  ]);
155
162
 
156
163
  const data = useMemo(() => {
@@ -158,42 +165,52 @@ export const useCrowdViewData = ({
158
165
  return null;
159
166
  }
160
167
 
161
- const candlesSeriesData: [number, number, number, number][] = candles.map(
162
- (candle) => [
163
- candle?.open || 0,
164
- candle?.close || 0,
165
- candle?.low || 0,
166
- candle?.high || 0,
167
- ]
168
- );
169
-
170
168
  return {
171
- buckets,
172
- xAxisData,
173
- candlesSeriesData,
174
- orderPositionBooks,
175
- bucketWidth: targetBucketWidth,
176
- precision: INSTRUMENTS_CONFIG[instrument].precision,
177
- bookType,
178
- sentiments,
169
+ mainData: {
170
+ dates,
171
+ candlesOpen,
172
+ candlesClose,
173
+ candlesLow,
174
+ candlesHigh,
175
+ bookPrices,
176
+ bookIndexes,
177
+ sentimentShorts,
178
+ sentimentLongs,
179
+ },
180
+ additionalData: {
181
+ bucketWidth,
182
+ buckets,
183
+ displayPrecision: pipsLocation,
184
+ bookType,
185
+ sentimentThresholdMin,
186
+ sentimentThresholdMax,
187
+ },
179
188
  };
180
189
  }, [
181
190
  priceCandlesData,
182
191
  orderPositionData,
183
192
  sentimentsData,
184
193
  error,
185
- candles,
194
+ dates,
195
+ candlesOpen,
196
+ candlesClose,
197
+ candlesLow,
198
+ candlesHigh,
199
+ bookPrices,
200
+ bookIndexes,
201
+ sentimentShorts,
202
+ sentimentLongs,
203
+ bucketWidth,
186
204
  buckets,
187
- xAxisData,
188
- orderPositionBooks,
189
- targetBucketWidth,
190
- instrument,
205
+ pipsLocation,
191
206
  bookType,
192
- sentiments,
207
+ sentimentThresholdMin,
208
+ sentimentThresholdMax,
193
209
  ]);
194
210
 
195
211
  return {
196
- data,
212
+ mainData: data?.mainData,
213
+ additionalData: data?.additionalData,
197
214
  loading,
198
215
  error: !!error,
199
216
  };
@@ -1,39 +1,40 @@
1
+ import { useLayoutProvider } from '@oanda/labs-widget-common';
1
2
  import { useLocale } from '@oanda/mono-i18n';
2
3
  import React from 'react';
3
4
 
4
5
  import { BookType } from '../../../gql/types/graphql';
5
- import { BOOKS_THRESHOLDS } from '../../constants';
6
6
  import { LegendBar } from './LegendBar';
7
7
 
8
8
  interface LegendProps {
9
- longValues?: [number, number];
10
- shortValues?: [number, number];
11
9
  bookType: BookType;
12
- isDark: boolean;
13
10
  }
14
11
 
15
- export const Legend = ({
16
- longValues = [BOOKS_THRESHOLDS.MIN, BOOKS_THRESHOLDS.MAX],
17
- shortValues = [BOOKS_THRESHOLDS.MIN, BOOKS_THRESHOLDS.MAX],
18
- bookType,
19
- isDark,
20
- }: LegendProps) => {
12
+ export const Legend = ({ bookType }: LegendProps) => {
13
+ const { isDark } = useLayoutProvider();
21
14
  const { lang } = useLocale();
22
15
 
23
16
  return (
24
- <div className="lw-mx-auto lw-mt-4 lw-flex lw-w-full lw-flex-col lw-items-center lw-space-y-4 lw-pb-6 lw-pt-0 sm:lw-max-w-md lg:lw-max-w-xl">
25
- <LegendBar
26
- isDark={isDark}
27
- label={lang(bookType === BookType.Order ? 'buy' : 'long')}
28
- type="long"
29
- values={longValues}
30
- />
31
- <LegendBar
32
- isDark={isDark}
33
- label={lang(bookType === BookType.Order ? 'sell' : 'short')}
34
- type="short"
35
- values={shortValues}
36
- />
17
+ <div className="lw-my-4 lw-w-full">
18
+ <div className="lw-mb-1 lw-flex lw-w-full lw-flex-row lw-justify-between">
19
+ <LegendBar isDark={isDark} type="long" />
20
+ <div className="lw-w-[250px]" />
21
+ <LegendBar isDark={isDark} type="short" />
22
+ </div>
23
+ <div className="lw-flex lw-w-full lw-flex-row lw-justify-between lw-pb-2 lw-font-sans lw-text-xs lw-text-text-primary">
24
+ <span>
25
+ {lang(
26
+ bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance'
27
+ )}
28
+ </span>
29
+ <span>{lang('even_market_demand')}</span>
30
+ <span>
31
+ {lang(
32
+ bookType === BookType.Order
33
+ ? 'sell_overbalance'
34
+ : 'short_overbalance'
35
+ )}
36
+ </span>
37
+ </div>
37
38
  </div>
38
39
  );
39
40
  };
@@ -5,39 +5,26 @@ import { COLOR_MAP } from '../../constants';
5
5
  export type LegendType = 'long' | 'short';
6
6
 
7
7
  interface LegendBarProps {
8
- values: number[];
9
8
  type: LegendType;
10
- label: string;
11
9
  isDark: boolean;
12
10
  }
13
11
 
14
- export const LegendBar = ({ values, type, label, isDark }: LegendBarProps) => {
12
+ export const LegendBar = ({ type, isDark }: LegendBarProps) => {
15
13
  const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;
16
- const colors = type === 'long' ? colorPalette.long : colorPalette.short;
14
+ const startColor =
15
+ type === 'long' ? colorPalette.long[1] : colorPalette.short[0];
16
+ const endColor =
17
+ type === 'long' ? colorPalette.long[0] : colorPalette.short[1];
17
18
 
18
19
  return (
19
- <div className="lw-flex lw-w-full lw-flex-col lw-space-y-1 lw-border-border-primary">
20
- <span className="lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary">
21
- {label}
22
- </span>
23
- <div className="lw-flex lw-h-2 lw-w-full lw-overflow-hidden lw-border lw-border-border-primary">
24
- <div
25
- className="lw-h-full lw-flex-1"
26
- data-testid="legend-bar-segment"
27
- style={{
28
- background: `linear-gradient(90deg,${colors[0]} 0%, ${colors[1]} 100%)`,
29
- }}
30
- />
31
- </div>
32
-
33
- <div className="lw-flex lw-w-full lw-justify-between">
34
- <span className="lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary">
35
- {values[0].toFixed(2)}%
36
- </span>
37
- <span className="lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary">
38
- {`≤ ${values[1].toFixed(2)}`}%
39
- </span>
40
- </div>
20
+ <div className="lw-flex lw-h-2 lw-w-full lw-overflow-hidden">
21
+ <div
22
+ className="lw-h-full lw-flex-1"
23
+ data-testid="legend-bar-segment"
24
+ style={{
25
+ background: `linear-gradient(90deg,${startColor} 0%, ${endColor} 100%)`,
26
+ }}
27
+ />
41
28
  </div>
42
29
  );
43
30
  };
@@ -1,15 +1,11 @@
1
1
  import { colorPalette } from '@oanda/labs-widget-common';
2
+ import chroma from 'chroma-js';
2
3
 
3
4
  import { InstrumentId } from './types';
4
5
 
5
- export const BOOKS_THRESHOLDS = {
6
- MIN: 0.15,
7
- MAX: 0.55,
8
- } as const;
9
-
10
6
  export const BUCKET_CONFIG = {
11
7
  MULTIPLIER: 4,
12
- PRICE_PADDING_MULTIPLIER: 2,
8
+ PRICE_MARGIN_MULTIPLIER: 2,
13
9
  } as const;
14
10
 
15
11
  export const TIME_THRESHOLDS = {
@@ -17,6 +13,7 @@ export const TIME_THRESHOLDS = {
17
13
  } as const;
18
14
 
19
15
  export const CHART_CONFIG = {
16
+ HEIGHT: 440,
20
17
  MAIN_HEIGHT: 400,
21
18
  MARGIN_BETWEEN: 50,
22
19
  SENTIMENT_HEIGHT: 120,
@@ -24,33 +21,34 @@ export const CHART_CONFIG = {
24
21
  X_LABEL_SIZE: 40,
25
22
  Y_LABEL_SIZE_DESKTOP: 60,
26
23
  Y_LABEL_SIZE_MOBILE: 40,
27
- INITIAL_START_ZOOM: 80,
24
+ Y_SENTIMENT_LABEL_SIZE: 40,
25
+ INITIAL_START_ZOOM: 90,
28
26
  INITIAL_END_ZOOM: 100,
29
27
  X_AXIS_DATE_PADDING: ' ',
30
28
  SENTIMENT_MIN: 0,
31
29
  SENTIMENT_MAX: 100,
32
- SENTIMENT_INTERVAL: 25,
33
- SENTIMENT_TEXT_OFFSET: 16,
34
30
  } as const;
35
31
 
36
- export const CHART_CONFIG_CALCULATED = {
37
- FULL_HEIGHT:
38
- CHART_CONFIG.MAIN_HEIGHT +
39
- CHART_CONFIG.MARGIN_BETWEEN +
40
- CHART_CONFIG.SENTIMENT_HEIGHT +
41
- CHART_CONFIG.X_LABEL_SIZE,
42
- SENTIMENT_TEXT_POSITION:
43
- CHART_CONFIG.SENTIMENT_HEIGHT + CHART_CONFIG.SENTIMENT_TEXT_OFFSET,
44
- };
45
-
46
32
  export const COLOR_MAP = {
47
33
  dark: {
48
- long: [colorPalette.darkBlue10, colorPalette.darkBlue90],
49
- short: [colorPalette.darkYellow10, colorPalette.darkYellow90],
34
+ long: [
35
+ chroma(colorPalette.darkBlue10).shade(0.5).hex(),
36
+ chroma(colorPalette.darkBlue90).shade(0.5).hex(),
37
+ ],
38
+ short: [
39
+ chroma(colorPalette.darkYellow10).shade(0.5).hex(),
40
+ chroma(colorPalette.darkYellow90).shade(0.5).hex(),
41
+ ],
50
42
  },
51
43
  light: {
52
- long: [colorPalette.lightBlue10, colorPalette.lightBlue90],
53
- short: [colorPalette.lightYellow10, colorPalette.lightYellow90],
44
+ long: [
45
+ chroma(colorPalette.lightBlue10).tint(0.5).hex(),
46
+ chroma(colorPalette.lightBlue90).tint(0.5).hex(),
47
+ ],
48
+ short: [
49
+ chroma(colorPalette.lightYellow10).tint(0.5).hex(),
50
+ chroma(colorPalette.lightYellow90).tint(0.5).hex(),
51
+ ],
54
52
  },
55
53
  } as const;
56
54
 
@@ -8,6 +8,8 @@ const getOrderPositionBooks = gql`
8
8
  $granularity: Granularity!
9
9
  $maxBookPrice: Float
10
10
  $minBookPrice: Float
11
+ $bucketMultiplier: Int!
12
+ $bucketMargin: Int!
11
13
  ) {
12
14
  orderPositionBooks(
13
15
  instrument: $instrument
@@ -16,14 +18,20 @@ const getOrderPositionBooks = gql`
16
18
  granularity: $granularity
17
19
  maxBookPrice: $maxBookPrice
18
20
  minBookPrice: $minBookPrice
21
+ bucketMultiplier: $bucketMultiplier
22
+ bucketMargin: $bucketMargin
19
23
  ) {
20
- bucketWidth
21
- price
22
- time
23
- buckets {
24
+ books {
25
+ time
24
26
  price
25
- sentiment
27
+ buckets {
28
+ price
29
+ sentiment
30
+ }
26
31
  }
32
+ bucketWidth
33
+ sentimentThresholdMax
34
+ sentimentThresholdMin
27
35
  }
28
36
  }
29
37
  `;
@@ -22,6 +22,7 @@ const getPriceCandles = gql`
22
22
  open
23
23
  close
24
24
  }
25
+ pipsLocation
25
26
  }
26
27
  }
27
28
  `;
@@ -13,9 +13,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
13
13
  * Therefore it is highly recommended to use the babel or swc plugin for production.
14
14
  */
15
15
  const documents = {
16
- '\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n sentiment\n }\n }\n }\n':
16
+ '\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n $bucketMultiplier: Int!\n $bucketMargin: Int!\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n bucketMultiplier: $bucketMultiplier\n bucketMargin: $bucketMargin\n ) {\n books {\n time\n price\n buckets {\n price\n sentiment\n }\n }\n bucketWidth\n sentimentThresholdMax\n sentimentThresholdMin\n }\n }\n':
17
17
  types.GetOrderPositionBooksDocument,
18
- '\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n }\n }\n':
18
+ '\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n':
19
19
  types.GetPriceCandlesDocument,
20
20
  '\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n longPercent\n shortPercent\n }\n time\n }\n }\n }\n':
21
21
  types.GetSentimentsDocument,
@@ -39,14 +39,14 @@ export function graphql(source: string): unknown;
39
39
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
40
40
  */
41
41
  export function graphql(
42
- source: '\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n sentiment\n }\n }\n }\n'
43
- ): (typeof documents)['\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n sentiment\n }\n }\n }\n'];
42
+ source: '\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n $bucketMultiplier: Int!\n $bucketMargin: Int!\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n bucketMultiplier: $bucketMultiplier\n bucketMargin: $bucketMargin\n ) {\n books {\n time\n price\n buckets {\n price\n sentiment\n }\n }\n bucketWidth\n sentimentThresholdMax\n sentimentThresholdMin\n }\n }\n'
43
+ ): (typeof documents)['\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n $bucketMultiplier: Int!\n $bucketMargin: Int!\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n bucketMultiplier: $bucketMultiplier\n bucketMargin: $bucketMargin\n ) {\n books {\n time\n price\n buckets {\n price\n sentiment\n }\n }\n bucketWidth\n sentimentThresholdMax\n sentimentThresholdMin\n }\n }\n'];
44
44
  /**
45
45
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
46
46
  */
47
47
  export function graphql(
48
- source: '\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n }\n }\n'
49
- ): (typeof documents)['\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n }\n }\n'];
48
+ source: '\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n'
49
+ ): (typeof documents)['\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n'];
50
50
  /**
51
51
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
52
52
  */