@oanda/labs-crowd-view-widget 1.0.53 → 1.0.55
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 +444 -0
- package/dist/main/CrowdViewWidget/Main.js +4 -2
- package/dist/main/CrowdViewWidget/Main.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +41 -83
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +23 -17
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +24 -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 +30 -49
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +159 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +47 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +83 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +68 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +60 -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 +57 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +66 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js +127 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.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 +23 -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 +120 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +59 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js +34 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js +116 -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/getMultiplayerForTimeSpan.js +19 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.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 +19 -8
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js +115 -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 +15 -12
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js +15 -12
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +15 -16
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/main/CrowdViewWidget/constants.js +20 -14
- package/dist/main/CrowdViewWidget/constants.js.map +1 -1
- package/dist/main/CrowdViewWidget/selectConfig.js +0 -6
- package/dist/main/CrowdViewWidget/selectConfig.js.map +1 -1
- package/dist/main/translations/sources/en.json +3 -1
- package/dist/module/CrowdViewWidget/Main.js +4 -2
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +43 -84
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +22 -16
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +17 -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 +30 -49
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +151 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +39 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +76 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +61 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +53 -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 +50 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +59 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js +12 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.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 +16 -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 +113 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +52 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js +27 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +11 -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/getMultiplayerForTimeSpan.js +12 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getMultiplayerForTimeSpan.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 +8 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js +108 -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 +8 -5
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +15 -12
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +15 -16
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +18 -13
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/CrowdViewWidget/selectConfig.js +0 -6
- package/dist/module/CrowdViewWidget/selectConfig.js.map +1 -1
- package/dist/module/translations/sources/en.json +3 -1
- package/dist/types/CrowdViewWidget/components/Chart/Chart.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridLines.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.d.ts +8 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts +8 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.d.ts +12 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts +8 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.d.ts +18 -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 +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/index.d.ts +11 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.d.ts +1 -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 +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getRectColor.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +12 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.d.ts +4 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.d.ts +3 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/index.d.ts +10 -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/getMultiplayerForTimeSpan.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.d.ts +3 -2
- package/dist/types/CrowdViewWidget/components/Chart/index.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +5 -0
- 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 +13 -9
- package/package.json +3 -3
- package/src/CrowdViewWidget/Main.tsx +3 -2
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +76 -109
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +33 -28
- package/src/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.ts +22 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts +29 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts +126 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.ts +191 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts +44 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts +103 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts +72 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +74 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.ts +32 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts +68 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts +60 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/index.ts +11 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.ts +13 -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 +18 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getRectColor.ts +27 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +212 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.ts +75 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.ts +37 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/index.ts +10 -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/getMultiplayerForTimeSpan.ts +13 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.ts +14 -0
- package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.ts +3 -2
- package/src/CrowdViewWidget/components/Chart/getOption.ts +138 -0
- package/src/CrowdViewWidget/components/Chart/index.ts +1 -1
- package/src/CrowdViewWidget/components/Chart/types.ts +5 -0
- package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +14 -7
- package/src/CrowdViewWidget/components/Legend/Legend.tsx +24 -22
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +29 -26
- package/src/CrowdViewWidget/constants.ts +30 -19
- package/src/CrowdViewWidget/selectConfig.ts +0 -8
- package/src/translations/sources/en.json +3 -1
- package/test/components/Chart/utils/chartUtils.test.ts +20 -9
- package/test/components/Chart/utils/getChartStyles.test.ts +10 -10
- package/test/components/Chart/utils/handleLabelUpdate.test.ts +419 -0
- package/test/components/Chart/utils/handleTooltipUpdate.test.ts +140 -0
- package/test/components/Chart/utils/processSentiments.test.ts +1 -1
- package/test/components/Legend.test.tsx +15 -23
- package/test/components/LegendBar.test.tsx +45 -63
- package/test/utils/instrumentUtils.test.ts +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js +0 -399
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -126
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
- package/dist/main/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js +0 -391
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -113
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js +0 -7
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
- package/dist/module/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
- package/dist/types/CrowdViewWidget/components/Chart/utils/chartUtils.d.ts +0 -30
- package/dist/types/CrowdViewWidget/components/Chart/utils/getGridLines.d.ts +0 -97
- package/src/CrowdViewWidget/components/Chart/chartOptions.ts +0 -449
- package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +0 -228
- package/src/CrowdViewWidget/components/Chart/utils/getGridLines.ts +0 -148
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.js +0 -0
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.js +0 -0
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.js +0 -0
- /package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.js +0 -0
- /package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.d.ts +0 -0
- /package/dist/types/CrowdViewWidget/components/Chart/{chartOptions.d.ts → getOption.d.ts} +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/processOrderPositionBooks.ts +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/processPriceCandles.ts +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/processSentiments.ts +0 -0
- /package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectConfig.js","names":["BookType","Granularity","InstrumentId","navigationConfig","id","Order","label","Position","instrumentSelectConfigOC","EUR_AUD","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","instrumentSelectConfig","XAU_USD","XAG_USD","granularitySelectConfig","H1","H4"
|
|
1
|
+
{"version":3,"file":"selectConfig.js","names":["BookType","Granularity","InstrumentId","navigationConfig","id","Order","label","Position","instrumentSelectConfigOC","EUR_AUD","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","instrumentSelectConfig","XAU_USD","XAG_USD","granularitySelectConfig","H1","H4"],"sources":["../../../src/CrowdViewWidget/selectConfig.ts"],"sourcesContent":["import { BookType, Granularity } from '../gql/types/graphql';\nimport { InstrumentId } from './types';\n\nconst navigationConfig = [\n {\n id: BookType.Order,\n label: 'order_book',\n },\n {\n id: BookType.Position,\n label: 'position_book',\n },\n];\n\nconst instrumentSelectConfigOC = [\n {\n id: InstrumentId.EUR_AUD,\n label: 'EUR/AUD',\n },\n {\n id: InstrumentId.EUR_GBP,\n label: 'EUR/GBP',\n },\n {\n id: InstrumentId.EUR_JPY,\n label: 'EUR/JPY',\n },\n {\n id: InstrumentId.EUR_USD,\n label: 'EUR/USD',\n },\n {\n id: InstrumentId.EUR_CHF,\n label: 'EUR/CHF',\n },\n {\n id: InstrumentId.USD_CHF,\n label: 'USD/CHF',\n },\n {\n id: InstrumentId.USD_JPY,\n label: 'USD/JPY',\n },\n {\n id: InstrumentId.USD_CAD,\n label: 'USD/CAD',\n },\n {\n id: InstrumentId.GBP_USD,\n label: 'GBP/USD',\n },\n {\n id: InstrumentId.GBP_JPY,\n label: 'GBP/JPY',\n },\n {\n id: InstrumentId.GBP_CHF,\n label: 'GBP/CHF',\n },\n {\n id: InstrumentId.AUD_JPY,\n label: 'AUD/JPY',\n },\n {\n id: InstrumentId.AUD_USD,\n label: 'AUD/USD',\n },\n {\n id: InstrumentId.NZD_USD,\n label: 'NZD/USD',\n },\n];\n\nconst instrumentSelectConfig = [\n ...instrumentSelectConfigOC,\n {\n id: InstrumentId.XAU_USD,\n label: 'XAU/USD',\n },\n {\n id: InstrumentId.XAG_USD,\n label: 'XAG/USD',\n },\n];\n\nconst granularitySelectConfig = [\n {\n id: Granularity.H1,\n label: '1_hour',\n },\n {\n id: Granularity.H4,\n label: '4_hours',\n },\n];\n\nexport {\n granularitySelectConfig,\n instrumentSelectConfig,\n instrumentSelectConfigOC,\n navigationConfig,\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,WAAW,QAAQ,sBAAsB;AAC5D,SAASC,YAAY,QAAQ,SAAS;AAEtC,MAAMC,gBAAgB,GAAG,CACvB;EACEC,EAAE,EAAEJ,QAAQ,CAACK,KAAK;EAClBC,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEJ,QAAQ,CAACO,QAAQ;EACrBD,KAAK,EAAE;AACT,CAAC,CACF;AAED,MAAME,wBAAwB,GAAG,CAC/B;EACEJ,EAAE,EAAEF,YAAY,CAACO,OAAO;EACxBH,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACQ,OAAO;EACxBJ,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACS,OAAO;EACxBL,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACU,OAAO;EACxBN,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACW,OAAO;EACxBP,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACY,OAAO;EACxBR,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACa,OAAO;EACxBT,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACc,OAAO;EACxBV,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACe,OAAO;EACxBX,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACgB,OAAO;EACxBZ,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACiB,OAAO;EACxBb,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACkB,OAAO;EACxBd,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACmB,OAAO;EACxBf,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACoB,OAAO;EACxBhB,KAAK,EAAE;AACT,CAAC,CACF;AAED,MAAMiB,sBAAsB,GAAG,CAC7B,GAAGf,wBAAwB,EAC3B;EACEJ,EAAE,EAAEF,YAAY,CAACsB,OAAO;EACxBlB,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEF,YAAY,CAACuB,OAAO;EACxBnB,KAAK,EAAE;AACT,CAAC,CACF;AAED,MAAMoB,uBAAuB,GAAG,CAC9B;EACEtB,EAAE,EAAEH,WAAW,CAAC0B,EAAE;EAClBrB,KAAK,EAAE;AACT,CAAC,EACD;EACEF,EAAE,EAAEH,WAAW,CAAC2B,EAAE;EAClBtB,KAAK,EAAE;AACT,CAAC,CACF;AAED,SACEoB,uBAAuB,EACvBH,sBAAsB,EACtBf,wBAAwB,EACxBL,gBAAgB","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChartProps } from './types';
|
|
3
|
-
declare const Chart: ({ mainData, additionalData, isDesktop }: ChartProps) => React.JSX.Element;
|
|
3
|
+
declare const Chart: ({ mainData, additionalData, isDesktop, isLoading, }: ChartProps) => React.JSX.Element;
|
|
4
4
|
export { Chart };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GraphicComponentOption } from 'echarts';
|
|
2
|
+
interface getLabelsConfigParams {
|
|
3
|
+
isDark: boolean;
|
|
4
|
+
isDesktop: boolean;
|
|
5
|
+
labelCallback: (key: string, params?: Record<string, unknown>) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare const getLabelsConfig: ({ isDark, isDesktop, labelCallback, }: getLabelsConfigParams) => GraphicComponentOption[];
|
|
8
|
+
export {};
|
package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CandlestickSeriesOption } from 'echarts';
|
|
2
|
+
import type { ChartStyles } from '../chartUtils/getChartStyles';
|
|
3
|
+
interface GetSeriesCandlestickConfigParams {
|
|
4
|
+
styles: ChartStyles;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const getSeriesCandlestickConfig: ({ styles, isLoading, }: GetSeriesCandlestickConfigParams) => CandlestickSeriesOption;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CustomSeriesOption } from 'echarts';
|
|
2
|
+
import type { Bucket } from '../types';
|
|
3
|
+
interface GetSeriesHeatmapConfigParams {
|
|
4
|
+
bucketWidth: number;
|
|
5
|
+
buckets: Bucket[][];
|
|
6
|
+
isDark: boolean;
|
|
7
|
+
sentimentThresholdMax: number;
|
|
8
|
+
sentimentThresholdMin: number;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const getSeriesHeatmapConfig: ({ bucketWidth, buckets, isDark, sentimentThresholdMax, sentimentThresholdMin, isLoading, }: GetSeriesHeatmapConfigParams) => CustomSeriesOption;
|
|
12
|
+
export {};
|
package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LineSeriesOption } from 'echarts';
|
|
2
|
+
import type { ChartStyles } from '../chartUtils';
|
|
3
|
+
interface GetSeriesSentimentConfigParams {
|
|
4
|
+
styles: ChartStyles;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const getSeriesSentimentConfig: ({ styles, isLoading, }: GetSeriesSentimentConfigParams) => LineSeriesOption;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TooltipComponentOption } from 'echarts';
|
|
2
|
+
import type { BookType } from '../../../../gql/types/graphql';
|
|
3
|
+
import type { Bucket } from '../types';
|
|
4
|
+
interface GetTooltipConfigParams {
|
|
5
|
+
bookType: BookType;
|
|
6
|
+
bucketWidth: number;
|
|
7
|
+
buckets: Bucket[][];
|
|
8
|
+
displayPrecision: number;
|
|
9
|
+
labelCallback: (key: string, params?: Record<string, unknown>) => string;
|
|
10
|
+
selectedPriceRef: {
|
|
11
|
+
current: number;
|
|
12
|
+
};
|
|
13
|
+
tooltipLinesColor: string;
|
|
14
|
+
sentimentLongs: (number | null)[];
|
|
15
|
+
sentimentShorts: (number | null)[];
|
|
16
|
+
}
|
|
17
|
+
export declare const getTooltipConfig: ({ bookType, bucketWidth, buckets, displayPrecision, labelCallback, selectedPriceRef, tooltipLinesColor, sentimentLongs, sentimentShorts, }: GetTooltipConfigParams) => TooltipComponentOption;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VisualMapComponentOption } from 'echarts';
|
|
2
|
+
interface GetVisualMapConfigParams {
|
|
3
|
+
sentimentLongColor: string;
|
|
4
|
+
sentimentShortColor: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const getVisualMapConfig: ({ sentimentLongColor, sentimentShortColor, }: GetVisualMapConfigParams) => VisualMapComponentOption;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { XAXisComponentOption } from 'echarts';
|
|
2
|
+
interface GetXAxisConfigParams {
|
|
3
|
+
dates: string[];
|
|
4
|
+
isGreaterThanTwoWeeks: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const getXAxisConfig: ({ dates, isGreaterThanTwoWeeks, }: GetXAxisConfigParams) => XAXisComponentOption[];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { YAXisComponentOption } from 'echarts';
|
|
2
|
+
interface GetYAxisConfigParams {
|
|
3
|
+
bucketWidth: number;
|
|
4
|
+
displayPrecision: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const getYAxisConfig: ({ bucketWidth, displayPrecision, }: GetYAxisConfigParams) => YAXisComponentOption[];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './getDataZoomConfig';
|
|
2
|
+
export * from './getGridConfig';
|
|
3
|
+
export * from './getGridLines';
|
|
4
|
+
export * from './getLabelsConfig';
|
|
5
|
+
export * from './getSeriesCandlestickConfig';
|
|
6
|
+
export * from './getSeriesHeatmapConfig';
|
|
7
|
+
export * from './getSeriesSentimentConfig';
|
|
8
|
+
export * from './getTooltipConfig';
|
|
9
|
+
export * from './getVisualMapConfig';
|
|
10
|
+
export * from './getXAxisConfig';
|
|
11
|
+
export * from './getYAxisConfig';
|
package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatXAxisAdditionalLabel: (value: unknown, isGreaterThanTwoWeeks: boolean) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatXAxisLabel: (value: unknown, isGreaterThanTwoWeeks: boolean) => string;
|
package/dist/types/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.d.ts
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface ChartStyles {
|
|
2
2
|
sentimentLongColor: string;
|
|
3
3
|
sentimentShortColor: string;
|
|
4
|
+
sentimentOutlineColor: string;
|
|
4
5
|
candleLongColor: string;
|
|
5
6
|
candleShortColor: string;
|
|
6
|
-
sentimentAreaOpacity: number;
|
|
7
7
|
tooltipLinesColor: string;
|
|
8
|
-
|
|
8
|
+
sentimentOutlineWidth: number;
|
|
9
9
|
}
|
|
10
10
|
export declare const getChartStyles: (isDark: boolean) => ChartStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getGradientColor: (value: number, startColor: string, targetColor: string, minThreshold: number, maxThreshold: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRectColor: (sentiment: number, isDark: boolean, minThreshold: number, maxThreshold: number) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BookType } from '../../../../gql/types/graphql';
|
|
2
|
+
import type { Bucket, TooltipParam } from '../types';
|
|
3
|
+
export declare const getTooltipFormatter: ({ params, buckets, bucketWidth, selectedPrice, bookType, labelCallback, sentimentLongs, sentimentShorts, }: {
|
|
4
|
+
params: TooltipParam[];
|
|
5
|
+
buckets: Bucket[][];
|
|
6
|
+
bucketWidth: number;
|
|
7
|
+
selectedPrice: number;
|
|
8
|
+
bookType: BookType;
|
|
9
|
+
labelCallback: (key: string) => string;
|
|
10
|
+
sentimentLongs: (number | null)[];
|
|
11
|
+
sentimentShorts: (number | null)[];
|
|
12
|
+
}) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EChartsType } from 'echarts';
|
|
2
|
+
import type { MutableRefObject } from 'react';
|
|
3
|
+
import type { ChartProps } from '../types';
|
|
4
|
+
export declare const handleLabelUpdate: (instance: EChartsType, mainData: ChartProps["mainData"], labelTimerRef: MutableRefObject<NodeJS.Timeout | null>, isGreaterThanTwoWeeksRef: MutableRefObject<boolean | null>) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EChartsType } from 'echarts';
|
|
2
|
+
import type { MutableRefObject } from 'react';
|
|
3
|
+
export declare const handleTooltipUpdate: (instance: EChartsType, zoomTimerRef: MutableRefObject<NodeJS.Timeout | null>, tooltipVisibleRef: MutableRefObject<boolean>, canHover: boolean) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './formatXAxisAdditionalLabel';
|
|
2
|
+
export * from './formatXAxisLabel';
|
|
3
|
+
export * from './getChartStyles';
|
|
4
|
+
export * from './getGradientColor';
|
|
5
|
+
export * from './getLabelData';
|
|
6
|
+
export * from './getRectColor';
|
|
7
|
+
export * from './getTooltipFormatter';
|
|
8
|
+
export * from './handleLabelUpdate';
|
|
9
|
+
export * from './handleTooltipUpdate';
|
|
10
|
+
export * from './isDifferenceGreaterThanTwoWeeks';
|
package/dist/types/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isDifferenceGreaterThanTwoWeeks: (startDate: string, endDate: string) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Division } from '
|
|
1
|
+
import { Division } from '../../../../gql/types/graphql';
|
|
2
2
|
export declare const getInstrumentConfigForDivision: (division: Division) => {
|
|
3
|
-
id: import("
|
|
3
|
+
id: import("../../..").InstrumentId;
|
|
4
4
|
label: string;
|
|
5
5
|
}[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './getInstrumentConfigForDivision';
|
|
2
|
+
export * from './getMultiplayerForTimeSpan';
|
|
3
|
+
export * from './getTimeSpanForGranularity';
|
|
3
4
|
export * from './processOrderPositionBooks';
|
|
4
5
|
export * from './processPriceCandles';
|
|
5
6
|
export * from './processSentiments';
|
|
@@ -34,6 +34,9 @@ export interface UseCrowdViewDataReturn {
|
|
|
34
34
|
mainData?: CrowdViewMainData | null;
|
|
35
35
|
additionalData?: CrowdViewAdditionalData | null;
|
|
36
36
|
loading: boolean;
|
|
37
|
+
priceCandlesLoading: boolean;
|
|
38
|
+
orderPositionLoading: boolean;
|
|
39
|
+
sentimentsLoading: boolean;
|
|
37
40
|
error: boolean;
|
|
38
41
|
}
|
|
39
42
|
interface GetOptionProps {
|
|
@@ -41,6 +44,7 @@ interface GetOptionProps {
|
|
|
41
44
|
additionalData: CrowdViewAdditionalData;
|
|
42
45
|
isDark: boolean;
|
|
43
46
|
isDesktop: boolean;
|
|
47
|
+
isLoading: boolean;
|
|
44
48
|
labelCallback: (key: string, params?: Record<string, unknown>) => string;
|
|
45
49
|
}
|
|
46
50
|
export type GetOptionType = (props: GetOptionProps) => EChartsOption;
|
|
@@ -48,6 +52,7 @@ export interface ChartProps {
|
|
|
48
52
|
mainData: CrowdViewMainData;
|
|
49
53
|
additionalData: CrowdViewAdditionalData;
|
|
50
54
|
isDesktop: boolean;
|
|
55
|
+
isLoading: boolean;
|
|
51
56
|
}
|
|
52
57
|
export interface ChartWithDataProps {
|
|
53
58
|
bookType: BookType;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BookType } from '../../../gql/types/graphql';
|
|
3
3
|
interface LegendProps {
|
|
4
|
-
longValues: (number | undefined)[];
|
|
5
|
-
shortValues: (number | undefined)[];
|
|
6
4
|
bookType: BookType;
|
|
7
|
-
isDark: boolean;
|
|
8
5
|
}
|
|
9
|
-
export declare const Legend: ({
|
|
6
|
+
export declare const Legend: ({ bookType }: LegendProps) => React.JSX.Element;
|
|
10
7
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type LegendType = 'long' | 'short';
|
|
3
3
|
interface LegendBarProps {
|
|
4
|
-
values: (number | undefined)[];
|
|
5
4
|
type: LegendType;
|
|
6
|
-
label: string;
|
|
7
5
|
isDark: boolean;
|
|
8
6
|
}
|
|
9
|
-
export declare const LegendBar: ({
|
|
7
|
+
export declare const LegendBar: ({ type, isDark }: LegendBarProps) => React.JSX.Element;
|
|
10
8
|
export {};
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { InstrumentId } from './types';
|
|
2
2
|
export declare const BUCKET_CONFIG: {
|
|
3
|
-
readonly
|
|
3
|
+
readonly MULTIPLIER_5M: 1;
|
|
4
|
+
readonly MULTIPLIER_15M: 1;
|
|
5
|
+
readonly MULTIPLIER_1H: 2;
|
|
6
|
+
readonly MULTIPLIER_4H: 4;
|
|
4
7
|
readonly PRICE_MARGIN_MULTIPLIER: 2;
|
|
5
8
|
};
|
|
6
9
|
export declare const TIME_THRESHOLDS: {
|
|
7
10
|
readonly TWO_WEEKS_MS: number;
|
|
8
11
|
};
|
|
9
12
|
export declare const CHART_CONFIG: {
|
|
13
|
+
readonly HEIGHT: 440;
|
|
10
14
|
readonly MAIN_HEIGHT: 400;
|
|
11
15
|
readonly MARGIN_BETWEEN: 50;
|
|
12
16
|
readonly SENTIMENT_HEIGHT: 120;
|
|
13
17
|
readonly WIDTH: 9999;
|
|
14
18
|
readonly X_LABEL_SIZE: 40;
|
|
15
|
-
readonly Y_LABEL_SIZE_DESKTOP:
|
|
19
|
+
readonly Y_LABEL_SIZE_DESKTOP: 50;
|
|
16
20
|
readonly Y_LABEL_SIZE_MOBILE: 40;
|
|
17
|
-
readonly
|
|
21
|
+
readonly Y_SENTIMENT_LABEL_DESKTOP_SIZE: 40;
|
|
22
|
+
readonly Y_SENTIMENT_LABEL_MOBILE_SIZE: 30;
|
|
23
|
+
readonly INITIAL_START_ZOOM_DESKTOP: 70;
|
|
24
|
+
readonly INITIAL_START_ZOOM_MOBILE: 85;
|
|
18
25
|
readonly INITIAL_END_ZOOM: 100;
|
|
19
26
|
readonly X_AXIS_DATE_PADDING: " ";
|
|
20
27
|
readonly SENTIMENT_MIN: 0;
|
|
21
28
|
readonly SENTIMENT_MAX: 100;
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
|
|
25
|
-
export declare const CHART_CONFIG_CALCULATED: {
|
|
26
|
-
FULL_HEIGHT: number;
|
|
27
|
-
SENTIMENT_TEXT_POSITION: number;
|
|
29
|
+
readonly TOP_MARGIN_DESKTOP: 0;
|
|
30
|
+
readonly TOP_MARGIN_MOBILE: 30;
|
|
31
|
+
readonly TOOLTIP_OFFSET: 5;
|
|
28
32
|
};
|
|
29
33
|
export declare const COLOR_MAP: {
|
|
30
34
|
readonly dark: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-crowd-view-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Labs Crowd View Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "OANDA",
|
|
14
14
|
"license": "UNLICENSED",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
16
|
+
"@oanda/labs-widget-common": "^1.0.237",
|
|
17
17
|
"@oanda/mono-i18n": "10.0.1",
|
|
18
18
|
"chroma-js": "^3.1.2",
|
|
19
19
|
"decimal.js": "^10.6.0",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@graphql-codegen/client-preset": "4.1.0",
|
|
25
25
|
"@types/chroma-js": "^3.1.2"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "c229ff589fb221f71aa5b10c1498b32e4a3b61b3"
|
|
28
28
|
}
|
|
@@ -10,10 +10,10 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
10
10
|
|
|
11
11
|
import type { Granularity } from '../gql/types/graphql';
|
|
12
12
|
import { BookType } from '../gql/types/graphql';
|
|
13
|
-
import { ChartWithData } from './components';
|
|
13
|
+
import { ChartWithData, Legend } from './components';
|
|
14
|
+
import { getInstrumentConfigForDivision } from './components/Chart/dataUtils/getInstrumentConfigForDivision';
|
|
14
15
|
import { granularitySelectConfig, navigationConfig } from './selectConfig';
|
|
15
16
|
import type { InstrumentId, MainProps } from './types';
|
|
16
|
-
import { getInstrumentConfigForDivision } from './utils/instrumentUtils';
|
|
17
17
|
|
|
18
18
|
const Main = ({ division }: MainProps) => {
|
|
19
19
|
const { lang } = useLocale();
|
|
@@ -107,6 +107,7 @@ const Main = ({ division }: MainProps) => {
|
|
|
107
107
|
granularity={granularity.id}
|
|
108
108
|
instrument={instrument.id}
|
|
109
109
|
/>
|
|
110
|
+
<Legend bookType={bookType} />
|
|
110
111
|
</div>
|
|
111
112
|
)}
|
|
112
113
|
</>
|
|
@@ -12,28 +12,23 @@ import {
|
|
|
12
12
|
DataZoomInsideComponent,
|
|
13
13
|
GraphicComponent,
|
|
14
14
|
GridSimpleComponent,
|
|
15
|
-
|
|
16
|
-
MarkPointComponent,
|
|
15
|
+
MarkLineComponent,
|
|
17
16
|
TooltipComponent,
|
|
18
17
|
VisualMapComponent,
|
|
19
18
|
} from 'echarts/components';
|
|
20
19
|
import * as echarts from 'echarts/core';
|
|
21
20
|
import { CanvasRenderer } from 'echarts/renderers';
|
|
22
|
-
import React from 'react';
|
|
21
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
22
|
+
import { useMediaQuery } from 'usehooks-ts';
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
import { getOption } from './chartOptions';
|
|
26
|
-
import type {
|
|
27
|
-
ChartProps,
|
|
28
|
-
DataZoomArray,
|
|
29
|
-
DataZoomEvent,
|
|
30
|
-
XAxisArray,
|
|
31
|
-
} from './types';
|
|
24
|
+
import { CHART_CONFIG } from '../../constants';
|
|
32
25
|
import {
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
handleLabelUpdate,
|
|
27
|
+
handleTooltipUpdate,
|
|
35
28
|
isDifferenceGreaterThanTwoWeeks,
|
|
36
|
-
} from './
|
|
29
|
+
} from './chartUtils';
|
|
30
|
+
import { getOption } from './getOption';
|
|
31
|
+
import type { ChartProps, DataZoomEvent } from './types';
|
|
37
32
|
|
|
38
33
|
echarts.use([
|
|
39
34
|
GridSimpleComponent,
|
|
@@ -43,8 +38,7 @@ echarts.use([
|
|
|
43
38
|
CustomChart,
|
|
44
39
|
TooltipComponent,
|
|
45
40
|
CandlestickChart,
|
|
46
|
-
|
|
47
|
-
MarkAreaComponent,
|
|
41
|
+
MarkLineComponent,
|
|
48
42
|
LineChart,
|
|
49
43
|
VisualMapComponent,
|
|
50
44
|
DatasetComponent,
|
|
@@ -53,109 +47,82 @@ echarts.use([
|
|
|
53
47
|
echarts.registerTheme('dark_theme', getChartTheme(Theme.Dark));
|
|
54
48
|
echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
|
|
55
49
|
|
|
56
|
-
const Chart = ({
|
|
50
|
+
const Chart = ({
|
|
51
|
+
mainData,
|
|
52
|
+
additionalData,
|
|
53
|
+
isDesktop,
|
|
54
|
+
isLoading,
|
|
55
|
+
}: ChartProps) => {
|
|
57
56
|
const { isDark } = useLayoutProvider();
|
|
58
57
|
const { lang } = useLocale();
|
|
58
|
+
const canHover = useMediaQuery('(hover: hover)');
|
|
59
|
+
const labelTimerRef = useRef<NodeJS.Timeout | null>(null);
|
|
60
|
+
const isGreaterThanTwoWeeksRef = useRef<boolean | null>(null);
|
|
61
|
+
const zoomTimerRef = useRef<NodeJS.Timeout | null>(null);
|
|
62
|
+
const tooltipVisibleRef = useRef<boolean>(true);
|
|
63
|
+
|
|
64
|
+
const initialIsGreaterThanTwoWeeks = useMemo(() => {
|
|
65
|
+
const { dates } = mainData;
|
|
66
|
+
const initialStartZoom = isDesktop
|
|
67
|
+
? CHART_CONFIG.INITIAL_START_ZOOM_DESKTOP
|
|
68
|
+
: CHART_CONFIG.INITIAL_START_ZOOM_MOBILE;
|
|
69
|
+
|
|
70
|
+
const visibleXAxisData = dates.slice(
|
|
71
|
+
(dates.length * initialStartZoom) / 100,
|
|
72
|
+
(dates.length * CHART_CONFIG.INITIAL_END_ZOOM) / 100
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
if (visibleXAxisData.length === 0) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return isDifferenceGreaterThanTwoWeeks(
|
|
80
|
+
visibleXAxisData[0],
|
|
81
|
+
visibleXAxisData[visibleXAxisData.length - 1]
|
|
82
|
+
);
|
|
83
|
+
}, [mainData, isDesktop]);
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
isGreaterThanTwoWeeksRef.current = initialIsGreaterThanTwoWeeks;
|
|
87
|
+
}, [initialIsGreaterThanTwoWeeks]);
|
|
88
|
+
|
|
89
|
+
const chartOption = useMemo(
|
|
90
|
+
() =>
|
|
91
|
+
getOption({
|
|
92
|
+
mainData,
|
|
93
|
+
additionalData,
|
|
94
|
+
isDark,
|
|
95
|
+
isDesktop,
|
|
96
|
+
isLoading,
|
|
97
|
+
labelCallback: lang,
|
|
98
|
+
}),
|
|
99
|
+
[mainData, additionalData, isDark, isDesktop, isLoading, lang]
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// Memoize event handler to prevent unnecessary re-renders
|
|
103
|
+
const handleDataZoom = useCallback(
|
|
104
|
+
(_params: DataZoomEvent, instance: EChartsType) => {
|
|
105
|
+
handleTooltipUpdate(instance, zoomTimerRef, tooltipVisibleRef, canHover);
|
|
106
|
+
handleLabelUpdate(
|
|
107
|
+
instance,
|
|
108
|
+
mainData,
|
|
109
|
+
labelTimerRef,
|
|
110
|
+
isGreaterThanTwoWeeksRef
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
[mainData, canHover]
|
|
114
|
+
);
|
|
59
115
|
|
|
60
116
|
return (
|
|
61
117
|
<BaseChart
|
|
62
|
-
chartHeight={
|
|
118
|
+
chartHeight={CHART_CONFIG.HEIGHT}
|
|
63
119
|
echarts={echarts}
|
|
64
120
|
isDark={isDark}
|
|
65
121
|
lazyUpdate={true}
|
|
66
|
-
option={
|
|
67
|
-
mainData,
|
|
68
|
-
additionalData,
|
|
69
|
-
isDark,
|
|
70
|
-
isDesktop,
|
|
71
|
-
labelCallback: lang,
|
|
72
|
-
})}
|
|
122
|
+
option={chartOption}
|
|
73
123
|
opts={{ renderer: 'canvas' }}
|
|
74
124
|
onEvents={{
|
|
75
|
-
datazoom:
|
|
76
|
-
if (!params.batch?.[0]) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const { dates } = mainData;
|
|
81
|
-
const batchItem = params.batch[0];
|
|
82
|
-
const { start, end } = batchItem;
|
|
83
|
-
|
|
84
|
-
const { dataZoom, xAxis } = instance.getOption();
|
|
85
|
-
if (
|
|
86
|
-
!Array.isArray(dataZoom) ||
|
|
87
|
-
dataZoom.length === 0 ||
|
|
88
|
-
!dataZoom[0] ||
|
|
89
|
-
typeof dataZoom[0].startValue !== 'number' ||
|
|
90
|
-
typeof dataZoom[0].endValue !== 'number'
|
|
91
|
-
) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const { startValue, endValue } = dataZoom[0] as DataZoomArray[0];
|
|
96
|
-
|
|
97
|
-
if (batchItem.dataZoomId === 'main') {
|
|
98
|
-
instance.dispatchAction({
|
|
99
|
-
type: 'dataZoom',
|
|
100
|
-
dataZoomId: 'sentiment',
|
|
101
|
-
start,
|
|
102
|
-
end,
|
|
103
|
-
filterMode: 'none',
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (batchItem.dataZoomId === 'sentiment') {
|
|
108
|
-
instance.dispatchAction({
|
|
109
|
-
type: 'dataZoom',
|
|
110
|
-
dataZoomId: 'main',
|
|
111
|
-
start,
|
|
112
|
-
end,
|
|
113
|
-
filterMode: 'filter',
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (!dates[startValue] || !dates[endValue]) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const isGreaterThanTwoWeeks = isDifferenceGreaterThanTwoWeeks(
|
|
122
|
-
dates[startValue],
|
|
123
|
-
dates[endValue]
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
const wasGreaterThanTwoWeeks =
|
|
127
|
-
Array.isArray(xAxis) &&
|
|
128
|
-
xAxis.length > 0 &&
|
|
129
|
-
(xAxis as XAxisArray)[0]?.name === 'xAxis-greater-than-two-weeks';
|
|
130
|
-
|
|
131
|
-
if (isGreaterThanTwoWeeks !== wasGreaterThanTwoWeeks) {
|
|
132
|
-
const labelsData = getLabelData({
|
|
133
|
-
dates,
|
|
134
|
-
isGreaterThanTwoWeeks,
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
instance.setOption({
|
|
138
|
-
xAxis: {
|
|
139
|
-
id: 'main-xAxis',
|
|
140
|
-
name: isGreaterThanTwoWeeks
|
|
141
|
-
? 'xAxis-greater-than-two-weeks'
|
|
142
|
-
: 'xAxis-less-than-two-weeks',
|
|
143
|
-
axisLabel: {
|
|
144
|
-
formatter: (value: string) =>
|
|
145
|
-
formatXAxisLabel(value, isGreaterThanTwoWeeks),
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
series: [
|
|
149
|
-
{
|
|
150
|
-
id: 'candlestick',
|
|
151
|
-
markPoint: {
|
|
152
|
-
data: labelsData,
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
},
|
|
125
|
+
datazoom: handleDataZoom,
|
|
159
126
|
}}
|
|
160
127
|
/>
|
|
161
128
|
);
|