@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,12 +1,12 @@
|
|
|
1
|
-
import type { TooltipParam } from '../../../../src/CrowdViewWidget/components/Chart/types';
|
|
2
1
|
import {
|
|
3
2
|
formatXAxisLabel,
|
|
4
3
|
getLabelData,
|
|
5
4
|
getRectColor,
|
|
6
|
-
getTimeSpanForGranularity,
|
|
7
5
|
getTooltipFormatter,
|
|
8
6
|
isDifferenceGreaterThanTwoWeeks,
|
|
9
|
-
} from '../../../../src/CrowdViewWidget/components/Chart/
|
|
7
|
+
} from '../../../../src/CrowdViewWidget/components/Chart/chartUtils';
|
|
8
|
+
import { getTimeSpanForGranularity } from '../../../../src/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity';
|
|
9
|
+
import type { TooltipParam } from '../../../../src/CrowdViewWidget/components/Chart/types';
|
|
10
10
|
import { COLOR_MAP } from '../../../../src/CrowdViewWidget/constants';
|
|
11
11
|
import {
|
|
12
12
|
BookType,
|
|
@@ -231,7 +231,7 @@ describe('chartUtils', () => {
|
|
|
231
231
|
expect(html).toContain('69.50');
|
|
232
232
|
});
|
|
233
233
|
|
|
234
|
-
it('returns
|
|
234
|
+
it('returns empty string when no candlestick param is provided', () => {
|
|
235
235
|
const params: TooltipParam[] = [
|
|
236
236
|
{
|
|
237
237
|
seriesId: 'heatmap' as const,
|
|
@@ -249,10 +249,10 @@ describe('chartUtils', () => {
|
|
|
249
249
|
bookType: BookType.Order,
|
|
250
250
|
labelCallback,
|
|
251
251
|
});
|
|
252
|
-
expect(html).
|
|
252
|
+
expect(html).toBe('');
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
-
it('returns
|
|
255
|
+
it('returns empty string when params is empty', () => {
|
|
256
256
|
const html = getTooltipFormatter({
|
|
257
257
|
params: [],
|
|
258
258
|
buckets: [],
|
|
@@ -261,7 +261,7 @@ describe('chartUtils', () => {
|
|
|
261
261
|
bookType: BookType.Order,
|
|
262
262
|
labelCallback,
|
|
263
263
|
});
|
|
264
|
-
expect(html).
|
|
264
|
+
expect(html).toBe('');
|
|
265
265
|
});
|
|
266
266
|
});
|
|
267
267
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { colorPalette } from '@oanda/labs-widget-common';
|
|
2
2
|
|
|
3
|
-
import { getChartStyles } from '../../../../src/CrowdViewWidget/components/Chart/
|
|
3
|
+
import { getChartStyles } from '../../../../src/CrowdViewWidget/components/Chart/chartUtils/getChartStyles';
|
|
4
4
|
|
|
5
5
|
describe('getChartStyles', () => {
|
|
6
6
|
it('returns correct styles for dark mode', () => {
|
|
@@ -10,9 +10,9 @@ describe('getChartStyles', () => {
|
|
|
10
10
|
expect(styles.sentimentShortColor).toBe(colorPalette.darkYellow90);
|
|
11
11
|
expect(styles.candleLongColor).toBe(colorPalette.bottleGreenDark);
|
|
12
12
|
expect(styles.candleShortColor).toBe(colorPalette.orange);
|
|
13
|
-
expect(styles.
|
|
13
|
+
expect(styles.sentimentOutlineColor).toBe(colorPalette.black);
|
|
14
|
+
expect(styles.sentimentOutlineWidth).toBe(3);
|
|
14
15
|
expect(styles.tooltipLinesColor).toBe(colorPalette.orange);
|
|
15
|
-
expect(styles.sentimentLabelColor).toBe(colorPalette.white);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
it('returns correct styles for light mode', () => {
|
|
@@ -22,9 +22,9 @@ describe('getChartStyles', () => {
|
|
|
22
22
|
expect(styles.sentimentShortColor).toBe(colorPalette.lightYellow90);
|
|
23
23
|
expect(styles.candleLongColor).toBe(colorPalette.bottleGreenLight);
|
|
24
24
|
expect(styles.candleShortColor).toBe(colorPalette.raspberryLight);
|
|
25
|
-
expect(styles.
|
|
25
|
+
expect(styles.sentimentOutlineColor).toBe(colorPalette.white);
|
|
26
|
+
expect(styles.sentimentOutlineWidth).toBe(2);
|
|
26
27
|
expect(styles.tooltipLinesColor).toBe(colorPalette.bottleGreenLight);
|
|
27
|
-
expect(styles.sentimentLabelColor).toBe(colorPalette.black);
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
it('returns all required style properties', () => {
|
|
@@ -36,9 +36,9 @@ describe('getChartStyles', () => {
|
|
|
36
36
|
'sentimentShortColor',
|
|
37
37
|
'candleLongColor',
|
|
38
38
|
'candleShortColor',
|
|
39
|
-
'
|
|
39
|
+
'sentimentOutlineColor',
|
|
40
|
+
'sentimentOutlineWidth',
|
|
40
41
|
'tooltipLinesColor',
|
|
41
|
-
'sentimentLabelColor',
|
|
42
42
|
];
|
|
43
43
|
|
|
44
44
|
requiredProperties.forEach((prop) => {
|
|
@@ -53,12 +53,12 @@ describe('getChartStyles', () => {
|
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
it('returns different
|
|
56
|
+
it('returns different outline width values for dark and light modes', () => {
|
|
57
57
|
const darkStyles = getChartStyles(true);
|
|
58
58
|
const lightStyles = getChartStyles(false);
|
|
59
59
|
|
|
60
|
-
expect(darkStyles.
|
|
61
|
-
lightStyles.
|
|
60
|
+
expect(darkStyles.sentimentOutlineWidth).toBeGreaterThan(
|
|
61
|
+
lightStyles.sentimentOutlineWidth
|
|
62
62
|
);
|
|
63
63
|
});
|
|
64
64
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { processSentiments } from '../../../../src/CrowdViewWidget/components/Chart/
|
|
1
|
+
import { processSentiments } from '../../../../src/CrowdViewWidget/components/Chart/dataUtils/processSentiments';
|
|
2
2
|
import type { GetSentimentsQuery } from '../../../../src/gql/types/graphql';
|
|
3
3
|
|
|
4
4
|
describe('processSentiments', () => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { MockLayoutProvider } from '@oanda/labs-widget-common';
|
|
5
6
|
import { render } from '@testing-library/react';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
|
|
@@ -13,27 +14,21 @@ describe('Crowd View Widget', () => {
|
|
|
13
14
|
describe('components', () => {
|
|
14
15
|
describe('<Legend />', () => {
|
|
15
16
|
it('renders two LegendBar components', () => {
|
|
16
|
-
const {
|
|
17
|
-
<
|
|
18
|
-
bookType={BookType.Position}
|
|
19
|
-
|
|
20
|
-
longValues={[0.15, 0.55]}
|
|
21
|
-
shortValues={[0.15, 0.55]}
|
|
22
|
-
/>
|
|
17
|
+
const { getAllByTestId } = render(
|
|
18
|
+
<MockLayoutProvider isDark={false}>
|
|
19
|
+
<Legend bookType={BookType.Position} />
|
|
20
|
+
</MockLayoutProvider>
|
|
23
21
|
);
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
expect(
|
|
23
|
+
const segments = getAllByTestId('legend-bar-segment');
|
|
24
|
+
expect(segments.length).toBe(2);
|
|
27
25
|
});
|
|
28
26
|
|
|
29
27
|
it('passes isDark prop to LegendBar components in light mode', () => {
|
|
30
28
|
const { getAllByTestId } = render(
|
|
31
|
-
<
|
|
32
|
-
bookType={BookType.Position}
|
|
33
|
-
|
|
34
|
-
longValues={[0.15, 0.55]}
|
|
35
|
-
shortValues={[0.15, 0.55]}
|
|
36
|
-
/>
|
|
29
|
+
<MockLayoutProvider isDark={false}>
|
|
30
|
+
<Legend bookType={BookType.Position} />
|
|
31
|
+
</MockLayoutProvider>
|
|
37
32
|
);
|
|
38
33
|
const segments = getAllByTestId('legend-bar-segment');
|
|
39
34
|
expect(segments.length).toBe(2);
|
|
@@ -49,12 +44,9 @@ describe('Crowd View Widget', () => {
|
|
|
49
44
|
|
|
50
45
|
it('passes isDark prop to LegendBar components in dark mode', () => {
|
|
51
46
|
const { getAllByTestId } = render(
|
|
52
|
-
<
|
|
53
|
-
bookType={BookType.Position}
|
|
54
|
-
|
|
55
|
-
longValues={[0.15, 0.55]}
|
|
56
|
-
shortValues={[0.15, 0.55]}
|
|
57
|
-
/>
|
|
47
|
+
<MockLayoutProvider isDark={true}>
|
|
48
|
+
<Legend bookType={BookType.Position} />
|
|
49
|
+
</MockLayoutProvider>
|
|
58
50
|
);
|
|
59
51
|
const segments = getAllByTestId('legend-bar-segment');
|
|
60
52
|
expect(segments.length).toBe(2);
|
|
@@ -11,44 +11,17 @@ import { COLOR_MAP } from '../../src/CrowdViewWidget/constants';
|
|
|
11
11
|
describe('Crowd View Widget', () => {
|
|
12
12
|
describe('components', () => {
|
|
13
13
|
describe('<LegendBar />', () => {
|
|
14
|
-
const mockValues = [0.15, 0.55];
|
|
15
|
-
|
|
16
|
-
it('renders LegendBar with min and max values', () => {
|
|
17
|
-
const { getByText } = render(
|
|
18
|
-
<LegendBar
|
|
19
|
-
isDark={false}
|
|
20
|
-
label="long"
|
|
21
|
-
type="long"
|
|
22
|
-
values={mockValues}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
expect(getByText('long')).toBeInTheDocument();
|
|
27
|
-
expect(getByText('0.15%')).toBeInTheDocument();
|
|
28
|
-
expect(getByText('≤ 0.55%')).toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
14
|
it('renders exactly 1 segment', () => {
|
|
32
15
|
const { getAllByTestId } = render(
|
|
33
|
-
<LegendBar
|
|
34
|
-
isDark={false}
|
|
35
|
-
label="short"
|
|
36
|
-
type="short"
|
|
37
|
-
values={mockValues}
|
|
38
|
-
/>
|
|
16
|
+
<LegendBar isDark={false} type="short" />
|
|
39
17
|
);
|
|
40
18
|
const segments = getAllByTestId('legend-bar-segment');
|
|
41
19
|
expect(segments.length).toBe(1);
|
|
42
20
|
});
|
|
43
21
|
|
|
44
|
-
it('uses light mode colors when isDark is false', () => {
|
|
22
|
+
it('uses light mode colors when isDark is false for long type', () => {
|
|
45
23
|
const { getByTestId } = render(
|
|
46
|
-
<LegendBar
|
|
47
|
-
isDark={false}
|
|
48
|
-
label="long"
|
|
49
|
-
type="long"
|
|
50
|
-
values={mockValues}
|
|
51
|
-
/>
|
|
24
|
+
<LegendBar isDark={false} type="long" />
|
|
52
25
|
);
|
|
53
26
|
const segment = getByTestId('legend-bar-segment');
|
|
54
27
|
const style = segment.getAttribute('style');
|
|
@@ -56,15 +29,8 @@ describe('Crowd View Widget', () => {
|
|
|
56
29
|
expect(style).toContain(COLOR_MAP.light.long[1]);
|
|
57
30
|
});
|
|
58
31
|
|
|
59
|
-
it('uses dark mode colors when isDark is true', () => {
|
|
60
|
-
const { getByTestId } = render(
|
|
61
|
-
<LegendBar
|
|
62
|
-
isDark={true}
|
|
63
|
-
label="long"
|
|
64
|
-
type="long"
|
|
65
|
-
values={mockValues}
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
32
|
+
it('uses dark mode colors when isDark is true for long type', () => {
|
|
33
|
+
const { getByTestId } = render(<LegendBar isDark={true} type="long" />);
|
|
68
34
|
const segment = getByTestId('legend-bar-segment');
|
|
69
35
|
const style = segment.getAttribute('style');
|
|
70
36
|
expect(style).toContain(COLOR_MAP.dark.long[0]);
|
|
@@ -73,12 +39,7 @@ describe('Crowd View Widget', () => {
|
|
|
73
39
|
|
|
74
40
|
it('uses light mode short colors when isDark is false', () => {
|
|
75
41
|
const { getByTestId } = render(
|
|
76
|
-
<LegendBar
|
|
77
|
-
isDark={false}
|
|
78
|
-
label="short"
|
|
79
|
-
type="short"
|
|
80
|
-
values={mockValues}
|
|
81
|
-
/>
|
|
42
|
+
<LegendBar isDark={false} type="short" />
|
|
82
43
|
);
|
|
83
44
|
const segment = getByTestId('legend-bar-segment');
|
|
84
45
|
const style = segment.getAttribute('style');
|
|
@@ -88,18 +49,37 @@ describe('Crowd View Widget', () => {
|
|
|
88
49
|
|
|
89
50
|
it('uses dark mode short colors when isDark is true', () => {
|
|
90
51
|
const { getByTestId } = render(
|
|
91
|
-
<LegendBar
|
|
92
|
-
isDark={true}
|
|
93
|
-
label="short"
|
|
94
|
-
type="short"
|
|
95
|
-
values={mockValues}
|
|
96
|
-
/>
|
|
52
|
+
<LegendBar isDark={true} type="short" />
|
|
97
53
|
);
|
|
98
54
|
const segment = getByTestId('legend-bar-segment');
|
|
99
55
|
const style = segment.getAttribute('style');
|
|
100
56
|
expect(style).toContain(COLOR_MAP.dark.short[0]);
|
|
101
57
|
expect(style).toContain(COLOR_MAP.dark.short[1]);
|
|
102
58
|
});
|
|
59
|
+
|
|
60
|
+
it('renders gradient with correct direction for long type', () => {
|
|
61
|
+
const { getByTestId } = render(
|
|
62
|
+
<LegendBar isDark={false} type="long" />
|
|
63
|
+
);
|
|
64
|
+
const segment = getByTestId('legend-bar-segment');
|
|
65
|
+
const style = segment.getAttribute('style');
|
|
66
|
+
// Long type should use long[1] as start and long[0] as end
|
|
67
|
+
expect(style).toMatch(/linear-gradient\(90deg/);
|
|
68
|
+
expect(style).toContain(COLOR_MAP.light.long[1]);
|
|
69
|
+
expect(style).toContain(COLOR_MAP.light.long[0]);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('renders gradient with correct direction for short type', () => {
|
|
73
|
+
const { getByTestId } = render(
|
|
74
|
+
<LegendBar isDark={false} type="short" />
|
|
75
|
+
);
|
|
76
|
+
const segment = getByTestId('legend-bar-segment');
|
|
77
|
+
const style = segment.getAttribute('style');
|
|
78
|
+
// Short type should use short[0] as start and short[1] as end
|
|
79
|
+
expect(style).toMatch(/linear-gradient\(90deg/);
|
|
80
|
+
expect(style).toContain(COLOR_MAP.light.short[0]);
|
|
81
|
+
expect(style).toContain(COLOR_MAP.light.short[1]);
|
|
82
|
+
});
|
|
103
83
|
});
|
|
104
84
|
});
|
|
105
85
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { getInstrumentConfigForDivision } from '../../src/CrowdViewWidget/
|
|
5
|
+
import { getInstrumentConfigForDivision } from '../../src/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision';
|
|
6
6
|
import { Division } from '../../src/gql/types/graphql';
|
|
7
7
|
|
|
8
8
|
describe('instrumentUtils', () => {
|