@oanda/labs-crowd-view-widget 1.0.53 → 1.0.54
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 +220 -0
- package/dist/main/CrowdViewWidget/Main.js +4 -2
- package/dist/main/CrowdViewWidget/Main.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +5 -28
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +3 -10
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +30 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → chartOptions}/getGridLines.js +5 -52
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +54 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +65 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +60 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +53 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +31 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +42 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +75 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js +116 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.js +4 -4
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +14 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +42 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +14 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +108 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js +83 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +15 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -0
- package/dist/main/CrowdViewWidget/{utils/instrumentUtils.js → components/Chart/dataUtils/getInstrumentConfigForDivision.js} +3 -3
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.js +8 -8
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js +103 -0
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/index.js +11 -11
- package/dist/main/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +9 -9
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js +15 -12
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +5 -16
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/main/CrowdViewWidget/constants.js +11 -13
- package/dist/main/CrowdViewWidget/constants.js.map +1 -1
- package/dist/main/translations/sources/en.json +2 -1
- package/dist/module/CrowdViewWidget/Main.js +4 -2
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +6 -29
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +3 -10
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +23 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → chartOptions}/getGridLines.js +5 -52
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +46 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +58 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +53 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +46 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +24 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +35 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +68 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.js +4 -4
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +6 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +35 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +7 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +101 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +8 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +8 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -0
- package/dist/module/CrowdViewWidget/{utils/instrumentUtils.js → components/Chart/dataUtils/getInstrumentConfigForDivision.js} +3 -3
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.js +2 -2
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js +96 -0
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/index.js +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +2 -2
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +15 -12
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +5 -16
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +9 -12
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/translations/sources/en.json +2 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridLines.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts +9 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.d.ts +11 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.d.ts +16 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.d.ts +9 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/index.d.ts +10 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.d.ts +2 -2
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getLabelData.d.ts +17 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getRectColor.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +10 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/index.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.d.ts +1 -0
- package/dist/types/CrowdViewWidget/{utils/instrumentUtils.d.ts → components/Chart/dataUtils/getInstrumentConfigForDivision.d.ts} +2 -2
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.d.ts +2 -2
- package/dist/types/CrowdViewWidget/components/Chart/index.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Legend/Legend.d.ts +1 -4
- package/dist/types/CrowdViewWidget/components/Legend/LegendBar.d.ts +1 -3
- package/dist/types/CrowdViewWidget/constants.d.ts +3 -7
- package/package.json +3 -3
- package/src/CrowdViewWidget/Main.tsx +3 -2
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +10 -34
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +2 -15
- package/src/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.ts +13 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts +29 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts +84 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts +52 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts +82 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts +63 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +63 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.ts +32 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts +43 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts +77 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/index.ts +10 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts +16 -0
- package/src/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.ts +9 -6
- package/src/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.ts +16 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getLabelData.ts +42 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getRectColor.ts +27 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +183 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/index.ts +7 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.ts +13 -0
- package/src/CrowdViewWidget/{utils/instrumentUtils.ts → components/Chart/dataUtils/getInstrumentConfigForDivision.ts} +2 -2
- package/src/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.ts +14 -0
- package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.ts +2 -2
- package/src/CrowdViewWidget/components/Chart/getOption.ts +114 -0
- package/src/CrowdViewWidget/components/Chart/index.ts +1 -1
- package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +3 -3
- package/src/CrowdViewWidget/components/Legend/Legend.tsx +24 -22
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +13 -26
- package/src/CrowdViewWidget/constants.ts +20 -17
- package/src/translations/sources/en.json +2 -1
- package/test/components/Chart/utils/chartUtils.test.ts +7 -7
- package/test/components/Chart/utils/getChartStyles.test.ts +10 -10
- package/test/components/Chart/utils/processSentiments.test.ts +1 -1
- package/test/components/Legend.test.tsx +13 -21
- package/test/components/LegendBar.test.tsx +31 -51
- package/test/utils/instrumentUtils.test.ts +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js +0 -399
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -126
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
- package/dist/main/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js +0 -391
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -113
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
- package/dist/module/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
- package/dist/types/CrowdViewWidget/components/Chart/utils/chartUtils.d.ts +0 -30
- package/dist/types/CrowdViewWidget/components/Chart/utils/getGridLines.d.ts +0 -97
- package/src/CrowdViewWidget/components/Chart/chartOptions.ts +0 -449
- package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +0 -228
- package/src/CrowdViewWidget/components/Chart/utils/getGridLines.ts +0 -148
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.js +0 -0
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.js +0 -0
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.js +0 -0
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{chartOptions.d.ts → getOption.d.ts} +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.ts +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.ts +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.ts +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.ts +0 -0
|
@@ -1,29 +1,32 @@
|
|
|
1
|
+
import { useLayoutProvider } from '@oanda/labs-widget-common';
|
|
1
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { BookType } from '../../../gql/types/graphql';
|
|
4
5
|
import { LegendBar } from './LegendBar';
|
|
5
6
|
export const Legend = _ref => {
|
|
6
7
|
let {
|
|
7
|
-
|
|
8
|
-
shortValues,
|
|
9
|
-
bookType,
|
|
10
|
-
isDark
|
|
8
|
+
bookType
|
|
11
9
|
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
isDark
|
|
12
|
+
} = useLayoutProvider();
|
|
12
13
|
const {
|
|
13
14
|
lang
|
|
14
15
|
} = useLocale();
|
|
15
16
|
return React.createElement("div", {
|
|
16
|
-
className: "lw-
|
|
17
|
+
className: "lw-my-4 lw-w-full"
|
|
18
|
+
}, React.createElement("div", {
|
|
19
|
+
className: "lw-mb-1 lw-flex lw-w-full lw-flex-row lw-justify-between"
|
|
17
20
|
}, React.createElement(LegendBar, {
|
|
18
21
|
isDark: isDark,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
type: "long"
|
|
23
|
+
}), React.createElement("div", {
|
|
24
|
+
className: "lw-w-[250px]"
|
|
22
25
|
}), React.createElement(LegendBar, {
|
|
23
26
|
isDark: isDark,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}));
|
|
27
|
+
type: "short"
|
|
28
|
+
})), React.createElement("div", {
|
|
29
|
+
className: "lw-flex lw-w-full lw-flex-row lw-justify-between lw-pb-2 lw-font-sans lw-text-xs lw-text-text-primary"
|
|
30
|
+
}, React.createElement("span", null, lang(bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance')), React.createElement("span", null, lang('even_market_demand')), React.createElement("span", null, lang(bookType === BookType.Order ? 'sell_overbalance' : 'short_overbalance'))));
|
|
28
31
|
};
|
|
29
32
|
//# sourceMappingURL=Legend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.js","names":["useLocale","React","BookType","LegendBar","Legend","_ref","
|
|
1
|
+
{"version":3,"file":"Legend.js","names":["useLayoutProvider","useLocale","React","BookType","LegendBar","Legend","_ref","bookType","isDark","lang","createElement","className","type","Order"],"sources":["../../../../../src/CrowdViewWidget/components/Legend/Legend.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { BookType } from '../../../gql/types/graphql';\nimport { LegendBar } from './LegendBar';\n\ninterface LegendProps {\n bookType: BookType;\n}\n\nexport const Legend = ({ bookType }: LegendProps) => {\n const { isDark } = useLayoutProvider();\n const { lang } = useLocale();\n\n return (\n <div className=\"lw-my-4 lw-w-full\">\n <div className=\"lw-mb-1 lw-flex lw-w-full lw-flex-row lw-justify-between\">\n <LegendBar isDark={isDark} type=\"long\" />\n <div className=\"lw-w-[250px]\" />\n <LegendBar isDark={isDark} type=\"short\" />\n </div>\n <div className=\"lw-flex lw-w-full lw-flex-row lw-justify-between lw-pb-2 lw-font-sans lw-text-xs lw-text-text-primary\">\n <span>\n {lang(\n bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance'\n )}\n </span>\n <span>{lang('even_market_demand')}</span>\n <span>\n {lang(\n bookType === BookType.Order\n ? 'sell_overbalance'\n : 'short_overbalance'\n )}\n </span>\n </div>\n </div>\n );\n};\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,SAAS,QAAQ,aAAa;AAMvC,OAAO,MAAMC,MAAM,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EAC9C,MAAM;IAAEE;EAAO,CAAC,GAAGR,iBAAiB,CAAC,CAAC;EACtC,MAAM;IAAES;EAAK,CAAC,GAAGR,SAAS,CAAC,CAAC;EAE5B,OACEC,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAC;EAAmB,GAChCT,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAC;EAA0D,GACvET,KAAA,CAAAQ,aAAA,CAACN,SAAS;IAACI,MAAM,EAAEA,MAAO;IAACI,IAAI,EAAC;EAAM,CAAE,CAAC,EACzCV,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAC;EAAc,CAAE,CAAC,EAChCT,KAAA,CAAAQ,aAAA,CAACN,SAAS;IAACI,MAAM,EAAEA,MAAO;IAACI,IAAI,EAAC;EAAO,CAAE,CACtC,CAAC,EACNV,KAAA,CAAAQ,aAAA;IAAKC,SAAS,EAAC;EAAuG,GACpHT,KAAA,CAAAQ,aAAA,eACGD,IAAI,CACHF,QAAQ,KAAKJ,QAAQ,CAACU,KAAK,GAAG,iBAAiB,GAAG,kBACpD,CACI,CAAC,EACPX,KAAA,CAAAQ,aAAA,eAAOD,IAAI,CAAC,oBAAoB,CAAQ,CAAC,EACzCP,KAAA,CAAAQ,aAAA,eACGD,IAAI,CACHF,QAAQ,KAAKJ,QAAQ,CAACU,KAAK,GACvB,kBAAkB,GAClB,mBACN,CACI,CACH,CACF,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -2,31 +2,20 @@ import React from 'react';
|
|
|
2
2
|
import { COLOR_MAP } from '../../constants';
|
|
3
3
|
export const LegendBar = _ref => {
|
|
4
4
|
let {
|
|
5
|
-
values,
|
|
6
5
|
type,
|
|
7
|
-
label,
|
|
8
6
|
isDark
|
|
9
7
|
} = _ref;
|
|
10
8
|
const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;
|
|
11
|
-
const
|
|
9
|
+
const startColor = type === 'long' ? colorPalette.long[1] : colorPalette.short[0];
|
|
10
|
+
const endColor = type === 'long' ? colorPalette.long[0] : colorPalette.short[1];
|
|
12
11
|
return React.createElement("div", {
|
|
13
|
-
className: "lw-flex lw-
|
|
14
|
-
}, React.createElement("span", {
|
|
15
|
-
className: "lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary"
|
|
16
|
-
}, label), React.createElement("div", {
|
|
17
|
-
className: "lw-flex lw-h-2 lw-w-full lw-overflow-hidden lw-border lw-border-border-primary"
|
|
12
|
+
className: "lw-flex lw-h-2 lw-w-full lw-overflow-hidden"
|
|
18
13
|
}, React.createElement("div", {
|
|
19
14
|
className: "lw-h-full lw-flex-1",
|
|
20
15
|
"data-testid": "legend-bar-segment",
|
|
21
16
|
style: {
|
|
22
|
-
background: "linear-gradient(90deg,".concat(
|
|
17
|
+
background: "linear-gradient(90deg,".concat(startColor, " 0%, ").concat(endColor, " 100%)")
|
|
23
18
|
}
|
|
24
|
-
}))
|
|
25
|
-
className: "lw-flex lw-w-full lw-justify-between"
|
|
26
|
-
}, React.createElement("span", {
|
|
27
|
-
className: "lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary"
|
|
28
|
-
}, values[0] ? "".concat(values[0].toFixed(2), "%") : '—'), React.createElement("span", {
|
|
29
|
-
className: "lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary"
|
|
30
|
-
}, values[1] ? "\u2264 ".concat(values[1].toFixed(2), "%") : '—')));
|
|
19
|
+
}));
|
|
31
20
|
};
|
|
32
21
|
//# sourceMappingURL=LegendBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendBar.js","names":["React","COLOR_MAP","LegendBar","_ref","
|
|
1
|
+
{"version":3,"file":"LegendBar.js","names":["React","COLOR_MAP","LegendBar","_ref","type","isDark","colorPalette","dark","light","startColor","long","short","endColor","createElement","className","style","background","concat"],"sources":["../../../../../src/CrowdViewWidget/components/Legend/LegendBar.tsx"],"sourcesContent":["import React from 'react';\n\nimport { COLOR_MAP } from '../../constants';\n\nexport type LegendType = 'long' | 'short';\n\ninterface LegendBarProps {\n type: LegendType;\n isDark: boolean;\n}\n\nexport const LegendBar = ({ type, isDark }: LegendBarProps) => {\n const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;\n const startColor =\n type === 'long' ? colorPalette.long[1] : colorPalette.short[0];\n const endColor =\n type === 'long' ? colorPalette.long[0] : colorPalette.short[1];\n\n return (\n <div className=\"lw-flex lw-h-2 lw-w-full lw-overflow-hidden\">\n <div\n className=\"lw-h-full lw-flex-1\"\n data-testid=\"legend-bar-segment\"\n style={{\n background: `linear-gradient(90deg,${startColor} 0%, ${endColor} 100%)`,\n }}\n />\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,SAAS,QAAQ,iBAAiB;AAS3C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,IAAI;IAAEC;EAAuB,CAAC,GAAAF,IAAA;EACxD,MAAMG,YAAY,GAAGD,MAAM,GAAGJ,SAAS,CAACM,IAAI,GAAGN,SAAS,CAACO,KAAK;EAC9D,MAAMC,UAAU,GACdL,IAAI,KAAK,MAAM,GAAGE,YAAY,CAACI,IAAI,CAAC,CAAC,CAAC,GAAGJ,YAAY,CAACK,KAAK,CAAC,CAAC,CAAC;EAChE,MAAMC,QAAQ,GACZR,IAAI,KAAK,MAAM,GAAGE,YAAY,CAACI,IAAI,CAAC,CAAC,CAAC,GAAGJ,YAAY,CAACK,KAAK,CAAC,CAAC,CAAC;EAEhE,OACEX,KAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC;EAA6C,GAC1Dd,KAAA,CAAAa,aAAA;IACEC,SAAS,EAAC,qBAAqB;IAC/B,eAAY,oBAAoB;IAChCC,KAAK,EAAE;MACLC,UAAU,2BAAAC,MAAA,CAA2BR,UAAU,WAAAQ,MAAA,CAAQL,QAAQ;IACjE;EAAE,CACH,CACE,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { colorPalette } from '@oanda/labs-widget-common';
|
|
2
|
+
import chroma from 'chroma-js';
|
|
2
3
|
import { InstrumentId } from './types';
|
|
3
4
|
export const BUCKET_CONFIG = {
|
|
4
5
|
MULTIPLIER: 4,
|
|
@@ -8,6 +9,7 @@ export const TIME_THRESHOLDS = {
|
|
|
8
9
|
TWO_WEEKS_MS: 14 * 24 * 60 * 60 * 1000
|
|
9
10
|
};
|
|
10
11
|
export const CHART_CONFIG = {
|
|
12
|
+
HEIGHT: 440,
|
|
11
13
|
MAIN_HEIGHT: 400,
|
|
12
14
|
MARGIN_BETWEEN: 50,
|
|
13
15
|
SENTIMENT_HEIGHT: 120,
|
|
@@ -15,26 +17,21 @@ export const CHART_CONFIG = {
|
|
|
15
17
|
X_LABEL_SIZE: 40,
|
|
16
18
|
Y_LABEL_SIZE_DESKTOP: 60,
|
|
17
19
|
Y_LABEL_SIZE_MOBILE: 40,
|
|
18
|
-
|
|
20
|
+
Y_SENTIMENT_LABEL_SIZE: 40,
|
|
21
|
+
INITIAL_START_ZOOM: 90,
|
|
19
22
|
INITIAL_END_ZOOM: 100,
|
|
20
23
|
X_AXIS_DATE_PADDING: ' ',
|
|
21
24
|
SENTIMENT_MIN: 0,
|
|
22
|
-
SENTIMENT_MAX: 100
|
|
23
|
-
SENTIMENT_INTERVAL: 25,
|
|
24
|
-
SENTIMENT_TEXT_OFFSET: 16
|
|
25
|
-
};
|
|
26
|
-
export const CHART_CONFIG_CALCULATED = {
|
|
27
|
-
FULL_HEIGHT: CHART_CONFIG.MAIN_HEIGHT + CHART_CONFIG.MARGIN_BETWEEN + CHART_CONFIG.SENTIMENT_HEIGHT + CHART_CONFIG.X_LABEL_SIZE,
|
|
28
|
-
SENTIMENT_TEXT_POSITION: CHART_CONFIG.SENTIMENT_HEIGHT + CHART_CONFIG.SENTIMENT_TEXT_OFFSET
|
|
25
|
+
SENTIMENT_MAX: 100
|
|
29
26
|
};
|
|
30
27
|
export const COLOR_MAP = {
|
|
31
28
|
dark: {
|
|
32
|
-
long: [colorPalette.darkBlue10, colorPalette.darkBlue90],
|
|
33
|
-
short: [colorPalette.darkYellow10, colorPalette.darkYellow90]
|
|
29
|
+
long: [chroma(colorPalette.darkBlue10).shade(0.5).hex(), chroma(colorPalette.darkBlue90).shade(0.5).hex()],
|
|
30
|
+
short: [chroma(colorPalette.darkYellow10).shade(0.5).hex(), chroma(colorPalette.darkYellow90).shade(0.5).hex()]
|
|
34
31
|
},
|
|
35
32
|
light: {
|
|
36
|
-
long: [colorPalette.lightBlue10, colorPalette.lightBlue90],
|
|
37
|
-
short: [colorPalette.lightYellow10, colorPalette.lightYellow90]
|
|
33
|
+
long: [chroma(colorPalette.lightBlue10).tint(0.5).hex(), chroma(colorPalette.lightBlue90).tint(0.5).hex()],
|
|
34
|
+
short: [chroma(colorPalette.lightYellow10).tint(0.5).hex(), chroma(colorPalette.lightYellow90).tint(0.5).hex()]
|
|
38
35
|
}
|
|
39
36
|
};
|
|
40
37
|
export const INSTRUMENTS_CONFIG = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["colorPalette","InstrumentId","BUCKET_CONFIG","MULTIPLIER","PRICE_MARGIN_MULTIPLIER","TIME_THRESHOLDS","TWO_WEEKS_MS","CHART_CONFIG","MAIN_HEIGHT","MARGIN_BETWEEN","SENTIMENT_HEIGHT","WIDTH","X_LABEL_SIZE","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","INITIAL_START_ZOOM","INITIAL_END_ZOOM","X_AXIS_DATE_PADDING","SENTIMENT_MIN","SENTIMENT_MAX","
|
|
1
|
+
{"version":3,"file":"constants.js","names":["colorPalette","chroma","InstrumentId","BUCKET_CONFIG","MULTIPLIER","PRICE_MARGIN_MULTIPLIER","TIME_THRESHOLDS","TWO_WEEKS_MS","CHART_CONFIG","HEIGHT","MAIN_HEIGHT","MARGIN_BETWEEN","SENTIMENT_HEIGHT","WIDTH","X_LABEL_SIZE","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","Y_SENTIMENT_LABEL_SIZE","INITIAL_START_ZOOM","INITIAL_END_ZOOM","X_AXIS_DATE_PADDING","SENTIMENT_MIN","SENTIMENT_MAX","COLOR_MAP","dark","long","darkBlue10","shade","hex","darkBlue90","short","darkYellow10","darkYellow90","light","lightBlue10","tint","lightBlue90","lightYellow10","lightYellow90","INSTRUMENTS_CONFIG","EUR_AUD","mt5name","v20name","precision","defaultBucketWidth","EUR_GBP","EUR_JPY","EUR_USD","EUR_CHF","USD_CHF","USD_JPY","USD_CAD","GBP_USD","GBP_JPY","GBP_CHF","AUD_JPY","AUD_USD","NZD_USD","XAU_USD","XAG_USD"],"sources":["../../../src/CrowdViewWidget/constants.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport chroma from 'chroma-js';\n\nimport { InstrumentId } from './types';\n\nexport const BUCKET_CONFIG = {\n MULTIPLIER: 4,\n PRICE_MARGIN_MULTIPLIER: 2,\n} as const;\n\nexport const TIME_THRESHOLDS = {\n TWO_WEEKS_MS: 14 * 24 * 60 * 60 * 1000,\n} as const;\n\nexport const CHART_CONFIG = {\n HEIGHT: 440,\n MAIN_HEIGHT: 400,\n MARGIN_BETWEEN: 50,\n SENTIMENT_HEIGHT: 120,\n WIDTH: 9999,\n X_LABEL_SIZE: 40,\n Y_LABEL_SIZE_DESKTOP: 60,\n Y_LABEL_SIZE_MOBILE: 40,\n Y_SENTIMENT_LABEL_SIZE: 40,\n INITIAL_START_ZOOM: 90,\n INITIAL_END_ZOOM: 100,\n X_AXIS_DATE_PADDING: ' ',\n SENTIMENT_MIN: 0,\n SENTIMENT_MAX: 100,\n} as const;\n\nexport const COLOR_MAP = {\n dark: {\n long: [\n chroma(colorPalette.darkBlue10).shade(0.5).hex(),\n chroma(colorPalette.darkBlue90).shade(0.5).hex(),\n ],\n short: [\n chroma(colorPalette.darkYellow10).shade(0.5).hex(),\n chroma(colorPalette.darkYellow90).shade(0.5).hex(),\n ],\n },\n light: {\n long: [\n chroma(colorPalette.lightBlue10).tint(0.5).hex(),\n chroma(colorPalette.lightBlue90).tint(0.5).hex(),\n ],\n short: [\n chroma(colorPalette.lightYellow10).tint(0.5).hex(),\n chroma(colorPalette.lightYellow90).tint(0.5).hex(),\n ],\n },\n} as const;\n\nexport const INSTRUMENTS_CONFIG: Record<\n InstrumentId,\n {\n precision: number;\n defaultBucketWidth: number;\n v20name: string;\n mt5name: string;\n }\n> = {\n [InstrumentId.EUR_AUD]: {\n mt5name: 'EURAUD',\n v20name: 'EUR_AUD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.EUR_GBP]: {\n mt5name: 'EURGBP',\n v20name: 'EUR_GBP',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.EUR_JPY]: {\n mt5name: 'EURJPY',\n v20name: 'EUR_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.EUR_USD]: {\n mt5name: 'EURUSD',\n v20name: 'EUR_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.EUR_CHF]: {\n mt5name: 'EURCHF',\n v20name: 'EUR_CHF',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.USD_CHF]: {\n mt5name: 'USDCHF',\n v20name: 'USD_CHF',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.USD_JPY]: {\n mt5name: 'USDJPY',\n v20name: 'USD_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.USD_CAD]: {\n mt5name: 'USDCAD',\n v20name: 'USD_CAD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.GBP_USD]: {\n mt5name: 'GBPUSD',\n v20name: 'GBP_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.GBP_JPY]: {\n mt5name: 'GBPJPY',\n v20name: 'GBP_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.GBP_CHF]: {\n mt5name: 'GBPCHF',\n v20name: 'GBP_CHF',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.AUD_JPY]: {\n mt5name: 'AUDJPY',\n v20name: 'AUD_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.AUD_USD]: {\n mt5name: 'AUDUSD',\n v20name: 'AUD_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.NZD_USD]: {\n mt5name: 'NZDUSD',\n v20name: 'NZD_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.XAU_USD]: {\n mt5name: 'XAUUSD',\n v20name: 'XAU_USD',\n precision: 3,\n defaultBucketWidth: 0.5,\n },\n [InstrumentId.XAG_USD]: {\n mt5name: 'XAGUSD',\n v20name: 'XAG_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n};\n"],"mappings":"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","ignoreList":[]}
|
package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CandlestickSeriesOption } from 'echarts';
|
|
2
|
+
import type { ChartStyles } from '../chartUtils/getChartStyles';
|
|
3
|
+
interface GetSeriesCandlestickConfigParams {
|
|
4
|
+
dates: string[];
|
|
5
|
+
isGreaterThanTwoWeeks: boolean;
|
|
6
|
+
styles: ChartStyles;
|
|
7
|
+
}
|
|
8
|
+
export declare const getSeriesCandlestickConfig: ({ dates, isGreaterThanTwoWeeks, styles, }: GetSeriesCandlestickConfigParams) => CandlestickSeriesOption;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomSeriesOption } from 'echarts';
|
|
2
|
+
import type { Bucket } from '../types';
|
|
3
|
+
interface GetSeriesHeatmapConfigParams {
|
|
4
|
+
bucketWidth: number;
|
|
5
|
+
buckets: Bucket[][];
|
|
6
|
+
isDark: boolean;
|
|
7
|
+
sentimentThresholdMax: number;
|
|
8
|
+
sentimentThresholdMin: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const getSeriesHeatmapConfig: ({ bucketWidth, buckets, isDark, sentimentThresholdMax, sentimentThresholdMin, }: GetSeriesHeatmapConfigParams) => CustomSeriesOption;
|
|
11
|
+
export {};
|
package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LineSeriesOption } from 'echarts';
|
|
2
|
+
import type { ChartStyles } from '../chartUtils';
|
|
3
|
+
interface GetSeriesSentimentConfigParams {
|
|
4
|
+
styles: ChartStyles;
|
|
5
|
+
}
|
|
6
|
+
export declare const getSeriesSentimentConfig: ({ styles, }: GetSeriesSentimentConfigParams) => LineSeriesOption;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TooltipComponentOption } from 'echarts';
|
|
2
|
+
import type { BookType } from '../../../../gql/types/graphql';
|
|
3
|
+
import type { Bucket } from '../types';
|
|
4
|
+
interface GetTooltipConfigParams {
|
|
5
|
+
bookType: BookType;
|
|
6
|
+
bucketWidth: number;
|
|
7
|
+
buckets: Bucket[][];
|
|
8
|
+
displayPrecision: number;
|
|
9
|
+
labelCallback: (key: string, params?: Record<string, unknown>) => string;
|
|
10
|
+
selectedPriceRef: {
|
|
11
|
+
current: number;
|
|
12
|
+
};
|
|
13
|
+
tooltipLinesColor: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const getTooltipConfig: ({ bookType, bucketWidth, buckets, displayPrecision, labelCallback, selectedPriceRef, tooltipLinesColor, }: GetTooltipConfigParams) => TooltipComponentOption;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VisualMapComponentOption } from 'echarts';
|
|
2
|
+
interface GetVisualMapConfigParams {
|
|
3
|
+
sentimentLongColor: string;
|
|
4
|
+
sentimentShortColor: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const getVisualMapConfig: ({ sentimentLongColor, sentimentShortColor, }: GetVisualMapConfigParams) => VisualMapComponentOption;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { XAXisComponentOption } from 'echarts';
|
|
2
|
+
interface GetXAxisConfigParams {
|
|
3
|
+
dates: string[];
|
|
4
|
+
isGreaterThanTwoWeeks: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const getXAxisConfig: ({ dates, isGreaterThanTwoWeeks, }: GetXAxisConfigParams) => XAXisComponentOption[];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { YAXisComponentOption } from 'echarts';
|
|
2
|
+
interface GetYAxisConfigParams {
|
|
3
|
+
bucketWidth: number;
|
|
4
|
+
displayPrecision: number;
|
|
5
|
+
isDesktop: boolean;
|
|
6
|
+
labelCallback: (key: string, params?: Record<string, unknown>) => string;
|
|
7
|
+
}
|
|
8
|
+
export declare const getYAxisConfig: ({ bucketWidth, displayPrecision, isDesktop, labelCallback, }: GetYAxisConfigParams) => YAXisComponentOption[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './getDataZoomConfig';
|
|
2
|
+
export * from './getGridConfig';
|
|
3
|
+
export * from './getGridLines';
|
|
4
|
+
export * from './getSeriesCandlestickConfig';
|
|
5
|
+
export * from './getSeriesHeatmapConfig';
|
|
6
|
+
export * from './getSeriesSentimentConfig';
|
|
7
|
+
export * from './getTooltipConfig';
|
|
8
|
+
export * from './getVisualMapConfig';
|
|
9
|
+
export * from './getXAxisConfig';
|
|
10
|
+
export * from './getYAxisConfig';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatXAxisLabel: (value: unknown, isGreaterThanTwoWeeks: boolean) => string;
|
package/dist/types/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.d.ts
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface ChartStyles {
|
|
2
2
|
sentimentLongColor: string;
|
|
3
3
|
sentimentShortColor: string;
|
|
4
|
+
sentimentOutlineColor: string;
|
|
4
5
|
candleLongColor: string;
|
|
5
6
|
candleShortColor: string;
|
|
6
|
-
sentimentAreaOpacity: number;
|
|
7
7
|
tooltipLinesColor: string;
|
|
8
|
-
|
|
8
|
+
sentimentOutlineWidth: number;
|
|
9
9
|
}
|
|
10
10
|
export declare const getChartStyles: (isDark: boolean) => ChartStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getGradientColor: (value: number, startColor: string, targetColor: string, minThreshold: number, maxThreshold: number) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GetLabelsDataProps } from '../types';
|
|
2
|
+
export declare const getLabelData: ({ dates, isGreaterThanTwoWeeks, }: GetLabelsDataProps) => {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly xAxis: string;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly silent: true;
|
|
7
|
+
readonly emphasis: {
|
|
8
|
+
readonly disabled: true;
|
|
9
|
+
};
|
|
10
|
+
readonly label: {
|
|
11
|
+
readonly fontFamily: "Sofia W03";
|
|
12
|
+
readonly fontSize: 10;
|
|
13
|
+
readonly position: "bottom";
|
|
14
|
+
readonly align: "center";
|
|
15
|
+
readonly formatter: "{b}";
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRectColor: (sentiment: number, isDark: boolean, minThreshold: number, maxThreshold: number) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BookType } from '../../../../gql/types/graphql';
|
|
2
|
+
import type { Bucket, TooltipParam } from '../types';
|
|
3
|
+
export declare const getTooltipFormatter: ({ params, buckets, bucketWidth, selectedPrice, bookType, labelCallback, }: {
|
|
4
|
+
params: TooltipParam[];
|
|
5
|
+
buckets: Bucket[][];
|
|
6
|
+
bucketWidth: number;
|
|
7
|
+
selectedPrice: number;
|
|
8
|
+
bookType: BookType;
|
|
9
|
+
labelCallback: (key: string) => string;
|
|
10
|
+
}) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './formatXAxisLabel';
|
|
2
|
+
export * from './getChartStyles';
|
|
3
|
+
export * from './getGradientColor';
|
|
4
|
+
export * from './getLabelData';
|
|
5
|
+
export * from './getRectColor';
|
|
6
|
+
export * from './getTooltipFormatter';
|
|
7
|
+
export * from './isDifferenceGreaterThanTwoWeeks';
|
package/dist/types/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isDifferenceGreaterThanTwoWeeks: (startDate: string, endDate: string) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Division } from '
|
|
1
|
+
import { Division } from '../../../../gql/types/graphql';
|
|
2
2
|
export declare const getInstrumentConfigForDivision: (division: Division) => {
|
|
3
|
-
id: import("
|
|
3
|
+
id: import("../../..").InstrumentId;
|
|
4
4
|
label: string;
|
|
5
5
|
}[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './getInstrumentConfigForDivision';
|
|
2
|
+
export * from './getTimeSpanForGranularity';
|
|
3
3
|
export * from './processOrderPositionBooks';
|
|
4
4
|
export * from './processPriceCandles';
|
|
5
5
|
export * from './processSentiments';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BookType } from '../../../gql/types/graphql';
|
|
3
3
|
interface LegendProps {
|
|
4
|
-
longValues: (number | undefined)[];
|
|
5
|
-
shortValues: (number | undefined)[];
|
|
6
4
|
bookType: BookType;
|
|
7
|
-
isDark: boolean;
|
|
8
5
|
}
|
|
9
|
-
export declare const Legend: ({
|
|
6
|
+
export declare const Legend: ({ bookType }: LegendProps) => React.JSX.Element;
|
|
10
7
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type LegendType = 'long' | 'short';
|
|
3
3
|
interface LegendBarProps {
|
|
4
|
-
values: (number | undefined)[];
|
|
5
4
|
type: LegendType;
|
|
6
|
-
label: string;
|
|
7
5
|
isDark: boolean;
|
|
8
6
|
}
|
|
9
|
-
export declare const LegendBar: ({
|
|
7
|
+
export declare const LegendBar: ({ type, isDark }: LegendBarProps) => React.JSX.Element;
|
|
10
8
|
export {};
|
|
@@ -7,6 +7,7 @@ export declare const TIME_THRESHOLDS: {
|
|
|
7
7
|
readonly TWO_WEEKS_MS: number;
|
|
8
8
|
};
|
|
9
9
|
export declare const CHART_CONFIG: {
|
|
10
|
+
readonly HEIGHT: 440;
|
|
10
11
|
readonly MAIN_HEIGHT: 400;
|
|
11
12
|
readonly MARGIN_BETWEEN: 50;
|
|
12
13
|
readonly SENTIMENT_HEIGHT: 120;
|
|
@@ -14,17 +15,12 @@ export declare const CHART_CONFIG: {
|
|
|
14
15
|
readonly X_LABEL_SIZE: 40;
|
|
15
16
|
readonly Y_LABEL_SIZE_DESKTOP: 60;
|
|
16
17
|
readonly Y_LABEL_SIZE_MOBILE: 40;
|
|
17
|
-
readonly
|
|
18
|
+
readonly Y_SENTIMENT_LABEL_SIZE: 40;
|
|
19
|
+
readonly INITIAL_START_ZOOM: 90;
|
|
18
20
|
readonly INITIAL_END_ZOOM: 100;
|
|
19
21
|
readonly X_AXIS_DATE_PADDING: " ";
|
|
20
22
|
readonly SENTIMENT_MIN: 0;
|
|
21
23
|
readonly SENTIMENT_MAX: 100;
|
|
22
|
-
readonly SENTIMENT_INTERVAL: 25;
|
|
23
|
-
readonly SENTIMENT_TEXT_OFFSET: 16;
|
|
24
|
-
};
|
|
25
|
-
export declare const CHART_CONFIG_CALCULATED: {
|
|
26
|
-
FULL_HEIGHT: number;
|
|
27
|
-
SENTIMENT_TEXT_POSITION: number;
|
|
28
24
|
};
|
|
29
25
|
export declare const COLOR_MAP: {
|
|
30
26
|
readonly dark: {
|
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.54",
|
|
4
4
|
"description": "Labs Crowd View Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
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.236",
|
|
17
17
|
"@oanda/mono-i18n": "10.0.1",
|
|
18
18
|
"chroma-js": "^3.1.2",
|
|
19
19
|
"decimal.js": "^10.6.0",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@graphql-codegen/client-preset": "4.1.0",
|
|
25
25
|
"@types/chroma-js": "^3.1.2"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "f04c026db9ec11a1d0ac934dd66146c877b01570"
|
|
28
28
|
}
|
|
@@ -10,10 +10,10 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
10
10
|
|
|
11
11
|
import type { Granularity } from '../gql/types/graphql';
|
|
12
12
|
import { BookType } from '../gql/types/graphql';
|
|
13
|
-
import { ChartWithData } from './components';
|
|
13
|
+
import { ChartWithData, Legend } from './components';
|
|
14
|
+
import { getInstrumentConfigForDivision } from './components/Chart/dataUtils/getInstrumentConfigForDivision';
|
|
14
15
|
import { granularitySelectConfig, navigationConfig } from './selectConfig';
|
|
15
16
|
import type { InstrumentId, MainProps } from './types';
|
|
16
|
-
import { getInstrumentConfigForDivision } from './utils/instrumentUtils';
|
|
17
17
|
|
|
18
18
|
const Main = ({ division }: MainProps) => {
|
|
19
19
|
const { lang } = useLocale();
|
|
@@ -107,6 +107,7 @@ const Main = ({ division }: MainProps) => {
|
|
|
107
107
|
granularity={granularity.id}
|
|
108
108
|
instrument={instrument.id}
|
|
109
109
|
/>
|
|
110
|
+
<Legend bookType={bookType} />
|
|
110
111
|
</div>
|
|
111
112
|
)}
|
|
112
113
|
</>
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
DataZoomInsideComponent,
|
|
13
13
|
GraphicComponent,
|
|
14
14
|
GridSimpleComponent,
|
|
15
|
-
|
|
16
|
-
MarkPointComponent,
|
|
15
|
+
MarkLineComponent,
|
|
17
16
|
TooltipComponent,
|
|
18
17
|
VisualMapComponent,
|
|
19
18
|
} from 'echarts/components';
|
|
@@ -21,19 +20,19 @@ import * as echarts from 'echarts/core';
|
|
|
21
20
|
import { CanvasRenderer } from 'echarts/renderers';
|
|
22
21
|
import React from 'react';
|
|
23
22
|
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
23
|
+
import { CHART_CONFIG } from '../../constants';
|
|
24
|
+
import {
|
|
25
|
+
formatXAxisLabel,
|
|
26
|
+
getLabelData,
|
|
27
|
+
isDifferenceGreaterThanTwoWeeks,
|
|
28
|
+
} from './chartUtils';
|
|
29
|
+
import { getOption } from './getOption';
|
|
26
30
|
import type {
|
|
27
31
|
ChartProps,
|
|
28
32
|
DataZoomArray,
|
|
29
33
|
DataZoomEvent,
|
|
30
34
|
XAxisArray,
|
|
31
35
|
} from './types';
|
|
32
|
-
import {
|
|
33
|
-
formatXAxisLabel,
|
|
34
|
-
getLabelData,
|
|
35
|
-
isDifferenceGreaterThanTwoWeeks,
|
|
36
|
-
} from './utils/chartUtils';
|
|
37
36
|
|
|
38
37
|
echarts.use([
|
|
39
38
|
GridSimpleComponent,
|
|
@@ -43,8 +42,7 @@ echarts.use([
|
|
|
43
42
|
CustomChart,
|
|
44
43
|
TooltipComponent,
|
|
45
44
|
CandlestickChart,
|
|
46
|
-
|
|
47
|
-
MarkAreaComponent,
|
|
45
|
+
MarkLineComponent,
|
|
48
46
|
LineChart,
|
|
49
47
|
VisualMapComponent,
|
|
50
48
|
DatasetComponent,
|
|
@@ -59,7 +57,7 @@ const Chart = ({ mainData, additionalData, isDesktop }: ChartProps) => {
|
|
|
59
57
|
|
|
60
58
|
return (
|
|
61
59
|
<BaseChart
|
|
62
|
-
chartHeight={
|
|
60
|
+
chartHeight={CHART_CONFIG.HEIGHT}
|
|
63
61
|
echarts={echarts}
|
|
64
62
|
isDark={isDark}
|
|
65
63
|
lazyUpdate={true}
|
|
@@ -78,8 +76,6 @@ const Chart = ({ mainData, additionalData, isDesktop }: ChartProps) => {
|
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
const { dates } = mainData;
|
|
81
|
-
const batchItem = params.batch[0];
|
|
82
|
-
const { start, end } = batchItem;
|
|
83
79
|
|
|
84
80
|
const { dataZoom, xAxis } = instance.getOption();
|
|
85
81
|
if (
|
|
@@ -94,26 +90,6 @@ const Chart = ({ mainData, additionalData, isDesktop }: ChartProps) => {
|
|
|
94
90
|
|
|
95
91
|
const { startValue, endValue } = dataZoom[0] as DataZoomArray[0];
|
|
96
92
|
|
|
97
|
-
if (batchItem.dataZoomId === 'main') {
|
|
98
|
-
instance.dispatchAction({
|
|
99
|
-
type: 'dataZoom',
|
|
100
|
-
dataZoomId: 'sentiment',
|
|
101
|
-
start,
|
|
102
|
-
end,
|
|
103
|
-
filterMode: 'none',
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (batchItem.dataZoomId === 'sentiment') {
|
|
108
|
-
instance.dispatchAction({
|
|
109
|
-
type: 'dataZoom',
|
|
110
|
-
dataZoomId: 'main',
|
|
111
|
-
start,
|
|
112
|
-
end,
|
|
113
|
-
filterMode: 'filter',
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
93
|
if (!dates[startValue] || !dates[endValue]) {
|
|
118
94
|
return;
|
|
119
95
|
}
|