@oanda/labs-order-book-widget 1.0.77 → 1.0.79
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 +604 -0
- package/dist/main/OrderBookWidget/components/Chart/Chart.js +10 -5
- package/dist/main/OrderBookWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/Chart.js +10 -5
- package/dist/module/OrderBookWidget/components/Chart/Chart.js.map +1 -1
- package/package.json +3 -3
- package/src/OrderBookWidget/components/Chart/Chart.tsx +36 -8
- package/test/Main.test.tsx +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,610 @@
|
|
|
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.79 (2024-02-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.78 (2024-01-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.77 (2024-01-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.76 (2024-01-25)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.75 (2024-01-22)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.74 (2024-01-22)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.73 (2024-01-22)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.72 (2024-01-19)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.71 (2024-01-18)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.70 (2024-01-17)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.69 (2024-01-17)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.68 (2024-01-15)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.67 (2024-01-15)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.66 (2024-01-12)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.65 (2024-01-11)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.64 (2024-01-11)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.63 (2024-01-11)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.62 (2024-01-10)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.61 (2024-01-09)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.60 (2024-01-05)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.59 (2023-12-27)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.58 (2023-12-22)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.57 (2023-12-22)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.56 (2023-12-21)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.55 (2023-12-19)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.54 (2023-12-15)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.53 (2023-12-13)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.52 (2023-12-13)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.51 (2023-12-07)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.50 (2023-12-04)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.49 (2023-12-01)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.48 (2023-12-01)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.47 (2023-11-29)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.46 (2023-11-28)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.45 (2023-11-23)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.44 (2023-11-22)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## 1.0.43 (2023-11-15)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## 1.0.42 (2023-11-10)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 1.0.41 (2023-11-03)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## 1.0.40 (2023-11-02)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## 1.0.39 (2023-11-02)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## 1.0.38 (2023-10-26)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## 1.0.37 (2023-10-26)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 1.0.36 (2023-10-25)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## 1.0.35 (2023-10-24)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## 1.0.34 (2023-10-23)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 1.0.33 (2023-10-23)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## 1.0.32 (2023-10-23)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 1.0.31 (2023-10-20)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 1.0.30 (2023-10-19)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## 1.0.29 (2023-10-19)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 1.0.28 (2023-10-19)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## 1.0.27 (2023-10-18)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
## 1.0.26 (2023-10-18)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## 1.0.25 (2023-10-17)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## 1.0.24 (2023-10-13)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## 1.0.23 (2023-10-13)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
## 1.0.22 (2023-10-11)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## 1.0.21 (2023-10-10)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## 1.0.20 (2023-10-06)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## 1.0.19 (2023-10-06)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## 1.0.18 (2023-10-05)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## 1.0.17 (2023-10-04)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
## 1.0.16 (2023-10-04)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## 1.0.15 (2023-10-04)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
## 1.0.14 (2023-10-03)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## 1.0.13 (2023-10-03)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
## 1.0.12 (2023-10-03)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## 1.0.11 (2023-10-02)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
## 1.0.10 (2023-09-29)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
## 1.0.9 (2023-09-28)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## 1.0.8 (2023-09-27)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## 1.0.7 (2023-09-26)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## 1.0.6 (2023-09-21)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
## 1.0.5 (2023-09-13)
|
|
303
|
+
|
|
304
|
+
**Note:** Version bump only for package @oanda/labs-order-book-widget
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## 1.0.78 (2024-01-30)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
## 1.0.77 (2024-01-25)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
## 1.0.76 (2024-01-25)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
## 1.0.75 (2024-01-22)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
## 1.0.74 (2024-01-22)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## 1.0.73 (2024-01-22)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## 1.0.72 (2024-01-19)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
## 1.0.71 (2024-01-18)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
## 1.0.70 (2024-01-17)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
## 1.0.69 (2024-01-17)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
## 1.0.68 (2024-01-15)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## 1.0.67 (2024-01-15)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
## 1.0.66 (2024-01-12)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## 1.0.65 (2024-01-11)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## 1.0.64 (2024-01-11)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
## 1.0.63 (2024-01-11)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
## 1.0.62 (2024-01-10)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
## 1.0.61 (2024-01-09)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
## 1.0.60 (2024-01-05)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
## 1.0.59 (2023-12-27)
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
## 1.0.58 (2023-12-22)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## 1.0.57 (2023-12-22)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
## 1.0.56 (2023-12-21)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
## 1.0.55 (2023-12-19)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
## 1.0.54 (2023-12-15)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
## 1.0.53 (2023-12-13)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
## 1.0.52 (2023-12-13)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
## 1.0.51 (2023-12-07)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
## 1.0.50 (2023-12-04)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
## 1.0.49 (2023-12-01)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
## 1.0.48 (2023-12-01)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
## 1.0.47 (2023-11-29)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
## 1.0.46 (2023-11-28)
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
## 1.0.45 (2023-11-23)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
## 1.0.44 (2023-11-22)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
## 1.0.43 (2023-11-15)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
## 1.0.42 (2023-11-10)
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
## 1.0.41 (2023-11-03)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
## 1.0.40 (2023-11-02)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
## 1.0.39 (2023-11-02)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
## 1.0.38 (2023-10-26)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
## 1.0.37 (2023-10-26)
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
## 1.0.36 (2023-10-25)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
## 1.0.35 (2023-10-24)
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
## 1.0.34 (2023-10-23)
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
## 1.0.33 (2023-10-23)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
## 1.0.32 (2023-10-23)
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
## 1.0.31 (2023-10-20)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
## 1.0.30 (2023-10-19)
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
## 1.0.29 (2023-10-19)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
## 1.0.28 (2023-10-19)
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
## 1.0.27 (2023-10-18)
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
## 1.0.26 (2023-10-18)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
## 1.0.25 (2023-10-17)
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
## 1.0.24 (2023-10-13)
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
## 1.0.23 (2023-10-13)
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
## 1.0.22 (2023-10-11)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
## 1.0.21 (2023-10-10)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
## 1.0.20 (2023-10-06)
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
## 1.0.19 (2023-10-06)
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
## 1.0.18 (2023-10-05)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
## 1.0.17 (2023-10-04)
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
## 1.0.16 (2023-10-04)
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
## 1.0.15 (2023-10-04)
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
## 1.0.14 (2023-10-03)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
## 1.0.13 (2023-10-03)
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
## 1.0.12 (2023-10-03)
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
## 1.0.11 (2023-10-02)
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
## 1.0.10 (2023-09-29)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
## 1.0.9 (2023-09-28)
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
## 1.0.8 (2023-09-27)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
## 1.0.7 (2023-09-26)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
## 1.0.6 (2023-09-21)
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
## 1.0.5 (2023-09-13)
|
|
603
|
+
|
|
604
|
+
**Note:** Version bump only for package @oanda/labs-order-book-widget
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
6
610
|
## 1.0.77 (2024-01-25)
|
|
7
611
|
|
|
8
612
|
|
|
@@ -5,16 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Chart = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var _core = _interopRequireDefault(require("echarts-for-react/lib/core"));
|
|
9
|
+
var echarts = _interopRequireWildcard(require("echarts/core"));
|
|
10
|
+
var _charts = require("echarts/charts");
|
|
11
|
+
var _renderers = require("echarts/renderers");
|
|
12
|
+
var _components = require("echarts/components");
|
|
10
13
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
11
14
|
var _monoI18n = require("@oanda/mono-i18n");
|
|
12
15
|
var _getOption = require("./getOption");
|
|
13
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
-
(
|
|
17
|
-
|
|
19
|
+
echarts.use([_components.GridSimpleComponent, _components.GraphicComponent, _components.TooltipComponent, _components.TitleComponent, _renderers.CanvasRenderer, _charts.CustomChart, _components.MarkLineComponent, _components.ToolboxComponent, _components.DataZoomInsideComponent, _components.DatasetComponent]);
|
|
20
|
+
echarts.registerTheme('dark_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Dark));
|
|
21
|
+
echarts.registerTheme('light_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Light));
|
|
18
22
|
const Chart = _ref => {
|
|
19
23
|
let {
|
|
20
24
|
data,
|
|
@@ -59,7 +63,8 @@ const Chart = _ref => {
|
|
|
59
63
|
}, [echartRef, isDesktop, isDark, isOrderBook, lang]);
|
|
60
64
|
return _react.default.createElement("div", {
|
|
61
65
|
className: "lw-relative lw-w-full"
|
|
62
|
-
}, _react.default.createElement("div", null, data && _react.default.createElement(
|
|
66
|
+
}, _react.default.createElement("div", null, data && _react.default.createElement(_core.default, {
|
|
67
|
+
echarts: echarts,
|
|
63
68
|
ref: echartRef,
|
|
64
69
|
theme: isDark ? 'dark_theme' : 'light_theme',
|
|
65
70
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["_react","_interopRequireWildcard","require","_core","_interopRequireDefault","echarts","_charts","_renderers","_components","_labsWidgetCommon","_monoI18n","_getOption","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","CanvasRenderer","CustomChart","MarkLineComponent","ToolboxComponent","DataZoomInsideComponent","DatasetComponent","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","data","isOrderBook","precision","lang","useLocale","isDark","isDesktop","useContext","ThemeContext","echartRef","useRef","useEffect","current","echartInstance","getEchartsInstance","on","getOption","color","colorPalette","bottleGreenLight","setOption","bottleGreenLight70","orange70","raspberryDark70","orange","raspberryDark","getResponsiveOption","createElement","className","ref","theme","style","height","width","option","exports"],"sources":["../../../../../src/OrderBookWidget/components/Chart/Chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useContext } from 'react';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport * as echarts from 'echarts/core';\nimport { CustomChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport {\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n MarkLineComponent,\n ToolboxComponent,\n DataZoomInsideComponent,\n DatasetComponent,\n} from 'echarts/components';\nimport {\n Theme, ThemeContext, colorPalette, getChartTheme,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { getResponsiveOption, getOption } from './getOption';\nimport { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n CanvasRenderer,\n CustomChart,\n MarkLineComponent,\n ToolboxComponent,\n DataZoomInsideComponent,\n DatasetComponent,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nexport const Chart = ({ data, isOrderBook, precision }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark, isDesktop } = useContext(ThemeContext);\n\n const echartRef = useRef(null);\n\n useEffect(() => {\n if (echartRef.current) {\n // @ts-ignore\n const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;\n\n echartInstance.on('highlight', () => {\n if ((\n echartInstance.getOption().color as echarts.Color[])[0] === colorPalette.bottleGreenLight\n ) {\n echartInstance.setOption({\n color: [\n colorPalette.bottleGreenLight70,\n isDark ? colorPalette.orange70 : colorPalette.raspberryDark70,\n ],\n });\n }\n });\n\n echartInstance.on('globalout', () => {\n echartInstance.setOption({\n color: [\n colorPalette.bottleGreenLight,\n isDark ? colorPalette.orange : colorPalette.raspberryDark,\n ],\n });\n });\n }\n }, [echartRef, isDark]);\n\n useEffect(() => {\n if (echartRef.current) {\n // @ts-ignore\n const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;\n\n echartInstance.setOption(\n getResponsiveOption({\n isDark, isOrderBook, isDesktop, lang,\n }),\n );\n }\n }, [echartRef, isDesktop, isDark, isOrderBook, lang]);\n\n return (\n <div className=\"lw-relative lw-w-full\">\n <div>\n {data && (\n <ReactEChartsCore\n echarts={echarts}\n ref={echartRef}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n style={{\n height: isDesktop ? '450px' : '390px',\n width: '100%',\n }}\n option={getOption({\n data, precision, isDark, isOrderBook, isDesktop, lang,\n })}\n />\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAUA,IAAAO,iBAAA,GAAAP,OAAA;AAGA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAA6D,SAAAE,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAf,wBAAAe,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,o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,cACG3B,IAAI,IACHpD,MAAA,CAAAc,OAAA,CAAAiE,aAAA,CAAC5E,KAAA,CAAAW,OAAgB;IACfT,OAAO,EAAEA,OAAQ;IACjB4E,GAAG,EAAEpB,SAAU;IACfqB,KAAK,EAAEzB,MAAM,GAAG,YAAY,GAAG,aAAc;IAC7C0B,KAAK,EAAE;MACLC,MAAM,EAAE1B,SAAS,GAAG,OAAO,GAAG,OAAO;MACrC2B,KAAK,EAAE;IACT,CAAE;IACFC,MAAM,EAAE,IAAAlB,oBAAS,EAAC;MAChBhB,IAAI;MAAEE,SAAS;MAAEG,MAAM;MAAEJ,WAAW;MAAEK,SAAS;MAAEH;IACnD,CAAC;EAAE,CACJ,CAEA,CACF,CAAC;AAEV,CAAC;AAACgC,OAAA,CAAArC,KAAA,GAAAA,KAAA"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useContext } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import ReactEChartsCore from 'echarts-for-react/lib/core';
|
|
3
|
+
import * as echarts from 'echarts/core';
|
|
4
|
+
import { CustomChart } from 'echarts/charts';
|
|
5
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
6
|
+
import { GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent, MarkLineComponent, ToolboxComponent, DataZoomInsideComponent, DatasetComponent } from 'echarts/components';
|
|
4
7
|
import { Theme, ThemeContext, colorPalette, getChartTheme } from '@oanda/labs-widget-common';
|
|
5
8
|
import { useLocale } from '@oanda/mono-i18n';
|
|
6
9
|
import { getResponsiveOption, getOption } from './getOption';
|
|
7
|
-
|
|
8
|
-
registerTheme('
|
|
10
|
+
echarts.use([GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent, CanvasRenderer, CustomChart, MarkLineComponent, ToolboxComponent, DataZoomInsideComponent, DatasetComponent]);
|
|
11
|
+
echarts.registerTheme('dark_theme', getChartTheme(Theme.Dark));
|
|
12
|
+
echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
|
|
9
13
|
export const Chart = _ref => {
|
|
10
14
|
let {
|
|
11
15
|
data,
|
|
@@ -50,7 +54,8 @@ export const Chart = _ref => {
|
|
|
50
54
|
}, [echartRef, isDesktop, isDark, isOrderBook, lang]);
|
|
51
55
|
return React.createElement("div", {
|
|
52
56
|
className: "lw-relative lw-w-full"
|
|
53
|
-
}, React.createElement("div", null, data && React.createElement(
|
|
57
|
+
}, React.createElement("div", null, data && React.createElement(ReactEChartsCore, {
|
|
58
|
+
echarts: echarts,
|
|
54
59
|
ref: echartRef,
|
|
55
60
|
theme: isDark ? 'dark_theme' : 'light_theme',
|
|
56
61
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["React","useRef","useEffect","useContext","
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","useRef","useEffect","useContext","ReactEChartsCore","echarts","CustomChart","CanvasRenderer","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","MarkLineComponent","ToolboxComponent","DataZoomInsideComponent","DatasetComponent","Theme","ThemeContext","colorPalette","getChartTheme","useLocale","getResponsiveOption","getOption","use","registerTheme","Dark","Light","Chart","_ref","data","isOrderBook","precision","lang","isDark","isDesktop","echartRef","current","echartInstance","getEchartsInstance","on","color","bottleGreenLight","setOption","bottleGreenLight70","orange70","raspberryDark70","orange","raspberryDark","createElement","className","ref","theme","style","height","width","option"],"sources":["../../../../../src/OrderBookWidget/components/Chart/Chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useContext } from 'react';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport * as echarts from 'echarts/core';\nimport { CustomChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport {\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n MarkLineComponent,\n ToolboxComponent,\n DataZoomInsideComponent,\n DatasetComponent,\n} from 'echarts/components';\nimport {\n Theme, ThemeContext, colorPalette, getChartTheme,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { getResponsiveOption, getOption } from './getOption';\nimport { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n CanvasRenderer,\n CustomChart,\n MarkLineComponent,\n ToolboxComponent,\n DataZoomInsideComponent,\n DatasetComponent,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nexport const Chart = ({ data, isOrderBook, precision }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark, isDesktop } = useContext(ThemeContext);\n\n const echartRef = useRef(null);\n\n useEffect(() => {\n if (echartRef.current) {\n // @ts-ignore\n const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;\n\n echartInstance.on('highlight', () => {\n if ((\n echartInstance.getOption().color as echarts.Color[])[0] === colorPalette.bottleGreenLight\n ) {\n echartInstance.setOption({\n color: [\n colorPalette.bottleGreenLight70,\n isDark ? colorPalette.orange70 : colorPalette.raspberryDark70,\n ],\n });\n }\n });\n\n echartInstance.on('globalout', () => {\n echartInstance.setOption({\n color: [\n colorPalette.bottleGreenLight,\n isDark ? colorPalette.orange : colorPalette.raspberryDark,\n ],\n });\n });\n }\n }, [echartRef, isDark]);\n\n useEffect(() => {\n if (echartRef.current) {\n // @ts-ignore\n const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;\n\n echartInstance.setOption(\n getResponsiveOption({\n isDark, isOrderBook, isDesktop, lang,\n }),\n );\n }\n }, [echartRef, isDesktop, isDark, isOrderBook, lang]);\n\n return (\n <div className=\"lw-relative lw-w-full\">\n <div>\n {data && (\n <ReactEChartsCore\n echarts={echarts}\n ref={echartRef}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n style={{\n height: isDesktop ? '450px' : '390px',\n width: '100%',\n }}\n option={getOption({\n data, precision, isDark, isOrderBook, isDesktop, lang,\n })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cACGnB,IAAI,IACH7B,KAAA,CAAAgD,aAAA,CAAC5C,gBAAgB;IACfC,OAAO,EAAEA,OAAQ;IACjB6C,GAAG,EAAEf,SAAU;IACfgB,KAAK,EAAElB,MAAM,GAAG,YAAY,GAAG,aAAc;IAC7CmB,KAAK,EAAE;MACLC,MAAM,EAAEnB,SAAS,GAAG,OAAO,GAAG,OAAO;MACrCoB,KAAK,EAAE;IACT,CAAE;IACFC,MAAM,EAAEjC,SAAS,CAAC;MAChBO,IAAI;MAAEE,SAAS;MAAEE,MAAM;MAAEH,WAAW;MAAEI,SAAS;MAAEF;IACnD,CAAC;EAAE,CACJ,CAEA,CACF,CAAC;AAEV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-order-book-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.79",
|
|
4
4
|
"description": "Labs Order Book Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@apollo/client": "3.7.17",
|
|
16
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
16
|
+
"@oanda/labs-widget-common": "^1.0.79",
|
|
17
17
|
"@oanda/mono-i18n": "9.0.0",
|
|
18
18
|
"classnames": "2.3.2",
|
|
19
19
|
"echarts": "5.4.3",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@graphql-codegen/client-preset": "4.1.0",
|
|
26
26
|
"@graphql-codegen/typescript": "4.0.1"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "e3c25377e179d6516e6fea1cc130868381275824"
|
|
29
29
|
}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useContext } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import ReactEChartsCore from 'echarts-for-react/lib/core';
|
|
3
|
+
import * as echarts from 'echarts/core';
|
|
4
|
+
import { CustomChart } from 'echarts/charts';
|
|
5
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
6
|
+
import {
|
|
7
|
+
GridSimpleComponent,
|
|
8
|
+
GraphicComponent,
|
|
9
|
+
TooltipComponent,
|
|
10
|
+
TitleComponent,
|
|
11
|
+
MarkLineComponent,
|
|
12
|
+
ToolboxComponent,
|
|
13
|
+
DataZoomInsideComponent,
|
|
14
|
+
DatasetComponent,
|
|
15
|
+
} from 'echarts/components';
|
|
4
16
|
import {
|
|
5
17
|
Theme, ThemeContext, colorPalette, getChartTheme,
|
|
6
18
|
} from '@oanda/labs-widget-common';
|
|
@@ -8,8 +20,21 @@ import { useLocale } from '@oanda/mono-i18n';
|
|
|
8
20
|
import { getResponsiveOption, getOption } from './getOption';
|
|
9
21
|
import { ChartProps } from './types';
|
|
10
22
|
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
echarts.use([
|
|
24
|
+
GridSimpleComponent,
|
|
25
|
+
GraphicComponent,
|
|
26
|
+
TooltipComponent,
|
|
27
|
+
TitleComponent,
|
|
28
|
+
CanvasRenderer,
|
|
29
|
+
CustomChart,
|
|
30
|
+
MarkLineComponent,
|
|
31
|
+
ToolboxComponent,
|
|
32
|
+
DataZoomInsideComponent,
|
|
33
|
+
DatasetComponent,
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
echarts.registerTheme('dark_theme', getChartTheme(Theme.Dark));
|
|
37
|
+
echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
|
|
13
38
|
|
|
14
39
|
export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
15
40
|
const { lang } = useLocale();
|
|
@@ -20,10 +45,12 @@ export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
|
20
45
|
useEffect(() => {
|
|
21
46
|
if (echartRef.current) {
|
|
22
47
|
// @ts-ignore
|
|
23
|
-
const echartInstance = echartRef.current.getEchartsInstance() as EChartsType;
|
|
48
|
+
const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;
|
|
24
49
|
|
|
25
50
|
echartInstance.on('highlight', () => {
|
|
26
|
-
if ((
|
|
51
|
+
if ((
|
|
52
|
+
echartInstance.getOption().color as echarts.Color[])[0] === colorPalette.bottleGreenLight
|
|
53
|
+
) {
|
|
27
54
|
echartInstance.setOption({
|
|
28
55
|
color: [
|
|
29
56
|
colorPalette.bottleGreenLight70,
|
|
@@ -47,7 +74,7 @@ export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
|
47
74
|
useEffect(() => {
|
|
48
75
|
if (echartRef.current) {
|
|
49
76
|
// @ts-ignore
|
|
50
|
-
const echartInstance = echartRef.current.getEchartsInstance() as EChartsType;
|
|
77
|
+
const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;
|
|
51
78
|
|
|
52
79
|
echartInstance.setOption(
|
|
53
80
|
getResponsiveOption({
|
|
@@ -61,7 +88,8 @@ export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
|
61
88
|
<div className="lw-relative lw-w-full">
|
|
62
89
|
<div>
|
|
63
90
|
{data && (
|
|
64
|
-
<
|
|
91
|
+
<ReactEChartsCore
|
|
92
|
+
echarts={echarts}
|
|
65
93
|
ref={echartRef}
|
|
66
94
|
theme={isDark ? 'dark_theme' : 'light_theme'}
|
|
67
95
|
style={{
|
package/test/Main.test.tsx
CHANGED
|
@@ -105,14 +105,13 @@ const mocks = [
|
|
|
105
105
|
|
|
106
106
|
describe('Main component', () => {
|
|
107
107
|
it('should render tool component', async () => {
|
|
108
|
-
const { findByTestId
|
|
108
|
+
const { findByTestId } = render(
|
|
109
109
|
<MockedProvider mocks={mocks}>
|
|
110
110
|
<Main />
|
|
111
111
|
</MockedProvider>,
|
|
112
112
|
);
|
|
113
113
|
|
|
114
114
|
expect(await findByTestId('order-book-widget')).toBeInTheDocument();
|
|
115
|
-
expect(getByTestId('spinner')).toBeInTheDocument();
|
|
116
115
|
expect((await findByTestId('select'))).toBeInTheDocument();
|
|
117
116
|
});
|
|
118
117
|
it('should render widget component', async () => {
|