@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
|
@@ -11,7 +11,7 @@ var _getPriceCandles = require("../../../gql/getPriceCandles");
|
|
|
11
11
|
var _getSentiments = require("../../../gql/getSentiments");
|
|
12
12
|
var _graphql = require("../../../gql/types/graphql");
|
|
13
13
|
var _constants = require("../../constants");
|
|
14
|
-
var
|
|
14
|
+
var _dataUtils = require("./dataUtils");
|
|
15
15
|
const useCrowdViewData = _ref => {
|
|
16
16
|
let {
|
|
17
17
|
instrument,
|
|
@@ -30,21 +30,21 @@ const useCrowdViewData = _ref => {
|
|
|
30
30
|
division,
|
|
31
31
|
instrument: dataSource === _graphql.DataSource.Mt5 ? _constants.INSTRUMENTS_CONFIG[instrument].mt5name : _constants.INSTRUMENTS_CONFIG[instrument].v20name,
|
|
32
32
|
granularity,
|
|
33
|
-
timeSpan: (0,
|
|
33
|
+
timeSpan: (0, _dataUtils.getTimeSpanForGranularity)(granularity)
|
|
34
34
|
},
|
|
35
35
|
fetchPolicy: 'no-cache'
|
|
36
36
|
});
|
|
37
|
-
const priceCandlesProcessed = (0, _react.useMemo)(() => (0, _utils.processPriceCandles)(priceCandlesData), [priceCandlesData]);
|
|
38
37
|
const {
|
|
39
38
|
minPrice,
|
|
40
39
|
maxPrice,
|
|
41
40
|
hasValidCandles,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
dates,
|
|
42
|
+
candlesOpen,
|
|
43
|
+
candlesClose,
|
|
44
|
+
candlesLow,
|
|
45
|
+
candlesHigh,
|
|
46
|
+
pipsLocation
|
|
47
|
+
} = (0, _react.useMemo)(() => (0, _dataUtils.processPriceCandles)(priceCandlesData), [priceCandlesData]);
|
|
48
48
|
const {
|
|
49
49
|
loading: orderPositionLoading,
|
|
50
50
|
data: orderPositionData,
|
|
@@ -53,14 +53,25 @@ const useCrowdViewData = _ref => {
|
|
|
53
53
|
variables: {
|
|
54
54
|
instrument: _constants.INSTRUMENTS_CONFIG[instrument].v20name,
|
|
55
55
|
bookType: bookType || _graphql.BookType.Order,
|
|
56
|
-
timeSpan: (0,
|
|
56
|
+
timeSpan: (0, _dataUtils.getTimeSpanForGranularity)(granularity),
|
|
57
57
|
granularity,
|
|
58
|
-
maxBookPrice,
|
|
59
|
-
minBookPrice
|
|
58
|
+
maxBookPrice: maxPrice,
|
|
59
|
+
minBookPrice: minPrice,
|
|
60
|
+
bucketMultiplier: 2,
|
|
61
|
+
bucketMargin: _constants.BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER
|
|
60
62
|
},
|
|
61
63
|
fetchPolicy: 'no-cache',
|
|
62
64
|
skip: priceCandlesLoading || !!priceCandlesError
|
|
63
65
|
});
|
|
66
|
+
const {
|
|
67
|
+
bookPrices,
|
|
68
|
+
bookIndexes,
|
|
69
|
+
buckets,
|
|
70
|
+
bucketWidth,
|
|
71
|
+
sentimentThresholdMin,
|
|
72
|
+
sentimentThresholdMax,
|
|
73
|
+
hasValidBooks
|
|
74
|
+
} = (0, _react.useMemo)(() => (0, _dataUtils.processOrderPositionBooks)(orderPositionData, dates), [orderPositionData, dates]);
|
|
64
75
|
const {
|
|
65
76
|
loading: sentimentsLoading,
|
|
66
77
|
data: sentimentsData,
|
|
@@ -69,16 +80,17 @@ const useCrowdViewData = _ref => {
|
|
|
69
80
|
variables: {
|
|
70
81
|
instrument: _constants.INSTRUMENTS_CONFIG[instrument].v20name,
|
|
71
82
|
granularity,
|
|
72
|
-
timeSpan: (0,
|
|
83
|
+
timeSpan: (0, _dataUtils.getTimeSpanForGranularity)(granularity)
|
|
73
84
|
},
|
|
74
85
|
fetchPolicy: 'no-cache',
|
|
75
86
|
skip: priceCandlesLoading || !!priceCandlesError
|
|
76
87
|
});
|
|
88
|
+
const {
|
|
89
|
+
sentimentLongs,
|
|
90
|
+
sentimentShorts,
|
|
91
|
+
hasValidSentiments
|
|
92
|
+
} = (0, _react.useMemo)(() => (0, _dataUtils.processSentiments)(sentimentsData, dates), [sentimentsData, dates]);
|
|
77
93
|
const loading = priceCandlesLoading || orderPositionLoading || sentimentsLoading;
|
|
78
|
-
const xAxisData = candles.map(candle => (candle === null || candle === void 0 ? void 0 : candle.point) || '');
|
|
79
|
-
const orderPositionBooks = (0, _react.useMemo)(() => (0, _utils.processOrderPositionBooks)(orderPositionData, candleMap), [orderPositionData, candleMap]);
|
|
80
|
-
const buckets = (0, _react.useMemo)(() => (0, _utils.processBuckets)(orderPositionData, targetBucketWidth), [orderPositionData, targetBucketWidth]);
|
|
81
|
-
const sentiments = (0, _react.useMemo)(() => (0, _utils.processSentiments)(sentimentsData, xAxisData), [sentimentsData, xAxisData]);
|
|
82
94
|
const error = (0, _react.useMemo)(() => {
|
|
83
95
|
if (priceCandlesError) {
|
|
84
96
|
return new Error("Price candles error: ".concat(priceCandlesError.message));
|
|
@@ -92,26 +104,37 @@ const useCrowdViewData = _ref => {
|
|
|
92
104
|
if (loading) {
|
|
93
105
|
return null;
|
|
94
106
|
}
|
|
95
|
-
return (0,
|
|
96
|
-
}, [priceCandlesError, orderPositionError, sentimentsError, loading, priceCandlesData, orderPositionData, hasValidCandles]);
|
|
107
|
+
return (0, _dataUtils.validateData)(priceCandlesData, orderPositionData, hasValidCandles, hasValidBooks, hasValidSentiments);
|
|
108
|
+
}, [priceCandlesError, orderPositionError, sentimentsError, loading, priceCandlesData, orderPositionData, hasValidCandles, hasValidBooks, hasValidSentiments]);
|
|
97
109
|
const data = (0, _react.useMemo)(() => {
|
|
98
110
|
if (!priceCandlesData || !orderPositionData || !sentimentsData || error) {
|
|
99
111
|
return null;
|
|
100
112
|
}
|
|
101
|
-
const candlesSeriesData = candles.map(candle => [(candle === null || candle === void 0 ? void 0 : candle.open) || 0, (candle === null || candle === void 0 ? void 0 : candle.close) || 0, (candle === null || candle === void 0 ? void 0 : candle.low) || 0, (candle === null || candle === void 0 ? void 0 : candle.high) || 0]);
|
|
102
113
|
return {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
mainData: {
|
|
115
|
+
dates,
|
|
116
|
+
candlesOpen,
|
|
117
|
+
candlesClose,
|
|
118
|
+
candlesLow,
|
|
119
|
+
candlesHigh,
|
|
120
|
+
bookPrices,
|
|
121
|
+
bookIndexes,
|
|
122
|
+
sentimentShorts,
|
|
123
|
+
sentimentLongs
|
|
124
|
+
},
|
|
125
|
+
additionalData: {
|
|
126
|
+
bucketWidth,
|
|
127
|
+
buckets,
|
|
128
|
+
displayPrecision: pipsLocation,
|
|
129
|
+
bookType,
|
|
130
|
+
sentimentThresholdMin,
|
|
131
|
+
sentimentThresholdMax
|
|
132
|
+
}
|
|
111
133
|
};
|
|
112
|
-
}, [priceCandlesData, orderPositionData, sentimentsData, error,
|
|
134
|
+
}, [priceCandlesData, orderPositionData, sentimentsData, error, dates, candlesOpen, candlesClose, candlesLow, candlesHigh, bookPrices, bookIndexes, sentimentShorts, sentimentLongs, bucketWidth, buckets, pipsLocation, bookType, sentimentThresholdMin, sentimentThresholdMax]);
|
|
113
135
|
return {
|
|
114
|
-
data,
|
|
136
|
+
mainData: data === null || data === void 0 ? void 0 : data.mainData,
|
|
137
|
+
additionalData: data === null || data === void 0 ? void 0 : data.additionalData,
|
|
115
138
|
loading,
|
|
116
139
|
error: !!error
|
|
117
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrowdViewData.js","names":["_client","require","_react","_getOrderPositionBooks","_getPriceCandles","_getSentiments","_graphql","_constants","_utils","useCrowdViewData","_ref","instrument","bookType","division","granularity","dataSource","Division","Ogm","Oj","DataSource","Mt5","V20","loading","priceCandlesLoading","data","priceCandlesData","error","priceCandlesError","useQuery","getPriceCandles","variables","INSTRUMENTS_CONFIG","mt5name","v20name","timeSpan","getTimeSpanForGranularity","fetchPolicy","priceCandlesProcessed","useMemo","processPriceCandles","minPrice","maxPrice","hasValidCandles","candleMap","candles","targetBucketWidth","getTargetBucketWidth","maxBookPrice","BUCKET_CONFIG","PRICE_PADDING_MULTIPLIER","minBookPrice","orderPositionLoading","orderPositionData","orderPositionError","getOrderPositionBooks","BookType","Order","skip","sentimentsLoading","sentimentsData","sentimentsError","getSentiments","xAxisData","map","candle","point","orderPositionBooks","processOrderPositionBooks","buckets","processBuckets","sentiments","processSentiments","Error","concat","message","validateData","candlesSeriesData","open","close","low","high","bucketWidth","precision","exports"],"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 getTargetBucketWidth,\n getTimeSpanForGranularity,\n processBuckets,\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 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 priceCandlesProcessed = useMemo(\n () => processPriceCandles(priceCandlesData),\n [priceCandlesData]\n );\n\n const { minPrice, maxPrice, hasValidCandles, candleMap, candles } =\n priceCandlesProcessed;\n\n const targetBucketWidth = getTargetBucketWidth(granularity, instrument);\n\n const maxBookPrice = useMemo(\n () => maxPrice + targetBucketWidth * BUCKET_CONFIG.PRICE_PADDING_MULTIPLIER,\n [maxPrice, targetBucketWidth]\n );\n\n const minBookPrice = useMemo(\n () => minPrice - targetBucketWidth * BUCKET_CONFIG.PRICE_PADDING_MULTIPLIER,\n [minPrice, targetBucketWidth]\n );\n\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,\n minBookPrice,\n },\n fetchPolicy: 'no-cache',\n skip: priceCandlesLoading || !!priceCandlesError,\n }\n );\n\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 loading =\n priceCandlesLoading || orderPositionLoading || sentimentsLoading;\n const xAxisData = candles.map((candle) => candle?.point || '');\n\n const orderPositionBooks = useMemo(\n () => processOrderPositionBooks(orderPositionData, candleMap),\n [orderPositionData, candleMap]\n );\n\n const buckets = useMemo(\n () => processBuckets(orderPositionData, targetBucketWidth),\n [orderPositionData, targetBucketWidth]\n );\n\n const sentiments = useMemo(\n () => processSentiments(sentimentsData, xAxisData),\n [sentimentsData, xAxisData]\n );\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(priceCandlesData, orderPositionData, hasValidCandles);\n }, [\n priceCandlesError,\n orderPositionError,\n sentimentsError,\n loading,\n priceCandlesData,\n orderPositionData,\n hasValidCandles,\n ]);\n\n const data = useMemo(() => {\n if (!priceCandlesData || !orderPositionData || !sentimentsData || error) {\n return null;\n }\n\n const candlesSeriesData: [number, number, number, number][] = candles.map(\n (candle) => [\n candle?.open || 0,\n candle?.close || 0,\n candle?.low || 0,\n candle?.high || 0,\n ]\n );\n\n return {\n buckets,\n xAxisData,\n candlesSeriesData,\n orderPositionBooks,\n bucketWidth: targetBucketWidth,\n precision: INSTRUMENTS_CONFIG[instrument].precision,\n bookType,\n sentiments,\n };\n }, [\n priceCandlesData,\n orderPositionData,\n sentimentsData,\n error,\n candles,\n buckets,\n xAxisData,\n orderPositionBooks,\n targetBucketWidth,\n instrument,\n bookType,\n sentiments,\n ]);\n\n return {\n data,\n loading,\n error: !!error,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AASA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAUO,MAAMQ,gBAAgB,GAAGC,IAAA,IAKqB;EAAA,IALpB;IAC/BC,UAAU;IACVC,QAAQ;IACRC,QAAQ;IACRC;EACqB,CAAC,GAAAJ,IAAA;EACtB,MAAMK,UAAU,GACdF,QAAQ,KAAKG,iBAAQ,CAACC,GAAG,IAAIJ,QAAQ,KAAKG,iBAAQ,CAACE,EAAE,GACjDC,mBAAU,CAACC,GAAG,GACdD,mBAAU,CAACE,GAAG;EACpB,MAAM;IACJC,OAAO,EAAEC,mBAAmB;IAC5BC,IAAI,EAAEC,gBAAgB;IACtBC,KAAK,EAAEC;EACT,CAAC,GAAG,IAAAC,gBAAQ,EACVC,gCAAe,EACf;IACEC,SAAS,EAAE;MACTf,UAAU;MACVF,QAAQ;MACRF,UAAU,EACRI,UAAU,KAAKI,mBAAU,CAACC,G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ACnDtE,QAAQ;MACR0D;IACF,CAAC;EACH,CAAC,EAAE,CACD7C,gBAAgB,EAChB2B,iBAAiB,EACjBO,cAAc,EACdjC,KAAK,EACLkB,OAAO,EACPwB,OAAO,EACPN,SAAS,EACTI,kBAAkB,EAClBrB,iBAAiB,EACjBlC,UAAU,EACVC,QAAQ,EACR0D,UAAU,CACX,CAAC;EAEF,OAAO;IACL9C,IAAI;IACJF,OAAO;IACPI,KAAK,EAAE,CAAC,CAACA;EACX,CAAC;AACH,CAAC;AAACyD,OAAA,CAAA1E,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useCrowdViewData.js","names":["_client","require","_react","_getOrderPositionBooks","_getPriceCandles","_getSentiments","_graphql","_constants","_dataUtils","useCrowdViewData","_ref","instrument","bookType","division","granularity","dataSource","Division","Ogm","Oj","DataSource","Mt5","V20","loading","priceCandlesLoading","data","priceCandlesData","error","priceCandlesError","useQuery","getPriceCandles","variables","INSTRUMENTS_CONFIG","mt5name","v20name","timeSpan","getTimeSpanForGranularity","fetchPolicy","minPrice","maxPrice","hasValidCandles","dates","candlesOpen","candlesClose","candlesLow","candlesHigh","pipsLocation","useMemo","processPriceCandles","orderPositionLoading","orderPositionData","orderPositionError","getOrderPositionBooks","BookType","Order","maxBookPrice","minBookPrice","bucketMultiplier","bucketMargin","BUCKET_CONFIG","PRICE_MARGIN_MULTIPLIER","skip","bookPrices","bookIndexes","buckets","bucketWidth","sentimentThresholdMin","sentimentThresholdMax","hasValidBooks","processOrderPositionBooks","sentimentsLoading","sentimentsData","sentimentsError","getSentiments","sentimentLongs","sentimentShorts","hasValidSentiments","processSentiments","Error","concat","message","validateData","mainData","additionalData","displayPrecision","exports"],"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,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AASA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AASO,MAAMQ,gBAAgB,GAAGC,IAAA,IAKqB;EAAA,IALpB;IAC/BC,UAAU;IACVC,QAAQ;IACRC,QAAQ;IACRC;EACqB,CAAC,GAAAJ,IAAA;EACtB,MAAMK,UAAU,GACdF,QAAQ,KAAKG,iBAAQ,CAACC,GAAG,IAAIJ,QAAQ,KAAKG,iBAAQ,CAACE,EAAE,GACjDC,mBAAU,CAACC,GAAG,GACdD,mBAAU,CAACE,GAAG;EAGpB,MAAM;IACJC,OAAO,EAAEC,mBAAmB;IAC5BC,IAAI,EAAEC,gBAAgB;IACtBC,KAAK,EAAEC;EACT,CAAC,GAAG,IAAAC,gBAAQ,EACVC,gCAAe,EACf;IACEC,SAAS,EAAE;MACTf,UAAU;MACVF,QAAQ;MACRF,UAAU,EACRI,UAAU,KAAKI,mBAAU,CAACC,GAAG,GACzBW,6BAAkB,CAACpB,UAAU,CAAC,CAACqB,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jBuB,kBAAkB,EAClBqB,eAAe,EACfjD,OAAO,EACPG,gBAAgB,EAChBwB,iBAAiB,EACjBV,eAAe,EACf4B,aAAa,EACbQ,kBAAkB,CACnB,CAAC;EAEF,MAAMnD,IAAI,GAAG,IAAAsB,cAAO,EAAC,MAAM;IACzB,IAAI,CAACrB,gBAAgB,IAAI,CAACwB,iBAAiB,IAAI,CAACqB,cAAc,IAAI5C,KAAK,EAAE;MACvE,OAAO,IAAI;IACb;IAEA,OAAO;MACLuD,QAAQ,EAAE;QACRzC,KAAK;QACLC,WAAW;QACXC,YAAY;QACZC,UAAU;QACVC,WAAW;QACXiB,UAAU;QACVC,WAAW;QACXY,eAAe;QACfD;MACF,CAAC;MACDS,cAAc,EAAE;QACdlB,WAAW;QACXD,OAAO;QACPoB,gBAAgB,EAAEtC,YAAY;QAC9BjC,QAAQ;QACRqD,qBAAqB;QACrBC;MACF;IACF,CAAC;EACH,CAAC,EAAE,CACDzC,gBAAgB,EAChBwB,iBAAiB,EACjBqB,cAAc,EACd5C,KAAK,EACLc,KAAK,EACLC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXiB,UAAU,EACVC,WAAW,EACXY,eAAe,EACfD,cAAc,EACdT,WAAW,EACXD,OAAO,EACPlB,YAAY,EACZjC,QAAQ,EACRqD,qBAAqB,EACrBC,qBAAqB,CACtB,CAAC;EAEF,OAAO;IACLe,QAAQ,EAAEzD,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEyD,QAAQ;IACxBC,cAAc,EAAE1D,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAE0D,cAAc;IACpC5D,OAAO;IACPI,KAAK,EAAE,CAAC,CAACA;EACX,CAAC;AACH,CAAC;AAAC0D,OAAA,CAAA3E,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -4,35 +4,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Legend = void 0;
|
|
7
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
7
8
|
var _monoI18n = require("@oanda/mono-i18n");
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _graphql = require("../../../gql/types/graphql");
|
|
10
|
-
var _constants = require("../../constants");
|
|
11
11
|
var _LegendBar = require("./LegendBar");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const Legend = _ref => {
|
|
14
14
|
let {
|
|
15
|
-
|
|
16
|
-
shortValues = [_constants.BOOKS_THRESHOLDS.MIN, _constants.BOOKS_THRESHOLDS.MAX],
|
|
17
|
-
bookType,
|
|
18
|
-
isDark
|
|
15
|
+
bookType
|
|
19
16
|
} = _ref;
|
|
17
|
+
const {
|
|
18
|
+
isDark
|
|
19
|
+
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
20
20
|
const {
|
|
21
21
|
lang
|
|
22
22
|
} = (0, _monoI18n.useLocale)();
|
|
23
23
|
return _react.default.createElement("div", {
|
|
24
|
-
className: "lw-
|
|
24
|
+
className: "lw-my-4 lw-w-full"
|
|
25
|
+
}, _react.default.createElement("div", {
|
|
26
|
+
className: "lw-mb-1 lw-flex lw-w-full lw-flex-row lw-justify-between"
|
|
25
27
|
}, _react.default.createElement(_LegendBar.LegendBar, {
|
|
26
28
|
isDark: isDark,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
type: "long"
|
|
30
|
+
}), _react.default.createElement("div", {
|
|
31
|
+
className: "lw-w-[250px]"
|
|
30
32
|
}), _react.default.createElement(_LegendBar.LegendBar, {
|
|
31
33
|
isDark: isDark,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}));
|
|
34
|
+
type: "short"
|
|
35
|
+
})), _react.default.createElement("div", {
|
|
36
|
+
className: "lw-flex lw-w-full lw-flex-row lw-justify-between lw-pb-2 lw-font-sans lw-text-xs lw-text-text-primary"
|
|
37
|
+
}, _react.default.createElement("span", null, lang(bookType === _graphql.BookType.Order ? 'buy_overbalance' : 'long_overbalance')), _react.default.createElement("span", null, lang('even_market_demand')), _react.default.createElement("span", null, lang(bookType === _graphql.BookType.Order ? 'sell_overbalance' : 'short_overbalance'))));
|
|
36
38
|
};
|
|
37
39
|
exports.Legend = Legend;
|
|
38
40
|
//# sourceMappingURL=Legend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.js","names":["
|
|
1
|
+
{"version":3,"file":"Legend.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","_graphql","_LegendBar","e","__esModule","default","Legend","_ref","bookType","isDark","useLayoutProvider","lang","useLocale","createElement","className","LegendBar","type","BookType","Order","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Legend/Legend.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { BookType } from '../../../gql/types/graphql';\nimport { LegendBar } from './LegendBar';\n\ninterface LegendProps {\n bookType: BookType;\n}\n\nexport const Legend = ({ bookType }: LegendProps) => {\n const { isDark } = useLayoutProvider();\n const { lang } = useLocale();\n\n return (\n <div className=\"lw-my-4 lw-w-full\">\n <div className=\"lw-mb-1 lw-flex lw-w-full lw-flex-row lw-justify-between\">\n <LegendBar isDark={isDark} type=\"long\" />\n <div className=\"lw-w-[250px]\" />\n <LegendBar isDark={isDark} type=\"short\" />\n </div>\n <div className=\"lw-flex lw-w-full lw-flex-row lw-justify-between lw-pb-2 lw-font-sans lw-text-xs lw-text-text-primary\">\n <span>\n {lang(\n bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance'\n )}\n </span>\n <span>{lang('even_market_demand')}</span>\n <span>\n {lang(\n bookType === BookType.Order\n ? 'sell_overbalance'\n : 'short_overbalance'\n )}\n </span>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,O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AC,EACzCZ,MAAA,CAAAM,OAAA,CAAAQ,aAAA,eACGF,IAAI,CACHH,QAAQ,KAAKS,iBAAQ,CAACC,KAAK,GACvB,kBAAkB,GAClB,mBACN,CACI,CACH,CACF,CAAC;AAEV,CAAC;AAACC,OAAA,CAAAb,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -9,32 +9,21 @@ var _constants = require("../../constants");
|
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
const LegendBar = _ref => {
|
|
11
11
|
let {
|
|
12
|
-
values,
|
|
13
12
|
type,
|
|
14
|
-
label,
|
|
15
13
|
isDark
|
|
16
14
|
} = _ref;
|
|
17
15
|
const colorPalette = isDark ? _constants.COLOR_MAP.dark : _constants.COLOR_MAP.light;
|
|
18
|
-
const
|
|
16
|
+
const startColor = type === 'long' ? colorPalette.long[1] : colorPalette.short[0];
|
|
17
|
+
const endColor = type === 'long' ? colorPalette.long[0] : colorPalette.short[1];
|
|
19
18
|
return _react.default.createElement("div", {
|
|
20
|
-
className: "lw-flex lw-
|
|
21
|
-
}, _react.default.createElement("span", {
|
|
22
|
-
className: "lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary"
|
|
23
|
-
}, label), _react.default.createElement("div", {
|
|
24
|
-
className: "lw-flex lw-h-2 lw-w-full lw-overflow-hidden lw-border lw-border-border-primary"
|
|
19
|
+
className: "lw-flex lw-h-2 lw-w-full lw-overflow-hidden"
|
|
25
20
|
}, _react.default.createElement("div", {
|
|
26
21
|
className: "lw-h-full lw-flex-1",
|
|
27
22
|
"data-testid": "legend-bar-segment",
|
|
28
23
|
style: {
|
|
29
|
-
background: "linear-gradient(90deg,".concat(
|
|
24
|
+
background: "linear-gradient(90deg,".concat(startColor, " 0%, ").concat(endColor, " 100%)")
|
|
30
25
|
}
|
|
31
|
-
}))
|
|
32
|
-
className: "lw-flex lw-w-full lw-justify-between"
|
|
33
|
-
}, _react.default.createElement("span", {
|
|
34
|
-
className: "lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary"
|
|
35
|
-
}, values[0].toFixed(2), "%"), _react.default.createElement("span", {
|
|
36
|
-
className: "lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary"
|
|
37
|
-
}, "\u2264 ".concat(values[1].toFixed(2)), "%")));
|
|
26
|
+
}));
|
|
38
27
|
};
|
|
39
28
|
exports.LegendBar = LegendBar;
|
|
40
29
|
//# sourceMappingURL=LegendBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendBar.js","names":["_react","_interopRequireDefault","require","_constants","e","__esModule","default","LegendBar","_ref","
|
|
1
|
+
{"version":3,"file":"LegendBar.js","names":["_react","_interopRequireDefault","require","_constants","e","__esModule","default","LegendBar","_ref","type","isDark","colorPalette","COLOR_MAP","dark","light","startColor","long","short","endColor","createElement","className","style","background","concat","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Legend/LegendBar.tsx"],"sourcesContent":["import React from 'react';\n\nimport { COLOR_MAP } from '../../constants';\n\nexport type LegendType = 'long' | 'short';\n\ninterface LegendBarProps {\n type: LegendType;\n isDark: boolean;\n}\n\nexport const LegendBar = ({ type, isDark }: LegendBarProps) => {\n const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;\n const startColor =\n type === 'long' ? colorPalette.long[1] : colorPalette.short[0];\n const endColor =\n type === 'long' ? colorPalette.long[0] : colorPalette.short[1];\n\n return (\n <div className=\"lw-flex lw-h-2 lw-w-full lw-overflow-hidden\">\n <div\n className=\"lw-h-full lw-flex-1\"\n data-testid=\"legend-bar-segment\"\n style={{\n background: `linear-gradient(90deg,${startColor} 0%, ${endColor} 100%)`,\n }}\n />\n </div>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AASrC,MAAMG,SAAS,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,IAAI;IAAEC;EAAuB,CAAC,GAAAF,IAAA;EACxD,MAAMG,YAAY,GAAGD,MAAM,GAAGE,oBAAS,CAACC,IAAI,GAAGD,oBAAS,CAACE,KAAK;EAC9D,MAAMC,UAAU,GACdN,IAAI,KAAK,MAAM,GAAGE,YAAY,CAACK,IAAI,CAAC,CAAC,CAAC,GAAGL,YAAY,CAACM,KAAK,CAAC,CAAC,CAAC;EAChE,MAAMC,QAAQ,GACZT,IAAI,KAAK,MAAM,GAAGE,YAAY,CAACK,IAAI,CAAC,CAAC,CAAC,GAAGL,YAAY,CAACM,KAAK,CAAC,CAAC,CAAC;EAEhE,OACEjB,MAAA,CAAAM,OAAA,CAAAa,aAAA;IAAKC,SAAS,EAAC;EAA6C,GAC1DpB,MAAA,CAAAM,OAAA,CAAAa,aAAA;IACEC,SAAS,EAAC,qBAAqB;IAC/B,eAAY,oBAAoB;IAChCC,KAAK,EAAE;MACLC,UAAU,2BAAAC,MAAA,CAA2BR,UAAU,WAAAQ,MAAA,CAAQL,QAAQ;IACjE;EAAE,CACH,CACE,CAAC;AAEV,CAAC;AAACM,OAAA,CAAAjB,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TIME_THRESHOLDS = exports.INSTRUMENTS_CONFIG = exports.COLOR_MAP = exports.
|
|
6
|
+
exports.TIME_THRESHOLDS = exports.INSTRUMENTS_CONFIG = exports.COLOR_MAP = exports.CHART_CONFIG = exports.BUCKET_CONFIG = void 0;
|
|
7
7
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
8
9
|
var _types = require("./types");
|
|
9
|
-
|
|
10
|
-
MIN: 0.15,
|
|
11
|
-
MAX: 0.55
|
|
12
|
-
};
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
11
|
const BUCKET_CONFIG = exports.BUCKET_CONFIG = {
|
|
14
12
|
MULTIPLIER: 4,
|
|
15
|
-
|
|
13
|
+
PRICE_MARGIN_MULTIPLIER: 2
|
|
16
14
|
};
|
|
17
15
|
const TIME_THRESHOLDS = exports.TIME_THRESHOLDS = {
|
|
18
16
|
TWO_WEEKS_MS: 14 * 24 * 60 * 60 * 1000
|
|
19
17
|
};
|
|
20
18
|
const CHART_CONFIG = exports.CHART_CONFIG = {
|
|
19
|
+
HEIGHT: 440,
|
|
21
20
|
MAIN_HEIGHT: 400,
|
|
22
21
|
MARGIN_BETWEEN: 50,
|
|
23
22
|
SENTIMENT_HEIGHT: 120,
|
|
@@ -25,26 +24,21 @@ const CHART_CONFIG = exports.CHART_CONFIG = {
|
|
|
25
24
|
X_LABEL_SIZE: 40,
|
|
26
25
|
Y_LABEL_SIZE_DESKTOP: 60,
|
|
27
26
|
Y_LABEL_SIZE_MOBILE: 40,
|
|
28
|
-
|
|
27
|
+
Y_SENTIMENT_LABEL_SIZE: 40,
|
|
28
|
+
INITIAL_START_ZOOM: 90,
|
|
29
29
|
INITIAL_END_ZOOM: 100,
|
|
30
30
|
X_AXIS_DATE_PADDING: ' ',
|
|
31
31
|
SENTIMENT_MIN: 0,
|
|
32
|
-
SENTIMENT_MAX: 100
|
|
33
|
-
SENTIMENT_INTERVAL: 25,
|
|
34
|
-
SENTIMENT_TEXT_OFFSET: 16
|
|
35
|
-
};
|
|
36
|
-
const CHART_CONFIG_CALCULATED = exports.CHART_CONFIG_CALCULATED = {
|
|
37
|
-
FULL_HEIGHT: CHART_CONFIG.MAIN_HEIGHT + CHART_CONFIG.MARGIN_BETWEEN + CHART_CONFIG.SENTIMENT_HEIGHT + CHART_CONFIG.X_LABEL_SIZE,
|
|
38
|
-
SENTIMENT_TEXT_POSITION: CHART_CONFIG.SENTIMENT_HEIGHT + CHART_CONFIG.SENTIMENT_TEXT_OFFSET
|
|
32
|
+
SENTIMENT_MAX: 100
|
|
39
33
|
};
|
|
40
34
|
const COLOR_MAP = exports.COLOR_MAP = {
|
|
41
35
|
dark: {
|
|
42
|
-
long: [_labsWidgetCommon.colorPalette.darkBlue10, _labsWidgetCommon.colorPalette.darkBlue90],
|
|
43
|
-
short: [_labsWidgetCommon.colorPalette.darkYellow10, _labsWidgetCommon.colorPalette.darkYellow90]
|
|
36
|
+
long: [(0, _chromaJs.default)(_labsWidgetCommon.colorPalette.darkBlue10).shade(0.5).hex(), (0, _chromaJs.default)(_labsWidgetCommon.colorPalette.darkBlue90).shade(0.5).hex()],
|
|
37
|
+
short: [(0, _chromaJs.default)(_labsWidgetCommon.colorPalette.darkYellow10).shade(0.5).hex(), (0, _chromaJs.default)(_labsWidgetCommon.colorPalette.darkYellow90).shade(0.5).hex()]
|
|
44
38
|
},
|
|
45
39
|
light: {
|
|
46
|
-
long: [_labsWidgetCommon.colorPalette.lightBlue10, _labsWidgetCommon.colorPalette.lightBlue90],
|
|
47
|
-
short: [_labsWidgetCommon.colorPalette.lightYellow10, _labsWidgetCommon.colorPalette.lightYellow90]
|
|
40
|
+
long: [(0, _chromaJs.default)(_labsWidgetCommon.colorPalette.lightBlue10).tint(0.5).hex(), (0, _chromaJs.default)(_labsWidgetCommon.colorPalette.lightBlue90).tint(0.5).hex()],
|
|
41
|
+
short: [(0, _chromaJs.default)(_labsWidgetCommon.colorPalette.lightYellow10).tint(0.5).hex(), (0, _chromaJs.default)(_labsWidgetCommon.colorPalette.lightYellow90).tint(0.5).hex()]
|
|
48
42
|
}
|
|
49
43
|
};
|
|
50
44
|
const INSTRUMENTS_CONFIG = exports.INSTRUMENTS_CONFIG = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["_labsWidgetCommon","require","
|
|
1
|
+
{"version":3,"file":"constants.js","names":["_labsWidgetCommon","require","_chromaJs","_interopRequireDefault","_types","e","__esModule","default","BUCKET_CONFIG","exports","MULTIPLIER","PRICE_MARGIN_MULTIPLIER","TIME_THRESHOLDS","TWO_WEEKS_MS","CHART_CONFIG","HEIGHT","MAIN_HEIGHT","MARGIN_BETWEEN","SENTIMENT_HEIGHT","WIDTH","X_LABEL_SIZE","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","Y_SENTIMENT_LABEL_SIZE","INITIAL_START_ZOOM","INITIAL_END_ZOOM","X_AXIS_DATE_PADDING","SENTIMENT_MIN","SENTIMENT_MAX","COLOR_MAP","dark","long","chroma","colorPalette","darkBlue10","shade","hex","darkBlue90","short","darkYellow10","darkYellow90","light","lightBlue10","tint","lightBlue90","lightYellow10","lightYellow90","INSTRUMENTS_CONFIG","InstrumentId","EUR_AUD","mt5name","v20name","precision","defaultBucketWidth","EUR_GBP","EUR_JPY","EUR_USD","EUR_CHF","USD_CHF","USD_JPY","USD_CAD","GBP_USD","GBP_JPY","GBP_CHF","AUD_JPY","AUD_USD","NZD_USD","XAU_USD","XAG_USD"],"sources":["../../../src/CrowdViewWidget/constants.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport chroma from 'chroma-js';\n\nimport { InstrumentId } from './types';\n\nexport const BUCKET_CONFIG = {\n MULTIPLIER: 4,\n PRICE_MARGIN_MULTIPLIER: 2,\n} as const;\n\nexport const TIME_THRESHOLDS = {\n TWO_WEEKS_MS: 14 * 24 * 60 * 60 * 1000,\n} as const;\n\nexport const CHART_CONFIG = {\n HEIGHT: 440,\n MAIN_HEIGHT: 400,\n MARGIN_BETWEEN: 50,\n SENTIMENT_HEIGHT: 120,\n WIDTH: 9999,\n X_LABEL_SIZE: 40,\n Y_LABEL_SIZE_DESKTOP: 60,\n Y_LABEL_SIZE_MOBILE: 40,\n Y_SENTIMENT_LABEL_SIZE: 40,\n INITIAL_START_ZOOM: 90,\n INITIAL_END_ZOOM: 100,\n X_AXIS_DATE_PADDING: ' ',\n SENTIMENT_MIN: 0,\n SENTIMENT_MAX: 100,\n} as const;\n\nexport const COLOR_MAP = {\n dark: {\n long: [\n chroma(colorPalette.darkBlue10).shade(0.5).hex(),\n chroma(colorPalette.darkBlue90).shade(0.5).hex(),\n ],\n short: [\n chroma(colorPalette.darkYellow10).shade(0.5).hex(),\n chroma(colorPalette.darkYellow90).shade(0.5).hex(),\n ],\n },\n light: {\n long: [\n chroma(colorPalette.lightBlue10).tint(0.5).hex(),\n chroma(colorPalette.lightBlue90).tint(0.5).hex(),\n ],\n short: [\n chroma(colorPalette.lightYellow10).tint(0.5).hex(),\n chroma(colorPalette.lightYellow90).tint(0.5).hex(),\n ],\n },\n} as const;\n\nexport const INSTRUMENTS_CONFIG: Record<\n InstrumentId,\n {\n precision: number;\n defaultBucketWidth: number;\n v20name: string;\n mt5name: string;\n }\n> = {\n [InstrumentId.EUR_AUD]: {\n mt5name: 'EURAUD',\n v20name: 'EUR_AUD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.EUR_GBP]: {\n mt5name: 'EURGBP',\n v20name: 'EUR_GBP',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.EUR_JPY]: {\n mt5name: 'EURJPY',\n v20name: 'EUR_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.EUR_USD]: {\n mt5name: 'EURUSD',\n v20name: 'EUR_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.EUR_CHF]: {\n mt5name: 'EURCHF',\n v20name: 'EUR_CHF',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.USD_CHF]: {\n mt5name: 'USDCHF',\n v20name: 'USD_CHF',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.USD_JPY]: {\n mt5name: 'USDJPY',\n v20name: 'USD_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.USD_CAD]: {\n mt5name: 'USDCAD',\n v20name: 'USD_CAD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.GBP_USD]: {\n mt5name: 'GBPUSD',\n v20name: 'GBP_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.GBP_JPY]: {\n mt5name: 'GBPJPY',\n v20name: 'GBP_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.GBP_CHF]: {\n mt5name: 'GBPCHF',\n v20name: 'GBP_CHF',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.AUD_JPY]: {\n mt5name: 'AUDJPY',\n v20name: 'AUD_JPY',\n precision: 3,\n defaultBucketWidth: 0.05,\n },\n [InstrumentId.AUD_USD]: {\n mt5name: 'AUDUSD',\n v20name: 'AUD_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.NZD_USD]: {\n mt5name: 'NZDUSD',\n v20name: 'NZD_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n [InstrumentId.XAU_USD]: {\n mt5name: 'XAUUSD',\n v20name: 'XAU_USD',\n precision: 3,\n defaultBucketWidth: 0.5,\n },\n [InstrumentId.XAG_USD]: {\n mt5name: 'XAGUSD',\n v20name: 'XAG_USD',\n precision: 5,\n defaultBucketWidth: 0.0005,\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAAuC,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC3BE,UAAU,EAAE,CAAC;EACbC,uBAAuB,EAAE;AAC3B,CAAU;AAEH,MAAM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AE;EACtB,CAAC;EACD,CAACL,mBAAY,CAACmB,OAAO,GAAG;IACtBjB,OAAO,EAAE,QAAQ;IACjBC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,CAAC;IACZC,kBAAkB,EAAE;EACtB,CAAC;EACD,CAACL,mBAAY,CAACoB,OAAO,GAAG;IACtBlB,OAAO,EAAE,QAAQ;IACjBC,OAAO,EAAE,SAAS;IAClBC,SAAS,EAAE,CAAC;IACZC,kBAAkB,EAAE;EACtB;AACF,CAAC","ignoreList":[]}
|
|
@@ -7,5 +7,5 @@ exports.getOrderPositionBooks = void 0;
|
|
|
7
7
|
var _client = require("@apollo/client");
|
|
8
8
|
var _templateObject;
|
|
9
9
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
10
|
-
const getOrderPositionBooks = exports.getOrderPositionBooks = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n
|
|
10
|
+
const getOrderPositionBooks = exports.getOrderPositionBooks = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n $bucketMultiplier: Int!\n $bucketMargin: Int!\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n bucketMultiplier: $bucketMultiplier\n bucketMargin: $bucketMargin\n ) {\n books {\n time\n price\n buckets {\n price\n sentiment\n }\n }\n bucketWidth\n sentimentThresholdMax\n sentimentThresholdMin\n }\n }\n"])));
|
|
11
11
|
//# sourceMappingURL=getOrderPositionBooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrderPositionBooks.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getOrderPositionBooks","exports","gql"],"sources":["../../../src/gql/getOrderPositionBooks.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getOrderPositionBooks = gql`\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n
|
|
1
|
+
{"version":3,"file":"getOrderPositionBooks.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getOrderPositionBooks","exports","gql"],"sources":["../../../src/gql/getOrderPositionBooks.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getOrderPositionBooks = gql`\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n $bucketMultiplier: Int!\n $bucketMargin: Int!\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n bucketMultiplier: $bucketMultiplier\n bucketMargin: $bucketMargin\n ) {\n books {\n time\n price\n buckets {\n price\n sentiment\n }\n }\n bucketWidth\n sentimentThresholdMax\n sentimentThresholdMin\n }\n }\n`;\n\nexport { getOrderPositionBooks };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,CAAA,EAAAC,CAAA,WAAAA,CAAA,KAAAA,CAAA,GAAAD,CAAA,CAAAE,KAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,CAAA,IAAAM,GAAA,IAAAC,KAAA,EAAAJ,MAAA,CAAAC,MAAA,CAAAH,CAAA;AAErC,MAAMO,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,OAAGE,WAAG,EAAAZ,eAAA,KAAAA,eAAA,GAAAC,sBAAA,uwBAkChC","ignoreList":[]}
|
|
@@ -7,5 +7,5 @@ exports.getPriceCandles = void 0;
|
|
|
7
7
|
var _client = require("@apollo/client");
|
|
8
8
|
var _templateObject;
|
|
9
9
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
10
|
-
const getPriceCandles = exports.getPriceCandles = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n }\n }\n"])));
|
|
10
|
+
const getPriceCandles = exports.getPriceCandles = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n"])));
|
|
11
11
|
//# sourceMappingURL=getPriceCandles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPriceCandles.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getPriceCandles","exports","gql"],"sources":["../../../src/gql/getPriceCandles.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getPriceCandles = gql`\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n }\n }\n`;\n\nexport { getPriceCandles };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,CAAA,EAAAC,CAAA,WAAAA,CAAA,KAAAA,CAAA,GAAAD,CAAA,CAAAE,KAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,CAAA,IAAAM,GAAA,IAAAC,KAAA,EAAAJ,MAAA,CAAAC,MAAA,CAAAH,CAAA;AAErC,MAAMO,eAAe,GAAAC,OAAA,CAAAD,eAAA,OAAGE,WAAG,EAAAZ,eAAA,KAAAA,eAAA,GAAAC,sBAAA,
|
|
1
|
+
{"version":3,"file":"getPriceCandles.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getPriceCandles","exports","gql"],"sources":["../../../src/gql/getPriceCandles.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getPriceCandles = gql`\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n`;\n\nexport { getPriceCandles };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,CAAA,EAAAC,CAAA,WAAAA,CAAA,KAAAA,CAAA,GAAAD,CAAA,CAAAE,KAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,CAAA,IAAAM,GAAA,IAAAC,KAAA,EAAAJ,MAAA,CAAAC,MAAA,CAAAH,CAAA;AAErC,MAAMO,eAAe,GAAAC,OAAA,CAAAD,eAAA,OAAGE,WAAG,EAAAZ,eAAA,KAAAA,eAAA,GAAAC,sBAAA,weAyB1B","ignoreList":[]}
|
|
@@ -7,8 +7,8 @@ exports.graphql = graphql;
|
|
|
7
7
|
var types = _interopRequireWildcard(require("./graphql"));
|
|
8
8
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
9
|
const documents = {
|
|
10
|
-
'\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n ) {\n
|
|
11
|
-
'\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n }\n }\n': types.GetPriceCandlesDocument,
|
|
10
|
+
'\n query GetOrderPositionBooks(\n $instrument: String!\n $bookType: BookType!\n $timeSpan: TimeSpan!\n $granularity: Granularity!\n $maxBookPrice: Float\n $minBookPrice: Float\n $bucketMultiplier: Int!\n $bucketMargin: Int!\n ) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n timeSpan: $timeSpan\n granularity: $granularity\n maxBookPrice: $maxBookPrice\n minBookPrice: $minBookPrice\n bucketMultiplier: $bucketMultiplier\n bucketMargin: $bucketMargin\n ) {\n books {\n time\n price\n buckets {\n price\n sentiment\n }\n }\n bucketWidth\n sentimentThresholdMax\n sentimentThresholdMin\n }\n }\n': types.GetOrderPositionBooksDocument,
|
|
11
|
+
'\n query GetPriceCandles(\n $dataSource: DataSource!\n $division: Division!\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n priceCandles(\n dataSource: $dataSource\n division: $division\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n candle {\n point\n high\n low\n open\n close\n }\n pipsLocation\n }\n }\n': types.GetPriceCandlesDocument,
|
|
12
12
|
'\n query GetSentiments(\n $instrument: String!\n $granularity: Granularity!\n $timeSpan: TimeSpan!\n ) {\n sentiments(\n instrument: $instrument\n granularity: $granularity\n timeSpan: $timeSpan\n ) {\n sentiments {\n sentiment {\n longPercent\n shortPercent\n }\n time\n }\n }\n }\n': types.GetSentimentsDocument
|
|
13
13
|
};
|
|
14
14
|
function graphql(source) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.js","names":["types","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","documents","GetOrderPositionBooksDocument","GetPriceCandlesDocument","GetSentimentsDocument","graphql","source","_source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n '\\n query GetOrderPositionBooks(\\n $instrument: String!\\n $bookType: BookType!\\n $timeSpan: TimeSpan!\\n $granularity: Granularity!\\n $maxBookPrice: Float\\n $minBookPrice: Float\\n ) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n timeSpan: $timeSpan\\n granularity: $granularity\\n maxBookPrice: $maxBookPrice\\n minBookPrice: $minBookPrice\\n ) {\\n
|
|
1
|
+
{"version":3,"file":"gql.js","names":["types","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","documents","GetOrderPositionBooksDocument","GetPriceCandlesDocument","GetSentimentsDocument","graphql","source","_source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n '\\n query GetOrderPositionBooks(\\n $instrument: String!\\n $bookType: BookType!\\n $timeSpan: TimeSpan!\\n $granularity: Granularity!\\n $maxBookPrice: Float\\n $minBookPrice: Float\\n $bucketMultiplier: Int!\\n $bucketMargin: Int!\\n ) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n timeSpan: $timeSpan\\n granularity: $granularity\\n maxBookPrice: $maxBookPrice\\n minBookPrice: $minBookPrice\\n bucketMultiplier: $bucketMultiplier\\n bucketMargin: $bucketMargin\\n ) {\\n books {\\n time\\n price\\n buckets {\\n price\\n sentiment\\n }\\n }\\n bucketWidth\\n sentimentThresholdMax\\n sentimentThresholdMin\\n }\\n }\\n':\n types.GetOrderPositionBooksDocument,\n '\\n query GetPriceCandles(\\n $dataSource: DataSource!\\n $division: Division!\\n $instrument: String!\\n $granularity: Granularity!\\n $timeSpan: TimeSpan!\\n ) {\\n priceCandles(\\n dataSource: $dataSource\\n division: $division\\n instrument: $instrument\\n granularity: $granularity\\n timeSpan: $timeSpan\\n ) {\\n candle {\\n point\\n high\\n low\\n open\\n close\\n }\\n pipsLocation\\n }\\n }\\n':\n types.GetPriceCandlesDocument,\n '\\n query GetSentiments(\\n $instrument: String!\\n $granularity: Granularity!\\n $timeSpan: TimeSpan!\\n ) {\\n sentiments(\\n instrument: $instrument\\n granularity: $granularity\\n timeSpan: $timeSpan\\n ) {\\n sentiments {\\n sentiment {\\n longPercent\\n shortPercent\\n }\\n time\\n }\\n }\\n }\\n':\n types.GetSentimentsDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query GetOrderPositionBooks(\\n $instrument: String!\\n $bookType: BookType!\\n $timeSpan: TimeSpan!\\n $granularity: Granularity!\\n $maxBookPrice: Float\\n $minBookPrice: Float\\n $bucketMultiplier: Int!\\n $bucketMargin: Int!\\n ) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n timeSpan: $timeSpan\\n granularity: $granularity\\n maxBookPrice: $maxBookPrice\\n minBookPrice: $minBookPrice\\n bucketMultiplier: $bucketMultiplier\\n bucketMargin: $bucketMargin\\n ) {\\n books {\\n time\\n price\\n buckets {\\n price\\n sentiment\\n }\\n }\\n bucketWidth\\n sentimentThresholdMax\\n sentimentThresholdMin\\n }\\n }\\n'\n): (typeof documents)['\\n query GetOrderPositionBooks(\\n $instrument: String!\\n $bookType: BookType!\\n $timeSpan: TimeSpan!\\n $granularity: Granularity!\\n $maxBookPrice: Float\\n $minBookPrice: Float\\n $bucketMultiplier: Int!\\n $bucketMargin: Int!\\n ) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n timeSpan: $timeSpan\\n granularity: $granularity\\n maxBookPrice: $maxBookPrice\\n minBookPrice: $minBookPrice\\n bucketMultiplier: $bucketMultiplier\\n bucketMargin: $bucketMargin\\n ) {\\n books {\\n time\\n price\\n buckets {\\n price\\n sentiment\\n }\\n }\\n bucketWidth\\n sentimentThresholdMax\\n sentimentThresholdMin\\n }\\n }\\n'];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query GetPriceCandles(\\n $dataSource: DataSource!\\n $division: Division!\\n $instrument: String!\\n $granularity: Granularity!\\n $timeSpan: TimeSpan!\\n ) {\\n priceCandles(\\n dataSource: $dataSource\\n division: $division\\n instrument: $instrument\\n granularity: $granularity\\n timeSpan: $timeSpan\\n ) {\\n candle {\\n point\\n high\\n low\\n open\\n close\\n }\\n pipsLocation\\n }\\n }\\n'\n): (typeof documents)['\\n query GetPriceCandles(\\n $dataSource: DataSource!\\n $division: Division!\\n $instrument: String!\\n $granularity: Granularity!\\n $timeSpan: TimeSpan!\\n ) {\\n priceCandles(\\n dataSource: $dataSource\\n division: $division\\n instrument: $instrument\\n granularity: $granularity\\n timeSpan: $timeSpan\\n ) {\\n candle {\\n point\\n high\\n low\\n open\\n close\\n }\\n pipsLocation\\n }\\n }\\n'];\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query GetSentiments(\\n $instrument: String!\\n $granularity: Granularity!\\n $timeSpan: TimeSpan!\\n ) {\\n sentiments(\\n instrument: $instrument\\n granularity: $granularity\\n timeSpan: $timeSpan\\n ) {\\n sentiments {\\n sentiment {\\n longPercent\\n shortPercent\\n }\\n time\\n }\\n }\\n }\\n'\n): (typeof documents)['\\n query GetSentiments(\\n $instrument: String!\\n $granularity: Granularity!\\n $timeSpan: TimeSpan!\\n ) {\\n sentiments(\\n instrument: $instrument\\n granularity: $granularity\\n timeSpan: $timeSpan\\n ) {\\n sentiments {\\n sentiment {\\n longPercent\\n shortPercent\\n }\\n time\\n }\\n }\\n }\\n'];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmC,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,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