@oanda/labs-crowd-view-widget 1.0.67 → 1.0.69
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 +556 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +3 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +9 -6
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -1
- package/dist/main/gql/getSentiments.js +0 -1
- package/dist/main/gql/getSentiments.js.map +1 -1
- package/dist/main/gql/types/gql.js +1 -1
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +0 -6
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/translations/sources/ja.json +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +3 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +9 -6
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -1
- package/dist/module/gql/getSentiments.js +0 -1
- package/dist/module/gql/getSentiments.js.map +1 -1
- package/dist/module/gql/types/gql.js +1 -1
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +0 -6
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/translations/sources/ja.json +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +2 -1
- package/dist/types/gql/types/gql.d.ts +2 -2
- package/dist/types/gql/types/graphql.d.ts +0 -1
- package/package.json +3 -3
- package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +2 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +8 -3
- package/src/CrowdViewWidget/components/Chart/dataUtils/processSentiments.ts +3 -1
- package/src/gql/getSentiments.ts +0 -1
- package/src/gql/types/gql.ts +3 -3
- package/src/gql/types/graphql.ts +1 -9
- package/src/translations/sources/ja.json +1 -1
- package/test/components/Chart/utils/chartUtils.test.ts +4 -0
- package/test/components/Chart/utils/processSentiments.test.ts +0 -10
|
@@ -21,7 +21,9 @@ export const processSentiments = (
|
|
|
21
21
|
item?.time,
|
|
22
22
|
{
|
|
23
23
|
sentimentShorts: item?.sentiment?.shortPercent ?? null,
|
|
24
|
-
sentimentLongs: item?.sentiment?.
|
|
24
|
+
sentimentLongs: item?.sentiment?.shortPercent
|
|
25
|
+
? 100 - item?.sentiment?.shortPercent
|
|
26
|
+
: null,
|
|
25
27
|
},
|
|
26
28
|
])
|
|
27
29
|
);
|
package/src/gql/getSentiments.ts
CHANGED
package/src/gql/types/gql.ts
CHANGED
|
@@ -17,7 +17,7 @@ const documents = {
|
|
|
17
17
|
types.GetOrderPositionBooksDocument,
|
|
18
18
|
'\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n':
|
|
19
19
|
types.GetPriceCandlesDocument,
|
|
20
|
-
'\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n
|
|
20
|
+
'\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n shortPercent\n }\n time\n }\n }\n }\n':
|
|
21
21
|
types.GetSentimentsDocument,
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -51,8 +51,8 @@ export function graphql(
|
|
|
51
51
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
52
52
|
*/
|
|
53
53
|
export function graphql(
|
|
54
|
-
source: '\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n
|
|
55
|
-
): (typeof documents)['\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n
|
|
54
|
+
source: '\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n shortPercent\n }\n time\n }\n }\n }\n'
|
|
55
|
+
): (typeof documents)['\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n shortPercent\n }\n time\n }\n }\n }\n'];
|
|
56
56
|
|
|
57
57
|
export function graphql(source: string) {
|
|
58
58
|
return (documents as any)[source] ?? {};
|
package/src/gql/types/graphql.ts
CHANGED
|
@@ -623,11 +623,7 @@ export type GetSentimentsQuery = {
|
|
|
623
623
|
sentiments: Array<{
|
|
624
624
|
__typename?: 'SentimentWithTime';
|
|
625
625
|
time: string;
|
|
626
|
-
sentiment: {
|
|
627
|
-
__typename?: 'Sentiment';
|
|
628
|
-
longPercent: number;
|
|
629
|
-
shortPercent: number;
|
|
630
|
-
};
|
|
626
|
+
sentiment: { __typename?: 'Sentiment'; shortPercent: number };
|
|
631
627
|
} | null>;
|
|
632
628
|
};
|
|
633
629
|
};
|
|
@@ -1115,10 +1111,6 @@ export const GetSentimentsDocument = {
|
|
|
1115
1111
|
selectionSet: {
|
|
1116
1112
|
kind: 'SelectionSet',
|
|
1117
1113
|
selections: [
|
|
1118
|
-
{
|
|
1119
|
-
kind: 'Field',
|
|
1120
|
-
name: { kind: 'Name', value: 'longPercent' },
|
|
1121
|
-
},
|
|
1122
1114
|
{
|
|
1123
1115
|
kind: 'Field',
|
|
1124
1116
|
name: { kind: 'Name', value: 'shortPercent' },
|
|
@@ -257,6 +257,7 @@ describe('chartUtils', () => {
|
|
|
257
257
|
isDesktop: true,
|
|
258
258
|
locale: 'en-US',
|
|
259
259
|
isDark: false,
|
|
260
|
+
isJapanese: false,
|
|
260
261
|
});
|
|
261
262
|
expect(html).toBeDefined();
|
|
262
263
|
expect(html).toContain('candle');
|
|
@@ -298,6 +299,7 @@ describe('chartUtils', () => {
|
|
|
298
299
|
isDesktop: true,
|
|
299
300
|
locale: 'en-US',
|
|
300
301
|
isDark: false,
|
|
302
|
+
isJapanese: false,
|
|
301
303
|
});
|
|
302
304
|
expect(html).toBeDefined();
|
|
303
305
|
expect(html).toContain('candle');
|
|
@@ -331,6 +333,7 @@ describe('chartUtils', () => {
|
|
|
331
333
|
isDesktop: true,
|
|
332
334
|
locale: 'en-US',
|
|
333
335
|
isDark: false,
|
|
336
|
+
isJapanese: false,
|
|
334
337
|
});
|
|
335
338
|
expect(html).toBe('');
|
|
336
339
|
});
|
|
@@ -348,6 +351,7 @@ describe('chartUtils', () => {
|
|
|
348
351
|
isDesktop: true,
|
|
349
352
|
locale: 'en-US',
|
|
350
353
|
isDark: false,
|
|
354
|
+
isJapanese: false,
|
|
351
355
|
});
|
|
352
356
|
expect(html).toBe('');
|
|
353
357
|
});
|
|
@@ -52,14 +52,12 @@ describe('processSentiments', () => {
|
|
|
52
52
|
time: '2025-03-15T10:30:00Z',
|
|
53
53
|
sentiment: {
|
|
54
54
|
shortPercent: 30.5,
|
|
55
|
-
longPercent: 69.5,
|
|
56
55
|
},
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
58
|
time: '2025-03-15T11:30:00Z',
|
|
60
59
|
sentiment: {
|
|
61
60
|
shortPercent: 40.2,
|
|
62
|
-
longPercent: 59.8,
|
|
63
61
|
},
|
|
64
62
|
},
|
|
65
63
|
],
|
|
@@ -81,14 +79,12 @@ describe('processSentiments', () => {
|
|
|
81
79
|
time: '2025-03-15T10:30:00Z',
|
|
82
80
|
sentiment: {
|
|
83
81
|
shortPercent: 30.5,
|
|
84
|
-
longPercent: 69.5,
|
|
85
82
|
},
|
|
86
83
|
},
|
|
87
84
|
{
|
|
88
85
|
time: '2025-03-15T12:30:00Z', // Not in dates
|
|
89
86
|
sentiment: {
|
|
90
87
|
shortPercent: 50.0,
|
|
91
|
-
longPercent: 50.0,
|
|
92
88
|
},
|
|
93
89
|
},
|
|
94
90
|
],
|
|
@@ -109,7 +105,6 @@ describe('processSentiments', () => {
|
|
|
109
105
|
time: '2025-03-15T11:30:00Z',
|
|
110
106
|
sentiment: {
|
|
111
107
|
shortPercent: 30.5,
|
|
112
|
-
longPercent: 69.5,
|
|
113
108
|
},
|
|
114
109
|
},
|
|
115
110
|
],
|
|
@@ -135,14 +130,12 @@ describe('processSentiments', () => {
|
|
|
135
130
|
time: '2025-03-15T10:30:00Z',
|
|
136
131
|
sentiment: {
|
|
137
132
|
shortPercent: 30.5,
|
|
138
|
-
longPercent: 69.5,
|
|
139
133
|
},
|
|
140
134
|
},
|
|
141
135
|
{
|
|
142
136
|
time: '2025-03-15T12:30:00Z',
|
|
143
137
|
sentiment: {
|
|
144
138
|
shortPercent: 25.0,
|
|
145
|
-
longPercent: 75.0,
|
|
146
139
|
},
|
|
147
140
|
},
|
|
148
141
|
],
|
|
@@ -181,7 +174,6 @@ describe('processSentiments', () => {
|
|
|
181
174
|
time: '2025-03-15T10:30:00Z',
|
|
182
175
|
sentiment: {
|
|
183
176
|
shortPercent: undefined as never,
|
|
184
|
-
longPercent: undefined as never,
|
|
185
177
|
},
|
|
186
178
|
},
|
|
187
179
|
],
|
|
@@ -201,7 +193,6 @@ describe('processSentiments', () => {
|
|
|
201
193
|
time: '2025-03-15T10:30:00Z',
|
|
202
194
|
sentiment: {
|
|
203
195
|
shortPercent: 30.5,
|
|
204
|
-
longPercent: 69.5,
|
|
205
196
|
},
|
|
206
197
|
},
|
|
207
198
|
],
|
|
@@ -224,7 +215,6 @@ describe('processSentiments', () => {
|
|
|
224
215
|
time: '2025-03-15T10:30:00Z',
|
|
225
216
|
sentiment: {
|
|
226
217
|
shortPercent: 30.5,
|
|
227
|
-
longPercent: 69.5,
|
|
228
218
|
},
|
|
229
219
|
},
|
|
230
220
|
],
|