@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CHART_CONFIG } from '../../../constants';
|
|
2
|
+
export const formatXAxisLabel = (value, isGreaterThanTwoWeeks) => {
|
|
3
|
+
const date = new Date(value);
|
|
4
|
+
return isGreaterThanTwoWeeks ? "".concat(date.toLocaleTimeString(undefined, {
|
|
5
|
+
hour: '2-digit',
|
|
6
|
+
minute: '2-digit'
|
|
7
|
+
})) : "".concat(CHART_CONFIG.X_AXIS_DATE_PADDING).concat(date.toLocaleDateString(undefined, {
|
|
8
|
+
day: 'numeric'
|
|
9
|
+
})).concat(CHART_CONFIG.X_AXIS_DATE_PADDING);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=formatXAxisLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatXAxisLabel.js","names":["CHART_CONFIG","formatXAxisLabel","value","isGreaterThanTwoWeeks","date","Date","concat","toLocaleTimeString","undefined","hour","minute","X_AXIS_DATE_PADDING","toLocaleDateString","day"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts"],"sourcesContent":["import { CHART_CONFIG } from '../../../constants';\n\nexport const formatXAxisLabel = (\n value: unknown,\n isGreaterThanTwoWeeks: boolean\n) => {\n const date = new Date(value as string);\n return isGreaterThanTwoWeeks\n ? `${date.toLocaleTimeString(undefined, {\n hour: '2-digit',\n minute: '2-digit',\n })}`\n : `${CHART_CONFIG.X_AXIS_DATE_PADDING}${date.toLocaleDateString(undefined, {\n day: 'numeric',\n })}${CHART_CONFIG.X_AXIS_DATE_PADDING}`;\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAoB;AAEjD,OAAO,MAAMC,gBAAgB,GAAGA,CAC9BC,KAAc,EACdC,qBAA8B,KAC3B;EACH,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACH,KAAe,CAAC;EACtC,OAAOC,qBAAqB,MAAAG,MAAA,CACrBF,IAAI,CAACG,kBAAkB,CAACC,SAAS,EAAE;IACpCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC,CAAC,OAAAJ,MAAA,CACCN,YAAY,CAACW,mBAAmB,EAAAL,MAAA,CAAGF,IAAI,CAACQ,kBAAkB,CAACJ,SAAS,EAAE;IACvEK,GAAG,EAAE;EACP,CAAC,CAAC,EAAAP,MAAA,CAAGN,YAAY,CAACW,mBAAmB,CAAE;AAC7C,CAAC","ignoreList":[]}
|
|
@@ -2,19 +2,19 @@ import { colorPalette } from '@oanda/labs-widget-common';
|
|
|
2
2
|
export const getChartStyles = isDark => {
|
|
3
3
|
const sentimentLongColor = isDark ? colorPalette.darkBlue90 : colorPalette.lightBlue90;
|
|
4
4
|
const sentimentShortColor = isDark ? colorPalette.darkYellow90 : colorPalette.lightYellow90;
|
|
5
|
+
const sentimentOutlineColor = isDark ? colorPalette.black : colorPalette.white;
|
|
6
|
+
const sentimentOutlineWidth = isDark ? 3 : 2;
|
|
5
7
|
const candleLongColor = isDark ? colorPalette.bottleGreenDark : colorPalette.bottleGreenLight;
|
|
6
8
|
const candleShortColor = isDark ? colorPalette.orange : colorPalette.raspberryLight;
|
|
7
|
-
const sentimentAreaOpacity = isDark ? 0.5 : 0.2;
|
|
8
9
|
const tooltipLinesColor = isDark ? colorPalette.orange : colorPalette.bottleGreenLight;
|
|
9
|
-
const sentimentLabelColor = isDark ? colorPalette.white : colorPalette.black;
|
|
10
10
|
return {
|
|
11
11
|
sentimentLongColor,
|
|
12
12
|
sentimentShortColor,
|
|
13
|
+
sentimentOutlineColor,
|
|
13
14
|
candleLongColor,
|
|
14
15
|
candleShortColor,
|
|
15
|
-
sentimentAreaOpacity,
|
|
16
16
|
tooltipLinesColor,
|
|
17
|
-
|
|
17
|
+
sentimentOutlineWidth
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=getChartStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChartStyles.js","names":["colorPalette","getChartStyles","isDark","sentimentLongColor","darkBlue90","lightBlue90","sentimentShortColor","darkYellow90","lightYellow90","sentimentOutlineColor","black","white","sentimentOutlineWidth","candleLongColor","bottleGreenDark","bottleGreenLight","candleShortColor","orange","raspberryLight","tooltipLinesColor"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\n\nexport interface ChartStyles {\n sentimentLongColor: string;\n sentimentShortColor: string;\n sentimentOutlineColor: string;\n candleLongColor: string;\n candleShortColor: string;\n tooltipLinesColor: string;\n sentimentOutlineWidth: number;\n}\n\nexport const getChartStyles = (isDark: boolean): ChartStyles => {\n const sentimentLongColor = isDark\n ? colorPalette.darkBlue90\n : colorPalette.lightBlue90;\n const sentimentShortColor = isDark\n ? colorPalette.darkYellow90\n : colorPalette.lightYellow90;\n\n const sentimentOutlineColor = isDark\n ? colorPalette.black\n : colorPalette.white;\n const sentimentOutlineWidth = isDark ? 3 : 2;\n\n const candleLongColor = isDark\n ? colorPalette.bottleGreenDark\n : colorPalette.bottleGreenLight;\n const candleShortColor = isDark\n ? colorPalette.orange\n : colorPalette.raspberryLight;\n const tooltipLinesColor = isDark\n ? colorPalette.orange\n : colorPalette.bottleGreenLight;\n\n return {\n sentimentLongColor,\n sentimentShortColor,\n sentimentOutlineColor,\n candleLongColor,\n candleShortColor,\n tooltipLinesColor,\n sentimentOutlineWidth,\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAYxD,OAAO,MAAMC,cAAc,GAAIC,MAAe,IAAkB;EAC9D,MAAMC,kBAAkB,GAAGD,MAAM,GAC7BF,YAAY,CAACI,UAAU,GACvBJ,YAAY,CAACK,WAAW;EAC5B,MAAMC,mBAAmB,GAAGJ,MAAM,GAC9BF,YAAY,CAACO,YAAY,GACzBP,YAAY,CAACQ,aAAa;EAE9B,MAAMC,qBAAqB,GAAGP,MAAM,GAChCF,YAAY,CAACU,KAAK,GAClBV,YAAY,CAACW,KAAK;EACtB,MAAMC,qBAAqB,GAAGV,MAAM,GAAG,CAAC,GAAG,CAAC;EAE5C,MAAMW,eAAe,GAAGX,MAAM,GAC1BF,YAAY,CAACc,eAAe,GAC5Bd,YAAY,CAACe,gBAAgB;EACjC,MAAMC,gBAAgB,GAAGd,MAAM,GAC3BF,YAAY,CAACiB,MAAM,GACnBjB,YAAY,CAACkB,cAAc;EAC/B,MAAMC,iBAAiB,GAAGjB,MAAM,GAC5BF,YAAY,CAACiB,MAAM,GACnBjB,YAAY,CAACe,gBAAgB;EAEjC,OAAO;IACLZ,kBAAkB;IAClBG,mBAAmB;IACnBG,qBAAqB;IACrBI,eAAe;IACfG,gBAAgB;IAChBG,iBAAiB;IACjBP;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import chroma from 'chroma-js';
|
|
2
|
+
export const getGradientColor = (value, startColor, targetColor, minThreshold, maxThreshold) => {
|
|
3
|
+
const colorScale = chroma.scale([startColor, targetColor]).domain([minThreshold, maxThreshold]).mode('rgb');
|
|
4
|
+
return colorScale(value).hex();
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=getGradientColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGradientColor.js","names":["chroma","getGradientColor","value","startColor","targetColor","minThreshold","maxThreshold","colorScale","scale","domain","mode","hex"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.ts"],"sourcesContent":["import chroma from 'chroma-js';\n\nexport const getGradientColor = (\n value: number,\n startColor: string,\n targetColor: string,\n minThreshold: number,\n maxThreshold: number\n): string => {\n const colorScale = chroma\n .scale([startColor, targetColor])\n .domain([minThreshold, maxThreshold])\n .mode('rgb');\n\n return colorScale(value).hex();\n};\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,gBAAgB,GAAGA,CAC9BC,KAAa,EACbC,UAAkB,EAClBC,WAAmB,EACnBC,YAAoB,EACpBC,YAAoB,KACT;EACX,MAAMC,UAAU,GAAGP,MAAM,CACtBQ,KAAK,CAAC,CAACL,UAAU,EAAEC,WAAW,CAAC,CAAC,CAChCK,MAAM,CAAC,CAACJ,YAAY,EAAEC,YAAY,CAAC,CAAC,CACpCI,IAAI,CAAC,KAAK,CAAC;EAEd,OAAOH,UAAU,CAACL,KAAK,CAAC,CAACS,GAAG,CAAC,CAAC;AAChC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CHART_CONFIG } from '../../../constants';
|
|
2
|
+
export const getLabelData = _ref => {
|
|
3
|
+
let {
|
|
4
|
+
dates,
|
|
5
|
+
isGreaterThanTwoWeeks
|
|
6
|
+
} = _ref;
|
|
7
|
+
return dates.filter((record, index, arr) => {
|
|
8
|
+
if (index === 0) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const previousTimestamp = arr[index - 1];
|
|
12
|
+
const currentDate = new Date(record);
|
|
13
|
+
const previousDate = new Date(previousTimestamp);
|
|
14
|
+
return isGreaterThanTwoWeeks ? currentDate.getDate() !== previousDate.getDate() : currentDate.getMonth() !== previousDate.getMonth();
|
|
15
|
+
}).map(item => ({
|
|
16
|
+
name: new Date(item).toLocaleDateString(undefined, {
|
|
17
|
+
month: isGreaterThanTwoWeeks ? 'short' : 'long',
|
|
18
|
+
day: isGreaterThanTwoWeeks ? 'numeric' : undefined
|
|
19
|
+
}),
|
|
20
|
+
xAxis: item,
|
|
21
|
+
y: CHART_CONFIG.MAIN_HEIGHT + CHART_CONFIG.X_LABEL_SIZE - 22,
|
|
22
|
+
silent: true,
|
|
23
|
+
emphasis: {
|
|
24
|
+
disabled: true
|
|
25
|
+
},
|
|
26
|
+
label: {
|
|
27
|
+
fontFamily: 'Sofia W03',
|
|
28
|
+
fontSize: 10,
|
|
29
|
+
position: 'bottom',
|
|
30
|
+
align: 'center',
|
|
31
|
+
formatter: '{b}'
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=getLabelData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLabelData.js","names":["CHART_CONFIG","getLabelData","_ref","dates","isGreaterThanTwoWeeks","filter","record","index","arr","previousTimestamp","currentDate","Date","previousDate","getDate","getMonth","map","item","name","toLocaleDateString","undefined","month","day","xAxis","y","MAIN_HEIGHT","X_LABEL_SIZE","silent","emphasis","disabled","label","fontFamily","fontSize","position","align","formatter"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getLabelData.ts"],"sourcesContent":["import { CHART_CONFIG } from '../../../constants';\nimport type { GetLabelsDataProps } from '../types';\n\nexport const getLabelData = ({\n dates,\n isGreaterThanTwoWeeks,\n}: GetLabelsDataProps) =>\n dates\n .filter((record, index, arr) => {\n if (index === 0) {\n return false;\n }\n const previousTimestamp = arr[index - 1];\n const currentDate = new Date(record);\n const previousDate = new Date(previousTimestamp);\n\n return isGreaterThanTwoWeeks\n ? currentDate.getDate() !== previousDate.getDate()\n : currentDate.getMonth() !== previousDate.getMonth();\n })\n .map(\n (item) =>\n ({\n name: new Date(item).toLocaleDateString(undefined, {\n month: isGreaterThanTwoWeeks ? 'short' : 'long',\n day: isGreaterThanTwoWeeks ? 'numeric' : undefined,\n }),\n xAxis: item,\n y: CHART_CONFIG.MAIN_HEIGHT + CHART_CONFIG.X_LABEL_SIZE - 22,\n silent: true,\n emphasis: {\n disabled: true,\n },\n label: {\n fontFamily: 'Sofia W03',\n fontSize: 10,\n position: 'bottom' as const,\n align: 'center' as const,\n formatter: '{b}',\n },\n }) as const\n );\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAoB;AAGjD,OAAO,MAAMC,YAAY,GAAGC,IAAA;EAAA,IAAC;IAC3BC,KAAK;IACLC;EACkB,CAAC,GAAAF,IAAA;EAAA,OACnBC,KAAK,CACFE,MAAM,CAAC,CAACC,MAAM,EAAEC,KAAK,EAAEC,GAAG,KAAK;IAC9B,IAAID,KAAK,KAAK,CAAC,EAAE;MACf,OAAO,KAAK;IACd;IACA,MAAME,iBAAiB,GAAGD,GAAG,CAACD,KAAK,GAAG,CAAC,CAAC;IACxC,MAAMG,WAAW,GAAG,IAAIC,IAAI,CAACL,MAAM,CAAC;IACpC,MAAMM,YAAY,GAAG,IAAID,IAAI,CAACF,iBAAiB,CAAC;IAEhD,OAAOL,qBAAqB,GACxBM,WAAW,CAACG,OAAO,CAAC,CAAC,KAAKD,YAAY,CAACC,OAAO,CAAC,CAAC,GAChDH,WAAW,CAACI,QAAQ,CAAC,CAAC,KAAKF,YAAY,CAACE,QAAQ,CAAC,CAAC;EACxD,CAAC,CAAC,CACDC,GAAG,CACDC,IAAI,KACF;IACCC,IAAI,EAAE,IAAIN,IAAI,CAACK,IAAI,CAAC,CAACE,kBAAkB,CAACC,SAAS,EAAE;MACjDC,KAAK,EAAEhB,qBAAqB,GAAG,OAAO,GAAG,MAAM;MAC/CiB,GAAG,EAAEjB,qBAAqB,GAAG,SAAS,GAAGe;IAC3C,CAAC,CAAC;IACFG,KAAK,EAAEN,IAAI;IACXO,CAAC,EAAEvB,YAAY,CAACwB,WAAW,GAAGxB,YAAY,CAACyB,YAAY,GAAG,EAAE;IAC5DC,MAAM,EAAE,IAAI;IACZC,QAAQ,EAAE;MACRC,QAAQ,EAAE;IACZ,CAAC;IACDC,KAAK,EAAE;MACLC,UAAU,EAAE,WAAW;MACvBC,QAAQ,EAAE,EAAE;MACZC,QAAQ,EAAE,QAAiB;MAC3BC,KAAK,EAAE,QAAiB;MACxBC,SAAS,EAAE;IACb;EACF,CAAC,CACL,CAAC;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { COLOR_MAP } from '../../../constants';
|
|
2
|
+
import { getGradientColor } from './getGradientColor';
|
|
3
|
+
export const getRectColor = (sentiment, isDark, minThreshold, maxThreshold) => {
|
|
4
|
+
const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;
|
|
5
|
+
return sentiment < 0 ? getGradientColor(sentiment * -1, colorPalette.short[0], colorPalette.short[1], minThreshold, maxThreshold) : getGradientColor(sentiment, colorPalette.long[0], colorPalette.long[1], minThreshold, maxThreshold);
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=getRectColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRectColor.js","names":["COLOR_MAP","getGradientColor","getRectColor","sentiment","isDark","minThreshold","maxThreshold","colorPalette","dark","light","short","long"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getRectColor.ts"],"sourcesContent":["import { COLOR_MAP } from '../../../constants';\nimport { getGradientColor } from './getGradientColor';\n\nexport const getRectColor = (\n sentiment: number,\n isDark: boolean,\n minThreshold: number,\n maxThreshold: number\n) => {\n const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;\n\n return sentiment < 0\n ? getGradientColor(\n sentiment * -1,\n colorPalette.short[0],\n colorPalette.short[1],\n minThreshold,\n maxThreshold\n )\n : getGradientColor(\n sentiment,\n colorPalette.long[0],\n colorPalette.long[1],\n minThreshold,\n maxThreshold\n );\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,OAAO,MAAMC,YAAY,GAAGA,CAC1BC,SAAiB,EACjBC,MAAe,EACfC,YAAoB,EACpBC,YAAoB,KACjB;EACH,MAAMC,YAAY,GAAGH,MAAM,GAAGJ,SAAS,CAACQ,IAAI,GAAGR,SAAS,CAACS,KAAK;EAE9D,OAAON,SAAS,GAAG,CAAC,GAChBF,gBAAgB,CACdE,SAAS,GAAG,CAAC,CAAC,EACdI,YAAY,CAACG,KAAK,CAAC,CAAC,CAAC,EACrBH,YAAY,CAACG,KAAK,CAAC,CAAC,CAAC,EACrBL,YAAY,EACZC,YACF,CAAC,GACDL,gBAAgB,CACdE,SAAS,EACTI,YAAY,CAACI,IAAI,CAAC,CAAC,CAAC,EACpBJ,YAAY,CAACI,IAAI,CAAC,CAAC,CAAC,EACpBN,YAAY,EACZC,YACF,CAAC;AACP,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BookType } from '../../../../gql/types/graphql';
|
|
2
|
+
const DATE_FORMAT_OPTIONS = {
|
|
3
|
+
hour: '2-digit',
|
|
4
|
+
minute: '2-digit',
|
|
5
|
+
year: 'numeric',
|
|
6
|
+
day: 'numeric',
|
|
7
|
+
month: 'numeric',
|
|
8
|
+
timeZoneName: 'short'
|
|
9
|
+
};
|
|
10
|
+
const SENTIMENT_DISPLAY_PRECISION = 2;
|
|
11
|
+
const calculateBucketDisplayPrecision = bucketWidth => {
|
|
12
|
+
var _bucketWidth$toString;
|
|
13
|
+
return ((_bucketWidth$toString = bucketWidth.toString().split('.')[1]) === null || _bucketWidth$toString === void 0 ? void 0 : _bucketWidth$toString.length) || 0;
|
|
14
|
+
};
|
|
15
|
+
const findSeriesParam = (params, seriesId) => {
|
|
16
|
+
return params.find(series => series.seriesId === seriesId);
|
|
17
|
+
};
|
|
18
|
+
const getSentimentOverbalanceLabel = (sentiment, bookType) => {
|
|
19
|
+
if (sentiment < 0) {
|
|
20
|
+
return bookType === BookType.Order ? 'sell_overbalance' : 'short_overbalance';
|
|
21
|
+
}
|
|
22
|
+
return bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance';
|
|
23
|
+
};
|
|
24
|
+
const formatCandleData = (candleData, labelCallback) => {
|
|
25
|
+
const [, open, close, low, high] = candleData;
|
|
26
|
+
return "<p><b>".concat(labelCallback('candle'), ":</b></p>\n<p>").concat(labelCallback('open_price'), ": ").concat(open, " </p>\n<p>").concat(labelCallback('close_price'), ": ").concat(close, " </p>\n<p>").concat(labelCallback('low'), ": ").concat(low, " </p>\n<p>").concat(labelCallback('high'), ": ").concat(high, " </p>\n");
|
|
27
|
+
};
|
|
28
|
+
const formatBookData = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
matchedBucket,
|
|
31
|
+
bucketWidth,
|
|
32
|
+
bucketDisplayPrecision,
|
|
33
|
+
bookType,
|
|
34
|
+
labelCallback
|
|
35
|
+
} = _ref;
|
|
36
|
+
const bookLabelKey = bookType === BookType.Order ? 'orders' : 'positions';
|
|
37
|
+
const priceRangeStart = matchedBucket.price.toFixed(bucketDisplayPrecision);
|
|
38
|
+
const priceRangeEnd = (matchedBucket.price + bucketWidth).toFixed(bucketDisplayPrecision);
|
|
39
|
+
const sentimentLabel = getSentimentOverbalanceLabel(matchedBucket.sentiment, bookType);
|
|
40
|
+
const sentimentValue = Math.abs(matchedBucket.sentiment).toFixed(bucketDisplayPrecision);
|
|
41
|
+
return "<br /><p><b>".concat(labelCallback(bookLabelKey), ":</b></p>\n<p>").concat(labelCallback('price_range'), ": ").concat(priceRangeStart, " - ").concat(priceRangeEnd, " </p>\n<p>").concat(labelCallback(sentimentLabel), ": ").concat(sentimentValue, "% </p>");
|
|
42
|
+
};
|
|
43
|
+
const formatSentimentData = (sentimentParam, labelCallback) => {
|
|
44
|
+
const [, shortPercent, longPercent] = sentimentParam.value;
|
|
45
|
+
return "<br /><p><b>".concat(labelCallback('sentiment'), ":</b></p>\n<p>").concat(labelCallback('long'), ": ").concat(longPercent.toFixed(SENTIMENT_DISPLAY_PRECISION), "% </p>\n<p>").concat(labelCallback('short'), ": ").concat(shortPercent.toFixed(SENTIMENT_DISPLAY_PRECISION), "% </p>");
|
|
46
|
+
};
|
|
47
|
+
const hasValidCandleData = candleData => !!candleData[1] && !!candleData[2] && !!candleData[3] && !!candleData[3];
|
|
48
|
+
const hasValidSentimentData = sentimentParam => !!(sentimentParam !== null && sentimentParam !== void 0 && sentimentParam.value[1]) && !!(sentimentParam !== null && sentimentParam !== void 0 && sentimentParam.value[2]);
|
|
49
|
+
const findMatchingBucket = (buckets, bucketsIndex, selectedPrice, bucketWidth) => {
|
|
50
|
+
if (bucketsIndex === undefined) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const selectedBuckets = buckets[bucketsIndex];
|
|
54
|
+
return selectedBuckets === null || selectedBuckets === void 0 ? void 0 : selectedBuckets.find(_ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
price
|
|
57
|
+
} = _ref2;
|
|
58
|
+
return selectedPrice >= price && selectedPrice < price + bucketWidth;
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
export const getTooltipFormatter = _ref3 => {
|
|
62
|
+
let {
|
|
63
|
+
params,
|
|
64
|
+
buckets,
|
|
65
|
+
bucketWidth,
|
|
66
|
+
selectedPrice,
|
|
67
|
+
bookType,
|
|
68
|
+
labelCallback
|
|
69
|
+
} = _ref3;
|
|
70
|
+
if (!params || !Array.isArray(params) || params.length === 0) {
|
|
71
|
+
return '';
|
|
72
|
+
}
|
|
73
|
+
const candleParam = findSeriesParam(params, 'candlestick');
|
|
74
|
+
const booksParam = findSeriesParam(params, 'heatmap');
|
|
75
|
+
const sentimentParam = findSeriesParam(params, 'sentiment');
|
|
76
|
+
if (!candleParam) {
|
|
77
|
+
return '';
|
|
78
|
+
}
|
|
79
|
+
const bucketDisplayPrecision = calculateBucketDisplayPrecision(bucketWidth);
|
|
80
|
+
const time = new Date(candleParam.axisValue);
|
|
81
|
+
const candleData = candleParam.value;
|
|
82
|
+
const bucketsIndex = booksParam === null || booksParam === void 0 ? void 0 : booksParam.value[2];
|
|
83
|
+
const matchedBucket = findMatchingBucket(buckets, bucketsIndex, selectedPrice, bucketWidth);
|
|
84
|
+
const showCandles = hasValidCandleData(candleData);
|
|
85
|
+
const showSentiment = hasValidSentimentData(sentimentParam);
|
|
86
|
+
if (!showCandles && !matchedBucket) {
|
|
87
|
+
return '';
|
|
88
|
+
}
|
|
89
|
+
const timeFormatted = time.toLocaleString(undefined, DATE_FORMAT_OPTIONS);
|
|
90
|
+
const candleSection = showCandles ? formatCandleData(candleData, labelCallback) : '';
|
|
91
|
+
const bookSection = matchedBucket ? formatBookData({
|
|
92
|
+
matchedBucket,
|
|
93
|
+
bucketWidth,
|
|
94
|
+
bucketDisplayPrecision,
|
|
95
|
+
bookType,
|
|
96
|
+
labelCallback
|
|
97
|
+
}) : '';
|
|
98
|
+
const sentimentSection = showSentiment && sentimentParam ? formatSentimentData(sentimentParam, labelCallback) : '';
|
|
99
|
+
return "<p>".concat(timeFormatted, "</p><br />\n").concat(candleSection, "\n").concat(bookSection, "\n").concat(sentimentSection);
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=getTooltipFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTooltipFormatter.js","names":["BookType","DATE_FORMAT_OPTIONS","hour","minute","year","day","month","timeZoneName","SENTIMENT_DISPLAY_PRECISION","calculateBucketDisplayPrecision","bucketWidth","_bucketWidth$toString","toString","split","length","findSeriesParam","params","seriesId","find","series","getSentimentOverbalanceLabel","sentiment","bookType","Order","formatCandleData","candleData","labelCallback","open","close","low","high","concat","formatBookData","_ref","matchedBucket","bucketDisplayPrecision","bookLabelKey","priceRangeStart","price","toFixed","priceRangeEnd","sentimentLabel","sentimentValue","Math","abs","formatSentimentData","sentimentParam","shortPercent","longPercent","value","hasValidCandleData","hasValidSentimentData","findMatchingBucket","buckets","bucketsIndex","selectedPrice","undefined","selectedBuckets","_ref2","getTooltipFormatter","_ref3","Array","isArray","candleParam","booksParam","time","Date","axisValue","showCandles","showSentiment","timeFormatted","toLocaleString","candleSection","bookSection","sentimentSection"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts"],"sourcesContent":["import { BookType } from '../../../../gql/types/graphql';\nimport type { Bucket, TooltipParam } from '../types';\n\nconst DATE_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n day: 'numeric',\n month: 'numeric',\n timeZoneName: 'short',\n};\n\nconst SENTIMENT_DISPLAY_PRECISION = 2;\n\nconst calculateBucketDisplayPrecision = (bucketWidth: number): number => {\n return bucketWidth.toString().split('.')[1]?.length || 0;\n};\n\nconst findSeriesParam = <T extends TooltipParam['seriesId']>(\n params: TooltipParam[],\n seriesId: T\n): Extract<TooltipParam, { seriesId: T }> | undefined => {\n return params.find(\n (series): series is Extract<TooltipParam, { seriesId: T }> =>\n series.seriesId === seriesId\n );\n};\n\nconst getSentimentOverbalanceLabel = (\n sentiment: number,\n bookType: BookType\n): string => {\n if (sentiment < 0) {\n return bookType === BookType.Order\n ? 'sell_overbalance'\n : 'short_overbalance';\n }\n return bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance';\n};\n\nconst formatCandleData = (\n candleData: [number, number, number, number, number],\n labelCallback: (key: string) => string\n): string => {\n const [, open, close, low, high] = candleData;\n return `<p><b>${labelCallback('candle')}:</b></p>\n<p>${labelCallback('open_price')}: ${open} </p>\n<p>${labelCallback('close_price')}: ${close} </p>\n<p>${labelCallback('low')}: ${low} </p>\n<p>${labelCallback('high')}: ${high} </p>\n`;\n};\n\nconst formatBookData = ({\n matchedBucket,\n bucketWidth,\n bucketDisplayPrecision,\n bookType,\n labelCallback,\n}: {\n matchedBucket: Bucket;\n bucketWidth: number;\n bucketDisplayPrecision: number;\n bookType: BookType;\n labelCallback: (key: string) => string;\n}): string => {\n const bookLabelKey = bookType === BookType.Order ? 'orders' : 'positions';\n const priceRangeStart = matchedBucket.price.toFixed(bucketDisplayPrecision);\n const priceRangeEnd = (matchedBucket.price + bucketWidth).toFixed(\n bucketDisplayPrecision\n );\n const sentimentLabel = getSentimentOverbalanceLabel(\n matchedBucket.sentiment,\n bookType\n );\n const sentimentValue = Math.abs(matchedBucket.sentiment).toFixed(\n bucketDisplayPrecision\n );\n\n return `<br /><p><b>${labelCallback(bookLabelKey)}:</b></p>\n<p>${labelCallback('price_range')}: ${priceRangeStart} - ${priceRangeEnd} </p>\n<p>${labelCallback(sentimentLabel)}: ${sentimentValue}% </p>`;\n};\n\nconst formatSentimentData = (\n sentimentParam: Extract<TooltipParam, { seriesId: 'sentiment' }>,\n labelCallback: (key: string) => string\n): string => {\n const [, shortPercent, longPercent] = sentimentParam.value;\n return `<br /><p><b>${labelCallback('sentiment')}:</b></p>\n<p>${labelCallback('long')}: ${longPercent.toFixed(SENTIMENT_DISPLAY_PRECISION)}% </p>\n<p>${labelCallback('short')}: ${shortPercent.toFixed(SENTIMENT_DISPLAY_PRECISION)}% </p>`;\n};\n\nconst hasValidCandleData = (\n candleData: [number, number, number, number, number]\n): boolean =>\n !!candleData[1] && !!candleData[2] && !!candleData[3] && !!candleData[3];\nconst hasValidSentimentData = (\n sentimentParam: Extract<TooltipParam, { seriesId: 'sentiment' }> | undefined\n): boolean => !!sentimentParam?.value[1] && !!sentimentParam?.value[2];\nconst findMatchingBucket = (\n buckets: Bucket[][],\n bucketsIndex: number | undefined,\n selectedPrice: number,\n bucketWidth: number\n): Bucket | undefined => {\n if (bucketsIndex === undefined) {\n return undefined;\n }\n const selectedBuckets = buckets[bucketsIndex];\n return selectedBuckets?.find(\n ({ price }) => selectedPrice >= price && selectedPrice < price + bucketWidth\n );\n};\n\nexport const getTooltipFormatter = ({\n params,\n buckets,\n bucketWidth,\n selectedPrice,\n bookType,\n labelCallback,\n}: {\n params: TooltipParam[];\n buckets: Bucket[][];\n bucketWidth: number;\n selectedPrice: number;\n bookType: BookType;\n labelCallback: (key: string) => string;\n}) => {\n if (!params || !Array.isArray(params) || params.length === 0) {\n return '';\n }\n\n const candleParam = findSeriesParam(params, 'candlestick');\n const booksParam = findSeriesParam(params, 'heatmap');\n const sentimentParam = findSeriesParam(params, 'sentiment');\n\n if (!candleParam) {\n return '';\n }\n\n const bucketDisplayPrecision = calculateBucketDisplayPrecision(bucketWidth);\n const time = new Date(candleParam.axisValue as string);\n const candleData = candleParam.value;\n const bucketsIndex = booksParam?.value[2];\n const matchedBucket = findMatchingBucket(\n buckets,\n bucketsIndex,\n selectedPrice,\n bucketWidth\n );\n const showCandles = hasValidCandleData(candleData);\n const showSentiment = hasValidSentimentData(sentimentParam);\n\n if (!showCandles && !matchedBucket) {\n return '';\n }\n\n const timeFormatted = time.toLocaleString(undefined, DATE_FORMAT_OPTIONS);\n const candleSection = showCandles\n ? formatCandleData(candleData, labelCallback)\n : '';\n const bookSection = matchedBucket\n ? formatBookData({\n matchedBucket,\n bucketWidth,\n bucketDisplayPrecision,\n bookType,\n labelCallback,\n })\n : '';\n const sentimentSection =\n showSentiment && sentimentParam\n ? formatSentimentData(sentimentParam, labelCallback)\n : '';\n\n return `<p>${timeFormatted}</p><br />\n${candleSection}\n${bookSection}\n${sentimentSection}`;\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,+BAA+B;AAGxD,MAAMC,mBAA+C,GAAG;EACtDC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE,SAA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,EAAE;EAER,aAAAK,MAAA,CAAauC,aAAa,kBAAAvC,MAAA,CAC1ByC,aAAa,QAAAzC,MAAA,CACb0C,WAAW,QAAA1C,MAAA,CACX2C,gBAAgB;AAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
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';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/index.ts"],"sourcesContent":["export * from './formatXAxisLabel';\nexport * from './getChartStyles';\nexport * from './getGradientColor';\nexport * from './getLabelData';\nexport * from './getRectColor';\nexport * from './getTooltipFormatter';\nexport * from './isDifferenceGreaterThanTwoWeeks';\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,kBAAkB;AAChC,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,uBAAuB;AACrC,cAAc,mCAAmC","ignoreList":[]}
|
package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TIME_THRESHOLDS } from '../../../constants';
|
|
2
|
+
export const isDifferenceGreaterThanTwoWeeks = (startDate, endDate) => {
|
|
3
|
+
const date1 = new Date(startDate);
|
|
4
|
+
const date2 = new Date(endDate);
|
|
5
|
+
const differenceInMs = Math.abs(date2.getTime() - date1.getTime());
|
|
6
|
+
return differenceInMs < TIME_THRESHOLDS.TWO_WEEKS_MS;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=isDifferenceGreaterThanTwoWeeks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDifferenceGreaterThanTwoWeeks.js","names":["TIME_THRESHOLDS","isDifferenceGreaterThanTwoWeeks","startDate","endDate","date1","Date","date2","differenceInMs","Math","abs","getTime","TWO_WEEKS_MS"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.ts"],"sourcesContent":["import { TIME_THRESHOLDS } from '../../../constants';\n\nexport const isDifferenceGreaterThanTwoWeeks = (\n startDate: string,\n endDate: string\n) => {\n const date1 = new Date(startDate);\n const date2 = new Date(endDate);\n\n const differenceInMs = Math.abs(date2.getTime() - date1.getTime());\n\n return differenceInMs < TIME_THRESHOLDS.TWO_WEEKS_MS;\n};\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AAEpD,OAAO,MAAMC,+BAA+B,GAAGA,CAC7CC,SAAiB,EACjBC,OAAe,KACZ;EACH,MAAMC,KAAK,GAAG,IAAIC,IAAI,CAACH,SAAS,CAAC;EACjC,MAAMI,KAAK,GAAG,IAAID,IAAI,CAACF,OAAO,CAAC;EAE/B,MAAMI,cAAc,GAAGC,IAAI,CAACC,GAAG,CAACH,KAAK,CAACI,OAAO,CAAC,CAAC,GAAGN,KAAK,CAACM,OAAO,CAAC,CAAC,CAAC;EAElE,OAAOH,cAAc,GAAGP,eAAe,CAACW,YAAY;AACtD,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Division } from '
|
|
2
|
-
import { instrumentSelectConfig, instrumentSelectConfigOC } from '
|
|
1
|
+
import { Division } from '../../../../gql/types/graphql';
|
|
2
|
+
import { instrumentSelectConfig, instrumentSelectConfigOC } from '../../../selectConfig';
|
|
3
3
|
export const getInstrumentConfigForDivision = division => {
|
|
4
4
|
return division === Division.Oc ? instrumentSelectConfigOC : instrumentSelectConfig;
|
|
5
5
|
};
|
|
6
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=getInstrumentConfigForDivision.js.map
|
package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInstrumentConfigForDivision.js","names":["Division","instrumentSelectConfig","instrumentSelectConfigOC","getInstrumentConfigForDivision","division","Oc"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.ts"],"sourcesContent":["import { Division } from '../../../../gql/types/graphql';\nimport {\n instrumentSelectConfig,\n instrumentSelectConfigOC,\n} from '../../../selectConfig';\n\nexport const getInstrumentConfigForDivision = (division: Division) => {\n return division === Division.Oc\n ? instrumentSelectConfigOC\n : instrumentSelectConfig;\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,+BAA+B;AACxD,SACEC,sBAAsB,EACtBC,wBAAwB,QACnB,uBAAuB;AAE9B,OAAO,MAAMC,8BAA8B,GAAIC,QAAkB,IAAK;EACpE,OAAOA,QAAQ,KAAKJ,QAAQ,CAACK,EAAE,GAC3BH,wBAAwB,GACxBD,sBAAsB;AAC5B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Granularity, TimeSpan } from '../../../../gql/types/graphql';
|
|
2
|
+
export const getTimeSpanForGranularity = granularity => {
|
|
3
|
+
const granularityTimeSpanMap = {
|
|
4
|
+
[Granularity.M5]: TimeSpan.TwoDays,
|
|
5
|
+
[Granularity.M15]: TimeSpan.FiveDays,
|
|
6
|
+
[Granularity.H1]: TimeSpan.TwentyDays,
|
|
7
|
+
[Granularity.H4]: TimeSpan.NinetyDays
|
|
8
|
+
};
|
|
9
|
+
return granularityTimeSpanMap[granularity] || TimeSpan.TwoDays;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=getTimeSpanForGranularity.js.map
|
package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTimeSpanForGranularity.js","names":["Granularity","TimeSpan","getTimeSpanForGranularity","granularity","granularityTimeSpanMap","M5","TwoDays","M15","FiveDays","H1","TwentyDays","H4","NinetyDays"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.ts"],"sourcesContent":["import { Granularity, TimeSpan } from '../../../../gql/types/graphql';\n\nexport const getTimeSpanForGranularity = (\n granularity: Granularity\n): TimeSpan => {\n const granularityTimeSpanMap: Record<Granularity, TimeSpan> = {\n [Granularity.M5]: TimeSpan.TwoDays,\n [Granularity.M15]: TimeSpan.FiveDays,\n [Granularity.H1]: TimeSpan.TwentyDays,\n [Granularity.H4]: TimeSpan.NinetyDays,\n };\n\n return granularityTimeSpanMap[granularity] || TimeSpan.TwoDays;\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,+BAA+B;AAErE,OAAO,MAAMC,yBAAyB,GACpCC,WAAwB,IACX;EACb,MAAMC,sBAAqD,GAAG;IAC5D,CAACJ,WAAW,CAACK,EAAE,GAAGJ,QAAQ,CAACK,OAAO;IAClC,CAACN,WAAW,CAACO,GAAG,GAAGN,QAAQ,CAACO,QAAQ;IACpC,CAACR,WAAW,CAACS,EAAE,GAAGR,QAAQ,CAACS,UAAU;IACrC,CAACV,WAAW,CAACW,EAAE,GAAGV,QAAQ,CAACW;EAC7B,CAAC;EAED,OAAOR,sBAAsB,CAACD,WAAW,CAAC,IAAIF,QAAQ,CAACK,OAAO;AAChE,CAAC","ignoreList":[]}
|
|
@@ -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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/index.ts"],"sourcesContent":["export * from './getInstrumentConfigForDivision';\nexport * from './getTimeSpanForGranularity';\nexport * from './processOrderPositionBooks';\nexport * from './processPriceCandles';\nexport * from './processSentiments';\nexport * from './validateData';\n"],"mappings":"AAAA,cAAc,kCAAkC;AAChD,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAC3C,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,gBAAgB","ignoreList":[]}
|
package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processOrderPositionBooks.js","names":["processOrderPositionBooks","orderPositionData","dates","_orderPositionData$or","_orderPositionData$or2","_orderPositionData$or3","_orderPositionData$or4","Array","isArray","length","bookPrices","bookIndexes","buckets","bucketWidth","sentimentThresholdMin","sentimentThresholdMax","hasValidBooks","orderPositionBooks","books","booksDataMap","Map","map","item","time","price","forEach","date","index","_book$price","book","get","currentBuckets","filter","bucket","sentiment","Math","abs","push"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.ts"],"sourcesContent":["import type { GetOrderPositionBooksQuery } from '../../../../gql/types/graphql';\nimport type { Bucket } from '../types';\n\nexport const processOrderPositionBooks = (\n orderPositionData: GetOrderPositionBooksQuery | undefined,\n dates: string[]\n) => {\n // Input validation\n if (!Array.isArray(dates) || dates.length === 0) {\n return {\n bookPrices: [],\n bookIndexes: [],\n buckets: [],\n bucketWidth: 0,\n sentimentThresholdMin: 0,\n sentimentThresholdMax: 0,\n hasValidBooks: false,\n };\n }\n\n if (\n !orderPositionData?.orderPositionBooks?.books?.length ||\n !orderPositionData?.orderPositionBooks?.sentimentThresholdMin ||\n !orderPositionData?.orderPositionBooks?.sentimentThresholdMax ||\n !orderPositionData?.orderPositionBooks?.bucketWidth\n ) {\n return {\n bookPrices: [],\n bookIndexes: [],\n buckets: [],\n bucketWidth: 0,\n sentimentThresholdMin: 0,\n sentimentThresholdMax: 0,\n hasValidBooks: false,\n };\n }\n\n const { bucketWidth, sentimentThresholdMin, sentimentThresholdMax } =\n orderPositionData.orderPositionBooks;\n\n const booksDataMap = new Map(\n orderPositionData.orderPositionBooks.books.map((item) => [\n item.time,\n {\n price: item.price,\n buckets: item.buckets,\n },\n ])\n );\n\n // Use forEach + push for O(n) performance instead of reduce with spreads (O(n²))\n const bookPrices: (number | null)[] = [];\n const bookIndexes: number[] = [];\n const buckets: Bucket[][] = [];\n\n dates.forEach((date, index) => {\n const book = booksDataMap.get(date);\n\n const currentBuckets =\n book?.buckets\n .filter(\n (\n bucket\n ): bucket is {\n price: number;\n sentiment: number;\n } =>\n bucket !== null &&\n typeof bucket.price === 'number' &&\n typeof bucket.sentiment === 'number' &&\n Math.abs(bucket.sentiment) >= sentimentThresholdMin\n )\n .map((bucket) => ({\n price: bucket.price,\n sentiment: bucket.sentiment,\n })) || [];\n\n bookPrices.push(book?.price ?? null);\n bookIndexes.push(index);\n buckets.push(currentBuckets);\n });\n\n return {\n bookPrices,\n bookIndexes,\n buckets,\n bucketWidth,\n sentimentThresholdMin,\n sentimentThresholdMax,\n hasValidBooks: true,\n };\n};\n"],"mappings":"AAGA,OAAO,MAAMA,yBAAyB,GAAGA,CACvCC,iBAAyD,EACzDC,KAAe,KACZ;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EAEH,IAAI,CAACC,KAAK,CAACC,OAAO,CAACN,KAAK,CAAC,IAAIA,KAAK,CAACO,MAAM,KAAK,CAAC,EAAE;IAC/C,OAAO;MACLC,UAAU,EAAE,EAAE;MACdC,WAAW,EAAE,EAAE;MACfC,OAAO,EAAE,EAAE;MACXC,WAAW,EAAE,CAAC;MACdC,qBAAqB,EAAE,CAAC;MACxBC,qBAAqB,EAAE,CAAC;MACxBC,aAA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AAMC,OAAmB,GAAG,EAAE;EAE9BV,KAAK,CAACuB,OAAO,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;IAAA,IAAAC,WAAA;IAC7B,MAAMC,IAAI,GAAGV,YAAY,CAACW,GAAG,CAACJ,IAAI,CAAC;IAEnC,MAAMK,cAAc,GAClB,CAAAF,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEjB,OAAO,CACVoB,MAAM,CAEHC,MAAM,IAKNA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,CAACT,KAAK,KAAK,QAAQ,IAChC,OAAOS,MAAM,CAACC,SAAS,KAAK,QAAQ,IACpCC,IAAI,CAACC,GAAG,CAACH,MAAM,CAACC,SAAS,CAAC,IAAIpB,qBAClC,CAAC,CACAO,GAAG,CAAEY,MAAM,KAAM;MAChBT,KAAK,EAAES,MAAM,CAACT,KAAK;MACnBU,SAAS,EAAED,MAAM,CAACC;IACpB,CAAC,CAAC,CAAC,KAAI,EAAE;IAEbxB,UAAU,CAAC2B,IAAI,EAAAT,WAAA,GAACC,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEL,KAAK,cAAAI,WAAA,cAAAA,WAAA,GAAI,IAAI,CAAC;IACpCjB,WAAW,CAAC0B,IAAI,CAACV,KAAK,CAAC;IACvBf,OAAO,CAACyB,IAAI,CAACN,cAAc,CAAC;EAC9B,CAAC,CAAC;EAEF,OAAO;IACLrB,UAAU;IACVC,WAAW;IACXC,OAAO;IACPC,WAAW;IACXC,qBAAqB;IACrBC,qBAAqB;IACrBC,aAAa,EAAE;EACjB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processPriceCandles.js","names":["processPriceCandles","priceCandlesData","_priceCandlesData$pri","_priceCandlesData$pri2","errorResult","minPrice","maxPrice","pipsLocation","hasValidCandles","candlesOpen","candlesClose","candlesLow","candlesHigh","dates","priceCandles","candle","length","reduce","acc","point","open","close","low","high","Math","min","max"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.ts"],"sourcesContent":["import type { GetPriceCandlesQuery } from '../../../../gql/types/graphql';\n\nexport const processPriceCandles = (\n priceCandlesData: GetPriceCandlesQuery | undefined\n) => {\n const errorResult = {\n minPrice: 0,\n maxPrice: 0,\n pipsLocation: 0,\n hasValidCandles: false,\n candlesOpen: [],\n candlesClose: [],\n candlesLow: [],\n candlesHigh: [],\n dates: [],\n };\n\n if (\n !priceCandlesData?.priceCandles?.candle?.length ||\n !priceCandlesData?.priceCandles?.pipsLocation\n ) {\n return errorResult;\n }\n\n const { dates, candlesOpen, candlesClose, candlesLow, candlesHigh } =\n priceCandlesData.priceCandles.candle.reduce(\n (acc, candle) => {\n if (!candle) {\n return acc;\n }\n\n return {\n dates: [...acc.dates, candle.point],\n candlesOpen: [...acc.candlesOpen, candle.open],\n candlesClose: [...acc.candlesClose, candle.close],\n candlesLow: [...acc.candlesLow, candle.low],\n candlesHigh: [...acc.candlesHigh, candle.high],\n };\n },\n {\n dates: [] as string[],\n candlesOpen: [] as number[],\n candlesClose: [] as number[],\n candlesLow: [] as number[],\n candlesHigh: [] as number[],\n }\n );\n\n if (dates.length === 0) {\n return errorResult;\n }\n\n const minPrice = Math.min(...candlesLow);\n const maxPrice = Math.max(...candlesHigh);\n\n return {\n minPrice,\n maxPrice,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n dates,\n hasValidCandles: true,\n pipsLocation: priceCandlesData.priceCandles.pipsLocation,\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,mBAAmB,GAC9BC,gBAAkD,IAC/C;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EACH,MAAMC,WAAW,GAAG;IAClBC,QAAQ,EAAE,CAAC;IACXC,QAAQ,EAAE,CAAC;IACXC,YAAY,EAAE,CAAC;IACfC,eAAe,EAAE,KAAK;IACtBC,WAAW,EAAE,EAAE;IACfC,YAAY,EAAE,EAAE;IAChBC,UAAU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;EAEH,IAAIC,KAAK,CAACG,MAAM,KAAK,CAAC,EAAE;IACtB,OAAOZ,WAAW;EACpB;EAEA,MAAMC,QAAQ,GAAGmB,IAAI,CAACC,GAAG,CAAC,GAAGd,UAAU,CAAC;EACxC,MAAML,QAAQ,GAAGkB,IAAI,CAACE,GAAG,CAAC,GAAGd,WAAW,CAAC;EAEzC,OAAO;IACLP,QAAQ;IACRC,QAAQ;IACRG,WAAW;IACXC,YAAY;IACZC,UAAU;IACVC,WAAW;IACXC,KAAK;IACLL,eAAe,EAAE,IAAI;IACrBD,YAAY,EAAEN,gBAAgB,CAACa,YAAY,CAACP;EAC9C,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processSentiments.js","names":["processSentiments","sentimentsData","dates","_sentimentsData$senti","Array","isArray","length","sentiments","sentimentLongs","sentimentShorts","hasValidSentiments","sentimentMap","Map","map","item","_item$sentiment$short","_item$sentiment","_item$sentiment$longP","_item$sentiment2","time","sentiment","shortPercent","longPercent","reduce","acc","date","get"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/processSentiments.ts"],"sourcesContent":["import type { GetSentimentsQuery } from '../../../../gql/types/graphql';\n\nexport const processSentiments = (\n sentimentsData: GetSentimentsQuery | undefined,\n dates: string[]\n) => {\n if (\n !Array.isArray(dates) ||\n dates.length === 0 ||\n !sentimentsData?.sentiments?.sentiments?.length\n ) {\n return {\n sentimentLongs: [],\n sentimentShorts: [],\n hasValidSentiments: false,\n };\n }\n\n const sentimentMap = new Map(\n sentimentsData.sentiments.sentiments.map((item) => [\n item?.time,\n {\n sentimentShorts: item?.sentiment?.shortPercent ?? null,\n sentimentLongs: item?.sentiment?.longPercent ?? null,\n },\n ])\n );\n\n const { sentimentLongs, sentimentShorts } = dates.reduce(\n (acc, date) => {\n const sentiment = sentimentMap.get(date);\n\n return {\n sentimentLongs: [\n ...acc.sentimentLongs,\n sentiment?.sentimentLongs || null,\n ],\n sentimentShorts: [\n ...acc.sentimentShorts,\n sentiment?.sentimentShorts || null,\n ],\n };\n },\n {\n sentimentLongs: [] as (number | null)[],\n sentimentShorts: [] as (number | null)[],\n }\n );\n\n return {\n sentimentLongs,\n sentimentShorts,\n hasValidSentiments: true,\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,iBAAiB,GAAGA,CAC/BC,cAA8C,EAC9CC,KAAe,KACZ;EAAA,IAAAC,qBAAA;EACH,IACE,CAACC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,IACrBA,KAAK,CAACI,MAAM,KAAK,CAAC,IAClB,EAACL,cAAc,aAAdA,cAAc,gBAAAE,qBAAA,GAAdF,cAAc,CAAEM,UAAU,cAAAJ,qBAAA,gBAAAA,qBAAA,GAA1BA,qBAAA,CAA4BI,UAAU,cAAAJ,qBAAA,eAAtCA,qBAAA,CAAwCG,MAAM,GAC/C;IACA,OAAO;MACLE,cAAc,EAAE,EAAE;MAClBC,eAAe,EAAE,EAAE;MACnBC,kBAAkB,EAAE;IACtB,CAAC;EACH;EAEA,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAC1BX,cAAc,CAACM,UAAU,CAACA,UAAU,CAACM,GAAG,CAAEC,IAAI;IAAA,IAAAC,qBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,gBAAA;IAAA,OAAK,CACjDJ,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEK,IAAI,EACV;MACEV,eAAe,GAAAM,qBAAA,GAAED,IAAI,aAAJA,IAAI,gBAAAE,eAAA,GAAJF,IAAI,CAAEM,SAAS,cAAAJ,eAAA,uBAAfA,eAAA,CAAiBK,YAAY,cAAAN,qBAAA,cAAAA,qBAAA,GAAI,IAAI;MACtDP,cAAc,GAAAS,qBAAA,GAAEH,IAAI,aAAJA,IAAI,gBAAAI,gBAAA,GAAJJ,IAAI,CAAEM,SAAS,cAAAF,gBAAA,uBAAfA,gBAAA,CAAiBI,WAAW,cAAAL,qBAAA,cAAAA,qBAAA,GAAI;IAClD,CAAC,CACF;EAAA,EACH,CAAC;EAED,MAAM;IAAET,cAAc;IAAEC;EAAgB,CAAC,GAAGP,KAAK,CAACqB,MAAM,CACtD,CAACC,GAAG,EAAEC,IAAI,KAAK;IACb,MAAML,SAAS,GAAGT,YAAY,CAACe,GAAG,CAACD,IAAI,CAAC;IAExC,OAAO;MACLjB,cAAc,EAAE,CACd,GAAGgB,GAAG,CAAChB,cAAc,EACrB,CAAAY,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEZ,cAAc,KAAI,IAAI,CAClC;MACDC,eAAe,EAAE,CACf,GAAGe,GAAG,CAACf,eAAe,EACtB,CAAAW,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEX,eAAe,KAAI,IAAI;IAEtC,CAAC;EACH,CAAC,EACD;IACED,cAAc,EAAE,EAAuB;IACvCC,eAAe,EAAE;EACnB,CACF,CAAC;EAED,OAAO;IACLD,cAAc;IACdC,eAAe;IACfC,kBAAkB,EAAE;EACtB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateData.js","names":["validateData","priceCandlesData","orderPositionData","hasValidCandles","hasValidBooks","hasValidSentiments","_priceCandlesData$pri","_priceCandlesData$pri2","_orderPositionData$or","_orderPositionData$or2","hasValidPriceData","priceCandles","candle","length","hasValidOrderData","orderPositionBooks","books","Error"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/dataUtils/validateData.ts"],"sourcesContent":["import type {\n GetOrderPositionBooksQuery,\n GetPriceCandlesQuery,\n} from '../../../../gql/types/graphql';\n\nexport const validateData = (\n priceCandlesData: GetPriceCandlesQuery | undefined,\n orderPositionData: GetOrderPositionBooksQuery | undefined,\n hasValidCandles: boolean,\n hasValidBooks: boolean,\n hasValidSentiments: boolean\n): Error | null => {\n const hasValidPriceData =\n (priceCandlesData?.priceCandles?.candle?.length ?? 0) >= 1;\n const hasValidOrderData =\n (orderPositionData?.orderPositionBooks?.books?.length ?? 0) >= 1;\n\n if (!hasValidPriceData) {\n return new Error('Insufficient price candle data');\n }\n if (!hasValidOrderData) {\n return new Error('Insufficient order position data');\n }\n if (!hasValidCandles) {\n return new Error('Invalid candle data');\n }\n if (!hasValidBooks) {\n return new Error('Invalid book data');\n }\n if (!hasValidSentiments) {\n return new Error('Invalid sentiment data');\n }\n\n return null;\n};\n"],"mappings":"AAKA,OAAO,MAAMA,YAAY,GAAGA,CAC1BC,gBAAkD,EAClDC,iBAAyD,EACzDC,eAAwB,EACxBC,aAAsB,EACtBC,kBAA2B,KACV;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,sBAAA;EACjB,MAAMC,iBAAiB,GACrB,EAAAJ,qBAAA,GAACL,gBAAgB,aAAhBA,gBAAgB,gBAAAM,sBAAA,GAAhBN,gBAAgB,CAAEU,YAAY,cAAAJ,sBAAA,gBAAAA,sBAAA,GAA9BA,sBAAA,CAAgCK,MAAM,cAAAL,sBAAA,uBAAtCA,sBAAA,CAAwCM,MAAM,cAAAP,qBAAA,cAAAA,qBAAA,GAAI,CAAC,KAAK,CAAC;EAC5D,MAAMQ,iBAAiB,GACrB,EAAAN,qBAAA,GAACN,iBAAiB,aAAjBA,iBAAiB,gBAAAO,sBAAA,GAAjBP,iBAAiB,CAAEa,kBAAkB,cAAAN,sBAAA,gBAAAA,sBAAA,GAArCA,sBAAA,CAAuCO,KAAK,cAAAP,sBAAA,uBAA5CA,sBAAA,CAA8CI,MAAM,cAAAL,qBAAA,cAAAA,qBAAA,GAAI,CAAC,KAAK,CAAC;EAElE,IAAI,CAACE,iBAAiB,EAAE;IACtB,OAAO,IAAIO,KAAK,CAAC,gCAAgC,CAAC;EACpD;EACA,IAAI,CAACH,iBAAiB,EAAE;IACtB,OAAO,IAAIG,KAAK,CAAC,kCAAkC,CAAC;EACtD;EACA,IAAI,CAACd,eAAe,EAAE;IACpB,OAAO,IAAIc,KAAK,CAAC,qBAAqB,CAAC;EACzC;EACA,IAAI,CAACb,aAAa,EAAE;IAClB,OAAO,IAAIa,KAAK,CAAC,mBAAmB,CAAC;EACvC;EACA,IAAI,CAACZ,kBAAkB,EAAE;IACvB,OAAO,IAAIY,KAAK,CAAC,wBAAwB,CAAC;EAC5C;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CHART_CONFIG } from '../../constants';
|
|
2
|
+
import { getDataZoomConfig, getGridConfig, getGridLines, getSeriesCandlestickConfig, getSeriesHeatmapConfig, getSeriesSentimentConfig, getTooltipConfig, getVisualMapConfig, getXAxisConfig, getYAxisConfig } from './chartOptions';
|
|
3
|
+
import { isDifferenceGreaterThanTwoWeeks } from './chartUtils';
|
|
4
|
+
import { getChartStyles } from './chartUtils/getChartStyles';
|
|
5
|
+
export const getOption = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
mainData: {
|
|
8
|
+
dates,
|
|
9
|
+
candlesOpen,
|
|
10
|
+
candlesClose,
|
|
11
|
+
candlesLow,
|
|
12
|
+
candlesHigh,
|
|
13
|
+
bookPrices,
|
|
14
|
+
bookIndexes,
|
|
15
|
+
sentimentShorts,
|
|
16
|
+
sentimentLongs
|
|
17
|
+
},
|
|
18
|
+
additionalData: {
|
|
19
|
+
bucketWidth,
|
|
20
|
+
buckets,
|
|
21
|
+
displayPrecision,
|
|
22
|
+
bookType,
|
|
23
|
+
sentimentThresholdMin,
|
|
24
|
+
sentimentThresholdMax
|
|
25
|
+
},
|
|
26
|
+
isDark,
|
|
27
|
+
isDesktop,
|
|
28
|
+
labelCallback
|
|
29
|
+
} = _ref;
|
|
30
|
+
const styles = getChartStyles(isDark);
|
|
31
|
+
const selectedPriceRef = {
|
|
32
|
+
current: 0
|
|
33
|
+
};
|
|
34
|
+
const visibleXAxisData = dates.slice(dates.length * CHART_CONFIG.INITIAL_START_ZOOM / 100, dates.length * CHART_CONFIG.INITIAL_END_ZOOM / 100);
|
|
35
|
+
const isGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks(visibleXAxisData[0], visibleXAxisData[visibleXAxisData.length - 1]);
|
|
36
|
+
return {
|
|
37
|
+
animation: false,
|
|
38
|
+
tooltip: getTooltipConfig({
|
|
39
|
+
bookType,
|
|
40
|
+
bucketWidth,
|
|
41
|
+
buckets,
|
|
42
|
+
displayPrecision,
|
|
43
|
+
labelCallback,
|
|
44
|
+
selectedPriceRef,
|
|
45
|
+
tooltipLinesColor: styles.tooltipLinesColor
|
|
46
|
+
}),
|
|
47
|
+
grid: getGridConfig({
|
|
48
|
+
isDesktop
|
|
49
|
+
}),
|
|
50
|
+
xAxis: getXAxisConfig({
|
|
51
|
+
dates,
|
|
52
|
+
isGreaterThanTwoWeeks
|
|
53
|
+
}),
|
|
54
|
+
yAxis: getYAxisConfig({
|
|
55
|
+
bucketWidth,
|
|
56
|
+
displayPrecision,
|
|
57
|
+
isDesktop,
|
|
58
|
+
labelCallback
|
|
59
|
+
}),
|
|
60
|
+
dataZoom: getDataZoomConfig(),
|
|
61
|
+
visualMap: getVisualMapConfig({
|
|
62
|
+
sentimentLongColor: styles.sentimentLongColor,
|
|
63
|
+
sentimentShortColor: styles.sentimentShortColor
|
|
64
|
+
}),
|
|
65
|
+
graphic: getGridLines({
|
|
66
|
+
isDark
|
|
67
|
+
}),
|
|
68
|
+
dataset: {
|
|
69
|
+
source: {
|
|
70
|
+
dates,
|
|
71
|
+
candlesOpen,
|
|
72
|
+
candlesClose,
|
|
73
|
+
candlesLow,
|
|
74
|
+
candlesHigh,
|
|
75
|
+
bookPrices: bookPrices !== null && bookPrices !== void 0 ? bookPrices : [],
|
|
76
|
+
bookIndexes: bookIndexes !== null && bookIndexes !== void 0 ? bookIndexes : [],
|
|
77
|
+
sentimentShorts,
|
|
78
|
+
sentimentLongs
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
series: [getSeriesCandlestickConfig({
|
|
82
|
+
dates,
|
|
83
|
+
isGreaterThanTwoWeeks,
|
|
84
|
+
styles
|
|
85
|
+
}), getSeriesHeatmapConfig({
|
|
86
|
+
bucketWidth,
|
|
87
|
+
buckets,
|
|
88
|
+
isDark,
|
|
89
|
+
sentimentThresholdMax,
|
|
90
|
+
sentimentThresholdMin
|
|
91
|
+
}), getSeriesSentimentConfig({
|
|
92
|
+
styles
|
|
93
|
+
})]
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=getOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOption.js","names":["CHART_CONFIG","getDataZoomConfig","getGridConfig","getGridLines","getSeriesCandlestickConfig","getSeriesHeatmapConfig","getSeriesSentimentConfig","getTooltipConfig","getVisualMapConfig","getXAxisConfig","getYAxisConfig","isDifferenceGreaterThanTwoWeeks","getChartStyles","getOption","_ref","mainData","dates","candlesOpen","candlesClose","candlesLow","candlesHigh","bookPrices","bookIndexes","sentimentShorts","sentimentLongs","additionalData","bucketWidth","buckets","displayPrecision","bookType","sentimentThresholdMin","sentimentThresholdMax","isDark","isDesktop","labelCallback","styles","selectedPriceRef","current","visibleXAxisData","slice","length","INITIAL_START_ZOOM","INITIAL_END_ZOOM","isGreaterThanTwoWeeks","animation","tooltip","tooltipLinesColor","grid","xAxis","yAxis","dataZoom","visualMap","sentimentLongColor","sentimentShortColor","graphic","dataset","source","series"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/getOption.ts"],"sourcesContent":["import { CHART_CONFIG } from '../../constants';\nimport {\n getDataZoomConfig,\n getGridConfig,\n getGridLines,\n getSeriesCandlestickConfig,\n getSeriesHeatmapConfig,\n getSeriesSentimentConfig,\n getTooltipConfig,\n getVisualMapConfig,\n getXAxisConfig,\n getYAxisConfig,\n} from './chartOptions';\nimport { isDifferenceGreaterThanTwoWeeks } from './chartUtils';\nimport { getChartStyles } from './chartUtils/getChartStyles';\nimport type { GetOptionType } from './types';\n\nexport const getOption: GetOptionType = ({\n mainData: {\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n bookPrices,\n bookIndexes,\n sentimentShorts,\n sentimentLongs,\n },\n additionalData: {\n bucketWidth,\n buckets,\n displayPrecision,\n bookType,\n sentimentThresholdMin,\n sentimentThresholdMax,\n },\n isDark,\n isDesktop,\n labelCallback,\n}) => {\n const styles = getChartStyles(isDark);\n const selectedPriceRef = { current: 0 };\n\n const visibleXAxisData = dates.slice(\n (dates.length * CHART_CONFIG.INITIAL_START_ZOOM) / 100,\n (dates.length * CHART_CONFIG.INITIAL_END_ZOOM) / 100\n );\n\n const isGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks(\n visibleXAxisData[0],\n visibleXAxisData[visibleXAxisData.length - 1]\n );\n\n return {\n animation: false,\n tooltip: getTooltipConfig({\n bookType,\n bucketWidth,\n buckets,\n displayPrecision,\n labelCallback,\n selectedPriceRef,\n tooltipLinesColor: styles.tooltipLinesColor,\n }),\n grid: getGridConfig({ isDesktop }),\n xAxis: getXAxisConfig({\n dates,\n isGreaterThanTwoWeeks,\n }),\n yAxis: getYAxisConfig({\n bucketWidth,\n displayPrecision,\n isDesktop,\n labelCallback,\n }),\n dataZoom: getDataZoomConfig(),\n visualMap: getVisualMapConfig({\n sentimentLongColor: styles.sentimentLongColor,\n sentimentShortColor: styles.sentimentShortColor,\n }),\n graphic: getGridLines({ isDark }),\n dataset: {\n source: {\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n bookPrices: bookPrices ?? [],\n bookIndexes: bookIndexes ?? [],\n sentimentShorts,\n sentimentLongs,\n },\n },\n series: [\n getSeriesCandlestickConfig({\n dates,\n isGreaterThanTwoWeeks,\n styles,\n }),\n getSeriesHeatmapConfig({\n bucketWidth,\n buckets,\n isDark,\n sentimentThresholdMax,\n sentimentThresholdMin,\n }),\n getSeriesSentimentConfig({\n styles,\n }),\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,SACEC,iBA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,IAAI,EAAE7C,aAAa,CAAC;MAAE+B;IAAU,CAAC,CAAC;IAClCe,KAAK,EAAEvC,cAAc,CAAC;MACpBO,KAAK;MACL2B;IACF,CAAC,CAAC;IACFM,KAAK,EAAEvC,cAAc,CAAC;MACpBgB,WAAW;MACXE,gBAAgB;MAChBK,SAAS;MACTC;IACF,CAAC,CAAC;IACFgB,QAAQ,EAAEjD,iBAAiB,CAAC,CAAC;IAC7BkD,SAAS,EAAE3C,kBAAkB,CAAC;MAC5B4C,kBAAkB,EAAEjB,MAAM,CAACiB,kBAAkB;MAC7CC,mBAAmB,EAAElB,MAAM,CAACkB;IAC9B,CAAC,CAAC;IACFC,OAAO,EAAEnD,YAAY,CAAC;MAAE6B;IAAO,CAAC,CAAC;IACjCuB,OAAO,EAAE;MACPC,MAAM,EAAE;QACNxC,KAAK;QACLC,WAAW;QACXC,YAAY;QACZC,UAAU;QACVC,WAAW;QACXC,UAAU,EAAEA,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,EAAE;QAC5BC,WAAW,EAAEA,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI,EAAE;QAC9BC,eAAe;QACfC;MACF;IACF,CAAC;IACDiC,MAAM,EAAE,CACNrD,0BAA0B,CAAC;MACzBY,KAAK;MACL2B,qBAAqB;MACrBR;IACF,CAAC,CAAC,EACF9B,sBAAsB,CAAC;MACrBqB,WAAW;MACXC,OAAO;MACPK,MAAM;MACND,qBAAqB;MACrBD;IACF,CAAC,CAAC,EACFxB,wBAAwB,CAAC;MACvB6B;IACF,CAAC,CAAC;EAEN,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/CrowdViewWidget/components/Chart/index.ts"],"sourcesContent":["export * from './Chart';\nexport * from './chartOptions';\nexport * from './ChartWithData';\nexport * from './
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/CrowdViewWidget/components/Chart/index.ts"],"sourcesContent":["export * from './Chart';\nexport * from './chartOptions';\nexport * from './ChartWithData';\nexport * from './dataUtils';\nexport * from './types';\nexport * from './useCrowdViewData';\n"],"mappings":"AAAA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,oBAAoB","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ import { getPriceCandles } from '../../../gql/getPriceCandles';
|
|
|
5
5
|
import { getSentiments } from '../../../gql/getSentiments';
|
|
6
6
|
import { BookType, DataSource, Division } from '../../../gql/types/graphql';
|
|
7
7
|
import { BUCKET_CONFIG, INSTRUMENTS_CONFIG } from '../../constants';
|
|
8
|
-
import { getTimeSpanForGranularity, processOrderPositionBooks, processPriceCandles, processSentiments, validateData } from './
|
|
8
|
+
import { getTimeSpanForGranularity, processOrderPositionBooks, processPriceCandles, processSentiments, validateData } from './dataUtils';
|
|
9
9
|
export const useCrowdViewData = _ref => {
|
|
10
10
|
let {
|
|
11
11
|
instrument,
|
|
@@ -51,7 +51,7 @@ export const useCrowdViewData = _ref => {
|
|
|
51
51
|
granularity,
|
|
52
52
|
maxBookPrice: maxPrice,
|
|
53
53
|
minBookPrice: minPrice,
|
|
54
|
-
bucketMultiplier:
|
|
54
|
+
bucketMultiplier: 2,
|
|
55
55
|
bucketMargin: BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER
|
|
56
56
|
},
|
|
57
57
|
fetchPolicy: 'no-cache',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrowdViewData.js","names":["useQuery","useMemo","getOrderPositionBooks","getPriceCandles","getSentiments","BookType","DataSource","Division","BUCKET_CONFIG","INSTRUMENTS_CONFIG","getTimeSpanForGranularity","processOrderPositionBooks","processPriceCandles","processSentiments","validateData","useCrowdViewData","_ref","instrument","bookType","division","granularity","dataSource","Ogm","Oj","Mt5","V20","loading","priceCandlesLoading","data","priceCandlesData","error","priceCandlesError","variables","mt5name","v20name","timeSpan","fetchPolicy","minPrice","maxPrice","hasValidCandles","dates","candlesOpen","candlesClose","candlesLow","candlesHigh","pipsLocation","orderPositionLoading","orderPositionData","orderPositionError","Order","maxBookPrice","minBookPrice","bucketMultiplier","bucketMargin","PRICE_MARGIN_MULTIPLIER","skip","bookPrices","bookIndexes","buckets","bucketWidth","sentimentThresholdMin","sentimentThresholdMax","hasValidBooks","sentimentsLoading","sentimentsData","sentimentsError","sentimentLongs","sentimentShorts","hasValidSentiments","Error","concat","message","mainData","additionalData","displayPrecision"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/useCrowdViewData.ts"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { useMemo } from 'react';\n\nimport { getOrderPositionBooks } from '../../../gql/getOrderPositionBooks';\nimport { getPriceCandles } from '../../../gql/getPriceCandles';\nimport { getSentiments } from '../../../gql/getSentiments';\nimport type {\n GetOrderPositionBooksQuery,\n GetOrderPositionBooksQueryVariables,\n GetPriceCandlesQuery,\n GetPriceCandlesQueryVariables,\n GetSentimentsQuery,\n GetSentimentsQueryVariables,\n} from '../../../gql/types/graphql';\nimport { BookType, DataSource, Division } from '../../../gql/types/graphql';\nimport { BUCKET_CONFIG, INSTRUMENTS_CONFIG } from '../../constants';\nimport type { UseCrowdViewDataProps, UseCrowdViewDataReturn } from './types';\nimport {\n getTimeSpanForGranularity,\n processOrderPositionBooks,\n processPriceCandles,\n processSentiments,\n validateData,\n} from './utils';\n\nexport const useCrowdViewData = ({\n instrument,\n bookType,\n division,\n granularity,\n}: UseCrowdViewDataProps): UseCrowdViewDataReturn => {\n const dataSource =\n division === Division.Ogm || division === Division.Oj\n ? DataSource.Mt5\n : DataSource.V20;\n\n // Get price candles data\n const {\n loading: priceCandlesLoading,\n data: priceCandlesData,\n error: priceCandlesError,\n } = useQuery<GetPriceCandlesQuery, GetPriceCandlesQueryVariables>(\n getPriceCandles,\n {\n variables: {\n dataSource,\n division,\n instrument:\n dataSource === DataSource.Mt5\n ? INSTRUMENTS_CONFIG[instrument].mt5name\n : INSTRUMENTS_CONFIG[instrument].v20name,\n granularity,\n timeSpan: getTimeSpanForGranularity(granularity),\n },\n fetchPolicy: 'no-cache',\n }\n );\n\n const {\n minPrice,\n maxPrice,\n hasValidCandles,\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n pipsLocation,\n } = useMemo(() => processPriceCandles(priceCandlesData), [priceCandlesData]);\n\n // Get order position books data\n const {\n loading: orderPositionLoading,\n data: orderPositionData,\n error: orderPositionError,\n } = useQuery<GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables>(\n getOrderPositionBooks,\n {\n variables: {\n instrument: INSTRUMENTS_CONFIG[instrument].v20name,\n bookType: bookType || BookType.Order,\n timeSpan: getTimeSpanForGranularity(granularity),\n granularity,\n maxBookPrice: maxPrice,\n minBookPrice: minPrice,\n bucketMultiplier: 3,\n bucketMargin: BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,\n },\n fetchPolicy: 'no-cache',\n skip: priceCandlesLoading || !!priceCandlesError,\n }\n );\n\n const {\n bookPrices,\n bookIndexes,\n buckets,\n bucketWidth,\n sentimentThresholdMin,\n sentimentThresholdMax,\n hasValidBooks,\n } = useMemo(\n () => processOrderPositionBooks(orderPositionData, dates),\n [orderPositionData, dates]\n );\n\n // Get sentiments data\n const {\n loading: sentimentsLoading,\n data: sentimentsData,\n error: sentimentsError,\n } = useQuery<GetSentimentsQuery, GetSentimentsQueryVariables>(getSentiments, {\n variables: {\n instrument: INSTRUMENTS_CONFIG[instrument].v20name,\n granularity,\n timeSpan: getTimeSpanForGranularity(granularity),\n },\n fetchPolicy: 'no-cache',\n skip: priceCandlesLoading || !!priceCandlesError,\n });\n\n const { sentimentLongs, sentimentShorts, hasValidSentiments } = useMemo(\n () => processSentiments(sentimentsData, dates),\n [sentimentsData, dates]\n );\n\n // Gather all results\n const loading =\n priceCandlesLoading || orderPositionLoading || sentimentsLoading;\n\n const error = useMemo((): Error | null => {\n if (priceCandlesError) {\n return new Error(`Price candles error: ${priceCandlesError.message}`);\n }\n if (orderPositionError) {\n return new Error(`Order position error: ${orderPositionError.message}`);\n }\n if (sentimentsError) {\n return new Error(`Sentiments error: ${sentimentsError.message}`);\n }\n if (loading) {\n return null;\n }\n return validateData(\n priceCandlesData,\n orderPositionData,\n hasValidCandles,\n hasValidBooks,\n hasValidSentiments\n );\n }, [\n priceCandlesError,\n orderPositionError,\n sentimentsError,\n loading,\n priceCandlesData,\n orderPositionData,\n hasValidCandles,\n hasValidBooks,\n hasValidSentiments,\n ]);\n\n const data = useMemo(() => {\n if (!priceCandlesData || !orderPositionData || !sentimentsData || error) {\n return null;\n }\n\n return {\n mainData: {\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n bookPrices,\n bookIndexes,\n sentimentShorts,\n sentimentLongs,\n },\n additionalData: {\n bucketWidth,\n buckets,\n displayPrecision: pipsLocation,\n bookType,\n sentimentThresholdMin,\n sentimentThresholdMax,\n },\n };\n }, [\n priceCandlesData,\n orderPositionData,\n sentimentsData,\n error,\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n bookPrices,\n bookIndexes,\n sentimentShorts,\n sentimentLongs,\n bucketWidth,\n buckets,\n pipsLocation,\n bookType,\n sentimentThresholdMin,\n sentimentThresholdMax,\n ]);\n\n return {\n mainData: data?.mainData,\n additionalData: data?.additionalData,\n loading,\n error: !!error,\n };\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,OAAO,QAAQ,OAAO;AAE/B,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,aAAa,QAAQ,4BAA4B;AAS1D,SAASC,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,4BAA4B;AAC3E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,iBAAiB;AAEnE,SACEC,y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,WAAW,EACXY,UAAU,EACVC,WAAW,EACXU,eAAe,EACfD,cAAc,EACdP,WAAW,EACXD,OAAO,EACPb,YAAY,EACZ3B,QAAQ,EACR0C,qBAAqB,EACrBC,qBAAqB,CACtB,CAAC;EAEF,OAAO;IACLW,QAAQ,EAAE5C,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAE4C,QAAQ;IACxBC,cAAc,EAAE7C,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAE6C,cAAc;IACpC/C,OAAO;IACPI,KAAK,EAAE,CAAC,CAACA;EACX,CAAC;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useCrowdViewData.js","names":["useQuery","useMemo","getOrderPositionBooks","getPriceCandles","getSentiments","BookType","DataSource","Division","BUCKET_CONFIG","INSTRUMENTS_CONFIG","getTimeSpanForGranularity","processOrderPositionBooks","processPriceCandles","processSentiments","validateData","useCrowdViewData","_ref","instrument","bookType","division","granularity","dataSource","Ogm","Oj","Mt5","V20","loading","priceCandlesLoading","data","priceCandlesData","error","priceCandlesError","variables","mt5name","v20name","timeSpan","fetchPolicy","minPrice","maxPrice","hasValidCandles","dates","candlesOpen","candlesClose","candlesLow","candlesHigh","pipsLocation","orderPositionLoading","orderPositionData","orderPositionError","Order","maxBookPrice","minBookPrice","bucketMultiplier","bucketMargin","PRICE_MARGIN_MULTIPLIER","skip","bookPrices","bookIndexes","buckets","bucketWidth","sentimentThresholdMin","sentimentThresholdMax","hasValidBooks","sentimentsLoading","sentimentsData","sentimentsError","sentimentLongs","sentimentShorts","hasValidSentiments","Error","concat","message","mainData","additionalData","displayPrecision"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/useCrowdViewData.ts"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { useMemo } from 'react';\n\nimport { getOrderPositionBooks } from '../../../gql/getOrderPositionBooks';\nimport { getPriceCandles } from '../../../gql/getPriceCandles';\nimport { getSentiments } from '../../../gql/getSentiments';\nimport type {\n GetOrderPositionBooksQuery,\n GetOrderPositionBooksQueryVariables,\n GetPriceCandlesQuery,\n GetPriceCandlesQueryVariables,\n GetSentimentsQuery,\n GetSentimentsQueryVariables,\n} from '../../../gql/types/graphql';\nimport { BookType, DataSource, Division } from '../../../gql/types/graphql';\nimport { BUCKET_CONFIG, INSTRUMENTS_CONFIG } from '../../constants';\nimport {\n getTimeSpanForGranularity,\n processOrderPositionBooks,\n processPriceCandles,\n processSentiments,\n validateData,\n} from './dataUtils';\nimport type { UseCrowdViewDataProps, UseCrowdViewDataReturn } from './types';\n\nexport const useCrowdViewData = ({\n instrument,\n bookType,\n division,\n granularity,\n}: UseCrowdViewDataProps): UseCrowdViewDataReturn => {\n const dataSource =\n division === Division.Ogm || division === Division.Oj\n ? DataSource.Mt5\n : DataSource.V20;\n\n // Get price candles data\n const {\n loading: priceCandlesLoading,\n data: priceCandlesData,\n error: priceCandlesError,\n } = useQuery<GetPriceCandlesQuery, GetPriceCandlesQueryVariables>(\n getPriceCandles,\n {\n variables: {\n dataSource,\n division,\n instrument:\n dataSource === DataSource.Mt5\n ? INSTRUMENTS_CONFIG[instrument].mt5name\n : INSTRUMENTS_CONFIG[instrument].v20name,\n granularity,\n timeSpan: getTimeSpanForGranularity(granularity),\n },\n fetchPolicy: 'no-cache',\n }\n );\n\n const {\n minPrice,\n maxPrice,\n hasValidCandles,\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n pipsLocation,\n } = useMemo(() => processPriceCandles(priceCandlesData), [priceCandlesData]);\n\n // Get order position books data\n const {\n loading: orderPositionLoading,\n data: orderPositionData,\n error: orderPositionError,\n } = useQuery<GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables>(\n getOrderPositionBooks,\n {\n variables: {\n instrument: INSTRUMENTS_CONFIG[instrument].v20name,\n bookType: bookType || BookType.Order,\n timeSpan: getTimeSpanForGranularity(granularity),\n granularity,\n maxBookPrice: maxPrice,\n minBookPrice: minPrice,\n bucketMultiplier: 2,\n bucketMargin: BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,\n },\n fetchPolicy: 'no-cache',\n skip: priceCandlesLoading || !!priceCandlesError,\n }\n );\n\n const {\n bookPrices,\n bookIndexes,\n buckets,\n bucketWidth,\n sentimentThresholdMin,\n sentimentThresholdMax,\n hasValidBooks,\n } = useMemo(\n () => processOrderPositionBooks(orderPositionData, dates),\n [orderPositionData, dates]\n );\n\n // Get sentiments data\n const {\n loading: sentimentsLoading,\n data: sentimentsData,\n error: sentimentsError,\n } = useQuery<GetSentimentsQuery, GetSentimentsQueryVariables>(getSentiments, {\n variables: {\n instrument: INSTRUMENTS_CONFIG[instrument].v20name,\n granularity,\n timeSpan: getTimeSpanForGranularity(granularity),\n },\n fetchPolicy: 'no-cache',\n skip: priceCandlesLoading || !!priceCandlesError,\n });\n\n const { sentimentLongs, sentimentShorts, hasValidSentiments } = useMemo(\n () => processSentiments(sentimentsData, dates),\n [sentimentsData, dates]\n );\n\n // Gather all results\n const loading =\n priceCandlesLoading || orderPositionLoading || sentimentsLoading;\n\n const error = useMemo((): Error | null => {\n if (priceCandlesError) {\n return new Error(`Price candles error: ${priceCandlesError.message}`);\n }\n if (orderPositionError) {\n return new Error(`Order position error: ${orderPositionError.message}`);\n }\n if (sentimentsError) {\n return new Error(`Sentiments error: ${sentimentsError.message}`);\n }\n if (loading) {\n return null;\n }\n return validateData(\n priceCandlesData,\n orderPositionData,\n hasValidCandles,\n hasValidBooks,\n hasValidSentiments\n );\n }, [\n priceCandlesError,\n orderPositionError,\n sentimentsError,\n loading,\n priceCandlesData,\n orderPositionData,\n hasValidCandles,\n hasValidBooks,\n hasValidSentiments,\n ]);\n\n const data = useMemo(() => {\n if (!priceCandlesData || !orderPositionData || !sentimentsData || error) {\n return null;\n }\n\n return {\n mainData: {\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n bookPrices,\n bookIndexes,\n sentimentShorts,\n sentimentLongs,\n },\n additionalData: {\n bucketWidth,\n buckets,\n displayPrecision: pipsLocation,\n bookType,\n sentimentThresholdMin,\n sentimentThresholdMax,\n },\n };\n }, [\n priceCandlesData,\n orderPositionData,\n sentimentsData,\n error,\n dates,\n candlesOpen,\n candlesClose,\n candlesLow,\n candlesHigh,\n bookPrices,\n bookIndexes,\n sentimentShorts,\n sentimentLongs,\n bucketWidth,\n buckets,\n pipsLocation,\n bookType,\n sentimentThresholdMin,\n sentimentThresholdMax,\n ]);\n\n return {\n mainData: data?.mainData,\n additionalData: data?.additionalData,\n loading,\n error: !!error,\n };\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,OAAO,QAAQ,OAAO;AAE/B,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,aAAa,QAAQ,4BAA4B;AAS1D,SAASC,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,4BAA4B;AAC3E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,iBAAiB;AACnE,SACEC,yBAAyB,EACzBC,yBAAyB,EACzBC,mBAAmB,EACnBC,iBAAiB,EACjBC,YAAY,QACP,aAAa;AAGpB,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAKqB;EAAA,IALpB;IAC/BC,UAAU;IACVC,QAAQ;IACRC,QAAQ;IACRC;EACqB,CAAC,GAAAJ,IAAA;EACtB,MAAMK,UAAU,GACdF,QAAQ,KAAKZ,QAAQ,CAACe,GAAG,IAAIH,QAAQ,KAAKZ,QAAQ,CAACgB,EAAE,GACjDjB,UAAU,CAACkB,GAAG,GACdlB,UAAU,CAACmB,GAAG;EAGpB,MAAM;IACJC,OAAO,EAAEC,mBAAmB;IAC5BC,IAAI,EAAEC,gBAAgB;IACtBC,KAAK,EAAEC;EACT,CAAC,GAAG/B,QAAQ,CACVG,eAAe,EACf;IACE6B,SAAS,EAAE;MACTX,UAAU;MACVF,QAAQ;MACRF,UAAU,EACRI,UAAU,KAAKf,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