@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
|
@@ -14,16 +14,14 @@ import type {
|
|
|
14
14
|
} from '../../../gql/types/graphql';
|
|
15
15
|
import { BookType, DataSource, Division } from '../../../gql/types/graphql';
|
|
16
16
|
import { BUCKET_CONFIG, INSTRUMENTS_CONFIG } from '../../constants';
|
|
17
|
-
import type { UseCrowdViewDataProps, UseCrowdViewDataReturn } from './types';
|
|
18
17
|
import {
|
|
19
|
-
getTargetBucketWidth,
|
|
20
18
|
getTimeSpanForGranularity,
|
|
21
|
-
processBuckets,
|
|
22
19
|
processOrderPositionBooks,
|
|
23
20
|
processPriceCandles,
|
|
24
21
|
processSentiments,
|
|
25
22
|
validateData,
|
|
26
|
-
} from './
|
|
23
|
+
} from './dataUtils';
|
|
24
|
+
import type { UseCrowdViewDataProps, UseCrowdViewDataReturn } from './types';
|
|
27
25
|
|
|
28
26
|
export const useCrowdViewData = ({
|
|
29
27
|
instrument,
|
|
@@ -35,6 +33,8 @@ export const useCrowdViewData = ({
|
|
|
35
33
|
division === Division.Ogm || division === Division.Oj
|
|
36
34
|
? DataSource.Mt5
|
|
37
35
|
: DataSource.V20;
|
|
36
|
+
|
|
37
|
+
// Get price candles data
|
|
38
38
|
const {
|
|
39
39
|
loading: priceCandlesLoading,
|
|
40
40
|
data: priceCandlesData,
|
|
@@ -56,26 +56,19 @@ export const useCrowdViewData = ({
|
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const minBookPrice = useMemo(
|
|
75
|
-
() => minPrice - targetBucketWidth * BUCKET_CONFIG.PRICE_PADDING_MULTIPLIER,
|
|
76
|
-
[minPrice, targetBucketWidth]
|
|
77
|
-
);
|
|
78
|
-
|
|
59
|
+
const {
|
|
60
|
+
minPrice,
|
|
61
|
+
maxPrice,
|
|
62
|
+
hasValidCandles,
|
|
63
|
+
dates,
|
|
64
|
+
candlesOpen,
|
|
65
|
+
candlesClose,
|
|
66
|
+
candlesLow,
|
|
67
|
+
candlesHigh,
|
|
68
|
+
pipsLocation,
|
|
69
|
+
} = useMemo(() => processPriceCandles(priceCandlesData), [priceCandlesData]);
|
|
70
|
+
|
|
71
|
+
// Get order position books data
|
|
79
72
|
const {
|
|
80
73
|
loading: orderPositionLoading,
|
|
81
74
|
data: orderPositionData,
|
|
@@ -88,14 +81,30 @@ export const useCrowdViewData = ({
|
|
|
88
81
|
bookType: bookType || BookType.Order,
|
|
89
82
|
timeSpan: getTimeSpanForGranularity(granularity),
|
|
90
83
|
granularity,
|
|
91
|
-
maxBookPrice,
|
|
92
|
-
minBookPrice,
|
|
84
|
+
maxBookPrice: maxPrice,
|
|
85
|
+
minBookPrice: minPrice,
|
|
86
|
+
bucketMultiplier: 2,
|
|
87
|
+
bucketMargin: BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,
|
|
93
88
|
},
|
|
94
89
|
fetchPolicy: 'no-cache',
|
|
95
90
|
skip: priceCandlesLoading || !!priceCandlesError,
|
|
96
91
|
}
|
|
97
92
|
);
|
|
98
93
|
|
|
94
|
+
const {
|
|
95
|
+
bookPrices,
|
|
96
|
+
bookIndexes,
|
|
97
|
+
buckets,
|
|
98
|
+
bucketWidth,
|
|
99
|
+
sentimentThresholdMin,
|
|
100
|
+
sentimentThresholdMax,
|
|
101
|
+
hasValidBooks,
|
|
102
|
+
} = useMemo(
|
|
103
|
+
() => processOrderPositionBooks(orderPositionData, dates),
|
|
104
|
+
[orderPositionData, dates]
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// Get sentiments data
|
|
99
108
|
const {
|
|
100
109
|
loading: sentimentsLoading,
|
|
101
110
|
data: sentimentsData,
|
|
@@ -110,24 +119,14 @@ export const useCrowdViewData = ({
|
|
|
110
119
|
skip: priceCandlesLoading || !!priceCandlesError,
|
|
111
120
|
});
|
|
112
121
|
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const orderPositionBooks = useMemo(
|
|
118
|
-
() => processOrderPositionBooks(orderPositionData, candleMap),
|
|
119
|
-
[orderPositionData, candleMap]
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
const buckets = useMemo(
|
|
123
|
-
() => processBuckets(orderPositionData, targetBucketWidth),
|
|
124
|
-
[orderPositionData, targetBucketWidth]
|
|
122
|
+
const { sentimentLongs, sentimentShorts, hasValidSentiments } = useMemo(
|
|
123
|
+
() => processSentiments(sentimentsData, dates),
|
|
124
|
+
[sentimentsData, dates]
|
|
125
125
|
);
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
);
|
|
127
|
+
// Gather all results
|
|
128
|
+
const loading =
|
|
129
|
+
priceCandlesLoading || orderPositionLoading || sentimentsLoading;
|
|
131
130
|
|
|
132
131
|
const error = useMemo((): Error | null => {
|
|
133
132
|
if (priceCandlesError) {
|
|
@@ -142,7 +141,13 @@ export const useCrowdViewData = ({
|
|
|
142
141
|
if (loading) {
|
|
143
142
|
return null;
|
|
144
143
|
}
|
|
145
|
-
return validateData(
|
|
144
|
+
return validateData(
|
|
145
|
+
priceCandlesData,
|
|
146
|
+
orderPositionData,
|
|
147
|
+
hasValidCandles,
|
|
148
|
+
hasValidBooks,
|
|
149
|
+
hasValidSentiments
|
|
150
|
+
);
|
|
146
151
|
}, [
|
|
147
152
|
priceCandlesError,
|
|
148
153
|
orderPositionError,
|
|
@@ -151,6 +156,8 @@ export const useCrowdViewData = ({
|
|
|
151
156
|
priceCandlesData,
|
|
152
157
|
orderPositionData,
|
|
153
158
|
hasValidCandles,
|
|
159
|
+
hasValidBooks,
|
|
160
|
+
hasValidSentiments,
|
|
154
161
|
]);
|
|
155
162
|
|
|
156
163
|
const data = useMemo(() => {
|
|
@@ -158,42 +165,52 @@ export const useCrowdViewData = ({
|
|
|
158
165
|
return null;
|
|
159
166
|
}
|
|
160
167
|
|
|
161
|
-
const candlesSeriesData: [number, number, number, number][] = candles.map(
|
|
162
|
-
(candle) => [
|
|
163
|
-
candle?.open || 0,
|
|
164
|
-
candle?.close || 0,
|
|
165
|
-
candle?.low || 0,
|
|
166
|
-
candle?.high || 0,
|
|
167
|
-
]
|
|
168
|
-
);
|
|
169
|
-
|
|
170
168
|
return {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
mainData: {
|
|
170
|
+
dates,
|
|
171
|
+
candlesOpen,
|
|
172
|
+
candlesClose,
|
|
173
|
+
candlesLow,
|
|
174
|
+
candlesHigh,
|
|
175
|
+
bookPrices,
|
|
176
|
+
bookIndexes,
|
|
177
|
+
sentimentShorts,
|
|
178
|
+
sentimentLongs,
|
|
179
|
+
},
|
|
180
|
+
additionalData: {
|
|
181
|
+
bucketWidth,
|
|
182
|
+
buckets,
|
|
183
|
+
displayPrecision: pipsLocation,
|
|
184
|
+
bookType,
|
|
185
|
+
sentimentThresholdMin,
|
|
186
|
+
sentimentThresholdMax,
|
|
187
|
+
},
|
|
179
188
|
};
|
|
180
189
|
}, [
|
|
181
190
|
priceCandlesData,
|
|
182
191
|
orderPositionData,
|
|
183
192
|
sentimentsData,
|
|
184
193
|
error,
|
|
185
|
-
|
|
194
|
+
dates,
|
|
195
|
+
candlesOpen,
|
|
196
|
+
candlesClose,
|
|
197
|
+
candlesLow,
|
|
198
|
+
candlesHigh,
|
|
199
|
+
bookPrices,
|
|
200
|
+
bookIndexes,
|
|
201
|
+
sentimentShorts,
|
|
202
|
+
sentimentLongs,
|
|
203
|
+
bucketWidth,
|
|
186
204
|
buckets,
|
|
187
|
-
|
|
188
|
-
orderPositionBooks,
|
|
189
|
-
targetBucketWidth,
|
|
190
|
-
instrument,
|
|
205
|
+
pipsLocation,
|
|
191
206
|
bookType,
|
|
192
|
-
|
|
207
|
+
sentimentThresholdMin,
|
|
208
|
+
sentimentThresholdMax,
|
|
193
209
|
]);
|
|
194
210
|
|
|
195
211
|
return {
|
|
196
|
-
data,
|
|
212
|
+
mainData: data?.mainData,
|
|
213
|
+
additionalData: data?.additionalData,
|
|
197
214
|
loading,
|
|
198
215
|
error: !!error,
|
|
199
216
|
};
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
+
import { useLayoutProvider } from '@oanda/labs-widget-common';
|
|
1
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
|
|
4
5
|
import { BookType } from '../../../gql/types/graphql';
|
|
5
|
-
import { BOOKS_THRESHOLDS } from '../../constants';
|
|
6
6
|
import { LegendBar } from './LegendBar';
|
|
7
7
|
|
|
8
8
|
interface LegendProps {
|
|
9
|
-
longValues?: [number, number];
|
|
10
|
-
shortValues?: [number, number];
|
|
11
9
|
bookType: BookType;
|
|
12
|
-
isDark: boolean;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
|
-
export const Legend = ({
|
|
16
|
-
|
|
17
|
-
shortValues = [BOOKS_THRESHOLDS.MIN, BOOKS_THRESHOLDS.MAX],
|
|
18
|
-
bookType,
|
|
19
|
-
isDark,
|
|
20
|
-
}: LegendProps) => {
|
|
12
|
+
export const Legend = ({ bookType }: LegendProps) => {
|
|
13
|
+
const { isDark } = useLayoutProvider();
|
|
21
14
|
const { lang } = useLocale();
|
|
22
15
|
|
|
23
16
|
return (
|
|
24
|
-
<div className="lw-
|
|
25
|
-
<
|
|
26
|
-
isDark={isDark}
|
|
27
|
-
|
|
28
|
-
type="
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
<div className="lw-my-4 lw-w-full">
|
|
18
|
+
<div className="lw-mb-1 lw-flex lw-w-full lw-flex-row lw-justify-between">
|
|
19
|
+
<LegendBar isDark={isDark} type="long" />
|
|
20
|
+
<div className="lw-w-[250px]" />
|
|
21
|
+
<LegendBar isDark={isDark} type="short" />
|
|
22
|
+
</div>
|
|
23
|
+
<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">
|
|
24
|
+
<span>
|
|
25
|
+
{lang(
|
|
26
|
+
bookType === BookType.Order ? 'buy_overbalance' : 'long_overbalance'
|
|
27
|
+
)}
|
|
28
|
+
</span>
|
|
29
|
+
<span>{lang('even_market_demand')}</span>
|
|
30
|
+
<span>
|
|
31
|
+
{lang(
|
|
32
|
+
bookType === BookType.Order
|
|
33
|
+
? 'sell_overbalance'
|
|
34
|
+
: 'short_overbalance'
|
|
35
|
+
)}
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
37
38
|
</div>
|
|
38
39
|
);
|
|
39
40
|
};
|
|
@@ -5,39 +5,26 @@ import { COLOR_MAP } from '../../constants';
|
|
|
5
5
|
export type LegendType = 'long' | 'short';
|
|
6
6
|
|
|
7
7
|
interface LegendBarProps {
|
|
8
|
-
values: number[];
|
|
9
8
|
type: LegendType;
|
|
10
|
-
label: string;
|
|
11
9
|
isDark: boolean;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
export const LegendBar = ({
|
|
12
|
+
export const LegendBar = ({ type, isDark }: LegendBarProps) => {
|
|
15
13
|
const colorPalette = isDark ? COLOR_MAP.dark : COLOR_MAP.light;
|
|
16
|
-
const
|
|
14
|
+
const startColor =
|
|
15
|
+
type === 'long' ? colorPalette.long[1] : colorPalette.short[0];
|
|
16
|
+
const endColor =
|
|
17
|
+
type === 'long' ? colorPalette.long[0] : colorPalette.short[1];
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
<div className="lw-flex lw-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
style={{
|
|
28
|
-
background: `linear-gradient(90deg,${colors[0]} 0%, ${colors[1]} 100%)`,
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<div className="lw-flex lw-w-full lw-justify-between">
|
|
34
|
-
<span className="lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary">
|
|
35
|
-
{values[0].toFixed(2)}%
|
|
36
|
-
</span>
|
|
37
|
-
<span className="lw-whitespace-nowrap lw-font-sans lw-text-xs lw-text-text-primary">
|
|
38
|
-
{`≤ ${values[1].toFixed(2)}`}%
|
|
39
|
-
</span>
|
|
40
|
-
</div>
|
|
20
|
+
<div className="lw-flex lw-h-2 lw-w-full lw-overflow-hidden">
|
|
21
|
+
<div
|
|
22
|
+
className="lw-h-full lw-flex-1"
|
|
23
|
+
data-testid="legend-bar-segment"
|
|
24
|
+
style={{
|
|
25
|
+
background: `linear-gradient(90deg,${startColor} 0%, ${endColor} 100%)`,
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
41
28
|
</div>
|
|
42
29
|
);
|
|
43
30
|
};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { colorPalette } from '@oanda/labs-widget-common';
|
|
2
|
+
import chroma from 'chroma-js';
|
|
2
3
|
|
|
3
4
|
import { InstrumentId } from './types';
|
|
4
5
|
|
|
5
|
-
export const BOOKS_THRESHOLDS = {
|
|
6
|
-
MIN: 0.15,
|
|
7
|
-
MAX: 0.55,
|
|
8
|
-
} as const;
|
|
9
|
-
|
|
10
6
|
export const BUCKET_CONFIG = {
|
|
11
7
|
MULTIPLIER: 4,
|
|
12
|
-
|
|
8
|
+
PRICE_MARGIN_MULTIPLIER: 2,
|
|
13
9
|
} as const;
|
|
14
10
|
|
|
15
11
|
export const TIME_THRESHOLDS = {
|
|
@@ -17,6 +13,7 @@ export const TIME_THRESHOLDS = {
|
|
|
17
13
|
} as const;
|
|
18
14
|
|
|
19
15
|
export const CHART_CONFIG = {
|
|
16
|
+
HEIGHT: 440,
|
|
20
17
|
MAIN_HEIGHT: 400,
|
|
21
18
|
MARGIN_BETWEEN: 50,
|
|
22
19
|
SENTIMENT_HEIGHT: 120,
|
|
@@ -24,33 +21,34 @@ export const CHART_CONFIG = {
|
|
|
24
21
|
X_LABEL_SIZE: 40,
|
|
25
22
|
Y_LABEL_SIZE_DESKTOP: 60,
|
|
26
23
|
Y_LABEL_SIZE_MOBILE: 40,
|
|
27
|
-
|
|
24
|
+
Y_SENTIMENT_LABEL_SIZE: 40,
|
|
25
|
+
INITIAL_START_ZOOM: 90,
|
|
28
26
|
INITIAL_END_ZOOM: 100,
|
|
29
27
|
X_AXIS_DATE_PADDING: ' ',
|
|
30
28
|
SENTIMENT_MIN: 0,
|
|
31
29
|
SENTIMENT_MAX: 100,
|
|
32
|
-
SENTIMENT_INTERVAL: 25,
|
|
33
|
-
SENTIMENT_TEXT_OFFSET: 16,
|
|
34
30
|
} as const;
|
|
35
31
|
|
|
36
|
-
export const CHART_CONFIG_CALCULATED = {
|
|
37
|
-
FULL_HEIGHT:
|
|
38
|
-
CHART_CONFIG.MAIN_HEIGHT +
|
|
39
|
-
CHART_CONFIG.MARGIN_BETWEEN +
|
|
40
|
-
CHART_CONFIG.SENTIMENT_HEIGHT +
|
|
41
|
-
CHART_CONFIG.X_LABEL_SIZE,
|
|
42
|
-
SENTIMENT_TEXT_POSITION:
|
|
43
|
-
CHART_CONFIG.SENTIMENT_HEIGHT + CHART_CONFIG.SENTIMENT_TEXT_OFFSET,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
32
|
export const COLOR_MAP = {
|
|
47
33
|
dark: {
|
|
48
|
-
long: [
|
|
49
|
-
|
|
34
|
+
long: [
|
|
35
|
+
chroma(colorPalette.darkBlue10).shade(0.5).hex(),
|
|
36
|
+
chroma(colorPalette.darkBlue90).shade(0.5).hex(),
|
|
37
|
+
],
|
|
38
|
+
short: [
|
|
39
|
+
chroma(colorPalette.darkYellow10).shade(0.5).hex(),
|
|
40
|
+
chroma(colorPalette.darkYellow90).shade(0.5).hex(),
|
|
41
|
+
],
|
|
50
42
|
},
|
|
51
43
|
light: {
|
|
52
|
-
long: [
|
|
53
|
-
|
|
44
|
+
long: [
|
|
45
|
+
chroma(colorPalette.lightBlue10).tint(0.5).hex(),
|
|
46
|
+
chroma(colorPalette.lightBlue90).tint(0.5).hex(),
|
|
47
|
+
],
|
|
48
|
+
short: [
|
|
49
|
+
chroma(colorPalette.lightYellow10).tint(0.5).hex(),
|
|
50
|
+
chroma(colorPalette.lightYellow90).tint(0.5).hex(),
|
|
51
|
+
],
|
|
54
52
|
},
|
|
55
53
|
} as const;
|
|
56
54
|
|
|
@@ -8,6 +8,8 @@ const getOrderPositionBooks = gql`
|
|
|
8
8
|
$granularity: Granularity!
|
|
9
9
|
$maxBookPrice: Float
|
|
10
10
|
$minBookPrice: Float
|
|
11
|
+
$bucketMultiplier: Int!
|
|
12
|
+
$bucketMargin: Int!
|
|
11
13
|
) {
|
|
12
14
|
orderPositionBooks(
|
|
13
15
|
instrument: $instrument
|
|
@@ -16,14 +18,20 @@ const getOrderPositionBooks = gql`
|
|
|
16
18
|
granularity: $granularity
|
|
17
19
|
maxBookPrice: $maxBookPrice
|
|
18
20
|
minBookPrice: $minBookPrice
|
|
21
|
+
bucketMultiplier: $bucketMultiplier
|
|
22
|
+
bucketMargin: $bucketMargin
|
|
19
23
|
) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
time
|
|
23
|
-
buckets {
|
|
24
|
+
books {
|
|
25
|
+
time
|
|
24
26
|
price
|
|
25
|
-
|
|
27
|
+
buckets {
|
|
28
|
+
price
|
|
29
|
+
sentiment
|
|
30
|
+
}
|
|
26
31
|
}
|
|
32
|
+
bucketWidth
|
|
33
|
+
sentimentThresholdMax
|
|
34
|
+
sentimentThresholdMin
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
`;
|
package/src/gql/types/gql.ts
CHANGED
|
@@ -13,9 +13,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
|
|
|
13
13
|
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
|
14
14
|
*/
|
|
15
15
|
const documents = {
|
|
16
|
-
'\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
|
|
16
|
+
'\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':
|
|
17
17
|
types.GetOrderPositionBooksDocument,
|
|
18
|
-
'\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':
|
|
18
|
+
'\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':
|
|
19
19
|
types.GetPriceCandlesDocument,
|
|
20
20
|
'\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':
|
|
21
21
|
types.GetSentimentsDocument,
|
|
@@ -39,14 +39,14 @@ export function graphql(source: string): unknown;
|
|
|
39
39
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
40
40
|
*/
|
|
41
41
|
export function graphql(
|
|
42
|
-
source: '\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
|
|
43
|
-
): (typeof documents)['\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
|
|
42
|
+
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'
|
|
43
|
+
): (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'];
|
|
44
44
|
/**
|
|
45
45
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
46
46
|
*/
|
|
47
47
|
export function graphql(
|
|
48
|
-
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 }\n }\n'
|
|
49
|
-
): (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 }\n }\n'];
|
|
48
|
+
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'
|
|
49
|
+
): (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'];
|
|
50
50
|
/**
|
|
51
51
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
52
52
|
*/
|