@oanda/labs-crowd-view-widget 1.0.52 → 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 +436 -0
- package/dist/main/CrowdViewWidget/Main.js +4 -6
- package/dist/main/CrowdViewWidget/Main.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +18 -31
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +7 -5
- 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 -41
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +65 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +65 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +43 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +8 -2
- 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/types.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +53 -30
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js +15 -13
- 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 +12 -18
- package/dist/main/CrowdViewWidget/constants.js.map +1 -1
- package/dist/main/gql/getOrderPositionBooks.js +1 -1
- package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/main/gql/getPriceCandles.js +1 -1
- package/dist/main/gql/getPriceCandles.js.map +1 -1
- package/dist/main/gql/types/gql.js +2 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +111 -18
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/translations/sources/en.json +2 -1
- package/dist/module/CrowdViewWidget/Main.js +3 -5
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +20 -33
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +7 -5
- 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/dataUtils/index.js +7 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +58 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +58 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +36 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +8 -2
- 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/types.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +50 -27
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +15 -13
- 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 +10 -17
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/gql/getOrderPositionBooks.js +1 -1
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/getPriceCandles.js +1 -1
- package/dist/module/gql/getPriceCandles.js.map +1 -1
- package/dist/module/gql/types/gql.js +2 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +111 -18
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/translations/sources/en.json +2 -1
- package/dist/types/CrowdViewWidget/components/Chart/Chart.d.ts +1 -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/dataUtils/index.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.d.ts +11 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.d.ts +12 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processSentiments.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/index.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +28 -11
- 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 +4 -12
- package/dist/types/gql/types/gql.d.ts +6 -4
- package/dist/types/gql/types/graphql.d.ts +30 -11
- package/package.json +3 -3
- package/src/CrowdViewWidget/Main.tsx +3 -4
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +25 -40
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +8 -4
- 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/dataUtils/index.ts +6 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.ts +92 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.ts +67 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processSentiments.ts +55 -0
- package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.ts +10 -2
- package/src/CrowdViewWidget/components/Chart/getOption.ts +114 -0
- package/src/CrowdViewWidget/components/Chart/index.ts +1 -1
- package/src/CrowdViewWidget/components/Chart/types.ts +30 -19
- package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +84 -67
- package/src/CrowdViewWidget/components/Legend/Legend.tsx +24 -23
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +13 -26
- package/src/CrowdViewWidget/constants.ts +21 -23
- package/src/gql/getOrderPositionBooks.ts +13 -5
- package/src/gql/getPriceCandles.ts +1 -0
- package/src/gql/types/gql.ts +6 -6
- package/src/gql/types/graphql.ts +98 -16
- package/src/translations/sources/en.json +2 -1
- package/test/components/Chart/utils/chartUtils.test.ts +39 -21
- package/test/components/Chart/utils/getChartStyles.test.ts +10 -10
- package/test/components/Chart/utils/processSentiments.test.ts +138 -30
- 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/test/utils/processOrderPositionBooks.test.ts +201 -84
- package/test/utils/processPriceCandles.test.ts +93 -67
- package/test/utils/validateData.test.ts +136 -38
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js +0 -359
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -37
- package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -127
- 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/getTargetBucketWidth.js +0 -14
- package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -29
- package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +0 -23
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +0 -43
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js +0 -28
- 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 -351
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -29
- package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -114
- 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/getTargetBucketWidth.js +0 -7
- package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js +0 -10
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -22
- package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +0 -16
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +0 -36
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js +0 -21
- 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/aggregateBuckets.d.ts +0 -2
- package/dist/types/CrowdViewWidget/components/Chart/utils/chartUtils.d.ts +0 -31
- package/dist/types/CrowdViewWidget/components/Chart/utils/getGridLines.d.ts +0 -97
- package/dist/types/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.d.ts +0 -3
- package/dist/types/CrowdViewWidget/components/Chart/utils/index.d.ts +0 -9
- package/dist/types/CrowdViewWidget/components/Chart/utils/processBuckets.d.ts +0 -3
- package/dist/types/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.d.ts +0 -8
- package/dist/types/CrowdViewWidget/components/Chart/utils/processPriceCandles.d.ts +0 -27
- package/dist/types/CrowdViewWidget/components/Chart/utils/processSentiments.d.ts +0 -3
- package/src/CrowdViewWidget/components/Chart/chartOptions.ts +0 -401
- package/src/CrowdViewWidget/components/Chart/utils/aggregateBuckets.ts +0 -44
- package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +0 -216
- package/src/CrowdViewWidget/components/Chart/utils/getGridLines.ts +0 -148
- package/src/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.ts +0 -13
- package/src/CrowdViewWidget/components/Chart/utils/index.ts +0 -9
- package/src/CrowdViewWidget/components/Chart/utils/processBuckets.ts +0 -43
- package/src/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.ts +0 -30
- package/src/CrowdViewWidget/components/Chart/utils/processPriceCandles.ts +0 -53
- package/src/CrowdViewWidget/components/Chart/utils/processSentiments.ts +0 -42
- package/test/utils/aggregateBuckets.test.ts +0 -82
- package/test/utils/getTargetBucketWidth.test.ts +0 -37
- package/test/utils/processBuckets.test.ts +0 -153
- /package/dist/types/CrowdViewWidget/components/Chart/{chartOptions.d.ts → getOption.d.ts} +0 -0
package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInstrumentConfigForDivision.js","names":["_graphql","require","_selectConfig","getInstrumentConfigForDivision","division","Division","Oc","instrumentSelectConfigOC","instrumentSelectConfig","exports"],"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,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKO,MAAME,8BAA8B,GAAIC,QAAkB,IAAK;EACpE,OAAOA,QAAQ,KAAKC,iBAAQ,CAACC,EAAE,GAC3BC,sCAAwB,GACxBC,oCAAsB;AAC5B,CAAC;AAACC,OAAA,CAAAN,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTimeSpanForGranularity = void 0;
|
|
7
|
+
var _graphql = require("../../../../gql/types/graphql");
|
|
8
|
+
const getTimeSpanForGranularity = granularity => {
|
|
9
|
+
const granularityTimeSpanMap = {
|
|
10
|
+
[_graphql.Granularity.M5]: _graphql.TimeSpan.TwoDays,
|
|
11
|
+
[_graphql.Granularity.M15]: _graphql.TimeSpan.FiveDays,
|
|
12
|
+
[_graphql.Granularity.H1]: _graphql.TimeSpan.TwentyDays,
|
|
13
|
+
[_graphql.Granularity.H4]: _graphql.TimeSpan.NinetyDays
|
|
14
|
+
};
|
|
15
|
+
return granularityTimeSpanMap[granularity] || _graphql.TimeSpan.TwoDays;
|
|
16
|
+
};
|
|
17
|
+
exports.getTimeSpanForGranularity = getTimeSpanForGranularity;
|
|
18
|
+
//# sourceMappingURL=getTimeSpanForGranularity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTimeSpanForGranularity.js","names":["_graphql","require","getTimeSpanForGranularity","granularity","granularityTimeSpanMap","Granularity","M5","TimeSpan","TwoDays","M15","FiveDays","H1","TwentyDays","H4","NinetyDays","exports"],"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,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,yBAAyB,GACpCC,WAAwB,IACX;EACb,MAAMC,sBAAqD,GAAG;IAC5D,CAACC,oBAAW,CAACC,EAAE,GAAGC,iBAAQ,CAACC,OAAO;IAClC,CAACH,oBAAW,CAACI,GAAG,GAAGF,iBAAQ,CAACG,QAAQ;IACpC,CAACL,oBAAW,CAACM,EAAE,GAAGJ,iBAAQ,CAACK,UAAU;IACrC,CAACP,oBAAW,CAACQ,EAAE,GAAGN,iBAAQ,CAACO;EAC7B,CAAC;EAED,OAAOV,sBAAsB,CAACD,WAAW,CAAC,IAAII,iBAAQ,CAACC,OAAO;AAChE,CAAC;AAACO,OAAA,CAAAb,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -3,58 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
Object.keys(
|
|
6
|
+
var _getInstrumentConfigForDivision = require("./getInstrumentConfigForDivision");
|
|
7
|
+
Object.keys(_getInstrumentConfigForDivision).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] ===
|
|
9
|
+
if (key in exports && exports[key] === _getInstrumentConfigForDivision[key]) return;
|
|
10
10
|
Object.defineProperty(exports, key, {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function () {
|
|
13
|
-
return
|
|
13
|
+
return _getInstrumentConfigForDivision[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var
|
|
18
|
-
Object.keys(
|
|
17
|
+
var _getTimeSpanForGranularity = require("./getTimeSpanForGranularity");
|
|
18
|
+
Object.keys(_getTimeSpanForGranularity).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] ===
|
|
20
|
+
if (key in exports && exports[key] === _getTimeSpanForGranularity[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function () {
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _getChartStyles = require("./getChartStyles");
|
|
29
|
-
Object.keys(_getChartStyles).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _getChartStyles[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _getChartStyles[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _getTargetBucketWidth = require("./getTargetBucketWidth");
|
|
40
|
-
Object.keys(_getTargetBucketWidth).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _getTargetBucketWidth[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _getTargetBucketWidth[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _processBuckets = require("./processBuckets");
|
|
51
|
-
Object.keys(_processBuckets).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _processBuckets[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _processBuckets[key];
|
|
24
|
+
return _getTimeSpanForGranularity[key];
|
|
58
25
|
}
|
|
59
26
|
});
|
|
60
27
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_getInstrumentConfigForDivision","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getTimeSpanForGranularity","_processOrderPositionBooks","_processPriceCandles","_processSentiments","_validateData"],"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,IAAAA,+BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,+BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,+BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,+BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,0BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,0BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,0BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA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AV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,aAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,aAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.processOrderPositionBooks = void 0;
|
|
7
|
+
const processOrderPositionBooks = (orderPositionData, dates) => {
|
|
8
|
+
var _orderPositionData$or, _orderPositionData$or2, _orderPositionData$or3, _orderPositionData$or4;
|
|
9
|
+
if (!Array.isArray(dates) || dates.length === 0) {
|
|
10
|
+
return {
|
|
11
|
+
bookPrices: [],
|
|
12
|
+
bookIndexes: [],
|
|
13
|
+
buckets: [],
|
|
14
|
+
bucketWidth: 0,
|
|
15
|
+
sentimentThresholdMin: 0,
|
|
16
|
+
sentimentThresholdMax: 0,
|
|
17
|
+
hasValidBooks: false
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (!(orderPositionData !== null && orderPositionData !== void 0 && (_orderPositionData$or = orderPositionData.orderPositionBooks) !== null && _orderPositionData$or !== void 0 && (_orderPositionData$or = _orderPositionData$or.books) !== null && _orderPositionData$or !== void 0 && _orderPositionData$or.length) || !(orderPositionData !== null && orderPositionData !== void 0 && (_orderPositionData$or2 = orderPositionData.orderPositionBooks) !== null && _orderPositionData$or2 !== void 0 && _orderPositionData$or2.sentimentThresholdMin) || !(orderPositionData !== null && orderPositionData !== void 0 && (_orderPositionData$or3 = orderPositionData.orderPositionBooks) !== null && _orderPositionData$or3 !== void 0 && _orderPositionData$or3.sentimentThresholdMax) || !(orderPositionData !== null && orderPositionData !== void 0 && (_orderPositionData$or4 = orderPositionData.orderPositionBooks) !== null && _orderPositionData$or4 !== void 0 && _orderPositionData$or4.bucketWidth)) {
|
|
21
|
+
return {
|
|
22
|
+
bookPrices: [],
|
|
23
|
+
bookIndexes: [],
|
|
24
|
+
buckets: [],
|
|
25
|
+
bucketWidth: 0,
|
|
26
|
+
sentimentThresholdMin: 0,
|
|
27
|
+
sentimentThresholdMax: 0,
|
|
28
|
+
hasValidBooks: false
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const {
|
|
32
|
+
bucketWidth,
|
|
33
|
+
sentimentThresholdMin,
|
|
34
|
+
sentimentThresholdMax
|
|
35
|
+
} = orderPositionData.orderPositionBooks;
|
|
36
|
+
const booksDataMap = new Map(orderPositionData.orderPositionBooks.books.map(item => [item.time, {
|
|
37
|
+
price: item.price,
|
|
38
|
+
buckets: item.buckets
|
|
39
|
+
}]));
|
|
40
|
+
const bookPrices = [];
|
|
41
|
+
const bookIndexes = [];
|
|
42
|
+
const buckets = [];
|
|
43
|
+
dates.forEach((date, index) => {
|
|
44
|
+
var _book$price;
|
|
45
|
+
const book = booksDataMap.get(date);
|
|
46
|
+
const currentBuckets = (book === null || book === void 0 ? void 0 : book.buckets.filter(bucket => bucket !== null && typeof bucket.price === 'number' && typeof bucket.sentiment === 'number' && Math.abs(bucket.sentiment) >= sentimentThresholdMin).map(bucket => ({
|
|
47
|
+
price: bucket.price,
|
|
48
|
+
sentiment: bucket.sentiment
|
|
49
|
+
}))) || [];
|
|
50
|
+
bookPrices.push((_book$price = book === null || book === void 0 ? void 0 : book.price) !== null && _book$price !== void 0 ? _book$price : null);
|
|
51
|
+
bookIndexes.push(index);
|
|
52
|
+
buckets.push(currentBuckets);
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
bookPrices,
|
|
56
|
+
bookIndexes,
|
|
57
|
+
buckets,
|
|
58
|
+
bucketWidth,
|
|
59
|
+
sentimentThresholdMin,
|
|
60
|
+
sentimentThresholdMax,
|
|
61
|
+
hasValidBooks: true
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
exports.processOrderPositionBooks = processOrderPositionBooks;
|
|
65
|
+
//# sourceMappingURL=processOrderPositionBooks.js.map
|
|
@@ -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","exports"],"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":";;;;;;AAGO,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,aAAa,EAAE;IACjB,CAAC;EACH;EAEA,IACE,EAACf,iBAAiB,aAAjBA,iBAAiB,gBAAAE,qBAAA,GAAjBF,iBAAiB,CAAEgB,kBAAkB,cAAAd,qBAAA,gBAAAA,qBAAA,GAArCA,qBAAA,CAAuCe,KAAK,cAAAf,qBAAA,eAA5CA,qBAAA,CAA8CM,MAAM,KACrD,EAACR,iBAAiB,aAA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AEjB,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;AAACsB,OAAA,CAAAtC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.processPriceCandles = void 0;
|
|
7
|
+
const processPriceCandles = priceCandlesData => {
|
|
8
|
+
var _priceCandlesData$pri, _priceCandlesData$pri2;
|
|
9
|
+
const errorResult = {
|
|
10
|
+
minPrice: 0,
|
|
11
|
+
maxPrice: 0,
|
|
12
|
+
pipsLocation: 0,
|
|
13
|
+
hasValidCandles: false,
|
|
14
|
+
candlesOpen: [],
|
|
15
|
+
candlesClose: [],
|
|
16
|
+
candlesLow: [],
|
|
17
|
+
candlesHigh: [],
|
|
18
|
+
dates: []
|
|
19
|
+
};
|
|
20
|
+
if (!(priceCandlesData !== null && priceCandlesData !== void 0 && (_priceCandlesData$pri = priceCandlesData.priceCandles) !== null && _priceCandlesData$pri !== void 0 && (_priceCandlesData$pri = _priceCandlesData$pri.candle) !== null && _priceCandlesData$pri !== void 0 && _priceCandlesData$pri.length) || !(priceCandlesData !== null && priceCandlesData !== void 0 && (_priceCandlesData$pri2 = priceCandlesData.priceCandles) !== null && _priceCandlesData$pri2 !== void 0 && _priceCandlesData$pri2.pipsLocation)) {
|
|
21
|
+
return errorResult;
|
|
22
|
+
}
|
|
23
|
+
const {
|
|
24
|
+
dates,
|
|
25
|
+
candlesOpen,
|
|
26
|
+
candlesClose,
|
|
27
|
+
candlesLow,
|
|
28
|
+
candlesHigh
|
|
29
|
+
} = priceCandlesData.priceCandles.candle.reduce((acc, candle) => {
|
|
30
|
+
if (!candle) {
|
|
31
|
+
return acc;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
dates: [...acc.dates, candle.point],
|
|
35
|
+
candlesOpen: [...acc.candlesOpen, candle.open],
|
|
36
|
+
candlesClose: [...acc.candlesClose, candle.close],
|
|
37
|
+
candlesLow: [...acc.candlesLow, candle.low],
|
|
38
|
+
candlesHigh: [...acc.candlesHigh, candle.high]
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
dates: [],
|
|
42
|
+
candlesOpen: [],
|
|
43
|
+
candlesClose: [],
|
|
44
|
+
candlesLow: [],
|
|
45
|
+
candlesHigh: []
|
|
46
|
+
});
|
|
47
|
+
if (dates.length === 0) {
|
|
48
|
+
return errorResult;
|
|
49
|
+
}
|
|
50
|
+
const minPrice = Math.min(...candlesLow);
|
|
51
|
+
const maxPrice = Math.max(...candlesHigh);
|
|
52
|
+
return {
|
|
53
|
+
minPrice,
|
|
54
|
+
maxPrice,
|
|
55
|
+
candlesOpen,
|
|
56
|
+
candlesClose,
|
|
57
|
+
candlesLow,
|
|
58
|
+
candlesHigh,
|
|
59
|
+
dates,
|
|
60
|
+
hasValidCandles: true,
|
|
61
|
+
pipsLocation: priceCandlesData.priceCandles.pipsLocation
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
exports.processPriceCandles = processPriceCandles;
|
|
65
|
+
//# sourceMappingURL=processPriceCandles.js.map
|
|
@@ -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","exports"],"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":";;;;;;AAEO,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,EAAE,EAAE;IACdC,WAAW,EAAE,EAAE;IACfC,KAAK,EAAE;EACT,CAAC;EAED,IACE,EAACZ,gBAAgB,aAAhBA,gBAAgB,gBAAAC,qBAAA,GAAhBD,gBAAgB,CAAEa,YAAY,cAAAZ,qBAAA,gBAAAA,qBAAA,GAA9BA,qBAAA,CAAgCa,MAAM,cAAAb,qBAAA,eAAtCA,qBAAA,CAAwCc,MAAM,KAC/C,EAACf,gBAAgB,aAAhBA,gBAAgB,gBAAAE,sBAAA,GAAhBF,gBAAgB,CAAEa,YAAY,cAAAX,sBAAA,eAA9BA,sBAAA,CAAgCI,YAAY,GAC7C;IACA,OAAOH,WAAW;EACpB;EAEA,MAAM;IAAES,KAAK;IAAEJ,WAAW;IAAEC,YAAY;IAAEC,UAAU;IAAEC;EAAY,CAAC,GACjEX,gBAAgB,CAACa,YAAY,CAACC,MAAM,CAACE,MAAM,CACzC,CAACC,GAAG,EAAEH,MAAM,KAAK;IACf,IAAI,CAACA,MAAM,EAAE;MACX,OAAOG,GAAG;IACZ;IAEA,OAAO;MACLL,KAAK,EAAE,CAAC,GAAGK,GAAG,CAACL,KAAK,EAAEE,MAAM,CAACI,KAAK,CAAC;MACnCV,WAAW,EAAE,CAAC,GAAGS,GAAG,CAACT,WAAW,EAAEM,MAAM,CAACK,IAAI,CAAC;MAC9CV,YAAY,EAAE,CAAC,GAAGQ,GAAG,CAACR,YAAY,EAAEK,MAAM,CAACM,KAAK,CAAC;MACjDV,UAAU,EAAE,CAAC,GAAGO,GAAG,CAACP,UAAU,EAAEI,MAAM,CAACO,GAAG,CAAC;MAC3CV,WAAW,EAAE,CAAC,GAAGM,GAAG,CAACN,WAAW,EAAEG,MAAM,CAACQ,IAAI;IAC/C,CAAC;EACH,CAAC,EACD;IACEV,KAAK,EAAE,EAAc;IACrBJ,WAAW,EAAE,EAAc;IAC3BC,YAAY,EAAE,EAAc;IAC5BC,UAAU,EAAE,EAAc;IAC1BC,WAAW,EAAE;EACf,CACF,CAAC;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;AAACoB,OAAA,CAAA3B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.processSentiments = void 0;
|
|
7
|
+
const processSentiments = (sentimentsData, dates) => {
|
|
8
|
+
var _sentimentsData$senti;
|
|
9
|
+
if (!Array.isArray(dates) || dates.length === 0 || !(sentimentsData !== null && sentimentsData !== void 0 && (_sentimentsData$senti = sentimentsData.sentiments) !== null && _sentimentsData$senti !== void 0 && (_sentimentsData$senti = _sentimentsData$senti.sentiments) !== null && _sentimentsData$senti !== void 0 && _sentimentsData$senti.length)) {
|
|
10
|
+
return {
|
|
11
|
+
sentimentLongs: [],
|
|
12
|
+
sentimentShorts: [],
|
|
13
|
+
hasValidSentiments: false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const sentimentMap = new Map(sentimentsData.sentiments.sentiments.map(item => {
|
|
17
|
+
var _item$sentiment$short, _item$sentiment, _item$sentiment$longP, _item$sentiment2;
|
|
18
|
+
return [item === null || item === void 0 ? void 0 : item.time, {
|
|
19
|
+
sentimentShorts: (_item$sentiment$short = item === null || item === void 0 || (_item$sentiment = item.sentiment) === null || _item$sentiment === void 0 ? void 0 : _item$sentiment.shortPercent) !== null && _item$sentiment$short !== void 0 ? _item$sentiment$short : null,
|
|
20
|
+
sentimentLongs: (_item$sentiment$longP = item === null || item === void 0 || (_item$sentiment2 = item.sentiment) === null || _item$sentiment2 === void 0 ? void 0 : _item$sentiment2.longPercent) !== null && _item$sentiment$longP !== void 0 ? _item$sentiment$longP : null
|
|
21
|
+
}];
|
|
22
|
+
}));
|
|
23
|
+
const {
|
|
24
|
+
sentimentLongs,
|
|
25
|
+
sentimentShorts
|
|
26
|
+
} = dates.reduce((acc, date) => {
|
|
27
|
+
const sentiment = sentimentMap.get(date);
|
|
28
|
+
return {
|
|
29
|
+
sentimentLongs: [...acc.sentimentLongs, (sentiment === null || sentiment === void 0 ? void 0 : sentiment.sentimentLongs) || null],
|
|
30
|
+
sentimentShorts: [...acc.sentimentShorts, (sentiment === null || sentiment === void 0 ? void 0 : sentiment.sentimentShorts) || null]
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
sentimentLongs: [],
|
|
34
|
+
sentimentShorts: []
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
sentimentLongs,
|
|
38
|
+
sentimentShorts,
|
|
39
|
+
hasValidSentiments: true
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.processSentiments = processSentiments;
|
|
43
|
+
//# sourceMappingURL=processSentiments.js.map
|
|
@@ -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","exports"],"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":";;;;;;AAEO,MAAMA,iBAAiB,GAAGA,CAC/BC,cAA8C,EAC9CC,KAAe,KACZ;EAAA,IAAAC,qBAAA;EACH,IACE,CAACC,KAAK,CAACC,OAAO,CAACH,KAAK,CAA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,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;AAACiB,OAAA,CAAA3B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateData = void 0;
|
|
7
|
-
const validateData = (priceCandlesData, orderPositionData, hasValidCandles) => {
|
|
7
|
+
const validateData = (priceCandlesData, orderPositionData, hasValidCandles, hasValidBooks, hasValidSentiments) => {
|
|
8
8
|
var _priceCandlesData$pri, _priceCandlesData$pri2, _orderPositionData$or, _orderPositionData$or2;
|
|
9
9
|
const hasValidPriceData = ((_priceCandlesData$pri = priceCandlesData === null || priceCandlesData === void 0 || (_priceCandlesData$pri2 = priceCandlesData.priceCandles) === null || _priceCandlesData$pri2 === void 0 || (_priceCandlesData$pri2 = _priceCandlesData$pri2.candle) === null || _priceCandlesData$pri2 === void 0 ? void 0 : _priceCandlesData$pri2.length) !== null && _priceCandlesData$pri !== void 0 ? _priceCandlesData$pri : 0) >= 1;
|
|
10
|
-
const hasValidOrderData = ((_orderPositionData$or = orderPositionData === null || orderPositionData === void 0 || (_orderPositionData$or2 = orderPositionData.orderPositionBooks) === null || _orderPositionData$or2 === void 0 ? void 0 : _orderPositionData$or2.length) !== null && _orderPositionData$or !== void 0 ? _orderPositionData$or : 0) >= 1;
|
|
10
|
+
const hasValidOrderData = ((_orderPositionData$or = orderPositionData === null || orderPositionData === void 0 || (_orderPositionData$or2 = orderPositionData.orderPositionBooks) === null || _orderPositionData$or2 === void 0 || (_orderPositionData$or2 = _orderPositionData$or2.books) === null || _orderPositionData$or2 === void 0 ? void 0 : _orderPositionData$or2.length) !== null && _orderPositionData$or !== void 0 ? _orderPositionData$or : 0) >= 1;
|
|
11
11
|
if (!hasValidPriceData) {
|
|
12
12
|
return new Error('Insufficient price candle data');
|
|
13
13
|
}
|
|
@@ -17,6 +17,12 @@ const validateData = (priceCandlesData, orderPositionData, hasValidCandles) => {
|
|
|
17
17
|
if (!hasValidCandles) {
|
|
18
18
|
return new Error('Invalid candle data');
|
|
19
19
|
}
|
|
20
|
+
if (!hasValidBooks) {
|
|
21
|
+
return new Error('Invalid book data');
|
|
22
|
+
}
|
|
23
|
+
if (!hasValidSentiments) {
|
|
24
|
+
return new Error('Invalid sentiment data');
|
|
25
|
+
}
|
|
20
26
|
return null;
|
|
21
27
|
};
|
|
22
28
|
exports.validateData = validateData;
|
|
@@ -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","exports"],"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":";;;;;;AAKO,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;AAACC,OAAA,CAAAlB,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getOption = void 0;
|
|
7
|
+
var _constants = require("../../constants");
|
|
8
|
+
var _chartOptions = require("./chartOptions");
|
|
9
|
+
var _chartUtils = require("./chartUtils");
|
|
10
|
+
var _getChartStyles = require("./chartUtils/getChartStyles");
|
|
11
|
+
const getOption = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
mainData: {
|
|
14
|
+
dates,
|
|
15
|
+
candlesOpen,
|
|
16
|
+
candlesClose,
|
|
17
|
+
candlesLow,
|
|
18
|
+
candlesHigh,
|
|
19
|
+
bookPrices,
|
|
20
|
+
bookIndexes,
|
|
21
|
+
sentimentShorts,
|
|
22
|
+
sentimentLongs
|
|
23
|
+
},
|
|
24
|
+
additionalData: {
|
|
25
|
+
bucketWidth,
|
|
26
|
+
buckets,
|
|
27
|
+
displayPrecision,
|
|
28
|
+
bookType,
|
|
29
|
+
sentimentThresholdMin,
|
|
30
|
+
sentimentThresholdMax
|
|
31
|
+
},
|
|
32
|
+
isDark,
|
|
33
|
+
isDesktop,
|
|
34
|
+
labelCallback
|
|
35
|
+
} = _ref;
|
|
36
|
+
const styles = (0, _getChartStyles.getChartStyles)(isDark);
|
|
37
|
+
const selectedPriceRef = {
|
|
38
|
+
current: 0
|
|
39
|
+
};
|
|
40
|
+
const visibleXAxisData = dates.slice(dates.length * _constants.CHART_CONFIG.INITIAL_START_ZOOM / 100, dates.length * _constants.CHART_CONFIG.INITIAL_END_ZOOM / 100);
|
|
41
|
+
const isGreaterThanTwoWeeks = (0, _chartUtils.isDifferenceGreaterThanTwoWeeks)(visibleXAxisData[0], visibleXAxisData[visibleXAxisData.length - 1]);
|
|
42
|
+
return {
|
|
43
|
+
animation: false,
|
|
44
|
+
tooltip: (0, _chartOptions.getTooltipConfig)({
|
|
45
|
+
bookType,
|
|
46
|
+
bucketWidth,
|
|
47
|
+
buckets,
|
|
48
|
+
displayPrecision,
|
|
49
|
+
labelCallback,
|
|
50
|
+
selectedPriceRef,
|
|
51
|
+
tooltipLinesColor: styles.tooltipLinesColor
|
|
52
|
+
}),
|
|
53
|
+
grid: (0, _chartOptions.getGridConfig)({
|
|
54
|
+
isDesktop
|
|
55
|
+
}),
|
|
56
|
+
xAxis: (0, _chartOptions.getXAxisConfig)({
|
|
57
|
+
dates,
|
|
58
|
+
isGreaterThanTwoWeeks
|
|
59
|
+
}),
|
|
60
|
+
yAxis: (0, _chartOptions.getYAxisConfig)({
|
|
61
|
+
bucketWidth,
|
|
62
|
+
displayPrecision,
|
|
63
|
+
isDesktop,
|
|
64
|
+
labelCallback
|
|
65
|
+
}),
|
|
66
|
+
dataZoom: (0, _chartOptions.getDataZoomConfig)(),
|
|
67
|
+
visualMap: (0, _chartOptions.getVisualMapConfig)({
|
|
68
|
+
sentimentLongColor: styles.sentimentLongColor,
|
|
69
|
+
sentimentShortColor: styles.sentimentShortColor
|
|
70
|
+
}),
|
|
71
|
+
graphic: (0, _chartOptions.getGridLines)({
|
|
72
|
+
isDark
|
|
73
|
+
}),
|
|
74
|
+
dataset: {
|
|
75
|
+
source: {
|
|
76
|
+
dates,
|
|
77
|
+
candlesOpen,
|
|
78
|
+
candlesClose,
|
|
79
|
+
candlesLow,
|
|
80
|
+
candlesHigh,
|
|
81
|
+
bookPrices: bookPrices !== null && bookPrices !== void 0 ? bookPrices : [],
|
|
82
|
+
bookIndexes: bookIndexes !== null && bookIndexes !== void 0 ? bookIndexes : [],
|
|
83
|
+
sentimentShorts,
|
|
84
|
+
sentimentLongs
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
series: [(0, _chartOptions.getSeriesCandlestickConfig)({
|
|
88
|
+
dates,
|
|
89
|
+
isGreaterThanTwoWeeks,
|
|
90
|
+
styles
|
|
91
|
+
}), (0, _chartOptions.getSeriesHeatmapConfig)({
|
|
92
|
+
bucketWidth,
|
|
93
|
+
buckets,
|
|
94
|
+
isDark,
|
|
95
|
+
sentimentThresholdMax,
|
|
96
|
+
sentimentThresholdMin
|
|
97
|
+
}), (0, _chartOptions.getSeriesSentimentConfig)({
|
|
98
|
+
styles
|
|
99
|
+
})]
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
exports.getOption = getOption;
|
|
103
|
+
//# sourceMappingURL=getOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOption.js","names":["_constants","require","_chartOptions","_chartUtils","_getChartStyles","getOption","_ref","mainData","dates","candlesOpen","candlesClose","candlesLow","candlesHigh","bookPrices","bookIndexes","sentimentShorts","sentimentLongs","additionalData","bucketWidth","buckets","displayPrecision","bookType","sentimentThresholdMin","sentimentThresholdMax","isDark","isDesktop","labelCallback","styles","getChartStyles","selectedPriceRef","current","visibleXAxisData","slice","length","CHART_CONFIG","INITIAL_START_ZOOM","INITIAL_END_ZOOM","isGreaterThanTwoWeeks","isDifferenceGreaterThanTwoWeeks","animation","tooltip","getTooltipConfig","tooltipLinesColor","grid","getGridConfig","xAxis","getXAxisConfig","yAxis","getYAxisConfig","dataZoom","getDataZoomConfig","visualMap","getVisualMapConfig","sentimentLongColor","sentimentShortColor","graphic","getGridLines","dataset","source","series","getSeriesCandlestickConfig","getSeriesHeatmapConfig","getSeriesSentimentConfig","exports"],"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,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAYA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAGO,MAAMI,SAAwB,GAAGC,IAAA,IAuBlC;EAAA,IAvBmC;IACvCC,QAAQ,EAAE;MACRC,KAAK;MACLC,WAAW;MACXC,YAAY;MACZC,UAAU;MACVC,WAAW;MACXC,UAAU;MACVC,WAAW;MACXC,eAAe;MACfC;IACF,CAAC;IACDC,cAAc,EAAE;MACdC,WAAW;MACXC,OAAO;MACPC,gBAAgB;MAChBC,QAAQ;MACRC,qBAAqB;MACrBC;IACF,CAAC;IACDC,MAAM;IACNC,SAAS;IACTC;EACF,CAAC,GAAApB,IAAA;EACC,MAAMqB,MAAM,GAAG,IAAAC,8BAAc,EAACJ,MAAM,CAAC;EACrC,MAAMK,gBAAgB,GAAG;IAAEC,OAAO,EAAE;EAAE,CAAC;EAEvC,MAAMC,gBAAgB,GAAGvB,KAAK,CAACwB,KAAK,CACjCxB,KAAK,CAACyB,MAAM,GAAGC,uBAAY,CAACC,kBAAkB,GAAI,GAAG,EACrD3B,KAAK,CAACyB,MAAM,GAAGC,uBAAY,CAACE,gBAAgB,GAAI,GACnD,CAAC;EAED,MAAMC,qBAAqB,GAAG,IAAAC,2CAA+B,EAC3DP,gBAAgB,CAAC,CAAC,CAAC,EACnBA,gBAAgB,CAACA,gBAAgB,CAACE,MAAM,GAAG,CAAC,CAC9C,CAAC;EAED,OAAO;IACLM,SAAS,EAAE,KAAK;IAChBC,OAAO,EAAE,IAAAC,8BAAgB,EAAC;MACxBpB,QAAQ;MACRH,WAAW;MACXC,OAAO;MACPC,gBAAgB;MAChBM,aAAa;MACbG,gBAAgB;MAChBa,iBAAiB,EA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
38
38
|
});
|
|
39
|
+
var _dataUtils = require("./dataUtils");
|
|
40
|
+
Object.keys(_dataUtils).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _dataUtils[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _dataUtils[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
39
50
|
var _types = require("./types");
|
|
40
51
|
Object.keys(_types).forEach(function (key) {
|
|
41
52
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -58,15 +69,4 @@ Object.keys(_useCrowdViewData).forEach(function (key) {
|
|
|
58
69
|
}
|
|
59
70
|
});
|
|
60
71
|
});
|
|
61
|
-
var _utils = require("./utils");
|
|
62
|
-
Object.keys(_utils).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _utils[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _utils[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Chart","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_chartOptions","_ChartWithData","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Chart","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_chartOptions","_ChartWithData","_dataUtils","_types","_useCrowdViewData"],"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,IAAAA,MAAA,GAAAC,OAAA;AAAA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A,MAAAO,UAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,UAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,MAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,MAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,MAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,MAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,iBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,iBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,iBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,iBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/CrowdViewWidget/components/Chart/types.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts';\n\nimport type {\n BookType,\n Division,\n Granularity,\n} from '../../../gql/types/graphql';\nimport type { InstrumentId } from '../../types';\n\nexport interface Bucket {\n price: number;\n sentiment: number;\n}\n\nexport interface UseCrowdViewDataProps {\n instrument: InstrumentId;\n bookType: BookType;\n division: Division;\n granularity: Granularity;\n}\n\
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/CrowdViewWidget/components/Chart/types.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts';\n\nimport type {\n BookType,\n Division,\n Granularity,\n} from '../../../gql/types/graphql';\nimport type { InstrumentId } from '../../types';\n\nexport interface Bucket {\n price: number;\n sentiment: number;\n}\n\nexport interface UseCrowdViewDataProps {\n instrument: InstrumentId;\n bookType: BookType;\n division: Division;\n granularity: Granularity;\n}\n\ninterface CrowdViewMainData {\n dates: string[];\n candlesOpen: number[];\n candlesClose: number[];\n candlesLow: number[];\n candlesHigh: number[];\n bookPrices?: (number | null)[];\n bookIndexes?: (number | null)[];\n sentimentShorts: (number | null)[];\n sentimentLongs: (number | null)[];\n}\n\ninterface CrowdViewAdditionalData {\n bucketWidth: number;\n buckets: Bucket[][];\n displayPrecision: number;\n bookType: BookType;\n sentimentThresholdMin: number;\n sentimentThresholdMax: number;\n}\n\nexport interface UseCrowdViewDataReturn {\n mainData?: CrowdViewMainData | null;\n additionalData?: CrowdViewAdditionalData | null;\n loading: boolean;\n error: boolean;\n}\n\ninterface GetOptionProps {\n mainData: CrowdViewMainData;\n additionalData: CrowdViewAdditionalData;\n isDark: boolean;\n isDesktop: boolean;\n labelCallback: (key: string, params?: Record<string, unknown>) => string;\n}\n\nexport type GetOptionType = (props: GetOptionProps) => EChartsOption;\n\nexport interface ChartProps {\n mainData: CrowdViewMainData;\n additionalData: CrowdViewAdditionalData;\n isDesktop: boolean;\n}\n\nexport interface ChartWithDataProps {\n bookType: BookType;\n division: Division;\n instrument: InstrumentId;\n granularity: Granularity;\n}\n\nexport interface GetLabelsDataProps {\n dates: string[];\n isGreaterThanTwoWeeks: boolean;\n}\n\ninterface BaseTooltipParam {\n [key: string]: unknown;\n seriesId?: string;\n seriesName?: string;\n seriesType?: string;\n axisValue?: string | number;\n axisValueLabel?: string;\n axisDimension?: string;\n axisIndex?: number;\n value: unknown;\n}\n\nexport type TooltipParam =\n | (BaseTooltipParam & {\n seriesId: 'candlestick';\n value: [number, number, number, number, number]; // [0, open, close, low, high]\n })\n | (BaseTooltipParam & {\n seriesId: 'heatmap';\n value: [string, number, number]; // [time, price, index]\n })\n | (BaseTooltipParam & {\n seriesId: 'sentiment';\n value: [string, number, number]; // [time, shortPercent, longPercent]\n });\n\nexport interface DataZoomBatchItem {\n [key: string]: unknown;\n start: number;\n end: number;\n dataZoomId?: string;\n}\n\nexport interface DataZoomEvent {\n [key: string]: unknown;\n type: 'datazoom';\n batch?: DataZoomBatchItem[];\n}\n\nexport interface DataZoomItem {\n startValue: number;\n endValue: number;\n}\n\nexport type DataZoomArray = Array<DataZoomItem>;\n\nexport interface XAxisItem {\n name?: string;\n}\n\nexport type XAxisArray = Array<XAxisItem>;\n"],"mappings":"","ignoreList":[]}
|