@oanda/labs-crowd-view-widget 1.0.42 → 1.0.44
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 +356 -0
- package/dist/main/CrowdViewWidget/CrowdViewWidget.js +3 -3
- package/dist/main/CrowdViewWidget/CrowdViewWidget.js.map +1 -1
- package/dist/main/CrowdViewWidget/Main.js +8 -9
- package/dist/main/CrowdViewWidget/Main.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +11 -8
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +16 -13
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/{getOption.js → chartOptions.js} +53 -51
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/index.js +44 -0
- package/dist/main/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +170 -0
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +70 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js +3 -2
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +9 -11
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/main/CrowdViewWidget/constants.js +30 -0
- package/dist/main/CrowdViewWidget/constants.js.map +1 -0
- package/dist/main/CrowdViewWidget/render.js +1 -0
- package/dist/main/CrowdViewWidget/render.js.map +1 -1
- package/dist/main/CrowdViewWidget/selectConfig.js +121 -0
- package/dist/main/CrowdViewWidget/selectConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/types/index.js +17 -0
- package/dist/main/CrowdViewWidget/types/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/types/instruments.js +45 -0
- package/dist/main/CrowdViewWidget/types/instruments.js.map +1 -0
- package/dist/main/CrowdViewWidget/types.js +0 -44
- package/dist/main/CrowdViewWidget/types.js.map +1 -1
- package/dist/main/CrowdViewWidget/utils/instrumentUtils.js +13 -0
- package/dist/main/CrowdViewWidget/utils/instrumentUtils.js.map +1 -0
- package/dist/main/gql/getOrderPositionBooks.js +1 -1
- package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/main/gql/getPriceCandles.js +11 -0
- package/dist/main/gql/getPriceCandles.js.map +1 -0
- package/dist/main/gql/types/gql.js +2 -3
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +161 -160
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/module/CrowdViewWidget/CrowdViewWidget.js +3 -3
- package/dist/module/CrowdViewWidget/CrowdViewWidget.js.map +1 -1
- package/dist/module/CrowdViewWidget/Main.js +6 -7
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +9 -6
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +16 -12
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/{getOption.js → chartOptions.js} +51 -48
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/index.js +4 -0
- package/dist/module/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +163 -0
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +59 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +3 -2
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +9 -11
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +24 -0
- package/dist/module/CrowdViewWidget/constants.js.map +1 -0
- package/dist/module/CrowdViewWidget/render.js +1 -0
- package/dist/module/CrowdViewWidget/render.js.map +1 -1
- package/dist/module/CrowdViewWidget/selectConfig.js +116 -0
- package/dist/module/CrowdViewWidget/selectConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/types/index.js +2 -0
- package/dist/module/CrowdViewWidget/types/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/types/instruments.js +39 -0
- package/dist/module/CrowdViewWidget/types/instruments.js.map +1 -0
- package/dist/module/CrowdViewWidget/types.js +1 -43
- package/dist/module/CrowdViewWidget/types.js.map +1 -1
- package/dist/module/CrowdViewWidget/utils/instrumentUtils.js +6 -0
- package/dist/module/CrowdViewWidget/utils/instrumentUtils.js.map +1 -0
- package/dist/module/gql/getOrderPositionBooks.js +1 -1
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/getPriceCandles.js +6 -0
- package/dist/module/gql/getPriceCandles.js.map +1 -0
- package/dist/module/gql/types/gql.js +2 -3
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +160 -159
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/types/CrowdViewWidget/CrowdViewWidget.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/ChartWithData.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/index.d.ts +4 -0
- package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +19 -16
- package/dist/types/CrowdViewWidget/components/Chart/useCrowdViewData.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils.d.ts → utils/chartUtils.d.ts} +4 -11
- package/dist/types/CrowdViewWidget/components/Legend/Legend.d.ts +3 -3
- package/dist/types/CrowdViewWidget/constants.d.ts +23 -0
- package/dist/types/CrowdViewWidget/selectConfig.d.ts +19 -0
- package/dist/types/CrowdViewWidget/types/index.d.ts +1 -0
- package/dist/types/CrowdViewWidget/types/instruments.d.ts +36 -0
- package/dist/types/CrowdViewWidget/types.d.ts +2 -50
- package/dist/types/CrowdViewWidget/utils/instrumentUtils.d.ts +8 -0
- package/dist/types/gql/types/gql.d.ts +10 -14
- package/dist/types/gql/types/graphql.d.ts +71 -63
- package/package.json +6 -4
- package/src/CrowdViewWidget/CrowdViewWidget.tsx +2 -2
- package/src/CrowdViewWidget/Main.tsx +10 -16
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +15 -5
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +12 -12
- package/src/CrowdViewWidget/components/Chart/{getOption.ts → chartOptions.ts} +51 -70
- package/src/CrowdViewWidget/components/Chart/index.ts +4 -0
- package/src/CrowdViewWidget/components/Chart/types.ts +25 -23
- package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +263 -0
- package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +93 -0
- package/src/CrowdViewWidget/components/Legend/Legend.tsx +7 -3
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +16 -20
- package/src/CrowdViewWidget/constants.ts +27 -0
- package/src/CrowdViewWidget/render.tsx +1 -0
- package/src/CrowdViewWidget/{config.ts → selectConfig.ts} +65 -43
- package/src/CrowdViewWidget/types/index.ts +1 -0
- package/src/CrowdViewWidget/types/instruments.ts +37 -0
- package/src/CrowdViewWidget/types.ts +4 -55
- package/src/CrowdViewWidget/utils/instrumentUtils.ts +11 -0
- package/src/gql/getOrderPositionBooks.ts +9 -4
- package/src/gql/{mock/getPriceCandles.ts → getPriceCandles.ts} +5 -5
- package/src/gql/types/gql.ts +6 -14
- package/src/gql/types/graphql.ts +170 -160
- package/test/Main.test.tsx +1 -1
- package/test/components/Legend.test.tsx +3 -6
- package/test/components/LegendBar.test.tsx +7 -8
- package/test/utils/instrumentUtils.test.ts +52 -0
- package/dist/main/CrowdViewWidget/components/Chart/constants.js +0 -14
- package/dist/main/CrowdViewWidget/components/Chart/constants.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/getOrderPositionDataMock.js +0 -47
- package/dist/main/CrowdViewWidget/components/Chart/getOrderPositionDataMock.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/getPriceCandlesMock.js +0 -36
- package/dist/main/CrowdViewWidget/components/Chart/getPriceCandlesMock.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils.js +0 -166
- package/dist/main/CrowdViewWidget/components/Chart/utils.js.map +0 -1
- package/dist/main/CrowdViewWidget/config.js +0 -107
- package/dist/main/CrowdViewWidget/config.js.map +0 -1
- package/dist/main/gql/mock/getPriceCandles.js +0 -11
- package/dist/main/gql/mock/getPriceCandles.js.map +0 -1
- package/dist/main/gql/mock/schema.graphqls +0 -62
- package/dist/main/gql/validateInstruments.js +0 -11
- package/dist/main/gql/validateInstruments.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/constants.js +0 -8
- package/dist/module/CrowdViewWidget/components/Chart/constants.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/getOrderPositionDataMock.js +0 -40
- package/dist/module/CrowdViewWidget/components/Chart/getOrderPositionDataMock.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/getPriceCandlesMock.js +0 -29
- package/dist/module/CrowdViewWidget/components/Chart/getPriceCandlesMock.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils.js +0 -156
- package/dist/module/CrowdViewWidget/components/Chart/utils.js.map +0 -1
- package/dist/module/CrowdViewWidget/config.js +0 -102
- package/dist/module/CrowdViewWidget/config.js.map +0 -1
- package/dist/module/gql/mock/getPriceCandles.js +0 -6
- package/dist/module/gql/mock/getPriceCandles.js.map +0 -1
- package/dist/module/gql/mock/schema.graphqls +0 -62
- package/dist/module/gql/validateInstruments.js +0 -5
- package/dist/module/gql/validateInstruments.js.map +0 -1
- package/dist/types/CrowdViewWidget/components/Chart/constants.d.ts +0 -7
- package/dist/types/CrowdViewWidget/components/Chart/getOrderPositionDataMock.d.ts +0 -14
- package/dist/types/CrowdViewWidget/components/Chart/getPriceCandlesMock.d.ts +0 -2
- package/dist/types/CrowdViewWidget/config.d.ts +0 -22
- package/dist/types/gql/validateInstruments.d.ts +0 -1
- package/src/CrowdViewWidget/components/Chart/constants.tsx +0 -8
- package/src/CrowdViewWidget/components/Chart/getOrderPositionDataMock.ts +0 -66
- package/src/CrowdViewWidget/components/Chart/getPriceCandlesMock.ts +0 -43
- package/src/CrowdViewWidget/components/Chart/utils.ts +0 -191
- package/src/gql/mock/schema.graphqls +0 -62
- package/src/gql/validateInstruments.ts +0 -10
- /package/dist/types/CrowdViewWidget/components/Chart/{getOption.d.ts → chartOptions.d.ts} +0 -0
- /package/dist/types/gql/{mock/getPriceCandles.d.ts → getPriceCandles.d.ts} +0 -0
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import type { EChartsOption } from 'echarts';
|
|
2
|
-
import type { BookType } from '../../../gql/types/graphql';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { BookType, Division, Granularity } from '../../../gql/types/graphql';
|
|
3
|
+
export interface UseCrowdViewDataProps {
|
|
4
|
+
instrument: string;
|
|
5
|
+
bookType: BookType;
|
|
6
|
+
division: Division;
|
|
7
|
+
granularity: Granularity;
|
|
8
|
+
}
|
|
9
|
+
interface CrowdViewData {
|
|
5
10
|
xAxisData: string[];
|
|
6
|
-
ordersPositionsChartData: [
|
|
7
|
-
string,
|
|
8
|
-
number,
|
|
9
|
-
number
|
|
10
|
-
][];
|
|
11
|
-
ordersPositionsBucketWidth: number;
|
|
12
11
|
candlesSeriesData: [number, number, number, number][];
|
|
12
|
+
orderPositionBooks: ([string, number, string] | null)[];
|
|
13
|
+
bucketWidth: number;
|
|
13
14
|
}
|
|
14
|
-
export
|
|
15
|
+
export interface UseCrowdViewDataReturn {
|
|
16
|
+
data: CrowdViewData | null;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
error: boolean;
|
|
19
|
+
}
|
|
20
|
+
export type GetOptionType = (props: CrowdViewData, isDark: boolean) => EChartsOption;
|
|
15
21
|
export interface ChartProps {
|
|
16
|
-
data:
|
|
22
|
+
data: CrowdViewData;
|
|
17
23
|
}
|
|
18
24
|
export interface ChartWithDataProps {
|
|
19
25
|
bookType: BookType;
|
|
26
|
+
division: Division;
|
|
20
27
|
instrument: string;
|
|
21
|
-
granularity:
|
|
22
|
-
}
|
|
23
|
-
interface TransformDataForChartTypeProps {
|
|
24
|
-
granularity: GranularityId;
|
|
28
|
+
granularity: Granularity;
|
|
25
29
|
}
|
|
26
|
-
export type TransformDataForChartType = (props: TransformDataForChartTypeProps) => ChartOptionsProps;
|
|
27
30
|
export interface GetLabelsDataProps {
|
|
28
31
|
xAxisData: string[];
|
|
29
32
|
isGreaterThanTwoWeeks: boolean;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare enum GranularityId {
|
|
4
|
-
MINUTE_5 = "MINUTE_5",
|
|
5
|
-
MINUTE_15 = "MINUTE_15",
|
|
6
|
-
MINUTE_30 = "MINUTE_30",
|
|
7
|
-
HOUR_1 = "HOUR_1",
|
|
8
|
-
HOUR_4 = "HOUR_4",
|
|
9
|
-
DAY_1 = "DAY_1"
|
|
10
|
-
}
|
|
1
|
+
import { Granularity, TimeSpan } from '../../../../gql/types/graphql';
|
|
2
|
+
import type { GetLabelsDataProps } from '../types';
|
|
11
3
|
export declare const getLabelData: ({ xAxisData, isGreaterThanTwoWeeks, }: GetLabelsDataProps) => {
|
|
12
4
|
name: string;
|
|
13
5
|
xAxis: string;
|
|
@@ -25,4 +17,5 @@ export declare const getLabelData: ({ xAxisData, isGreaterThanTwoWeeks, }: GetLa
|
|
|
25
17
|
};
|
|
26
18
|
}[];
|
|
27
19
|
export declare const isDifferenceGreaterThanTwoWeeks: (startDate: string, endDate: string) => boolean;
|
|
28
|
-
export declare const
|
|
20
|
+
export declare const getTimeSpanForGranularity: (granularity: Granularity) => TimeSpan;
|
|
21
|
+
export declare const getRectColor: (sentiment: number) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface LegendProps {
|
|
3
|
-
longValues
|
|
4
|
-
shortValues
|
|
3
|
+
longValues?: [number, number];
|
|
4
|
+
shortValues?: [number, number];
|
|
5
5
|
}
|
|
6
|
-
export declare const Legend: ({ longValues, shortValues }: LegendProps) => React.JSX.Element;
|
|
6
|
+
export declare const Legend: ({ longValues, shortValues, }: LegendProps) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const BOOKS_THRESHOLDS: {
|
|
2
|
+
readonly MIN: 0.15;
|
|
3
|
+
readonly MAX: 0.55;
|
|
4
|
+
};
|
|
5
|
+
export declare const BUCKET_CONFIG: {
|
|
6
|
+
readonly DEFAULT_WIDTH: 0.0005;
|
|
7
|
+
readonly PRICE_PADDING_MULTIPLIER: 2;
|
|
8
|
+
};
|
|
9
|
+
export declare const TIME_THRESHOLDS: {
|
|
10
|
+
readonly TWO_WEEKS_MS: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const CHART_CONFIG: {
|
|
13
|
+
readonly HEIGHT: 425;
|
|
14
|
+
readonly WIDTH: 9999;
|
|
15
|
+
readonly X_LABEL_SIZE: 40;
|
|
16
|
+
readonly Y_LABEL_SIZE_DESKTOP: 60;
|
|
17
|
+
readonly INITIAL_START_ZOOM: 80;
|
|
18
|
+
readonly INITIAL_END_ZOOM: 100;
|
|
19
|
+
};
|
|
20
|
+
export declare const COLOR_MAP: {
|
|
21
|
+
readonly long: readonly ["#ffffff", "#fdb833"];
|
|
22
|
+
readonly short: readonly ["#ffffff", "#0096c7"];
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BookType, Granularity } from '../gql/types/graphql';
|
|
2
|
+
import { InstrumentId, InstrumentIdOC } from './types/instruments';
|
|
3
|
+
declare const navigationConfig: {
|
|
4
|
+
id: BookType;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
declare const instrumentSelectConfigOC: {
|
|
8
|
+
id: InstrumentIdOC;
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
declare const instrumentSelectConfig: {
|
|
12
|
+
id: InstrumentId;
|
|
13
|
+
label: string;
|
|
14
|
+
}[];
|
|
15
|
+
declare const granularitySelectConfig: {
|
|
16
|
+
id: Granularity;
|
|
17
|
+
label: string;
|
|
18
|
+
}[];
|
|
19
|
+
export { granularitySelectConfig, instrumentSelectConfig, instrumentSelectConfigOC, navigationConfig, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './instruments';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare enum InstrumentId {
|
|
2
|
+
EUR_AUD = "EURAUD",
|
|
3
|
+
EUR_GBP = "EURGBP",
|
|
4
|
+
EUR_JPY = "EURJPY",
|
|
5
|
+
EUR_USD = "EURUSD",
|
|
6
|
+
EUR_CHF = "EURCHF",
|
|
7
|
+
USD_CHF = "USDCHF",
|
|
8
|
+
USD_JPY = "USDJPY",
|
|
9
|
+
USD_CAD = "USDCAD",
|
|
10
|
+
GBP_USD = "GBPUSD",
|
|
11
|
+
GBP_JPY = "GBPJPY",
|
|
12
|
+
GBP_CHF = "GBPCHF",
|
|
13
|
+
AUD_JPY = "AUDJPY",
|
|
14
|
+
AUD_USD = "AUDUSD",
|
|
15
|
+
NZD_USD = "NZDUSD",
|
|
16
|
+
XAU_USD = "XAUUSD",
|
|
17
|
+
XAG_USD = "XAGUSD"
|
|
18
|
+
}
|
|
19
|
+
export declare enum InstrumentIdOC {
|
|
20
|
+
EUR_AUD = "EUR_AUD",
|
|
21
|
+
EUR_GBP = "EUR_GBP",
|
|
22
|
+
EUR_JPY = "EUR_JPY",
|
|
23
|
+
EUR_USD = "EUR_USD",
|
|
24
|
+
EUR_CHF = "EUR_CHF",
|
|
25
|
+
USD_CHF = "USD_CHF",
|
|
26
|
+
USD_JPY = "USD_JPY",
|
|
27
|
+
USD_CAD = "USD_CAD",
|
|
28
|
+
GBP_USD = "GBP_USD",
|
|
29
|
+
GBP_JPY = "GBP_JPY",
|
|
30
|
+
GBP_CHF = "GBP_CHF",
|
|
31
|
+
AUD_JPY = "AUD_JPY",
|
|
32
|
+
AUD_USD = "AUD_USD",
|
|
33
|
+
NZD_USD = "NZD_USD",
|
|
34
|
+
XAU_USD = "XAU_USD",
|
|
35
|
+
XAG_USD = "XAG_USD"
|
|
36
|
+
}
|
|
@@ -1,58 +1,10 @@
|
|
|
1
1
|
import type { WidgetConfig } from '@oanda/labs-widget-common';
|
|
2
2
|
import type { Division } from '../gql/types/graphql';
|
|
3
|
+
import type { InstrumentId } from './types/instruments';
|
|
3
4
|
export interface CrowdViewConfig extends WidgetConfig {
|
|
5
|
+
division: Division;
|
|
4
6
|
}
|
|
5
7
|
export interface MainProps {
|
|
6
8
|
instrument?: InstrumentId;
|
|
7
9
|
division: Division;
|
|
8
10
|
}
|
|
9
|
-
export declare enum InstrumentId {
|
|
10
|
-
EUR_AUD = "EURAUD",
|
|
11
|
-
EUR_GBP = "EURGBP",
|
|
12
|
-
EUR_JPY = "EURJPY",
|
|
13
|
-
EUR_USD = "EURUSD",
|
|
14
|
-
EUR_CHF = "EURCHF",
|
|
15
|
-
USD_CHF = "USDCHF",
|
|
16
|
-
USD_JPY = "USDJPY",
|
|
17
|
-
USD_CAD = "USDCAD",
|
|
18
|
-
GBP_USD = "GBPUSD",
|
|
19
|
-
GBP_JPY = "GBPJPY",
|
|
20
|
-
GBP_CHF = "GBPCHF",
|
|
21
|
-
AUD_JPY = "AUDJPY",
|
|
22
|
-
AUD_USD = "AUDUSD",
|
|
23
|
-
NZD_USD = "NZDUSD",
|
|
24
|
-
XAU_USD = "XAUUSD",
|
|
25
|
-
XAG_USD = "XAGUSD"
|
|
26
|
-
}
|
|
27
|
-
export declare enum GranularityId {
|
|
28
|
-
MINUTE_5 = "MINUTE_5",
|
|
29
|
-
MINUTE_15 = "MINUTE_15",
|
|
30
|
-
MINUTE_30 = "MINUTE_30",
|
|
31
|
-
HOUR_1 = "HOUR_1",
|
|
32
|
-
HOUR_4 = "HOUR_4",
|
|
33
|
-
DAY_1 = "DAY_1"
|
|
34
|
-
}
|
|
35
|
-
export declare enum TimeSpanId {
|
|
36
|
-
HOUR_1 = "HOUR_1",
|
|
37
|
-
HOUR_12 = "HOUR_12",
|
|
38
|
-
DAY_1 = "DAY_1",
|
|
39
|
-
DAY_2 = "DAY_2",
|
|
40
|
-
WEEK_1 = "WEEK_1",
|
|
41
|
-
WEEK_2 = "WEEK_2",
|
|
42
|
-
WEEK_3 = "WEEK_3",
|
|
43
|
-
MONTH_1 = "MONTH_1",
|
|
44
|
-
MONTH_3 = "MONTH_3",
|
|
45
|
-
MONTH_6 = "MONTH_6",
|
|
46
|
-
YEAR_1 = "YEAR_1",
|
|
47
|
-
YEAR_5 = "YEAR_5"
|
|
48
|
-
}
|
|
49
|
-
export interface OrdersPositionsData {
|
|
50
|
-
price: number;
|
|
51
|
-
buckets: {
|
|
52
|
-
price: number;
|
|
53
|
-
longCountPercent: number;
|
|
54
|
-
shortCountPercent: number;
|
|
55
|
-
}[];
|
|
56
|
-
bucketWidth: number;
|
|
57
|
-
timestamp: number;
|
|
58
|
-
}
|
|
@@ -11,21 +11,21 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
|
|
|
11
11
|
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
|
12
12
|
*/
|
|
13
13
|
declare const documents: {
|
|
14
|
-
'\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $
|
|
14
|
+
'\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n sentiment\n }\n }\n }\n': DocumentNode<types.GetOrderPositionBooksQuery, types.Exact<{
|
|
15
15
|
instrument: types.Scalars["String"]["input"];
|
|
16
16
|
bookType: types.BookType;
|
|
17
|
-
|
|
17
|
+
timeSpan: types.TimeSpan;
|
|
18
|
+
granularity: types.Granularity;
|
|
19
|
+
maxBookPrice?: types.InputMaybe<types.Scalars["Float"]["input"]>;
|
|
20
|
+
minBookPrice?: types.InputMaybe<types.Scalars["Float"]["input"]>;
|
|
18
21
|
}>>;
|
|
19
|
-
'\n query GetPriceCandles(\n $division: Division
|
|
20
|
-
|
|
22
|
+
'\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 }\n }\n': DocumentNode<types.GetPriceCandlesQuery, types.Exact<{
|
|
23
|
+
dataSource: types.DataSource;
|
|
24
|
+
division: types.Division;
|
|
21
25
|
instrument: types.Scalars["String"]["input"];
|
|
22
26
|
granularity: types.Granularity;
|
|
23
27
|
timeSpan: types.TimeSpan;
|
|
24
28
|
}>>;
|
|
25
|
-
'\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n': DocumentNode<types.ValidateInstrumentsQuery, types.Exact<{
|
|
26
|
-
instruments: Array<types.InputMaybe<types.Scalars["String"]["input"]>> | types.InputMaybe<types.Scalars["String"]["input"]>;
|
|
27
|
-
division?: types.InputMaybe<types.Division>;
|
|
28
|
-
}>>;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
@@ -43,14 +43,10 @@ export declare function graphql(source: string): unknown;
|
|
|
43
43
|
/**
|
|
44
44
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
45
45
|
*/
|
|
46
|
-
export declare function graphql(source: '\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $
|
|
47
|
-
/**
|
|
48
|
-
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
49
|
-
*/
|
|
50
|
-
export declare function graphql(source: '\n query GetPriceCandles(\n $division: Division\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n getPriceCandles(\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n time\n unixTime\n candle {\n high\n low\n open\n close\n }\n timeSpan\n }\n }\n'): (typeof documents)['\n query GetPriceCandles(\n $division: Division\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n getPriceCandles(\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n time\n unixTime\n candle {\n high\n low\n open\n close\n }\n timeSpan\n }\n }\n'];
|
|
46
|
+
export declare function graphql(source: '\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n sentiment\n }\n }\n }\n'): (typeof documents)['\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n sentiment\n }\n }\n }\n'];
|
|
51
47
|
/**
|
|
52
48
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
53
49
|
*/
|
|
54
|
-
export declare function graphql(source: '\n query
|
|
50
|
+
export declare function graphql(source: '\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 }\n }\n'): (typeof documents)['\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 }\n }\n'];
|
|
55
51
|
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
|
56
52
|
export {};
|
|
@@ -67,13 +67,16 @@ export type Candle = {
|
|
|
67
67
|
high: Scalars['Float']['output'];
|
|
68
68
|
low: Scalars['Float']['output'];
|
|
69
69
|
open: Scalars['Float']['output'];
|
|
70
|
+
/** UTC Timestamp */
|
|
71
|
+
point: Scalars['String']['output'];
|
|
70
72
|
};
|
|
71
73
|
export type CandlesData = {
|
|
72
74
|
__typename?: 'CandlesData';
|
|
73
|
-
candle: Candle
|
|
74
|
-
|
|
75
|
+
candle: Array<Maybe<Candle>>;
|
|
76
|
+
granularity: Granularity;
|
|
77
|
+
instrument: Instrument;
|
|
78
|
+
pipsLocation: Scalars['Int']['output'];
|
|
75
79
|
timeSpan: TimeSpan;
|
|
76
|
-
unixTime: Scalars['Int']['output'];
|
|
77
80
|
};
|
|
78
81
|
export type CorrelationHeatmap = {
|
|
79
82
|
__typename?: 'CorrelationHeatmap';
|
|
@@ -134,8 +137,9 @@ export type CurrencyStrength = {
|
|
|
134
137
|
updatedAt: Scalars['String']['output'];
|
|
135
138
|
};
|
|
136
139
|
export declare enum DataSource {
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
All = "ALL",
|
|
141
|
+
Mt5 = "MT5",
|
|
142
|
+
V20 = "V20"
|
|
139
143
|
}
|
|
140
144
|
export declare enum Division {
|
|
141
145
|
Oap = "OAP",
|
|
@@ -150,17 +154,16 @@ export declare enum Division {
|
|
|
150
154
|
}
|
|
151
155
|
export type ExtendedInstrument = {
|
|
152
156
|
__typename?: 'ExtendedInstrument';
|
|
157
|
+
dataSource: DataSource;
|
|
153
158
|
displayName: Scalars['String']['output'];
|
|
154
159
|
name: Scalars['String']['output'];
|
|
155
160
|
tradeMode: TradeMode;
|
|
156
161
|
};
|
|
157
162
|
export declare enum Granularity {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Minute_15 = "MINUTE_15",
|
|
163
|
-
Minute_30 = "MINUTE_30"
|
|
163
|
+
H1 = "H1",
|
|
164
|
+
H4 = "H4",
|
|
165
|
+
M5 = "M5",
|
|
166
|
+
M15 = "M15"
|
|
164
167
|
}
|
|
165
168
|
export type Heatmap = {
|
|
166
169
|
__typename?: 'Heatmap';
|
|
@@ -177,26 +180,33 @@ export type InstrumentCorrelation = {
|
|
|
177
180
|
instrument: Instrument;
|
|
178
181
|
value?: Maybe<Scalars['Float']['output']>;
|
|
179
182
|
};
|
|
180
|
-
export declare enum InstrumentDataSource {
|
|
181
|
-
Mt5 = "MT5",
|
|
182
|
-
V20 = "V20"
|
|
183
|
-
}
|
|
184
183
|
export type InstrumentTableResult = {
|
|
185
184
|
__typename?: 'InstrumentTableResult';
|
|
186
185
|
instruments: Array<ExtendedInstrument>;
|
|
187
186
|
totalCount: Scalars['Int']['output'];
|
|
188
187
|
updatedAt: Scalars['String']['output'];
|
|
189
188
|
};
|
|
189
|
+
export type MarginRate = {
|
|
190
|
+
__typename?: 'MarginRate';
|
|
191
|
+
instrument: Instrument;
|
|
192
|
+
rate: Scalars['Float']['output'];
|
|
193
|
+
};
|
|
190
194
|
export type Matrix = {
|
|
191
195
|
__typename?: 'Matrix';
|
|
192
196
|
instrument: Instrument;
|
|
193
197
|
instrumentCorrelation: Array<InstrumentCorrelation>;
|
|
194
198
|
};
|
|
199
|
+
export declare enum OrderBookDataSource {
|
|
200
|
+
Ny4 = "NY4",
|
|
201
|
+
Ny4Mt5 = "NY4_MT5",
|
|
202
|
+
Ty3 = "TY3"
|
|
203
|
+
}
|
|
195
204
|
export type OrderPositionBucket = {
|
|
196
205
|
__typename?: 'OrderPositionBucket';
|
|
197
|
-
longCountPercent
|
|
206
|
+
longCountPercent?: Maybe<Scalars['Float']['output']>;
|
|
198
207
|
price: Scalars['Float']['output'];
|
|
199
|
-
|
|
208
|
+
sentiment?: Maybe<Scalars['Float']['output']>;
|
|
209
|
+
shortCountPercent?: Maybe<Scalars['Float']['output']>;
|
|
200
210
|
};
|
|
201
211
|
export type OrderPositionData = {
|
|
202
212
|
__typename?: 'OrderPositionData';
|
|
@@ -216,10 +226,12 @@ export type Query = {
|
|
|
216
226
|
correlationMatrix: CorrelationMatrix;
|
|
217
227
|
currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;
|
|
218
228
|
currencyStrength?: Maybe<Array<CurrencyStrength>>;
|
|
219
|
-
getPriceCandles: Array<CandlesData>;
|
|
220
229
|
isAllowedPartner?: Maybe<Scalars['Boolean']['output']>;
|
|
221
230
|
mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;
|
|
231
|
+
marginRates?: Maybe<Array<MarginRate>>;
|
|
232
|
+
orderPositionBook: Array<Maybe<OrderPositionData>>;
|
|
222
233
|
orderPositionBooks: Array<Maybe<OrderPositionData>>;
|
|
234
|
+
priceCandles: CandlesData;
|
|
223
235
|
resolveInstrumentsByDivision?: Maybe<Array<Instrument>>;
|
|
224
236
|
resolveInstrumentsWithFilters?: Maybe<InstrumentTableResult>;
|
|
225
237
|
sentiment?: Maybe<Array<SentimentInstrument>>;
|
|
@@ -247,12 +259,6 @@ export type QueryCorrelationMatrixArgs = {
|
|
|
247
259
|
export type QueryCurrencyPowerBalanceArgs = {
|
|
248
260
|
timeUnit: CurrencyPowerBalanceTimeUnit;
|
|
249
261
|
};
|
|
250
|
-
export type QueryGetPriceCandlesArgs = {
|
|
251
|
-
division?: InputMaybe<Division>;
|
|
252
|
-
granularity: Granularity;
|
|
253
|
-
instrument: Scalars['String']['input'];
|
|
254
|
-
timeSpan: TimeSpan;
|
|
255
|
-
};
|
|
256
262
|
export type QueryIsAllowedPartnerArgs = {
|
|
257
263
|
url: Scalars['String']['input'];
|
|
258
264
|
};
|
|
@@ -260,12 +266,32 @@ export type QueryMapInstrumentNamesArgs = {
|
|
|
260
266
|
division?: InputMaybe<Division>;
|
|
261
267
|
instruments: Array<InputMaybe<Scalars['String']['input']>>;
|
|
262
268
|
};
|
|
263
|
-
export type
|
|
269
|
+
export type QueryMarginRatesArgs = {
|
|
270
|
+
dataSource: DataSource;
|
|
271
|
+
division: Division;
|
|
272
|
+
instruments?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
273
|
+
tradingGroup: Scalars['Int']['input'];
|
|
274
|
+
};
|
|
275
|
+
export type QueryOrderPositionBookArgs = {
|
|
264
276
|
bookType: BookType;
|
|
265
|
-
dataSource?: InputMaybe<
|
|
277
|
+
dataSource?: InputMaybe<OrderBookDataSource>;
|
|
266
278
|
instrument: Scalars['String']['input'];
|
|
267
279
|
recentHours?: InputMaybe<Scalars['Int']['input']>;
|
|
268
|
-
|
|
280
|
+
};
|
|
281
|
+
export type QueryOrderPositionBooksArgs = {
|
|
282
|
+
bookType: BookType;
|
|
283
|
+
granularity: Granularity;
|
|
284
|
+
instrument: Scalars['String']['input'];
|
|
285
|
+
maxBookPrice?: InputMaybe<Scalars['Float']['input']>;
|
|
286
|
+
minBookPrice?: InputMaybe<Scalars['Float']['input']>;
|
|
287
|
+
timeSpan: TimeSpan;
|
|
288
|
+
};
|
|
289
|
+
export type QueryPriceCandlesArgs = {
|
|
290
|
+
dataSource: DataSource;
|
|
291
|
+
division: Division;
|
|
292
|
+
granularity: Granularity;
|
|
293
|
+
instrument: Scalars['String']['input'];
|
|
294
|
+
timeSpan: TimeSpan;
|
|
269
295
|
};
|
|
270
296
|
export type QueryResolveInstrumentsByDivisionArgs = {
|
|
271
297
|
division: Division;
|
|
@@ -274,7 +300,7 @@ export type QueryResolveInstrumentsByDivisionArgs = {
|
|
|
274
300
|
export type QueryResolveInstrumentsWithFiltersArgs = {
|
|
275
301
|
assetClass?: InputMaybe<Array<InputMaybe<AssetClassName>>>;
|
|
276
302
|
count?: InputMaybe<Scalars['Int']['input']>;
|
|
277
|
-
dataSource
|
|
303
|
+
dataSource: DataSource;
|
|
278
304
|
division: Division;
|
|
279
305
|
instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
280
306
|
offset?: InputMaybe<Scalars['Int']['input']>;
|
|
@@ -355,17 +381,11 @@ export type TimeCorrelation = {
|
|
|
355
381
|
value?: Maybe<Scalars['Float']['output']>;
|
|
356
382
|
};
|
|
357
383
|
export declare enum TimeSpan {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
Month_3 = "MONTH_3",
|
|
364
|
-
Month_6 = "MONTH_6",
|
|
365
|
-
Week_1 = "WEEK_1",
|
|
366
|
-
Week_2 = "WEEK_2",
|
|
367
|
-
Week_3 = "WEEK_3",
|
|
368
|
-
Year_1 = "YEAR_1"
|
|
384
|
+
FiveDays = "FIVE_DAYS",
|
|
385
|
+
NinetyDays = "NINETY_DAYS",
|
|
386
|
+
TenDays = "TEN_DAYS",
|
|
387
|
+
TwentyDays = "TWENTY_DAYS",
|
|
388
|
+
TwoDays = "TWO_DAYS"
|
|
369
389
|
}
|
|
370
390
|
export type TopicalInstrument = {
|
|
371
391
|
__typename?: 'TopicalInstrument';
|
|
@@ -455,7 +475,10 @@ export declare enum VolatilityChartTimeUnit {
|
|
|
455
475
|
export type GetOrderPositionBooksQueryVariables = Exact<{
|
|
456
476
|
instrument: Scalars['String']['input'];
|
|
457
477
|
bookType: BookType;
|
|
458
|
-
|
|
478
|
+
timeSpan: TimeSpan;
|
|
479
|
+
granularity: Granularity;
|
|
480
|
+
maxBookPrice?: InputMaybe<Scalars['Float']['input']>;
|
|
481
|
+
minBookPrice?: InputMaybe<Scalars['Float']['input']>;
|
|
459
482
|
}>;
|
|
460
483
|
export type GetOrderPositionBooksQuery = {
|
|
461
484
|
__typename?: 'Query';
|
|
@@ -467,45 +490,30 @@ export type GetOrderPositionBooksQuery = {
|
|
|
467
490
|
buckets: Array<{
|
|
468
491
|
__typename?: 'OrderPositionBucket';
|
|
469
492
|
price: number;
|
|
470
|
-
|
|
471
|
-
shortCountPercent: number;
|
|
493
|
+
sentiment?: number | null;
|
|
472
494
|
} | null>;
|
|
473
495
|
} | null>;
|
|
474
496
|
};
|
|
475
497
|
export type GetPriceCandlesQueryVariables = Exact<{
|
|
476
|
-
|
|
498
|
+
dataSource: DataSource;
|
|
499
|
+
division: Division;
|
|
477
500
|
instrument: Scalars['String']['input'];
|
|
478
501
|
granularity: Granularity;
|
|
479
502
|
timeSpan: TimeSpan;
|
|
480
503
|
}>;
|
|
481
504
|
export type GetPriceCandlesQuery = {
|
|
482
505
|
__typename?: 'Query';
|
|
483
|
-
|
|
506
|
+
priceCandles: {
|
|
484
507
|
__typename?: 'CandlesData';
|
|
485
|
-
|
|
486
|
-
unixTime: number;
|
|
487
|
-
timeSpan: TimeSpan;
|
|
488
|
-
candle: {
|
|
508
|
+
candle: Array<{
|
|
489
509
|
__typename?: 'Candle';
|
|
510
|
+
point: string;
|
|
490
511
|
high: number;
|
|
491
512
|
low: number;
|
|
492
513
|
open: number;
|
|
493
514
|
close: number;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
};
|
|
497
|
-
export type ValidateInstrumentsQueryVariables = Exact<{
|
|
498
|
-
instruments: Array<InputMaybe<Scalars['String']['input']>> | InputMaybe<Scalars['String']['input']>;
|
|
499
|
-
division?: InputMaybe<Division>;
|
|
500
|
-
}>;
|
|
501
|
-
export type ValidateInstrumentsQuery = {
|
|
502
|
-
__typename?: 'Query';
|
|
503
|
-
mapInstrumentNames?: Array<{
|
|
504
|
-
__typename?: 'Instrument';
|
|
505
|
-
name: string;
|
|
506
|
-
displayName: string;
|
|
507
|
-
} | null> | null;
|
|
515
|
+
} | null>;
|
|
516
|
+
};
|
|
508
517
|
};
|
|
509
518
|
export declare const GetOrderPositionBooksDocument: DocumentNode<GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables>;
|
|
510
519
|
export declare const GetPriceCandlesDocument: DocumentNode<GetPriceCandlesQuery, GetPriceCandlesQueryVariables>;
|
|
511
|
-
export declare const ValidateInstrumentsDocument: DocumentNode<ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-crowd-view-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.44",
|
|
4
4
|
"description": "Labs Crowd View Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
"author": "OANDA",
|
|
14
14
|
"license": "UNLICENSED",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
16
|
+
"@oanda/labs-widget-common": "^1.0.226",
|
|
17
17
|
"@oanda/mono-i18n": "10.0.1",
|
|
18
|
+
"chroma-js": "^3.1.2",
|
|
18
19
|
"graphql": "16.8.1"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@graphql-codegen/cli": "5.0.0",
|
|
22
|
-
"@graphql-codegen/client-preset": "4.1.0"
|
|
23
|
+
"@graphql-codegen/client-preset": "4.1.0",
|
|
24
|
+
"@types/chroma-js": "^3.1.2"
|
|
23
25
|
},
|
|
24
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "4709e181ae37de87e1c5d5569391c5f6cfeeca33"
|
|
25
27
|
}
|
|
@@ -2,7 +2,6 @@ import { ApolloClient, InMemoryCache } from '@apollo/client';
|
|
|
2
2
|
import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import { Division } from '../gql/types/graphql';
|
|
6
5
|
import { translations } from '../translations';
|
|
7
6
|
import { Main } from './Main';
|
|
8
7
|
import type { CrowdViewConfig } from './types';
|
|
@@ -13,6 +12,7 @@ const CrowdViewWidget = ({
|
|
|
13
12
|
theme,
|
|
14
13
|
isParamError,
|
|
15
14
|
logoLink,
|
|
15
|
+
division,
|
|
16
16
|
}: CrowdViewConfig) => {
|
|
17
17
|
const client = new ApolloClient({
|
|
18
18
|
uri: graphqlUrl,
|
|
@@ -31,7 +31,7 @@ const CrowdViewWidget = ({
|
|
|
31
31
|
linkArea="logo"
|
|
32
32
|
logoLink={logoLink}
|
|
33
33
|
>
|
|
34
|
-
<Main division={
|
|
34
|
+
<Main division={division} />
|
|
35
35
|
</WidgetWrapper>
|
|
36
36
|
</WidgetProvider>
|
|
37
37
|
);
|
|
@@ -8,21 +8,17 @@ import {
|
|
|
8
8
|
import { useLocale } from '@oanda/mono-i18n';
|
|
9
9
|
import React, { useState } from 'react';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import type { Granularity } from '../gql/types/graphql';
|
|
12
|
+
import { BookType } from '../gql/types/graphql';
|
|
12
13
|
import { ChartWithData, Legend } from './components';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
navigationConfig,
|
|
18
|
-
} from './config';
|
|
19
|
-
import type { GranularityId, InstrumentId, MainProps } from './types';
|
|
14
|
+
import { granularitySelectConfig, navigationConfig } from './selectConfig';
|
|
15
|
+
import type { MainProps } from './types';
|
|
16
|
+
import type { InstrumentId } from './types/instruments';
|
|
17
|
+
import { getInstrumentConfigForDivision } from './utils/instrumentUtils';
|
|
20
18
|
|
|
21
19
|
const Main = ({ division }: MainProps) => {
|
|
22
20
|
const instrumentSelectConfigWithDivision =
|
|
23
|
-
division
|
|
24
|
-
? instrumentSelectConfigOC
|
|
25
|
-
: instrumentSelectConfig;
|
|
21
|
+
getInstrumentConfigForDivision(division);
|
|
26
22
|
|
|
27
23
|
const { size } = useLayoutProvider();
|
|
28
24
|
const isDesktop = size === Size.DESKTOP;
|
|
@@ -77,7 +73,7 @@ const Main = ({ division }: MainProps) => {
|
|
|
77
73
|
selectLabel={lang('granularity')}
|
|
78
74
|
selectedOption={granularity}
|
|
79
75
|
setSelectedOption={(val) =>
|
|
80
|
-
setGranularity(val as { id:
|
|
76
|
+
setGranularity(val as { id: Granularity; label: string })
|
|
81
77
|
}
|
|
82
78
|
/>
|
|
83
79
|
</div>
|
|
@@ -85,14 +81,12 @@ const Main = ({ division }: MainProps) => {
|
|
|
85
81
|
|
|
86
82
|
<ChartWithData
|
|
87
83
|
bookType={bookType}
|
|
84
|
+
division={division}
|
|
88
85
|
granularity={granularity.id}
|
|
89
86
|
instrument={instrument.id}
|
|
90
87
|
/>
|
|
91
88
|
|
|
92
|
-
<Legend
|
|
93
|
-
longValues={[0.15, 0.25, 0.4, 0.55]}
|
|
94
|
-
shortValues={[0.15, 0.25, 0.4, 0.55]}
|
|
95
|
-
/>
|
|
89
|
+
<Legend />
|
|
96
90
|
</div>
|
|
97
91
|
)}
|
|
98
92
|
</>
|