@oanda/labs-crowd-view-widget 1.0.51 → 1.0.53
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 +428 -0
- package/dist/main/CrowdViewWidget/Main.js +1 -5
- package/dist/main/CrowdViewWidget/Main.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +73 -24
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +18 -9
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js +265 -59
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +68 -26
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +20 -19
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getChartStyles.js +27 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/getGridLines.js +123 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/index.js +15 -26
- package/dist/main/CrowdViewWidget/components/Chart/utils/index.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +54 -12
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +49 -27
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js +43 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/utils/validateData.js +8 -2
- package/dist/main/CrowdViewWidget/components/Chart/utils/validateData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js +3 -4
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +2 -2
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/main/CrowdViewWidget/constants.js +14 -8
- package/dist/main/CrowdViewWidget/constants.js.map +1 -1
- package/dist/main/gql/getOrderPositionBooks.js +1 -1
- package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/main/gql/getPriceCandles.js +1 -1
- package/dist/main/gql/getPriceCandles.js.map +1 -1
- package/dist/main/gql/getSentiments.js +11 -0
- package/dist/main/gql/getSentiments.js.map +1 -0
- package/dist/main/gql/types/gql.js +3 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +273 -19
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/module/CrowdViewWidget/Main.js +2 -6
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +76 -27
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +18 -9
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js +265 -60
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +69 -27
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +21 -20
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getChartStyles.js +20 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/getGridLines.js +116 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js +2 -3
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +54 -12
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +49 -27
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js +36 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/utils/validateData.js +8 -2
- package/dist/module/CrowdViewWidget/components/Chart/utils/validateData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +3 -4
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +2 -2
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +13 -7
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/gql/getOrderPositionBooks.js +1 -1
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/getPriceCandles.js +1 -1
- package/dist/module/gql/getPriceCandles.js.map +1 -1
- package/dist/module/gql/getSentiments.js +6 -0
- package/dist/module/gql/getSentiments.js.map +1 -0
- package/dist/module/gql/types/gql.js +3 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +272 -18
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/Chart.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +69 -9
- package/dist/types/CrowdViewWidget/components/Chart/utils/chartUtils.d.ts +5 -6
- package/dist/types/CrowdViewWidget/components/Chart/utils/getChartStyles.d.ts +10 -0
- package/dist/types/CrowdViewWidget/components/Chart/utils/getGridLines.d.ts +97 -0
- package/dist/types/CrowdViewWidget/components/Chart/utils/index.d.ts +2 -3
- package/dist/types/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.d.ts +10 -7
- package/dist/types/CrowdViewWidget/components/Chart/utils/processPriceCandles.d.ts +6 -21
- package/dist/types/CrowdViewWidget/components/Chart/utils/processSentiments.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/utils/validateData.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Legend/Legend.d.ts +2 -2
- package/dist/types/CrowdViewWidget/components/Legend/LegendBar.d.ts +1 -1
- package/dist/types/CrowdViewWidget/constants.d.ts +12 -6
- package/dist/types/gql/getSentiments.d.ts +2 -0
- package/dist/types/gql/types/gql.d.ts +15 -4
- package/dist/types/gql/types/graphql.d.ts +66 -11
- package/package.json +3 -3
- package/src/CrowdViewWidget/Main.tsx +2 -4
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +99 -38
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +24 -7
- package/src/CrowdViewWidget/components/Chart/chartOptions.ts +305 -87
- package/src/CrowdViewWidget/components/Chart/types.ts +82 -16
- package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +105 -56
- package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +65 -34
- package/src/CrowdViewWidget/components/Chart/utils/getChartStyles.ts +42 -0
- package/src/CrowdViewWidget/components/Chart/utils/getGridLines.ts +148 -0
- package/src/CrowdViewWidget/components/Chart/utils/index.ts +2 -3
- package/src/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.ts +84 -22
- package/src/CrowdViewWidget/components/Chart/utils/processPriceCandles.ts +52 -38
- package/src/CrowdViewWidget/components/Chart/utils/processSentiments.ts +55 -0
- package/src/CrowdViewWidget/components/Chart/utils/validateData.ts +10 -2
- package/src/CrowdViewWidget/components/Legend/Legend.tsx +5 -6
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +3 -3
- package/src/CrowdViewWidget/constants.ts +18 -7
- package/src/gql/getOrderPositionBooks.ts +13 -5
- package/src/gql/getPriceCandles.ts +1 -0
- package/src/gql/getSentiments.ts +25 -0
- package/src/gql/types/gql.ts +14 -6
- package/src/gql/types/graphql.ts +259 -16
- package/test/components/Chart/utils/chartUtils.test.ts +105 -13
- package/test/components/Chart/utils/getChartStyles.test.ts +64 -0
- package/test/components/Chart/utils/processSentiments.test.ts +238 -0
- package/test/utils/processOrderPositionBooks.test.ts +201 -84
- package/test/utils/processPriceCandles.test.ts +93 -67
- package/test/utils/validateData.test.ts +136 -38
- package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -37
- package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js +0 -14
- package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -29
- package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -29
- package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js +0 -7
- package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -22
- package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
- package/dist/types/CrowdViewWidget/components/Chart/utils/aggregateBuckets.d.ts +0 -2
- package/dist/types/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.d.ts +0 -3
- package/dist/types/CrowdViewWidget/components/Chart/utils/processBuckets.d.ts +0 -3
- package/src/CrowdViewWidget/components/Chart/utils/aggregateBuckets.ts +0 -44
- package/src/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.ts +0 -13
- package/src/CrowdViewWidget/components/Chart/utils/processBuckets.ts +0 -43
- package/test/utils/aggregateBuckets.test.ts +0 -82
- package/test/utils/getTargetBucketWidth.test.ts +0 -37
- package/test/utils/processBuckets.test.ts +0 -153
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["cn","Select","Size","Tabs","useLayoutProvider","useLocale","React","useEffect","useMemo","useState","BookType","ChartWithData","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["cn","Select","Size","Tabs","useLayoutProvider","useLocale","React","useEffect","useMemo","useState","BookType","ChartWithData","granularitySelectConfig","navigationConfig","getInstrumentConfigForDivision","Main","_ref","division","lang","size","isDesktop","DESKTOP","bookType","setBookType","Order","granularitySelectConfigWithLang","map","opt","_objectSpread","label","instrumentSelectConfigWithDivision","instrument","setInstrument","granularity","setGranularity","createElement","Fragment","className","mobileFullWidth","activeTab","handleClick","e","currentTarget","value","items","labelCallback","options","searchPlaceholder","selectLabel","selectedOption","setSelectedOption","val","id"],"sources":["../../../src/CrowdViewWidget/Main.tsx"],"sourcesContent":["import {\n cn,\n Select,\n Size,\n Tabs,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport type { Granularity } from '../gql/types/graphql';\nimport { BookType } from '../gql/types/graphql';\nimport { ChartWithData } from './components';\nimport { granularitySelectConfig, navigationConfig } from './selectConfig';\nimport type { InstrumentId, MainProps } from './types';\nimport { getInstrumentConfigForDivision } from './utils/instrumentUtils';\n\nconst Main = ({ division }: MainProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n const [bookType, setBookType] = useState(BookType.Order);\n\n const granularitySelectConfigWithLang = useMemo(\n () =>\n granularitySelectConfig.map((opt) => ({\n ...opt,\n label: lang(opt.label),\n })),\n [lang]\n );\n\n const instrumentSelectConfigWithDivision =\n getInstrumentConfigForDivision(division);\n const [instrument, setInstrument] = useState(\n instrumentSelectConfigWithDivision[0]\n );\n\n const [granularity, setGranularity] = useState(\n granularitySelectConfigWithLang[0]\n );\n\n useEffect(() => {\n setGranularity(granularitySelectConfigWithLang[0]);\n }, [granularitySelectConfigWithLang]);\n\n return (\n <>\n {size && (\n <div\n className=\"lw-text-sm lw-tracking-normal\"\n data-testid=\"crowd-view-widget\"\n >\n <div>\n <Tabs\n mobileFullWidth\n activeTab={bookType}\n handleClick={(e) =>\n setBookType(e.currentTarget.value as BookType)\n }\n items={navigationConfig}\n labelCallback={lang}\n />\n <div\n className={cn('lw-mb-6 lw-mt-12', {\n 'lw-flex': isDesktop,\n })}\n >\n <div\n className={cn('lw-mr-2', {\n 'lw-w-full lw-mb-2': !isDesktop,\n 'lw-w-[280px]': isDesktop,\n })}\n >\n <Select\n options={instrumentSelectConfigWithDivision}\n searchPlaceholder={lang('search')}\n selectLabel={lang('instrument')}\n selectedOption={instrument}\n setSelectedOption={(val) =>\n setInstrument(val as { id: InstrumentId; label: string })\n }\n />\n </div>\n <div\n className={cn({\n 'lw-w-full': !isDesktop,\n 'lw-w-[280px]': isDesktop,\n })}\n >\n <Select\n options={granularitySelectConfigWithLang}\n searchPlaceholder={lang('search')}\n selectLabel={lang('granularity')}\n selectedOption={granularity}\n setSelectedOption={(val) =>\n setGranularity(val as { id: Granularity; label: string })\n }\n />\n </div>\n </div>\n </div>\n <ChartWithData\n bookType={bookType}\n division={division}\n granularity={granularity.id}\n instrument={instrument.id}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;AAAA,SACEA,EAAE,EACFC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAG3D,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ,gBAAgB;AAE1E,SAASC,8BAA8B,QAAQ,yBAAyB;AAExE,MAAMC,IAAI,GAAGC,IAAA,IAA6B;EAAA,IAA5B;IAAEC;EAAoB,CAAC,GAAAD,IAAA;EACnC,MAAM;IAAEE;EAAK,CAAC,GAAGb,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEc;EAAK,CAAC,GAAGf,iBAAiB,CAAC,CAAC;EACpC,MAAMgB,SAAS,GAAGD,IAAI,KAAKjB,IAAI,CAACmB,OAAO;EAEvC,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGd,QAAQ,CAACC,QAAQ,CAACc,KAAK,CAAC;EAExD,MAAMC,+BAA+B,GAAGjB,OAAO,CAC7C,MACEI,uBAAuB,CAACc,GAAG,CAAEC,GAAG,IAAAC,aAAA,CAAAA,aAAA,KAC3BD,GAAG;IACNE,KAAK,EAAEX,IAAI,CAACS,GAAG,CAACE,KAAK;EAAC,EACtB,CAAC,EACL,CAACX,IAAI,CACP,CAAC;EAED,MAAMY,kCAAkC,GACtChB,8BAA8B,CAACG,QAAQ,CAAC;EAC1C,MAAM,CAACc,UAAU,EAAEC,aAAa,CAAC,GAAGvB,QAAQ,CAC1CqB,kCAAkC,CAAC,CAAC,CACtC,CAAC;EAED,MAAM,CAACG,WAAW,EAAE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MACvB,cAAc,EAAEA;IAClB,CAAC;EAAE,GAEHd,KAAA,CAAA6B,aAAA,CAAClC,MAAM;IACL6C,OAAO,EAAErB,+BAAgC;IACzCsB,iBAAiB,EAAE7B,IAAI,CAAC,QAAQ,CAAE;IAClC8B,WAAW,EAAE9B,IAAI,CAAC,aAAa,CAAE;IACjC+B,cAAc,EAAEhB,WAAY;IAC5BiB,iBAAiB,EAAGC,GAAG,IACrBjB,cAAc,CAACiB,GAAyC;EACzD,CACF,CACE,CACF,CACF,CAAC,EACN7C,KAAA,CAAA6B,aAAA,CAACxB,aAAa;IACZW,QAAQ,EAAEA,QAAS;IACnBL,QAAQ,EAAEA,QAAS;IACnBgB,WAAW,EAAEA,WAAW,CAACmB,EAAG;IAC5BrB,UAAU,EAAEA,UAAU,CAACqB;EAAG,CAC3B,CACE,CAEP,CAAC;AAEP,CAAC;AAED,SAASrC,IAAI","ignoreList":[]}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { BaseChart, getChartTheme, Theme, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
2
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
-
import {
|
|
4
|
-
import { DataZoomInsideComponent, GraphicComponent, GridSimpleComponent, MarkPointComponent, TooltipComponent } from 'echarts/components';
|
|
3
|
+
import { CandlestickChart, CustomChart, LineChart } from 'echarts/charts';
|
|
4
|
+
import { DatasetComponent, DataZoomInsideComponent, GraphicComponent, GridSimpleComponent, MarkAreaComponent, MarkPointComponent, TooltipComponent, VisualMapComponent } from 'echarts/components';
|
|
5
5
|
import * as echarts from 'echarts/core';
|
|
6
6
|
import { CanvasRenderer } from 'echarts/renderers';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { CHART_CONFIG_CALCULATED } from '../../constants';
|
|
9
9
|
import { getOption } from './chartOptions';
|
|
10
10
|
import { formatXAxisLabel, getLabelData, isDifferenceGreaterThanTwoWeeks } from './utils/chartUtils';
|
|
11
|
-
echarts.use([GridSimpleComponent, GraphicComponent,
|
|
11
|
+
echarts.use([GridSimpleComponent, GraphicComponent, CanvasRenderer, DataZoomInsideComponent, CustomChart, TooltipComponent, CandlestickChart, MarkPointComponent, MarkAreaComponent, LineChart, VisualMapComponent, DatasetComponent]);
|
|
12
12
|
echarts.registerTheme('dark_theme', getChartTheme(Theme.Dark));
|
|
13
13
|
echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
|
|
14
14
|
const Chart = _ref => {
|
|
15
15
|
let {
|
|
16
|
-
|
|
16
|
+
mainData,
|
|
17
|
+
additionalData,
|
|
17
18
|
isDesktop
|
|
18
19
|
} = _ref;
|
|
19
20
|
const {
|
|
@@ -23,41 +24,89 @@ const Chart = _ref => {
|
|
|
23
24
|
lang
|
|
24
25
|
} = useLocale();
|
|
25
26
|
return React.createElement(BaseChart, {
|
|
26
|
-
chartHeight:
|
|
27
|
+
chartHeight: CHART_CONFIG_CALCULATED.FULL_HEIGHT,
|
|
27
28
|
echarts: echarts,
|
|
28
29
|
isDark: isDark,
|
|
29
30
|
lazyUpdate: true,
|
|
30
|
-
option: getOption(
|
|
31
|
+
option: getOption({
|
|
32
|
+
mainData,
|
|
33
|
+
additionalData,
|
|
34
|
+
isDark,
|
|
35
|
+
isDesktop,
|
|
36
|
+
labelCallback: lang
|
|
37
|
+
}),
|
|
31
38
|
opts: {
|
|
32
39
|
renderer: 'canvas'
|
|
33
40
|
},
|
|
34
41
|
onEvents: {
|
|
35
|
-
datazoom: (
|
|
42
|
+
datazoom: (params, instance) => {
|
|
43
|
+
var _params$batch, _;
|
|
44
|
+
if (!((_params$batch = params.batch) !== null && _params$batch !== void 0 && _params$batch[0])) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
36
47
|
const {
|
|
37
|
-
|
|
48
|
+
dates
|
|
49
|
+
} = mainData;
|
|
50
|
+
const batchItem = params.batch[0];
|
|
51
|
+
const {
|
|
52
|
+
start,
|
|
53
|
+
end
|
|
54
|
+
} = batchItem;
|
|
55
|
+
const {
|
|
56
|
+
dataZoom,
|
|
57
|
+
xAxis
|
|
38
58
|
} = instance.getOption();
|
|
59
|
+
if (!Array.isArray(dataZoom) || dataZoom.length === 0 || !dataZoom[0] || typeof dataZoom[0].startValue !== 'number' || typeof dataZoom[0].endValue !== 'number') {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
39
62
|
const {
|
|
40
63
|
startValue,
|
|
41
64
|
endValue
|
|
42
65
|
} = dataZoom[0];
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
}
|
|
66
|
+
if (batchItem.dataZoomId === 'main') {
|
|
67
|
+
instance.dispatchAction({
|
|
68
|
+
type: 'dataZoom',
|
|
69
|
+
dataZoomId: 'sentiment',
|
|
70
|
+
start,
|
|
71
|
+
end,
|
|
72
|
+
filterMode: 'none'
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (batchItem.dataZoomId === 'sentiment') {
|
|
76
|
+
instance.dispatchAction({
|
|
77
|
+
type: 'dataZoom',
|
|
78
|
+
dataZoomId: 'main',
|
|
79
|
+
start,
|
|
80
|
+
end,
|
|
81
|
+
filterMode: 'filter'
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (!dates[startValue] || !dates[endValue]) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const isGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks(dates[startValue], dates[endValue]);
|
|
88
|
+
const wasGreaterThanTwoWeeks = Array.isArray(xAxis) && xAxis.length > 0 && ((_ = xAxis[0]) === null || _ === void 0 ? void 0 : _.name) === 'xAxis-greater-than-two-weeks';
|
|
89
|
+
if (isGreaterThanTwoWeeks !== wasGreaterThanTwoWeeks) {
|
|
90
|
+
const labelsData = getLabelData({
|
|
91
|
+
dates,
|
|
92
|
+
isGreaterThanTwoWeeks
|
|
93
|
+
});
|
|
94
|
+
instance.setOption({
|
|
95
|
+
xAxis: {
|
|
96
|
+
id: 'main-xAxis',
|
|
97
|
+
name: isGreaterThanTwoWeeks ? 'xAxis-greater-than-two-weeks' : 'xAxis-less-than-two-weeks',
|
|
98
|
+
axisLabel: {
|
|
99
|
+
formatter: value => formatXAxisLabel(value, isGreaterThanTwoWeeks)
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
series: [{
|
|
103
|
+
id: 'candlestick',
|
|
104
|
+
markPoint: {
|
|
105
|
+
data: labelsData
|
|
106
|
+
}
|
|
107
|
+
}]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
61
110
|
}
|
|
62
111
|
}
|
|
63
112
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["BaseChart","getChartTheme","Theme","useLayoutProvider","useLocale","
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["BaseChart","getChartTheme","Theme","useLayoutProvider","useLocale","CandlestickChart","CustomChart","LineChart","DatasetComponent","DataZoomInsideComponent","GraphicComponent","GridSimpleComponent","MarkAreaComponent","MarkPointComponent","TooltipComponent","VisualMapComponent","echarts","CanvasRenderer","React","CHART_CONFIG_CALCULATED","getOption","formatXAxisLabel","getLabelData","isDifferenceGreaterThanTwoWeeks","use","registerTheme","Dark","Light","Chart","_ref","mainData","additionalData","isDesktop","isDark","lang","createElement","chartHeight","FULL_HEIGHT","lazyUpdate","option","labelCallback","opts","renderer","onEvents","datazoom","params","instance","_params$batch","_","batch","dates","batchItem","start","end","dataZoom","xAxis","Array","isArray","length","startValue","endValue","dataZoomId","dispatchAction","type","filterMode","isGreaterThanTwoWeeks","wasGreaterThanTwoWeeks","name","labelsData","setOption","id","axisLabel","formatter","value","series","markPoint","data"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n BaseChart,\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport type { EChartsType } from 'echarts';\nimport { CandlestickChart, CustomChart, LineChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n DataZoomInsideComponent,\n GraphicComponent,\n GridSimpleComponent,\n MarkAreaComponent,\n MarkPointComponent,\n TooltipComponent,\n VisualMapComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport React from 'react';\n\nimport { CHART_CONFIG_CALCULATED } from '../../constants';\nimport { getOption } from './chartOptions';\nimport type {\n ChartProps,\n DataZoomArray,\n DataZoomEvent,\n XAxisArray,\n} from './types';\nimport {\n formatXAxisLabel,\n getLabelData,\n isDifferenceGreaterThanTwoWeeks,\n} from './utils/chartUtils';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n CanvasRenderer,\n DataZoomInsideComponent,\n CustomChart,\n TooltipComponent,\n CandlestickChart,\n MarkPointComponent,\n MarkAreaComponent,\n LineChart,\n VisualMapComponent,\n DatasetComponent,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ mainData, additionalData, isDesktop }: ChartProps) => {\n const { isDark } = useLayoutProvider();\n const { lang } = useLocale();\n\n return (\n <BaseChart\n chartHeight={CHART_CONFIG_CALCULATED.FULL_HEIGHT}\n echarts={echarts}\n isDark={isDark}\n lazyUpdate={true}\n option={getOption({\n mainData,\n additionalData,\n isDark,\n isDesktop,\n labelCallback: lang,\n })}\n opts={{ renderer: 'canvas' }}\n onEvents={{\n datazoom: (params: DataZoomEvent, instance: EChartsType) => {\n if (!params.batch?.[0]) {\n return;\n }\n\n const { dates } = mainData;\n const batchItem = params.batch[0];\n const { start, end } = batchItem;\n\n const { dataZoom, xAxis } = instance.getOption();\n if (\n !Array.isArray(dataZoom) ||\n dataZoom.length === 0 ||\n !dataZoom[0] ||\n typeof dataZoom[0].startValue !== 'number' ||\n typeof dataZoom[0].endValue !== 'number'\n ) {\n return;\n }\n\n const { startValue, endValue } = dataZoom[0] as DataZoomArray[0];\n\n if (batchItem.dataZoomId === 'main') {\n instance.dispatchAction({\n type: 'dataZoom',\n dataZoomId: 'sentiment',\n start,\n end,\n filterMode: 'none',\n });\n }\n\n if (batchItem.dataZoomId === 'sentiment') {\n instance.dispatchAction({\n type: 'dataZoom',\n dataZoomId: 'main',\n start,\n end,\n filterMode: 'filter',\n });\n }\n\n if (!dates[startValue] || !dates[endValue]) {\n return;\n }\n\n const isGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks(\n dates[startValue],\n dates[endValue]\n );\n\n const wasGreaterThanTwoWeeks =\n Array.isArray(xAxis) &&\n xAxis.length > 0 &&\n (xAxis as XAxisArray)[0]?.name === 'xAxis-greater-than-two-weeks';\n\n if (isGreaterThanTwoWeeks !== wasGreaterThanTwoWeeks) {\n const labelsData = getLabelData({\n dates,\n isGreaterThanTwoWeeks,\n });\n\n instance.setOption({\n xAxis: {\n id: 'main-xAxis',\n name: isGreaterThanTwoWeeks\n ? 'xAxis-greater-than-two-weeks'\n : 'xAxis-less-than-two-weeks',\n axisLabel: {\n formatter: (value: string) =>\n formatXAxisLabel(value, isGreaterThanTwoWeeks),\n },\n },\n series: [\n {\n id: 'candlestick',\n markPoint: {\n data: labelsData,\n },\n },\n ],\n });\n }\n },\n }}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":"AAAA,SACEA,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,SAASC,gBAAgB,EAAEC,WAAW,EAAEC,SAAS,QAAQ,gBAAgB;AACzE,SACEC,gBAAgB,EAChBC,uBAAuB,EACvBC,gBAAgB,EAChBC,mBAAmB,EACnBC,iBAAiB,EACjBC,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;YACHW,UAAU,EAAE;UACd,CAAC,CAAC;QACJ;QAEA,IAAI,CAACd,KAAK,CAACS,UAAU,CAAC,IAAI,CAACT,KAAK,CAACU,QAAQ,CAAC,EAAE;UAC1C;QACF;QAEA,MAAMK,qBAAqB,GAAG1C,+BAA+B,CAC3D2B,KAAK,CAACS,UAAU,CAAC,EACjBT,KAAK,CAACU,QAAQ,CAChB,CAAC;QAED,MAAMM,sBAAsB,GAC1BV,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,IACpBA,KAAK,CAACG,MAAM,GAAG,CAAC,IAChB,EAAAV,CAAA,GAACO,KAAK,CAAgB,CAAC,CAAC,cAAAP,CAAA,uBAAxBA,CAAA,CAA0BmB,IAAI,MAAK,8BAA8B;QAEnE,IAAIF,qBAAqB,KAAKC,sBAAsB,EAAE;UACpD,MAAME,UAAU,GAAG9C,YAAY,CAAC;YAC9B4B,KAAK;YACLe;UACF,CAAC,CAAC;UAEFnB,QAAQ,CAACuB,SAAS,CAAC;YACjBd,KAAK,EAAE;cACLe,EAAE,EAAE,YAAY;cAChBH,IAAI,EAAEF,qBAAqB,GACvB,8BAA8B,GAC9B,2BAA2B;cAC/BM,SAAS,EAAE;gBACTC,SAAS,EAAGC,KAAa,IACvBpD,gBAAgB,CAACoD,KAAK,EAAER,qBAAqB;cACjD;YACF,CAAC;YACDS,MAAM,EAAE,CACN;cACEJ,EAAE,EAAE,aAAa;cACjBK,SAAS,EAAE;gBACTC,IAAI,EAAER;cACR;YACF,CAAC;UAEL,CAAC,CAAC;QACJ;MACF;IACF;EAAE,CACH,CAAC;AAEN,CAAC;AAED,SAASxC,KAAK","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChartError, Size, Spinner, SpinnerSize, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Legend } from '../Legend';
|
|
3
4
|
import { Chart } from './Chart';
|
|
4
5
|
import { useCrowdViewData } from './useCrowdViewData';
|
|
5
6
|
const ChartWithData = _ref => {
|
|
@@ -10,11 +11,13 @@ const ChartWithData = _ref => {
|
|
|
10
11
|
granularity
|
|
11
12
|
} = _ref;
|
|
12
13
|
const {
|
|
13
|
-
size
|
|
14
|
+
size,
|
|
15
|
+
isDark
|
|
14
16
|
} = useLayoutProvider();
|
|
15
17
|
const isDesktop = size === Size.DESKTOP;
|
|
16
18
|
const {
|
|
17
|
-
|
|
19
|
+
mainData,
|
|
20
|
+
additionalData,
|
|
18
21
|
loading,
|
|
19
22
|
error
|
|
20
23
|
} = useCrowdViewData({
|
|
@@ -24,19 +27,25 @@ const ChartWithData = _ref => {
|
|
|
24
27
|
granularity
|
|
25
28
|
});
|
|
26
29
|
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
27
|
-
className: "lw-relative lw-h-[
|
|
30
|
+
className: "lw-relative lw-h-[610px] lw-w-full"
|
|
28
31
|
}, error && React.createElement("div", {
|
|
29
|
-
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-
|
|
32
|
+
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary"
|
|
30
33
|
}, React.createElement(ChartError, null)), loading && React.createElement("div", {
|
|
31
|
-
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-
|
|
34
|
+
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary"
|
|
32
35
|
}, React.createElement(Spinner, {
|
|
33
36
|
size: SpinnerSize.lg
|
|
34
|
-
})), !loading && !error && !!
|
|
37
|
+
})), !loading && !error && !!mainData && !!additionalData && React.createElement("div", {
|
|
35
38
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full"
|
|
36
39
|
}, React.createElement(Chart, {
|
|
37
|
-
|
|
38
|
-
isDesktop: isDesktop
|
|
39
|
-
|
|
40
|
+
additionalData: additionalData,
|
|
41
|
+
isDesktop: isDesktop,
|
|
42
|
+
mainData: mainData
|
|
43
|
+
}))), React.createElement(Legend, {
|
|
44
|
+
bookType: bookType,
|
|
45
|
+
isDark: isDark,
|
|
46
|
+
longValues: [additionalData === null || additionalData === void 0 ? void 0 : additionalData.sentimentThresholdMin, additionalData === null || additionalData === void 0 ? void 0 : additionalData.sentimentThresholdMax],
|
|
47
|
+
shortValues: [additionalData === null || additionalData === void 0 ? void 0 : additionalData.sentimentThresholdMin, additionalData === null || additionalData === void 0 ? void 0 : additionalData.sentimentThresholdMax]
|
|
48
|
+
}));
|
|
40
49
|
};
|
|
41
50
|
export { ChartWithData };
|
|
42
51
|
//# sourceMappingURL=ChartWithData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["ChartError","Size","Spinner","SpinnerSize","useLayoutProvider","React","Chart","useCrowdViewData","ChartWithData","_ref","instrument","bookType","division","granularity","size","isDesktop","DESKTOP","
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["ChartError","Size","Spinner","SpinnerSize","useLayoutProvider","React","Legend","Chart","useCrowdViewData","ChartWithData","_ref","instrument","bookType","division","granularity","size","isDark","isDesktop","DESKTOP","mainData","additionalData","loading","error","createElement","Fragment","className","lg","longValues","sentimentThresholdMin","sentimentThresholdMax","shortValues"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/ChartWithData.tsx"],"sourcesContent":["import {\n ChartError,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport { Legend } from '../Legend';\nimport { Chart } from './Chart';\nimport type { ChartWithDataProps } from './types';\nimport { useCrowdViewData } from './useCrowdViewData';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n division,\n granularity,\n}: ChartWithDataProps) => {\n const { size, isDark } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n const { mainData, additionalData, loading, error } = useCrowdViewData({\n instrument,\n bookType,\n division,\n granularity,\n });\n\n return (\n <>\n <div className=\"lw-relative lw-h-[610px] lw-w-full\">\n {error && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )}\n {loading && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary\">\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && !error && !!mainData && !!additionalData && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full\">\n <Chart\n additionalData={additionalData}\n isDesktop={isDesktop}\n mainData={mainData}\n />\n </div>\n )}\n </div>\n <Legend\n bookType={bookType}\n isDark={isDark}\n longValues={[\n additionalData?.sentimentThresholdMin,\n additionalData?.sentimentThresholdMax,\n ]}\n shortValues={[\n additionalData?.sentimentThresholdMin,\n additionalData?.sentimentThresholdMax,\n ]}\n />\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,iBAAiB,QACZ,2BAA2B;AAClC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,QAAQ,SAAS;AAE/B,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,aAAa,GAAGC,IAAA,IAKI;EAAA,IALH;IACrBC,UAAU;IACVC,QAAQ;IACRC,QAAQ;IACRC;EACkB,CAAC,GAAAJ,IAAA;EACnB,MAAM;IAAEK,IAAI;IAAEC;EAAO,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EAC5C,MAAMa,SAAS,GAAGF,IAAI,KAAKd,IAAI,CAACiB,OAAO;EAEvC,MAAM;IAAEC,QAAQ;IAAEC,cAAc;IAAEC,OAAO;IAAEC;EAAM,CA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