@oanda/labs-currency-strength-widget 1.0.1

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 (137) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/codegen.ts +15 -0
  3. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js +50 -0
  4. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js.map +1 -0
  5. package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js +37 -0
  6. package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -0
  7. package/dist/main/CurrencyStrengthWidget/Main.js +22 -0
  8. package/dist/main/CurrencyStrengthWidget/Main.js.map +1 -0
  9. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js +50 -0
  10. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -0
  11. package/dist/main/CurrencyStrengthWidget/components/Chart/constants.js +22 -0
  12. package/dist/main/CurrencyStrengthWidget/components/Chart/constants.js.map +1 -0
  13. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js +18 -0
  14. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -0
  15. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js +121 -0
  16. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -0
  17. package/dist/main/CurrencyStrengthWidget/components/Chart/index.js +17 -0
  18. package/dist/main/CurrencyStrengthWidget/components/Chart/index.js.map +1 -0
  19. package/dist/main/CurrencyStrengthWidget/components/Chart/types.js +6 -0
  20. package/dist/main/CurrencyStrengthWidget/components/Chart/types.js.map +1 -0
  21. package/dist/main/CurrencyStrengthWidget/index.js +17 -0
  22. package/dist/main/CurrencyStrengthWidget/index.js.map +1 -0
  23. package/dist/main/CurrencyStrengthWidget/render.js +34 -0
  24. package/dist/main/CurrencyStrengthWidget/render.js.map +1 -0
  25. package/dist/main/CurrencyStrengthWidget/types.js +6 -0
  26. package/dist/main/CurrencyStrengthWidget/types.js.map +1 -0
  27. package/dist/main/gql/getCurrencyStrength.js +11 -0
  28. package/dist/main/gql/getCurrencyStrength.js.map +1 -0
  29. package/dist/main/gql/types/fragment-masking.js +24 -0
  30. package/dist/main/gql/types/fragment-masking.js.map +1 -0
  31. package/dist/main/gql/types/gql.js +17 -0
  32. package/dist/main/gql/types/gql.js.map +1 -0
  33. package/dist/main/gql/types/graphql.js +137 -0
  34. package/dist/main/gql/types/graphql.js.map +1 -0
  35. package/dist/main/gql/types/index.js +28 -0
  36. package/dist/main/gql/types/index.js.map +1 -0
  37. package/dist/main/index.js +17 -0
  38. package/dist/main/index.js.map +1 -0
  39. package/dist/main/translations/index.js +19 -0
  40. package/dist/main/translations/index.js.map +1 -0
  41. package/dist/main/translations/sources/en.json +6 -0
  42. package/dist/main/translations/sources/zh_TW.json +6 -0
  43. package/dist/main/translations/translations.js +8 -0
  44. package/dist/main/translations/translations.js.map +1 -0
  45. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js +41 -0
  46. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js.map +1 -0
  47. package/dist/module/CurrencyStrengthWidget/CurrencyStrengthWidget.js +30 -0
  48. package/dist/module/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -0
  49. package/dist/module/CurrencyStrengthWidget/Main.js +15 -0
  50. package/dist/module/CurrencyStrengthWidget/Main.js.map +1 -0
  51. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js +41 -0
  52. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -0
  53. package/dist/module/CurrencyStrengthWidget/components/Chart/constants.js +16 -0
  54. package/dist/module/CurrencyStrengthWidget/components/Chart/constants.js.map +1 -0
  55. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js +11 -0
  56. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -0
  57. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js +114 -0
  58. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -0
  59. package/dist/module/CurrencyStrengthWidget/components/Chart/index.js +2 -0
  60. package/dist/module/CurrencyStrengthWidget/components/Chart/index.js.map +1 -0
  61. package/dist/module/CurrencyStrengthWidget/components/Chart/types.js +2 -0
  62. package/dist/module/CurrencyStrengthWidget/components/Chart/types.js.map +1 -0
  63. package/dist/module/CurrencyStrengthWidget/index.js +2 -0
  64. package/dist/module/CurrencyStrengthWidget/index.js.map +1 -0
  65. package/dist/module/CurrencyStrengthWidget/render.js +31 -0
  66. package/dist/module/CurrencyStrengthWidget/render.js.map +1 -0
  67. package/dist/module/CurrencyStrengthWidget/types.js +2 -0
  68. package/dist/module/CurrencyStrengthWidget/types.js.map +1 -0
  69. package/dist/module/gql/getCurrencyStrength.js +6 -0
  70. package/dist/module/gql/getCurrencyStrength.js.map +1 -0
  71. package/dist/module/gql/types/fragment-masking.js +16 -0
  72. package/dist/module/gql/types/fragment-masking.js.map +1 -0
  73. package/dist/module/gql/types/gql.js +9 -0
  74. package/dist/module/gql/types/gql.js.map +1 -0
  75. package/dist/module/gql/types/graphql.js +131 -0
  76. package/dist/module/gql/types/graphql.js.map +1 -0
  77. package/dist/module/gql/types/index.js +3 -0
  78. package/dist/module/gql/types/index.js.map +1 -0
  79. package/dist/module/index.js +2 -0
  80. package/dist/module/index.js.map +1 -0
  81. package/dist/module/translations/index.js +12 -0
  82. package/dist/module/translations/index.js.map +1 -0
  83. package/dist/module/translations/sources/en.json +6 -0
  84. package/dist/module/translations/sources/zh_TW.json +6 -0
  85. package/dist/module/translations/translations.js +2 -0
  86. package/dist/module/translations/translations.js.map +1 -0
  87. package/dist/types/CurrencyStrengthWidget/ChartsWithData.d.ts +3 -0
  88. package/dist/types/CurrencyStrengthWidget/CurrencyStrengthWidget.d.ts +4 -0
  89. package/dist/types/CurrencyStrengthWidget/Main.d.ts +3 -0
  90. package/dist/types/CurrencyStrengthWidget/components/Chart/Chart.d.ts +4 -0
  91. package/dist/types/CurrencyStrengthWidget/components/Chart/constants.d.ts +14 -0
  92. package/dist/types/CurrencyStrengthWidget/components/Chart/formatters.d.ts +2 -0
  93. package/dist/types/CurrencyStrengthWidget/components/Chart/getOption.d.ts +169 -0
  94. package/dist/types/CurrencyStrengthWidget/components/Chart/index.d.ts +1 -0
  95. package/dist/types/CurrencyStrengthWidget/components/Chart/types.d.ts +22 -0
  96. package/dist/types/CurrencyStrengthWidget/index.d.ts +1 -0
  97. package/dist/types/CurrencyStrengthWidget/render.d.ts +1 -0
  98. package/dist/types/CurrencyStrengthWidget/types.d.ts +11 -0
  99. package/dist/types/gql/getCurrencyStrength.d.ts +2 -0
  100. package/dist/types/gql/types/fragment-masking.d.ts +15 -0
  101. package/dist/types/gql/types/gql.d.ts +36 -0
  102. package/dist/types/gql/types/graphql.d.ts +282 -0
  103. package/dist/types/gql/types/index.d.ts +2 -0
  104. package/dist/types/index.d.ts +1 -0
  105. package/dist/types/translations/index.d.ts +4 -0
  106. package/dist/types/translations/translations.d.ts +1 -0
  107. package/index.ts +1 -0
  108. package/lokalise.config.json +18 -0
  109. package/package.json +29 -0
  110. package/src/CurrencyStrengthWidget/ChartsWithData.tsx +53 -0
  111. package/src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx +32 -0
  112. package/src/CurrencyStrengthWidget/Main.tsx +18 -0
  113. package/src/CurrencyStrengthWidget/components/Chart/Chart.tsx +48 -0
  114. package/src/CurrencyStrengthWidget/components/Chart/constants.tsx +18 -0
  115. package/src/CurrencyStrengthWidget/components/Chart/formatters.ts +13 -0
  116. package/src/CurrencyStrengthWidget/components/Chart/getOption.ts +109 -0
  117. package/src/CurrencyStrengthWidget/components/Chart/index.ts +1 -0
  118. package/src/CurrencyStrengthWidget/components/Chart/types.ts +25 -0
  119. package/src/CurrencyStrengthWidget/index.ts +1 -0
  120. package/src/CurrencyStrengthWidget/render.tsx +34 -0
  121. package/src/CurrencyStrengthWidget/types.ts +13 -0
  122. package/src/gql/getCurrencyStrength.ts +15 -0
  123. package/src/gql/types/fragment-masking.ts +66 -0
  124. package/src/gql/types/gql.ts +42 -0
  125. package/src/gql/types/graphql.ts +290 -0
  126. package/src/gql/types/index.ts +2 -0
  127. package/src/index.ts +1 -0
  128. package/src/translations/index.ts +13 -0
  129. package/src/translations/sources/en.json +6 -0
  130. package/src/translations/sources/zh_TW.json +6 -0
  131. package/src/translations/translations.ts +3 -0
  132. package/test/Main.test.tsx +28 -0
  133. package/test/chartOptions.test.ts +18 -0
  134. package/test/mocks/currencyStrengthMock.ts +270 -0
  135. package/test/mocks/index.ts +2 -0
  136. package/test/mocks/responsesMocks.ts +19 -0
  137. package/tsconfig.types.json +12 -0
@@ -0,0 +1,270 @@
1
+ const currencyStrengthMock = [
2
+ {
3
+ currency: 'USD',
4
+ strengthRelation: [
5
+ {
6
+ currency: 'JPY',
7
+ percentage: -0.86,
8
+ },
9
+ {
10
+ currency: 'GBP',
11
+ percentage: -0.48,
12
+ },
13
+ {
14
+ currency: 'NZD',
15
+ percentage: -1.16,
16
+ },
17
+ {
18
+ currency: 'CHF',
19
+ percentage: -0.88,
20
+ },
21
+ {
22
+ currency: 'AUD',
23
+ percentage: 0,
24
+ },
25
+ {
26
+ currency: 'CAD',
27
+ percentage: -0.92,
28
+ },
29
+ {
30
+ currency: 'EUR',
31
+ percentage: -0.91,
32
+ },
33
+ ],
34
+ },
35
+ {
36
+ currency: 'AUD',
37
+ strengthRelation: [
38
+ {
39
+ currency: 'CHF',
40
+ percentage: 0.79,
41
+ },
42
+ {
43
+ currency: 'USD',
44
+ percentage: 0,
45
+ },
46
+ {
47
+ currency: 'EUR',
48
+ percentage: 0.78,
49
+ },
50
+ {
51
+ currency: 'CAD',
52
+ percentage: 0.76,
53
+ },
54
+ {
55
+ currency: 'GBP',
56
+ percentage: 0.56,
57
+ },
58
+ {
59
+ currency: 'JPY',
60
+ percentage: 0.83,
61
+ },
62
+ {
63
+ currency: 'NZD',
64
+ percentage: 0.52,
65
+ },
66
+ ],
67
+ },
68
+ {
69
+ currency: 'GBP',
70
+ strengthRelation: [
71
+ {
72
+ currency: 'AUD',
73
+ percentage: -0.55,
74
+ },
75
+ {
76
+ currency: 'USD',
77
+ percentage: 0.48,
78
+ },
79
+ {
80
+ currency: 'EUR',
81
+ percentage: 0.22,
82
+ },
83
+ {
84
+ currency: 'CAD',
85
+ percentage: 0.21,
86
+ },
87
+ {
88
+ currency: 'NZD',
89
+ percentage: -0.04,
90
+ },
91
+ {
92
+ currency: 'CHF',
93
+ percentage: 0.25,
94
+ },
95
+ {
96
+ currency: 'JPY',
97
+ percentage: 0.27,
98
+ },
99
+ ],
100
+ },
101
+ {
102
+ currency: 'EUR',
103
+ strengthRelation: [
104
+ {
105
+ currency: 'GBP',
106
+ percentage: -0.22,
107
+ },
108
+ {
109
+ currency: 'AUD',
110
+ percentage: -0.77,
111
+ },
112
+ {
113
+ currency: 'CHF',
114
+ percentage: 0.03,
115
+ },
116
+ {
117
+ currency: 'USD',
118
+ percentage: 0.91,
119
+ },
120
+ {
121
+ currency: 'JPY',
122
+ percentage: 0.05,
123
+ },
124
+ {
125
+ currency: 'CAD',
126
+ percentage: -0.01,
127
+ },
128
+ {
129
+ currency: 'NZD',
130
+ percentage: -0.26,
131
+ },
132
+ ],
133
+ },
134
+ {
135
+ currency: 'NZD',
136
+ strengthRelation: [
137
+ {
138
+ currency: 'CHF',
139
+ percentage: 0.32,
140
+ },
141
+ {
142
+ currency: 'JPY',
143
+ percentage: 0.31,
144
+ },
145
+ {
146
+ currency: 'AUD',
147
+ percentage: -0.52,
148
+ },
149
+ {
150
+ currency: 'USD',
151
+ percentage: 1.17,
152
+ },
153
+ {
154
+ currency: 'GBP',
155
+ percentage: 0.04,
156
+ },
157
+ {
158
+ currency: 'EUR',
159
+ percentage: 0.26,
160
+ },
161
+ {
162
+ currency: 'CAD',
163
+ percentage: 0.25,
164
+ },
165
+ ],
166
+ },
167
+ {
168
+ currency: 'CAD',
169
+ strengthRelation: [
170
+ {
171
+ currency: 'CHF',
172
+ percentage: 0.04,
173
+ },
174
+ {
175
+ currency: 'AUD',
176
+ percentage: -0.76,
177
+ },
178
+ {
179
+ currency: 'JPY',
180
+ percentage: 0.06,
181
+ },
182
+ {
183
+ currency: 'NZD',
184
+ percentage: -0.25,
185
+ },
186
+ {
187
+ currency: 'EUR',
188
+ percentage: 0.01,
189
+ },
190
+ {
191
+ currency: 'GBP',
192
+ percentage: -0.21,
193
+ },
194
+ {
195
+ currency: 'USD',
196
+ percentage: 0.93,
197
+ },
198
+ ],
199
+ },
200
+ {
201
+ currency: 'CHF',
202
+ strengthRelation: [
203
+ {
204
+ currency: 'JPY',
205
+ percentage: 0.02,
206
+ },
207
+ {
208
+ currency: 'CAD',
209
+ percentage: -0.04,
210
+ },
211
+ {
212
+ currency: 'EUR',
213
+ percentage: -0.03,
214
+ },
215
+ {
216
+ currency: 'USD',
217
+ percentage: 0.89,
218
+ },
219
+ {
220
+ currency: 'GBP',
221
+ percentage: -0.24,
222
+ },
223
+ {
224
+ currency: 'NZD',
225
+ percentage: -0.32,
226
+ },
227
+ {
228
+ currency: 'AUD',
229
+ percentage: -0.78,
230
+ },
231
+ ],
232
+ },
233
+ {
234
+ currency: 'JPY',
235
+ strengthRelation: [
236
+ {
237
+ currency: 'GBP',
238
+ percentage: -0.27,
239
+ },
240
+ {
241
+ currency: 'NZD',
242
+ percentage: -0.31,
243
+ },
244
+ {
245
+ currency: 'EUR',
246
+ percentage: -0.05,
247
+ },
248
+ {
249
+ currency: 'AUD',
250
+ percentage: -0.82,
251
+ },
252
+ {
253
+ currency: 'CHF',
254
+ percentage: -0.02,
255
+ },
256
+ {
257
+ currency: 'USD',
258
+ percentage: 0.87,
259
+ },
260
+ {
261
+ currency: 'CAD',
262
+ percentage: -0.06,
263
+ },
264
+ ],
265
+ },
266
+ ];
267
+
268
+ export {
269
+ currencyStrengthMock,
270
+ };
@@ -0,0 +1,2 @@
1
+ export * from './currencyStrengthMock';
2
+ export * from './responsesMocks';
@@ -0,0 +1,19 @@
1
+ import { currencyStrengthMock } from './currencyStrengthMock';
2
+ import { getCurrencyStrength } from '../../src/gql/getCurrencyStrength';
3
+
4
+ const mock = [
5
+ {
6
+ request: {
7
+ query: getCurrencyStrength,
8
+ },
9
+ result: {
10
+ data: {
11
+ currencyStrength: currencyStrengthMock,
12
+ },
13
+ },
14
+ },
15
+ ];
16
+
17
+ export {
18
+ mock,
19
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "../../tsconfig.types.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src",
5
+ "outDir": "./dist",
6
+ "declarationDir": "./dist/types"
7
+ },
8
+ "include": [
9
+ "./src/**/*",
10
+ "../../types/**/*"
11
+ ]
12
+ }