@oanda/labs-crowd-view-widget 1.0.55 → 1.0.57
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.
- package/CHANGELOG.md +460 -0
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +8 -10
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +15 -3
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +29 -14
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js +28 -9
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +20 -8
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +21 -16
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +29 -6
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +24 -4
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.js +27 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +2 -2
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +6 -5
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +71 -22
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +3 -3
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js +22 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js +11 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js +11 -5
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/useResizeObserver.js +47 -0
- package/dist/main/CrowdViewWidget/components/Chart/useResizeObserver.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/main/CrowdViewWidget/constants.js +22 -8
- package/dist/main/CrowdViewWidget/constants.js.map +1 -1
- package/dist/main/CrowdViewWidget/selectConfig.js +3 -3
- package/dist/main/CrowdViewWidget/selectConfig.js.map +1 -1
- package/dist/main/translations/sources/en.json +11 -9
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +9 -11
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +15 -3
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +29 -14
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js +28 -9
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +20 -8
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +21 -16
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +30 -7
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +25 -5
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.js +20 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +2 -2
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +6 -5
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +71 -22
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +3 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +2 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js +4 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js +11 -5
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useResizeObserver.js +40 -0
- package/dist/module/CrowdViewWidget/components/Chart/useResizeObserver.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +22 -8
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/CrowdViewWidget/selectConfig.js +3 -3
- package/dist/module/CrowdViewWidget/selectConfig.js.map +1 -1
- package/dist/module/translations/sources/en.json +11 -9
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.d.ts +4 -2
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.d.ts +3 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.d.ts +4 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +4 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/index.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/useResizeObserver.d.ts +5 -0
- package/dist/types/CrowdViewWidget/constants.d.ts +25 -19
- package/package.json +3 -3
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +12 -11
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +22 -3
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts +35 -19
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts +41 -11
- package/src/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.ts +31 -11
- package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +24 -22
- package/src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts +36 -5
- package/src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts +29 -6
- package/src/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.ts +26 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.ts +3 -2
- package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts +6 -4
- package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +143 -32
- package/src/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.ts +8 -3
- package/src/CrowdViewWidget/components/Chart/chartUtils/index.ts +2 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.ts +3 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.ts +1 -1
- package/src/CrowdViewWidget/components/Chart/getOption.ts +7 -1
- package/src/CrowdViewWidget/components/Chart/types.ts +1 -0
- package/src/CrowdViewWidget/components/Chart/useResizeObserver.ts +51 -0
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +3 -2
- package/src/CrowdViewWidget/constants.ts +27 -6
- package/src/CrowdViewWidget/selectConfig.ts +4 -4
- package/src/translations/sources/en.json +11 -9
- package/test/components/Chart/utils/chartUtils.test.ts +16 -4
- package/test/components/Chart/utils/handleLabelUpdate.test.ts +32 -16
- package/test/utils/processPriceCandles.test.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,466 @@
|
|
|
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.57 (2025-12-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.238 (2025-12-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.237 (2025-12-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.236 (2025-12-05)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.235 (2025-12-04)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.234 (2025-11-27)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.233 (2025-11-27)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.232 (2025-11-27)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.231 (2025-11-07)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.230 (2025-11-05)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.229 (2025-11-05)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.228 (2025-11-05)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.227 (2025-10-31)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.226 (2025-10-29)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.225 (2025-10-09)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.224 (2025-09-29)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.223 (2025-09-29)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.222 (2025-09-17)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.221 (2025-09-11)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.220 (2025-09-09)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.219 (2025-09-02)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.218 (2025-09-01)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.217 (2025-08-25)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.216 (2025-08-18)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.215 (2025-08-18)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.214 (2025-08-14)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.213 (2025-08-12)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.212 (2025-08-05)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.211 (2025-08-05)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.210 (2025-07-31)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.209 (2025-07-31)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.208 (2025-07-24)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.207 (2025-07-18)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.206 (2025-07-18)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.205 (2025-07-17)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.204 (2025-07-09)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## 1.0.203 (2025-06-16)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## 1.0.202 (2025-06-04)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 1.0.201 (2025-06-02)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## 1.0.200 (2025-05-30)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## 1.0.199 (2025-05-29)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## 1.0.198 (2025-05-26)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## 1.0.197 (2025-05-23)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 1.0.196 (2025-05-22)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## 1.0.195 (2025-05-21)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## 1.0.194 (2025-05-21)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 1.0.193 (2025-05-15)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## 1.0.192 (2025-05-14)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 1.0.191 (2025-04-30)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 1.0.190 (2025-04-28)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## 1.0.189 (2025-04-23)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 1.0.188 (2025-04-22)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## 1.0.187 (2025-04-18)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
## 1.0.186 (2025-04-10)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## 1.0.185 (2025-04-09)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## 1.0.184 (2025-04-08)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## 1.0.183 (2025-04-04)
|
|
231
|
+
|
|
232
|
+
**Note:** Version bump only for package @oanda/labs-crowd-view-widget
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## 1.0.56 (2025-12-11)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## 1.0.237 (2025-12-09)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## 1.0.236 (2025-12-05)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## 1.0.235 (2025-12-04)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## 1.0.234 (2025-11-27)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
## 1.0.233 (2025-11-27)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## 1.0.232 (2025-11-27)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
## 1.0.231 (2025-11-07)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## 1.0.230 (2025-11-05)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
## 1.0.229 (2025-11-05)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## 1.0.228 (2025-11-05)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
## 1.0.227 (2025-10-31)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
## 1.0.226 (2025-10-29)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## 1.0.225 (2025-10-09)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## 1.0.224 (2025-09-29)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## 1.0.223 (2025-09-29)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
## 1.0.222 (2025-09-17)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
## 1.0.221 (2025-09-11)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## 1.0.220 (2025-09-09)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
## 1.0.219 (2025-09-02)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
## 1.0.218 (2025-09-01)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
## 1.0.217 (2025-08-25)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
## 1.0.216 (2025-08-18)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## 1.0.215 (2025-08-18)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## 1.0.214 (2025-08-14)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
## 1.0.213 (2025-08-12)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
## 1.0.212 (2025-08-05)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
## 1.0.211 (2025-08-05)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
## 1.0.210 (2025-07-31)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## 1.0.209 (2025-07-31)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
## 1.0.208 (2025-07-24)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## 1.0.207 (2025-07-18)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## 1.0.206 (2025-07-18)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
## 1.0.205 (2025-07-17)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
## 1.0.204 (2025-07-09)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
## 1.0.203 (2025-06-16)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
## 1.0.202 (2025-06-04)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
## 1.0.201 (2025-06-02)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
## 1.0.200 (2025-05-30)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## 1.0.199 (2025-05-29)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
## 1.0.198 (2025-05-26)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
## 1.0.197 (2025-05-23)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
## 1.0.196 (2025-05-22)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
## 1.0.195 (2025-05-21)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
## 1.0.194 (2025-05-21)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
## 1.0.193 (2025-05-15)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
## 1.0.192 (2025-05-14)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
## 1.0.191 (2025-04-30)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
## 1.0.190 (2025-04-28)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
## 1.0.189 (2025-04-23)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
## 1.0.188 (2025-04-22)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
## 1.0.187 (2025-04-18)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
## 1.0.186 (2025-04-10)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
## 1.0.185 (2025-04-09)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
## 1.0.184 (2025-04-08)
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
## 1.0.183 (2025-04-04)
|
|
459
|
+
|
|
460
|
+
**Note:** Version bump only for package @oanda/labs-crowd-view-widget
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
6
466
|
## 1.0.55 (2025-12-09)
|
|
7
467
|
|
|
8
468
|
|
|
@@ -11,7 +11,6 @@ var _components = require("echarts/components");
|
|
|
11
11
|
var echarts = _interopRequireWildcard(require("echarts/core"));
|
|
12
12
|
var _renderers = require("echarts/renderers");
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _usehooksTs = require("usehooks-ts");
|
|
15
14
|
var _constants = require("../../constants");
|
|
16
15
|
var _chartUtils = require("./chartUtils");
|
|
17
16
|
var _getOption = require("./getOption");
|
|
@@ -30,13 +29,11 @@ const Chart = _ref => {
|
|
|
30
29
|
isDark
|
|
31
30
|
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
32
31
|
const {
|
|
33
|
-
lang
|
|
32
|
+
lang,
|
|
33
|
+
locale
|
|
34
34
|
} = (0, _monoI18n.useLocale)();
|
|
35
|
-
const canHover = (0, _usehooksTs.useMediaQuery)('(hover: hover)');
|
|
36
35
|
const labelTimerRef = (0, _react.useRef)(null);
|
|
37
36
|
const isGreaterThanTwoWeeksRef = (0, _react.useRef)(null);
|
|
38
|
-
const zoomTimerRef = (0, _react.useRef)(null);
|
|
39
|
-
const tooltipVisibleRef = (0, _react.useRef)(true);
|
|
40
37
|
const initialIsGreaterThanTwoWeeks = (0, _react.useMemo)(() => {
|
|
41
38
|
const {
|
|
42
39
|
dates
|
|
@@ -57,14 +54,15 @@ const Chart = _ref => {
|
|
|
57
54
|
isDark,
|
|
58
55
|
isDesktop,
|
|
59
56
|
isLoading,
|
|
57
|
+
locale: (0, _chartUtils.normalizeLocale)(locale),
|
|
60
58
|
labelCallback: lang
|
|
61
|
-
}), [mainData, additionalData, isDark, isDesktop, isLoading, lang]);
|
|
59
|
+
}), [mainData, additionalData, isDark, isDesktop, isLoading, lang, locale]);
|
|
62
60
|
const handleDataZoom = (0, _react.useCallback)((_params, instance) => {
|
|
63
|
-
(0, _chartUtils.
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
(0, _chartUtils.handleLabelUpdate)(instance, mainData, labelTimerRef, isGreaterThanTwoWeeksRef, (0, _chartUtils.normalizeLocale)(locale));
|
|
62
|
+
}, [mainData, locale]);
|
|
63
|
+
const chartHeight = isDesktop ? _constants.CHART_CONFIG.HEIGHT_DESKTOP : _constants.CHART_CONFIG.HEIGHT_MOBILE;
|
|
66
64
|
return _react.default.createElement(_labsWidgetCommon.BaseChart, {
|
|
67
|
-
chartHeight:
|
|
65
|
+
chartHeight: chartHeight,
|
|
68
66
|
echarts: echarts,
|
|
69
67
|
isDark: isDark,
|
|
70
68
|
lazyUpdate: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_react","
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_react","_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","labelTimerRef","useRef","isGreaterThanTwoWeeksRef","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","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';\n\nimport { CHART_CONFIG } from '../../constants';\nimport {\n handleLabelUpdate,\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 labelTimerRef = useRef<NodeJS.Timeout | null>(null);\n const isGreaterThanTwoWeeksRef = useRef<boolean | null>(null);\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 handleLabelUpdate(\n instance,\n mainData,\n labelTimerRef,\n isGreaterThanTwoWeeksRef,\n normalizeLocale(locale)\n );\n },\n [mainData, 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;AAEA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,SAAAK,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,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AC,EACJ,CAACN,QAAQ,EAAEC,cAAc,EAAEG,MAAM,EAAEF,SAAS,EAAEC,SAAS,EAAEG,IAAI,EAAEC,MAAM,CACvE,CAAC;EAGD,MAAMuB,cAAc,GAAG,IAAAC,kBAAW,EAChC,CAACC,OAAsB,EAAEC,QAAqB,KAAK;IACjD,IAAAC,6BAAiB,EACfD,QAAQ,EACRjC,QAAQ,EACRS,aAAa,EACbE,wBAAwB,EACxB,IAAAiB,2BAAe,EAACrB,MAAM,CACxB,CAAC;EACH,CAAC,EACD,CAACP,QAAQ,EAAEO,MAAM,CACnB,CAAC;EAED,MAAM4B,WAAW,GAAGjC,SAAS,GACzBc,uBAAY,CAACoB,cAAc,GAC3BpB,uBAAY,CAACqB,aAAa;EAE9B,OACE/E,MAAA,CAAAc,OAAA,CAAAkE,aAAA,CAACxF,iBAAA,CAAAyF,SAAS;IACRJ,WAAW,EAAEA,WAAY;IACzBhF,OAAO,EAAEA,OAAQ;IACjBiD,MAAM,EAAEA,MAAO;IACfoC,UAAU,EAAE,IAAK;IACjBC,MAAM,EAAEf,WAAY;IACpBgB,IAAI,EAAE;MAAEC,QAAQ,EAAE;IAAS,CAAE;IAC7BC,QAAQ,EAAE;MACRC,QAAQ,EAAEf;IACZ;EAAE,CACH,CAAC;AAEN,CAAC;AAACgB,OAAA,CAAAhD,KAAA,GAAAA,KAAA","ignoreList":[]}
|
|
@@ -7,8 +7,10 @@ exports.ChartWithData = void 0;
|
|
|
7
7
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _usehooksTs = require("usehooks-ts");
|
|
10
|
+
var _constants = require("../../constants");
|
|
10
11
|
var _Chart = require("./Chart");
|
|
11
12
|
var _useCrowdViewData = require("./useCrowdViewData");
|
|
13
|
+
var _useResizeObserver = require("./useResizeObserver");
|
|
12
14
|
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); }
|
|
13
15
|
const ChartWithData = _ref => {
|
|
14
16
|
let {
|
|
@@ -21,6 +23,9 @@ const ChartWithData = _ref => {
|
|
|
21
23
|
size
|
|
22
24
|
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
23
25
|
const [debouncedLoading, setDebouncedLoading] = (0, _react.useState)(true);
|
|
26
|
+
const [containerRef, isResizing] = (0, _useResizeObserver.useResizeObserver)({
|
|
27
|
+
debounceDelay: 150
|
|
28
|
+
});
|
|
24
29
|
const isDesktop = size === _labsWidgetCommon.Size.DESKTOP;
|
|
25
30
|
const {
|
|
26
31
|
mainData,
|
|
@@ -43,18 +48,25 @@ const ChartWithData = _ref => {
|
|
|
43
48
|
setDebouncedLoading(true);
|
|
44
49
|
}
|
|
45
50
|
}, [loading, hideLoading]);
|
|
51
|
+
const showChart = !priceCandlesLoading && !error && !!mainData && !!additionalData && !isResizing;
|
|
52
|
+
const showLoader = loading || isResizing;
|
|
53
|
+
const chartHeight = isDesktop ? _constants.CHART_CONFIG.HEIGHT_DESKTOP : _constants.CHART_CONFIG.HEIGHT_MOBILE;
|
|
46
54
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
47
|
-
|
|
55
|
+
ref: containerRef,
|
|
56
|
+
className: "lw-relative lw-w-full lw-overflow-hidden",
|
|
57
|
+
style: {
|
|
58
|
+
height: chartHeight
|
|
59
|
+
}
|
|
48
60
|
}, error && _react.default.createElement("div", {
|
|
49
61
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary"
|
|
50
|
-
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)),
|
|
62
|
+
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)), showChart && _react.default.createElement("div", {
|
|
51
63
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full"
|
|
52
64
|
}, _react.default.createElement(_Chart.Chart, {
|
|
53
65
|
additionalData: additionalData,
|
|
54
66
|
isDesktop: isDesktop,
|
|
55
67
|
isLoading: debouncedLoading,
|
|
56
68
|
mainData: mainData
|
|
57
|
-
})),
|
|
69
|
+
})), showLoader && _react.default.createElement("div", {
|
|
58
70
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary lw-bg-bg-transparent-50"
|
|
59
71
|
}, _react.default.createElement(_labsWidgetCommon.Spinner, {
|
|
60
72
|
size: _labsWidgetCommon.SpinnerSize.lg
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["_labsWidgetCommon","require","_react","_interopRequireWildcard","_usehooksTs","_Chart","_useCrowdViewData","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChartWithData","_ref","instrument","bookType","division","granularity","size","useLayoutProvider","debouncedLoading","setDebouncedLoading","useState","isDesktop","Size","DESKTOP","mainData","additionalData","loading","priceCandlesLoading","error","useCrowdViewData","hideLoading","useDebounceCallback","useEffect","createElement","Fragment","className","ChartError","Chart","isLoading","Spinner","SpinnerSize","lg","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/ChartWithData.tsx"],"sourcesContent":["import {\n ChartError,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport React, { useEffect, useState } from 'react';\nimport { useDebounceCallback } from 'usehooks-ts';\n\nimport { Chart } from './Chart';\nimport type { ChartWithDataProps } from './types';\nimport { useCrowdViewData } from './useCrowdViewData';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n division,\n granularity,\n}: ChartWithDataProps) => {\n const { size } = useLayoutProvider();\n const [debouncedLoading, setDebouncedLoading] = useState(true);\n const isDesktop = size === Size.DESKTOP;\n\n const { mainData, additionalData, loading, priceCandlesLoading, error } =\n useCrowdViewData({\n instrument,\n bookType,\n division,\n granularity,\n });\n\n const hideLoading = useDebounceCallback(\n () => setDebouncedLoading(false),\n 500\n );\n\n useEffect(() => {\n if (loading === false) {\n hideLoading();\n }\n if (loading === true) {\n setDebouncedLoading(true);\n }\n }, [loading, hideLoading]);\n\n return (\n <>\n <div
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["_labsWidgetCommon","require","_react","_interopRequireWildcard","_usehooksTs","_constants","_Chart","_useCrowdViewData","_useResizeObserver","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ChartWithData","_ref","instrument","bookType","division","granularity","size","useLayoutProvider","debouncedLoading","setDebouncedLoading","useState","containerRef","isResizing","useResizeObserver","debounceDelay","isDesktop","Size","DESKTOP","mainData","additionalData","loading","priceCandlesLoading","error","useCrowdViewData","hideLoading","useDebounceCallback","useEffect","showChart","showLoader","chartHeight","CHART_CONFIG","HEIGHT_DESKTOP","HEIGHT_MOBILE","createElement","Fragment","ref","className","style","height","ChartError","Chart","isLoading","Spinner","SpinnerSize","lg","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/ChartWithData.tsx"],"sourcesContent":["import {\n ChartError,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport React, { useEffect, useState } from 'react';\nimport { useDebounceCallback } from 'usehooks-ts';\n\nimport { CHART_CONFIG } from '../../constants';\nimport { Chart } from './Chart';\nimport type { ChartWithDataProps } from './types';\nimport { useCrowdViewData } from './useCrowdViewData';\nimport { useResizeObserver } from './useResizeObserver';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n division,\n granularity,\n}: ChartWithDataProps) => {\n const { size } = useLayoutProvider();\n const [debouncedLoading, setDebouncedLoading] = useState(true);\n const [containerRef, isResizing] = useResizeObserver({ debounceDelay: 150 });\n const isDesktop = size === Size.DESKTOP;\n\n const { mainData, additionalData, loading, priceCandlesLoading, error } =\n useCrowdViewData({\n instrument,\n bookType,\n division,\n granularity,\n });\n\n const hideLoading = useDebounceCallback(\n () => setDebouncedLoading(false),\n 500\n );\n\n useEffect(() => {\n if (loading === false) {\n hideLoading();\n }\n if (loading === true) {\n setDebouncedLoading(true);\n }\n }, [loading, hideLoading]);\n\n const showChart =\n !priceCandlesLoading &&\n !error &&\n !!mainData &&\n !!additionalData &&\n !isResizing;\n const showLoader = loading || isResizing;\n\n const chartHeight = isDesktop\n ? CHART_CONFIG.HEIGHT_DESKTOP\n : CHART_CONFIG.HEIGHT_MOBILE;\n\n return (\n <>\n <div\n ref={containerRef}\n className=\"lw-relative lw-w-full lw-overflow-hidden\"\n style={{ height: chartHeight }}\n >\n {error && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )}\n {showChart && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full\">\n <Chart\n additionalData={additionalData}\n isDesktop={isDesktop}\n isLoading={debouncedLoading}\n mainData={mainData}\n />\n </div>\n )}\n {showLoader && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary lw-bg-bg-transparent-50\">\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAA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