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

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 (193) hide show
  1. package/CHANGELOG.md +452 -0
  2. package/dist/main/CrowdViewWidget/components/Chart/Chart.js +42 -58
  3. package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
  4. package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +33 -8
  5. package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
  6. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +15 -9
  7. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -1
  8. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +28 -14
  9. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -1
  10. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js +55 -15
  11. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -1
  12. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +171 -0
  13. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -0
  14. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +7 -14
  15. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -1
  16. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +20 -2
  17. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -1
  18. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +13 -5
  19. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -1
  20. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +51 -5
  21. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
  22. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +30 -7
  23. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -1
  24. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +27 -29
  25. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -1
  26. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js +11 -0
  27. package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -1
  28. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +18 -0
  29. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js.map +1 -0
  30. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +6 -5
  31. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -1
  32. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +1 -20
  33. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -1
  34. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +91 -21
  35. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
  36. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +59 -0
  37. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -0
  38. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js +34 -0
  39. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js.map +1 -0
  40. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js +44 -0
  41. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -1
  42. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js +11 -0
  43. package/dist/main/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js.map +1 -0
  44. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.js +19 -0
  45. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.js.map +1 -0
  46. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js +11 -0
  47. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -1
  48. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +1 -1
  49. package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -1
  50. package/dist/main/CrowdViewWidget/components/Chart/getOption.js +41 -23
  51. package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
  52. package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
  53. package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +7 -4
  54. package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
  55. package/dist/main/CrowdViewWidget/components/Chart/useResizeObserver.js +47 -0
  56. package/dist/main/CrowdViewWidget/components/Chart/useResizeObserver.js.map +1 -0
  57. package/dist/main/CrowdViewWidget/components/Legend/Legend.js +1 -1
  58. package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
  59. package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +11 -1
  60. package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
  61. package/dist/main/CrowdViewWidget/constants.js +31 -10
  62. package/dist/main/CrowdViewWidget/constants.js.map +1 -1
  63. package/dist/main/CrowdViewWidget/selectConfig.js +3 -9
  64. package/dist/main/CrowdViewWidget/selectConfig.js.map +1 -1
  65. package/dist/main/translations/sources/en.json +10 -8
  66. package/dist/module/CrowdViewWidget/components/Chart/Chart.js +43 -58
  67. package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
  68. package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +32 -7
  69. package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
  70. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +15 -9
  71. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -1
  72. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +28 -14
  73. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -1
  74. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js +55 -15
  75. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -1
  76. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +163 -0
  77. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -0
  78. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +7 -14
  79. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -1
  80. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +20 -2
  81. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -1
  82. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +13 -5
  83. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -1
  84. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +50 -5
  85. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
  86. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +31 -8
  87. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -1
  88. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +28 -30
  89. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -1
  90. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js +1 -0
  91. package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -1
  92. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +11 -0
  93. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js.map +1 -0
  94. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +6 -5
  95. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -1
  96. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +1 -20
  97. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -1
  98. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +91 -21
  99. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
  100. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +52 -0
  101. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -0
  102. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js +27 -0
  103. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js.map +1 -0
  104. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +4 -0
  105. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -1
  106. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js +4 -0
  107. package/dist/module/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js.map +1 -0
  108. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.js +12 -0
  109. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.js.map +1 -0
  110. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js +1 -0
  111. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -1
  112. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +1 -1
  113. package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -1
  114. package/dist/module/CrowdViewWidget/components/Chart/getOption.js +42 -24
  115. package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
  116. package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
  117. package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +8 -5
  118. package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
  119. package/dist/module/CrowdViewWidget/components/Chart/useResizeObserver.js +40 -0
  120. package/dist/module/CrowdViewWidget/components/Chart/useResizeObserver.js.map +1 -0
  121. package/dist/module/CrowdViewWidget/components/Legend/Legend.js +1 -1
  122. package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
  123. package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +11 -1
  124. package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
  125. package/dist/module/CrowdViewWidget/constants.js +31 -10
  126. package/dist/module/CrowdViewWidget/constants.js.map +1 -1
  127. package/dist/module/CrowdViewWidget/selectConfig.js +3 -9
  128. package/dist/module/CrowdViewWidget/selectConfig.js.map +1 -1
  129. package/dist/module/translations/sources/en.json +10 -8
  130. package/dist/types/CrowdViewWidget/components/Chart/Chart.d.ts +1 -1
  131. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.d.ts +5 -1
  132. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridLines.d.ts +2 -1
  133. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.d.ts +8 -0
  134. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts +2 -3
  135. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.d.ts +2 -1
  136. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts +2 -1
  137. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.d.ts +6 -1
  138. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.d.ts +2 -1
  139. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.d.ts +1 -2
  140. package/dist/types/CrowdViewWidget/components/Chart/chartOptions/index.d.ts +1 -0
  141. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.d.ts +1 -0
  142. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.d.ts +1 -1
  143. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getLabelData.d.ts +1 -16
  144. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +6 -1
  145. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.d.ts +4 -0
  146. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.d.ts +3 -0
  147. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/index.d.ts +4 -0
  148. package/dist/types/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.d.ts +1 -0
  149. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.d.ts +2 -0
  150. package/dist/types/CrowdViewWidget/components/Chart/dataUtils/index.d.ts +1 -0
  151. package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +6 -0
  152. package/dist/types/CrowdViewWidget/components/Chart/useResizeObserver.d.ts +5 -0
  153. package/dist/types/CrowdViewWidget/constants.d.ts +28 -15
  154. package/package.json +3 -3
  155. package/src/CrowdViewWidget/components/Chart/Chart.tsx +78 -80
  156. package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +51 -14
  157. package/src/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.ts +11 -2
  158. package/src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts +34 -19
  159. package/src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts +71 -8
  160. package/src/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.ts +207 -0
  161. package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts +7 -15
  162. package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts +22 -1
  163. package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts +13 -4
  164. package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +91 -37
  165. package/src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts +62 -30
  166. package/src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts +22 -33
  167. package/src/CrowdViewWidget/components/Chart/chartOptions/index.ts +1 -0
  168. package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.ts +14 -0
  169. package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts +6 -4
  170. package/src/CrowdViewWidget/components/Chart/chartUtils/getLabelData.ts +11 -35
  171. package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +157 -31
  172. package/src/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.ts +80 -0
  173. package/src/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.ts +37 -0
  174. package/src/CrowdViewWidget/components/Chart/chartUtils/index.ts +4 -0
  175. package/src/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.ts +3 -0
  176. package/src/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.ts +13 -0
  177. package/src/CrowdViewWidget/components/Chart/dataUtils/index.ts +1 -0
  178. package/src/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.ts +1 -1
  179. package/src/CrowdViewWidget/components/Chart/getOption.ts +47 -17
  180. package/src/CrowdViewWidget/components/Chart/types.ts +6 -0
  181. package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +12 -5
  182. package/src/CrowdViewWidget/components/Chart/useResizeObserver.ts +51 -0
  183. package/src/CrowdViewWidget/components/Legend/Legend.tsx +1 -1
  184. package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +18 -1
  185. package/src/CrowdViewWidget/constants.ts +34 -7
  186. package/src/CrowdViewWidget/selectConfig.ts +4 -12
  187. package/src/translations/sources/en.json +10 -8
  188. package/test/components/Chart/utils/chartUtils.test.ts +29 -6
  189. package/test/components/Chart/utils/handleLabelUpdate.test.ts +435 -0
  190. package/test/components/Chart/utils/handleTooltipUpdate.test.ts +140 -0
  191. package/test/components/Legend.test.tsx +3 -3
  192. package/test/components/LegendBar.test.tsx +22 -20
  193. package/test/utils/processPriceCandles.test.ts +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,458 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.0.56 (2025-12-11)
7
+
8
+
9
+
10
+ ## 1.0.237 (2025-12-09)
11
+
12
+
13
+
14
+ ## 1.0.236 (2025-12-05)
15
+
16
+
17
+
18
+ ## 1.0.235 (2025-12-04)
19
+
20
+
21
+
22
+ ## 1.0.234 (2025-11-27)
23
+
24
+
25
+
26
+ ## 1.0.233 (2025-11-27)
27
+
28
+
29
+
30
+ ## 1.0.232 (2025-11-27)
31
+
32
+
33
+
34
+ ## 1.0.231 (2025-11-07)
35
+
36
+
37
+
38
+ ## 1.0.230 (2025-11-05)
39
+
40
+
41
+
42
+ ## 1.0.229 (2025-11-05)
43
+
44
+
45
+
46
+ ## 1.0.228 (2025-11-05)
47
+
48
+
49
+
50
+ ## 1.0.227 (2025-10-31)
51
+
52
+
53
+
54
+ ## 1.0.226 (2025-10-29)
55
+
56
+
57
+
58
+ ## 1.0.225 (2025-10-09)
59
+
60
+
61
+
62
+ ## 1.0.224 (2025-09-29)
63
+
64
+
65
+
66
+ ## 1.0.223 (2025-09-29)
67
+
68
+
69
+
70
+ ## 1.0.222 (2025-09-17)
71
+
72
+
73
+
74
+ ## 1.0.221 (2025-09-11)
75
+
76
+
77
+
78
+ ## 1.0.220 (2025-09-09)
79
+
80
+
81
+
82
+ ## 1.0.219 (2025-09-02)
83
+
84
+
85
+
86
+ ## 1.0.218 (2025-09-01)
87
+
88
+
89
+
90
+ ## 1.0.217 (2025-08-25)
91
+
92
+
93
+
94
+ ## 1.0.216 (2025-08-18)
95
+
96
+
97
+
98
+ ## 1.0.215 (2025-08-18)
99
+
100
+
101
+
102
+ ## 1.0.214 (2025-08-14)
103
+
104
+
105
+
106
+ ## 1.0.213 (2025-08-12)
107
+
108
+
109
+
110
+ ## 1.0.212 (2025-08-05)
111
+
112
+
113
+
114
+ ## 1.0.211 (2025-08-05)
115
+
116
+
117
+
118
+ ## 1.0.210 (2025-07-31)
119
+
120
+
121
+
122
+ ## 1.0.209 (2025-07-31)
123
+
124
+
125
+
126
+ ## 1.0.208 (2025-07-24)
127
+
128
+
129
+
130
+ ## 1.0.207 (2025-07-18)
131
+
132
+
133
+
134
+ ## 1.0.206 (2025-07-18)
135
+
136
+
137
+
138
+ ## 1.0.205 (2025-07-17)
139
+
140
+
141
+
142
+ ## 1.0.204 (2025-07-09)
143
+
144
+
145
+
146
+ ## 1.0.203 (2025-06-16)
147
+
148
+
149
+
150
+ ## 1.0.202 (2025-06-04)
151
+
152
+
153
+
154
+ ## 1.0.201 (2025-06-02)
155
+
156
+
157
+
158
+ ## 1.0.200 (2025-05-30)
159
+
160
+
161
+
162
+ ## 1.0.199 (2025-05-29)
163
+
164
+
165
+
166
+ ## 1.0.198 (2025-05-26)
167
+
168
+
169
+
170
+ ## 1.0.197 (2025-05-23)
171
+
172
+
173
+
174
+ ## 1.0.196 (2025-05-22)
175
+
176
+
177
+
178
+ ## 1.0.195 (2025-05-21)
179
+
180
+
181
+
182
+ ## 1.0.194 (2025-05-21)
183
+
184
+
185
+
186
+ ## 1.0.193 (2025-05-15)
187
+
188
+
189
+
190
+ ## 1.0.192 (2025-05-14)
191
+
192
+
193
+
194
+ ## 1.0.191 (2025-04-30)
195
+
196
+
197
+
198
+ ## 1.0.190 (2025-04-28)
199
+
200
+
201
+
202
+ ## 1.0.189 (2025-04-23)
203
+
204
+
205
+
206
+ ## 1.0.188 (2025-04-22)
207
+
208
+
209
+
210
+ ## 1.0.187 (2025-04-18)
211
+
212
+
213
+
214
+ ## 1.0.186 (2025-04-10)
215
+
216
+
217
+
218
+ ## 1.0.185 (2025-04-09)
219
+
220
+
221
+
222
+ ## 1.0.184 (2025-04-08)
223
+
224
+
225
+
226
+ ## 1.0.183 (2025-04-04)
227
+
228
+ **Note:** Version bump only for package @oanda/labs-crowd-view-widget
229
+
230
+
231
+
232
+
233
+
234
+ ## 1.0.55 (2025-12-09)
235
+
236
+
237
+
238
+ ## 1.0.236 (2025-12-05)
239
+
240
+
241
+
242
+ ## 1.0.235 (2025-12-04)
243
+
244
+
245
+
246
+ ## 1.0.234 (2025-11-27)
247
+
248
+
249
+
250
+ ## 1.0.233 (2025-11-27)
251
+
252
+
253
+
254
+ ## 1.0.232 (2025-11-27)
255
+
256
+
257
+
258
+ ## 1.0.231 (2025-11-07)
259
+
260
+
261
+
262
+ ## 1.0.230 (2025-11-05)
263
+
264
+
265
+
266
+ ## 1.0.229 (2025-11-05)
267
+
268
+
269
+
270
+ ## 1.0.228 (2025-11-05)
271
+
272
+
273
+
274
+ ## 1.0.227 (2025-10-31)
275
+
276
+
277
+
278
+ ## 1.0.226 (2025-10-29)
279
+
280
+
281
+
282
+ ## 1.0.225 (2025-10-09)
283
+
284
+
285
+
286
+ ## 1.0.224 (2025-09-29)
287
+
288
+
289
+
290
+ ## 1.0.223 (2025-09-29)
291
+
292
+
293
+
294
+ ## 1.0.222 (2025-09-17)
295
+
296
+
297
+
298
+ ## 1.0.221 (2025-09-11)
299
+
300
+
301
+
302
+ ## 1.0.220 (2025-09-09)
303
+
304
+
305
+
306
+ ## 1.0.219 (2025-09-02)
307
+
308
+
309
+
310
+ ## 1.0.218 (2025-09-01)
311
+
312
+
313
+
314
+ ## 1.0.217 (2025-08-25)
315
+
316
+
317
+
318
+ ## 1.0.216 (2025-08-18)
319
+
320
+
321
+
322
+ ## 1.0.215 (2025-08-18)
323
+
324
+
325
+
326
+ ## 1.0.214 (2025-08-14)
327
+
328
+
329
+
330
+ ## 1.0.213 (2025-08-12)
331
+
332
+
333
+
334
+ ## 1.0.212 (2025-08-05)
335
+
336
+
337
+
338
+ ## 1.0.211 (2025-08-05)
339
+
340
+
341
+
342
+ ## 1.0.210 (2025-07-31)
343
+
344
+
345
+
346
+ ## 1.0.209 (2025-07-31)
347
+
348
+
349
+
350
+ ## 1.0.208 (2025-07-24)
351
+
352
+
353
+
354
+ ## 1.0.207 (2025-07-18)
355
+
356
+
357
+
358
+ ## 1.0.206 (2025-07-18)
359
+
360
+
361
+
362
+ ## 1.0.205 (2025-07-17)
363
+
364
+
365
+
366
+ ## 1.0.204 (2025-07-09)
367
+
368
+
369
+
370
+ ## 1.0.203 (2025-06-16)
371
+
372
+
373
+
374
+ ## 1.0.202 (2025-06-04)
375
+
376
+
377
+
378
+ ## 1.0.201 (2025-06-02)
379
+
380
+
381
+
382
+ ## 1.0.200 (2025-05-30)
383
+
384
+
385
+
386
+ ## 1.0.199 (2025-05-29)
387
+
388
+
389
+
390
+ ## 1.0.198 (2025-05-26)
391
+
392
+
393
+
394
+ ## 1.0.197 (2025-05-23)
395
+
396
+
397
+
398
+ ## 1.0.196 (2025-05-22)
399
+
400
+
401
+
402
+ ## 1.0.195 (2025-05-21)
403
+
404
+
405
+
406
+ ## 1.0.194 (2025-05-21)
407
+
408
+
409
+
410
+ ## 1.0.193 (2025-05-15)
411
+
412
+
413
+
414
+ ## 1.0.192 (2025-05-14)
415
+
416
+
417
+
418
+ ## 1.0.191 (2025-04-30)
419
+
420
+
421
+
422
+ ## 1.0.190 (2025-04-28)
423
+
424
+
425
+
426
+ ## 1.0.189 (2025-04-23)
427
+
428
+
429
+
430
+ ## 1.0.188 (2025-04-22)
431
+
432
+
433
+
434
+ ## 1.0.187 (2025-04-18)
435
+
436
+
437
+
438
+ ## 1.0.186 (2025-04-10)
439
+
440
+
441
+
442
+ ## 1.0.185 (2025-04-09)
443
+
444
+
445
+
446
+ ## 1.0.184 (2025-04-08)
447
+
448
+
449
+
450
+ ## 1.0.183 (2025-04-04)
451
+
452
+ **Note:** Version bump only for package @oanda/labs-crowd-view-widget
453
+
454
+
455
+
456
+
457
+
6
458
  ## 1.0.54 (2025-12-05)
7
459
 
8
460
 
@@ -10,11 +10,11 @@ var _charts = require("echarts/charts");
10
10
  var _components = require("echarts/components");
11
11
  var echarts = _interopRequireWildcard(require("echarts/core"));
12
12
  var _renderers = require("echarts/renderers");
13
- var _react = _interopRequireDefault(require("react"));
13
+ var _react = _interopRequireWildcard(require("react"));
14
+ var _usehooksTs = require("usehooks-ts");
14
15
  var _constants = require("../../constants");
15
16
  var _chartUtils = require("./chartUtils");
16
17
  var _getOption = require("./getOption");
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
19
  echarts.use([_components.GridSimpleComponent, _components.GraphicComponent, _renderers.CanvasRenderer, _components.DataZoomInsideComponent, _charts.CustomChart, _components.TooltipComponent, _charts.CandlestickChart, _components.MarkLineComponent, _charts.LineChart, _components.VisualMapComponent, _components.DatasetComponent]);
20
20
  echarts.registerTheme('dark_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Dark));
@@ -23,76 +23,60 @@ const Chart = _ref => {
23
23
  let {
24
24
  mainData,
25
25
  additionalData,
26
- isDesktop
26
+ isDesktop,
27
+ isLoading
27
28
  } = _ref;
28
29
  const {
29
30
  isDark
30
31
  } = (0, _labsWidgetCommon.useLayoutProvider)();
31
32
  const {
32
- lang
33
+ lang,
34
+ locale
33
35
  } = (0, _monoI18n.useLocale)();
36
+ const canHover = (0, _usehooksTs.useMediaQuery)('(hover: hover)');
37
+ const labelTimerRef = (0, _react.useRef)(null);
38
+ const isGreaterThanTwoWeeksRef = (0, _react.useRef)(null);
39
+ const zoomTimerRef = (0, _react.useRef)(null);
40
+ const tooltipVisibleRef = (0, _react.useRef)(true);
41
+ const initialIsGreaterThanTwoWeeks = (0, _react.useMemo)(() => {
42
+ const {
43
+ dates
44
+ } = mainData;
45
+ const initialStartZoom = isDesktop ? _constants.CHART_CONFIG.INITIAL_START_ZOOM_DESKTOP : _constants.CHART_CONFIG.INITIAL_START_ZOOM_MOBILE;
46
+ const visibleXAxisData = dates.slice(dates.length * initialStartZoom / 100, dates.length * _constants.CHART_CONFIG.INITIAL_END_ZOOM / 100);
47
+ if (visibleXAxisData.length === 0) {
48
+ return false;
49
+ }
50
+ return (0, _chartUtils.isDifferenceGreaterThanTwoWeeks)(visibleXAxisData[0], visibleXAxisData[visibleXAxisData.length - 1]);
51
+ }, [mainData, isDesktop]);
52
+ (0, _react.useEffect)(() => {
53
+ isGreaterThanTwoWeeksRef.current = initialIsGreaterThanTwoWeeks;
54
+ }, [initialIsGreaterThanTwoWeeks]);
55
+ const chartOption = (0, _react.useMemo)(() => (0, _getOption.getOption)({
56
+ mainData,
57
+ additionalData,
58
+ isDark,
59
+ isDesktop,
60
+ isLoading,
61
+ locale: (0, _chartUtils.normalizeLocale)(locale),
62
+ labelCallback: lang
63
+ }), [mainData, additionalData, isDark, isDesktop, isLoading, lang, locale]);
64
+ const handleDataZoom = (0, _react.useCallback)((_params, instance) => {
65
+ (0, _chartUtils.handleTooltipUpdate)(instance, zoomTimerRef, tooltipVisibleRef, canHover);
66
+ (0, _chartUtils.handleLabelUpdate)(instance, mainData, labelTimerRef, isGreaterThanTwoWeeksRef, (0, _chartUtils.normalizeLocale)(locale));
67
+ }, [mainData, canHover, locale]);
68
+ const chartHeight = isDesktop ? _constants.CHART_CONFIG.HEIGHT_DESKTOP : _constants.CHART_CONFIG.HEIGHT_MOBILE;
34
69
  return _react.default.createElement(_labsWidgetCommon.BaseChart, {
35
- chartHeight: _constants.CHART_CONFIG.HEIGHT,
70
+ chartHeight: chartHeight,
36
71
  echarts: echarts,
37
72
  isDark: isDark,
38
73
  lazyUpdate: true,
39
- option: (0, _getOption.getOption)({
40
- mainData,
41
- additionalData,
42
- isDark,
43
- isDesktop,
44
- labelCallback: lang
45
- }),
74
+ option: chartOption,
46
75
  opts: {
47
76
  renderer: 'canvas'
48
77
  },
49
78
  onEvents: {
50
- datazoom: (params, instance) => {
51
- var _params$batch, _;
52
- if (!((_params$batch = params.batch) !== null && _params$batch !== void 0 && _params$batch[0])) {
53
- return;
54
- }
55
- const {
56
- dates
57
- } = mainData;
58
- const {
59
- dataZoom,
60
- xAxis
61
- } = instance.getOption();
62
- if (!Array.isArray(dataZoom) || dataZoom.length === 0 || !dataZoom[0] || typeof dataZoom[0].startValue !== 'number' || typeof dataZoom[0].endValue !== 'number') {
63
- return;
64
- }
65
- const {
66
- startValue,
67
- endValue
68
- } = dataZoom[0];
69
- if (!dates[startValue] || !dates[endValue]) {
70
- return;
71
- }
72
- const isGreaterThanTwoWeeks = (0, _chartUtils.isDifferenceGreaterThanTwoWeeks)(dates[startValue], dates[endValue]);
73
- const wasGreaterThanTwoWeeks = Array.isArray(xAxis) && xAxis.length > 0 && ((_ = xAxis[0]) === null || _ === void 0 ? void 0 : _.name) === 'xAxis-greater-than-two-weeks';
74
- if (isGreaterThanTwoWeeks !== wasGreaterThanTwoWeeks) {
75
- const labelsData = (0, _chartUtils.getLabelData)({
76
- dates,
77
- isGreaterThanTwoWeeks
78
- });
79
- instance.setOption({
80
- xAxis: {
81
- id: 'main-xAxis',
82
- name: isGreaterThanTwoWeeks ? 'xAxis-greater-than-two-weeks' : 'xAxis-less-than-two-weeks',
83
- axisLabel: {
84
- formatter: value => (0, _chartUtils.formatXAxisLabel)(value, isGreaterThanTwoWeeks)
85
- }
86
- },
87
- series: [{
88
- id: 'candlestick',
89
- markPoint: {
90
- data: labelsData
91
- }
92
- }]
93
- });
94
- }
95
- }
79
+ datazoom: handleDataZoom
96
80
  }
97
81
  });
98
82
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_react","_interopRequireDefault","_constants","_chartUtils","_getOption","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","use","GridSimpleComponent","GraphicComponent","CanvasRenderer","DataZoomInsideComponent","CustomChart","TooltipComponent","CandlestickChart","MarkLineComponent","LineChart","VisualMapComponent","DatasetComponent","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","mainData","additionalData","isDesktop","isDark","useLayoutProvider","lang","useLocale","createElement","BaseChart","chartHeight","CHART_CONFIG","HEIGHT","lazyUpdate","option","getOption","labelCallback","opts","renderer","onEvents","datazoom","params","instance","_params$batch","_","batch","dates","dataZoom","xAxis","Array","isArray","length","startValue","endValue","isGreaterThanTwoWeeks","isDifferenceGreaterThanTwoWeeks","wasGreaterThanTwoWeeks","name","labelsData","getLabelData","setOption","id","axisLabel","formatter","value","formatXAxisLabel","series","markPoint","data","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n BaseChart,\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport type { EChartsType } from 'echarts';\nimport { CandlestickChart, CustomChart, LineChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomInsideComponent,\n GraphicComponent,\n GridSimpleComponent,\n MarkLineComponent,\n TooltipComponent,\n VisualMapComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport React from 'react';\n\nimport { CHART_CONFIG } from '../../constants';\nimport {\n formatXAxisLabel,\n getLabelData,\n isDifferenceGreaterThanTwoWeeks,\n} from './chartUtils';\nimport { getOption } from './getOption';\nimport type {\n ChartProps,\n DataZoomArray,\n DataZoomEvent,\n XAxisArray,\n} from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n CanvasRenderer,\n DataZoomInsideComponent,\n CustomChart,\n TooltipComponent,\n CandlestickChart,\n MarkLineComponent,\n LineChart,\n VisualMapComponent,\n DatasetComponent,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ mainData, additionalData, isDesktop }: ChartProps) => {\n const { isDark } = useLayoutProvider();\n const { lang } = useLocale();\n\n return (\n <BaseChart\n chartHeight={CHART_CONFIG.HEIGHT}\n echarts={echarts}\n isDark={isDark}\n lazyUpdate={true}\n option={getOption({\n mainData,\n additionalData,\n isDark,\n isDesktop,\n labelCallback: lang,\n })}\n opts={{ renderer: 'canvas' }}\n onEvents={{\n datazoom: (params: DataZoomEvent, instance: EChartsType) => {\n if (!params.batch?.[0]) {\n return;\n }\n\n const { dates } = mainData;\n\n const { dataZoom, xAxis } = instance.getOption();\n if (\n !Array.isArray(dataZoom) ||\n dataZoom.length === 0 ||\n !dataZoom[0] ||\n typeof dataZoom[0].startValue !== 'number' ||\n typeof dataZoom[0].endValue !== 'number'\n ) {\n return;\n }\n\n const { startValue, endValue } = dataZoom[0] as DataZoomArray[0];\n\n if (!dates[startValue] || !dates[endValue]) {\n return;\n }\n\n const isGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks(\n dates[startValue],\n dates[endValue]\n );\n\n const wasGreaterThanTwoWeeks =\n Array.isArray(xAxis) &&\n xAxis.length > 0 &&\n (xAxis as XAxisArray)[0]?.name === 'xAxis-greater-than-two-weeks';\n\n if (isGreaterThanTwoWeeks !== wasGreaterThanTwoWeeks) {\n const labelsData = getLabelData({\n dates,\n isGreaterThanTwoWeeks,\n });\n\n instance.setOption({\n xAxis: {\n id: 'main-xAxis',\n name: isGreaterThanTwoWeeks\n ? 'xAxis-greater-than-two-weeks'\n : 'xAxis-less-than-two-weeks',\n axisLabel: {\n formatter: (value: string) =>\n formatXAxisLabel(value, isGreaterThanTwoWeeks),\n },\n },\n series: [\n {\n id: 'candlestick',\n markPoint: {\n data: labelsData,\n },\n },\n ],\n });\n }\n },\n }}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AASA,IAAAI,OAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAC,sBAAA,CAAAR,OAAA;AAEA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AAAwC,SAAAQ,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAA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","_components","echarts","_interopRequireWildcard","_renderers","_react","_usehooksTs","_constants","_chartUtils","_getOption","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","use","GridSimpleComponent","GraphicComponent","CanvasRenderer","DataZoomInsideComponent","CustomChart","TooltipComponent","CandlestickChart","MarkLineComponent","LineChart","VisualMapComponent","DatasetComponent","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","mainData","additionalData","isDesktop","isLoading","isDark","useLayoutProvider","lang","locale","useLocale","canHover","useMediaQuery","labelTimerRef","useRef","isGreaterThanTwoWeeksRef","zoomTimerRef","tooltipVisibleRef","initialIsGreaterThanTwoWeeks","useMemo","dates","initialStartZoom","CHART_CONFIG","INITIAL_START_ZOOM_DESKTOP","INITIAL_START_ZOOM_MOBILE","visibleXAxisData","slice","length","INITIAL_END_ZOOM","isDifferenceGreaterThanTwoWeeks","useEffect","current","chartOption","getOption","normalizeLocale","labelCallback","handleDataZoom","useCallback","_params","instance","handleTooltipUpdate","handleLabelUpdate","chartHeight","HEIGHT_DESKTOP","HEIGHT_MOBILE","createElement","BaseChart","lazyUpdate","option","opts","renderer","onEvents","datazoom","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n BaseChart,\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport type { EChartsType } from 'echarts';\nimport { CandlestickChart, CustomChart, LineChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomInsideComponent,\n GraphicComponent,\n GridSimpleComponent,\n MarkLineComponent,\n TooltipComponent,\n VisualMapComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useMediaQuery } from 'usehooks-ts';\n\nimport { CHART_CONFIG } from '../../constants';\nimport {\n handleLabelUpdate,\n handleTooltipUpdate,\n isDifferenceGreaterThanTwoWeeks,\n normalizeLocale,\n} from './chartUtils';\nimport { getOption } from './getOption';\nimport type { ChartProps, DataZoomEvent } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n CanvasRenderer,\n DataZoomInsideComponent,\n CustomChart,\n TooltipComponent,\n CandlestickChart,\n MarkLineComponent,\n LineChart,\n VisualMapComponent,\n DatasetComponent,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({\n mainData,\n additionalData,\n isDesktop,\n isLoading,\n}: ChartProps) => {\n const { isDark } = useLayoutProvider();\n const { lang, locale } = useLocale();\n const canHover = useMediaQuery('(hover: hover)');\n const labelTimerRef = useRef<NodeJS.Timeout | null>(null);\n const isGreaterThanTwoWeeksRef = useRef<boolean | null>(null);\n const zoomTimerRef = useRef<NodeJS.Timeout | null>(null);\n const tooltipVisibleRef = useRef<boolean>(true);\n\n const initialIsGreaterThanTwoWeeks = useMemo(() => {\n const { dates } = mainData;\n const initialStartZoom = isDesktop\n ? CHART_CONFIG.INITIAL_START_ZOOM_DESKTOP\n : CHART_CONFIG.INITIAL_START_ZOOM_MOBILE;\n\n const visibleXAxisData = dates.slice(\n (dates.length * initialStartZoom) / 100,\n (dates.length * CHART_CONFIG.INITIAL_END_ZOOM) / 100\n );\n\n if (visibleXAxisData.length === 0) {\n return false;\n }\n\n return isDifferenceGreaterThanTwoWeeks(\n visibleXAxisData[0],\n visibleXAxisData[visibleXAxisData.length - 1]\n );\n }, [mainData, isDesktop]);\n\n useEffect(() => {\n isGreaterThanTwoWeeksRef.current = initialIsGreaterThanTwoWeeks;\n }, [initialIsGreaterThanTwoWeeks]);\n\n const chartOption = useMemo(\n () =>\n getOption({\n mainData,\n additionalData,\n isDark,\n isDesktop,\n isLoading,\n locale: normalizeLocale(locale),\n labelCallback: lang,\n }),\n [mainData, additionalData, isDark, isDesktop, isLoading, lang, locale]\n );\n\n // Memoize event handler to prevent unnecessary re-renders\n const handleDataZoom = useCallback(\n (_params: DataZoomEvent, instance: EChartsType) => {\n handleTooltipUpdate(instance, zoomTimerRef, tooltipVisibleRef, canHover);\n handleLabelUpdate(\n instance,\n mainData,\n labelTimerRef,\n isGreaterThanTwoWeeksRef,\n normalizeLocale(locale)\n );\n },\n [mainData, canHover, locale]\n );\n\n const chartHeight = isDesktop\n ? CHART_CONFIG.HEIGHT_DESKTOP\n : CHART_CONFIG.HEIGHT_MOBILE;\n\n return (\n <BaseChart\n chartHeight={chartHeight}\n echarts={echarts}\n isDark={isDark}\n lazyUpdate={true}\n option={chartOption}\n opts={{ renderer: 'canvas' }}\n onEvents={{\n datazoom: handleDataZoom,\n }}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AASA,IAAAI,OAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAF,uBAAA,CAAAL,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAEA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAMA,IAAAW,UAAA,GAAAX,OAAA;AAAwC,SAAAK,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,u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