@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
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesCandlestickConfig = void 0;
|
|
7
|
+
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const getSeriesCandlestickConfig = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
styles,
|
|
12
|
+
isLoading
|
|
13
|
+
} = _ref;
|
|
14
|
+
const {
|
|
15
|
+
candleLongColor,
|
|
16
|
+
candleShortColor
|
|
17
|
+
} = styles;
|
|
18
|
+
return {
|
|
19
|
+
animation: isLoading,
|
|
20
|
+
type: 'candlestick',
|
|
21
|
+
id: 'candlestick',
|
|
22
|
+
xAxisIndex: 0,
|
|
23
|
+
yAxisIndex: 0,
|
|
24
|
+
silent: true,
|
|
25
|
+
clip: true,
|
|
26
|
+
large: true,
|
|
27
|
+
encode: {
|
|
28
|
+
x: 'dates',
|
|
29
|
+
y: ['open', 'close', 'low', 'high']
|
|
30
|
+
},
|
|
31
|
+
itemStyle: {
|
|
32
|
+
color: (0, _chromaJs.default)(candleLongColor).desaturate().css(),
|
|
33
|
+
color0: (0, _chromaJs.default)(candleShortColor).desaturate().css(),
|
|
34
|
+
borderColor: candleLongColor,
|
|
35
|
+
borderColor0: candleShortColor
|
|
36
|
+
},
|
|
37
|
+
emphasis: {
|
|
38
|
+
itemStyle: {
|
|
39
|
+
color: candleLongColor,
|
|
40
|
+
color0: candleShortColor
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
z: 3
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
exports.getSeriesCandlestickConfig = getSeriesCandlestickConfig;
|
|
47
|
+
//# sourceMappingURL=getSeriesCandlestickConfig.js.map
|
package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSeriesCandlestickConfig.js","names":["_chromaJs","_interopRequireDefault","require","e","__esModule","default","getSeriesCandlestickConfig","_ref","styles","isLoading","candleLongColor","candleShortColor","animation","type","id","xAxisIndex","yAxisIndex","silent","clip","large","encode","x","y","itemStyle","color","chroma","desaturate","css","color0","borderColor","borderColor0","emphasis","z","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts"],"sourcesContent":["import chroma from 'chroma-js';\nimport type { CandlestickSeriesOption } from 'echarts';\n\nimport type { ChartStyles } from '../chartUtils/getChartStyles';\n\ninterface GetSeriesCandlestickConfigParams {\n styles: ChartStyles;\n isLoading: boolean;\n}\n\nexport const getSeriesCandlestickConfig = ({\n styles,\n isLoading,\n}: GetSeriesCandlestickConfigParams): CandlestickSeriesOption => {\n const { candleLongColor, candleShortColor } = styles;\n\n return {\n animation: isLoading,\n type: 'candlestick',\n id: 'candlestick',\n xAxisIndex: 0,\n yAxisIndex: 0,\n silent: true,\n clip: true,\n large: true,\n encode: {\n x: 'dates',\n y: ['open', 'close', 'low', 'high'],\n },\n itemStyle: {\n color: chroma(candleLongColor).desaturate().css(),\n color0: chroma(candleShortColor).desaturate().css(),\n borderColor: candleLongColor,\n borderColor0: candleShortColor,\n },\n emphasis: {\n itemStyle: {\n color: candleLongColor,\n color0: candleShortColor,\n },\n },\n z: 3,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAUxB,MAAMG,0BAA0B,GAAGC,IAAA,IAGuB;EAAA,IAHtB;IACzCC,MAAM;IACNC;EACgC,CAAC,GAAAF,IAAA;EACjC,MAAM;IAAEG,eAAe;IAAEC;EAAiB,CAAC,GAAGH,MAAM;EAEpD,OAAO;IACLI,SAAS,EAAEH,SAAS;IACpBI,IAAI,EAAE,aAAa;IACnBC,EAAE,EAAE,aAAa;IACjBC,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,CAAC;IACbC,MAAM,EAAE,IAAI;IACZC,IAAI,EAAE,IAAI;IACVC,KAAK,EAAE,IAAI;IACXC,MAAM,EAAE;MACNC,CAAC,EAAE,OAAO;MACVC,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IACpC,CAAC;IACDC,SAAS,EAAE;MACTC,KAAK,EAAE,IAAAC,iBAAM,EAACf,eAAe,CAAC,CAACgB,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;MACjDC,MAAM,EAAE,IAAAH,iBAAM,EAACd,gBAAgB,CAAC,CAACe,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;MACnDE,WAAW,EAAEnB,eAAe;MAC5BoB,YAAY,EAAEnB;IAChB,CAAC;IACDoB,QAAQ,EAAE;MACRR,SAAS,EAAE;QACTC,KAAK,EAAEd,eAAe;QACtBkB,MAAM,EAAEjB;MACV;IACF,CAAC;IACDqB,CAAC,EAAE;EACL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA3B,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesHeatmapConfig = void 0;
|
|
7
|
+
var _chartUtils = require("../chartUtils");
|
|
8
|
+
const getSeriesHeatmapConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
bucketWidth,
|
|
11
|
+
buckets,
|
|
12
|
+
isDark,
|
|
13
|
+
sentimentThresholdMax,
|
|
14
|
+
sentimentThresholdMin,
|
|
15
|
+
isLoading
|
|
16
|
+
} = _ref;
|
|
17
|
+
return {
|
|
18
|
+
animation: isLoading,
|
|
19
|
+
type: 'custom',
|
|
20
|
+
id: 'heatmap',
|
|
21
|
+
name: 'heatmap',
|
|
22
|
+
xAxisIndex: 0,
|
|
23
|
+
yAxisIndex: 0,
|
|
24
|
+
encode: {
|
|
25
|
+
x: 'dates',
|
|
26
|
+
y: 'bookPrices'
|
|
27
|
+
},
|
|
28
|
+
dimensions: ['dates', 'bookPrices', 'bookIndexes'],
|
|
29
|
+
clip: true,
|
|
30
|
+
renderItem: (params, api) => {
|
|
31
|
+
const animationDelay = 350 * params.dataIndexInside / params.dataInsideLength;
|
|
32
|
+
const xVal = api.value(0);
|
|
33
|
+
const bucketIndex = api.value(2);
|
|
34
|
+
if (bucketIndex == null) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const metaValues = buckets[bucketIndex];
|
|
38
|
+
if (!metaValues) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const [rectWidth, rectHeight] = api.size([0, bucketWidth]);
|
|
42
|
+
const items = metaValues.map(_ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
price,
|
|
45
|
+
sentiment
|
|
46
|
+
} = _ref2;
|
|
47
|
+
const start = api.coord([xVal, price]);
|
|
48
|
+
return {
|
|
49
|
+
silent: true,
|
|
50
|
+
shape: {
|
|
51
|
+
height: rectHeight,
|
|
52
|
+
width: rectWidth + 1,
|
|
53
|
+
x: start[0] - rectWidth / 2,
|
|
54
|
+
y: start[1] - rectHeight
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
fill: (0, _chartUtils.getRectColor)(sentiment, isDark, sentimentThresholdMin, sentimentThresholdMax)
|
|
58
|
+
},
|
|
59
|
+
enterFrom: {
|
|
60
|
+
shape: {},
|
|
61
|
+
style: {
|
|
62
|
+
opacity: 0
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
enterAnimation: {
|
|
66
|
+
duration: 150,
|
|
67
|
+
delay: animationDelay
|
|
68
|
+
},
|
|
69
|
+
type: 'rect'
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
children: items,
|
|
74
|
+
emphasisDisabled: true,
|
|
75
|
+
silent: true,
|
|
76
|
+
type: 'group'
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
z: 1
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
exports.getSeriesHeatmapConfig = getSeriesHeatmapConfig;
|
|
83
|
+
//# sourceMappingURL=getSeriesHeatmapConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSeriesHeatmapConfig.js","names":["_chartUtils","require","getSeriesHeatmapConfig","_ref","bucketWidth","buckets","isDark","sentimentThresholdMax","sentimentThresholdMin","isLoading","animation","type","id","name","xAxisIndex","yAxisIndex","encode","x","y","dimensions","clip","renderItem","params","api","animationDelay","dataIndexInside","dataInsideLength","xVal","value","bucketIndex","metaValues","rectWidth","rectHeight","size","items","map","_ref2","price","sentiment","start","coord","silent","shape","height","width","style","fill","getRectColor","enterFrom","opacity","enterAnimation","duration","delay","children","emphasisDisabled","z","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts"],"sourcesContent":["import type {\n CustomSeriesOption,\n CustomSeriesRenderItemAPI,\n CustomSeriesRenderItemParams,\n} from 'echarts';\n\nimport { getRectColor } from '../chartUtils';\nimport type { Bucket } from '../types';\n\ninterface GetSeriesHeatmapConfigParams {\n bucketWidth: number;\n buckets: Bucket[][];\n isDark: boolean;\n sentimentThresholdMax: number;\n sentimentThresholdMin: number;\n isLoading: boolean;\n}\n\nexport const getSeriesHeatmapConfig = ({\n bucketWidth,\n buckets,\n isDark,\n sentimentThresholdMax,\n sentimentThresholdMin,\n isLoading,\n}: GetSeriesHeatmapConfigParams): CustomSeriesOption => {\n return {\n animation: isLoading,\n type: 'custom',\n id: 'heatmap',\n name: 'heatmap',\n xAxisIndex: 0,\n yAxisIndex: 0,\n encode: {\n x: 'dates',\n y: 'bookPrices',\n },\n dimensions: ['dates', 'bookPrices', 'bookIndexes'],\n clip: true,\n renderItem: (\n params: CustomSeriesRenderItemParams,\n api: CustomSeriesRenderItemAPI\n ) => {\n const animationDelay =\n (350 * params.dataIndexInside) / params.dataInsideLength;\n const xVal = api.value(0);\n const bucketIndex = api.value(2) as number;\n\n if (bucketIndex == null) {\n return null;\n }\n\n const metaValues = buckets[bucketIndex];\n\n if (!metaValues) {\n return null;\n }\n\n const [rectWidth, rectHeight] = api.size!([0, bucketWidth]) as number[];\n\n const items = metaValues.map(({ price, sentiment }: Bucket) => {\n const start = api.coord([xVal, price]);\n\n return {\n silent: true,\n shape: {\n height: rectHeight,\n width: rectWidth + 1,\n x: start[0] - rectWidth / 2,\n y: start[1] - rectHeight,\n },\n style: {\n fill: getRectColor(\n sentiment,\n isDark,\n sentimentThresholdMin,\n sentimentThresholdMax\n ),\n },\n enterFrom: {\n shape: {},\n style: {\n opacity: 0,\n },\n },\n enterAnimation: {\n duration: 150,\n delay: animationDelay,\n },\n type: 'rect' as const,\n };\n });\n\n return {\n children: items,\n emphasisD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C,GAAAF,KAAA;QACxD,MAAMG,KAAK,GAAGhB,GAAG,CAACiB,KAAK,CAAC,CAACb,IAAI,EAAEU,KAAK,CAAC,CAAC;QAEtC,OAAO;UACLI,MAAM,EAAE,IAAI;UACZC,KAAK,EAAE;YACLC,MAAM,EAAEX,UAAU;YAClBY,KAAK,EAAEb,SAAS,GAAG,CAAC;YACpBd,CAAC,EAAEsB,KAAK,CAAC,CAAC,CAAC,GAAGR,SAAS,GAAG,CAAC;YAC3Bb,CAAC,EAAEqB,KAAK,CAAC,CAAC,CAAC,GAAGP;UAChB,CAAC;UACDa,KAAK,EAAE;YACLC,IAAI,EAAE,IAAAC,wBAAY,EAChBT,SAAS,EACThC,MAAM,EACNE,qBAAqB,EACrBD,qBACF;UACF,CAAC;UACDyC,SAAS,EAAE;YACTN,KAAK,EAAE,CAAC,CAAC;YACTG,KAAK,EAAE;cACLI,OAAO,EAAE;YACX;UACF,CAAC;UACDC,cAAc,EAAE;YACdC,QAAQ,EAAE,GAAG;YACbC,KAAK,EAAE5B;UACT,CAAC;UACDb,IAAI,EAAE;QACR,CAAC;MACH,CAAC,CAAC;MAEF,OAAO;QACL0C,QAAQ,EAAEnB,KAAK;QACfoB,gBAAgB,EAAE,IAAI;QACtBb,MAAM,EAAE,IAAI;QACZ9B,IAAI,EAAE;MACR,CAAC;IACH,CAAC;IACD4C,CAAC,EAAE;EACL,CAAC;AACH,CAAC;AAACC,OAAA,CAAAtD,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesSentimentConfig = void 0;
|
|
7
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
const getSeriesSentimentConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
styles,
|
|
11
|
+
isLoading
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
animation: isLoading,
|
|
15
|
+
animationDelay: 350,
|
|
16
|
+
type: 'line',
|
|
17
|
+
id: 'sentiment',
|
|
18
|
+
name: 'sentiment',
|
|
19
|
+
xAxisIndex: 1,
|
|
20
|
+
yAxisIndex: 1,
|
|
21
|
+
encode: {
|
|
22
|
+
x: 'dates',
|
|
23
|
+
y: 'sentimentLongs'
|
|
24
|
+
},
|
|
25
|
+
dimensions: ['dates', 'sentimentLongs', 'sentimentShorts'],
|
|
26
|
+
lineStyle: {
|
|
27
|
+
width: styles.sentimentOutlineWidth,
|
|
28
|
+
opacity: 1,
|
|
29
|
+
shadowColor: styles.sentimentOutlineColor,
|
|
30
|
+
shadowBlur: 3
|
|
31
|
+
},
|
|
32
|
+
emphasis: {
|
|
33
|
+
disabled: true
|
|
34
|
+
},
|
|
35
|
+
tooltip: {
|
|
36
|
+
show: false
|
|
37
|
+
},
|
|
38
|
+
markLine: {
|
|
39
|
+
animation: isLoading,
|
|
40
|
+
silent: true,
|
|
41
|
+
symbol: ['none', 'none'],
|
|
42
|
+
label: {
|
|
43
|
+
show: false
|
|
44
|
+
},
|
|
45
|
+
lineStyle: {
|
|
46
|
+
color: _labsWidgetCommon.colorPalette.grayLight,
|
|
47
|
+
width: 1
|
|
48
|
+
},
|
|
49
|
+
data: [{
|
|
50
|
+
yAxis: 20
|
|
51
|
+
}, {
|
|
52
|
+
yAxis: 50,
|
|
53
|
+
lineStyle: {
|
|
54
|
+
width: 1
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
yAxis: 80
|
|
58
|
+
}]
|
|
59
|
+
},
|
|
60
|
+
showSymbol: false,
|
|
61
|
+
symbol: 'none',
|
|
62
|
+
z: 2,
|
|
63
|
+
connectNulls: true,
|
|
64
|
+
silent: true
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
exports.getSeriesSentimentConfig = getSeriesSentimentConfig;
|
|
68
|
+
//# sourceMappingURL=getSeriesSentimentConfig.js.map
|
package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSeriesSentimentConfig.js","names":["_labsWidgetCommon","require","getSeriesSentimentConfig","_ref","styles","isLoading","animation","animationDelay","type","id","name","xAxisIndex","yAxisIndex","encode","x","y","dimensions","lineStyle","width","sentimentOutlineWidth","opacity","shadowColor","sentimentOutlineColor","shadowBlur","emphasis","disabled","tooltip","show","markLine","silent","symbol","label","color","colorPalette","grayLight","data","yAxis","showSymbol","z","connectNulls","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport type { LineSeriesOption } from 'echarts';\n\nimport type { ChartStyles } from '../chartUtils';\n\ninterface GetSeriesSentimentConfigParams {\n styles: ChartStyles;\n isLoading: boolean;\n}\n\nexport const getSeriesSentimentConfig = ({\n styles,\n isLoading,\n}: GetSeriesSentimentConfigParams): LineSeriesOption => {\n return {\n animation: isLoading,\n animationDelay: 350,\n type: 'line',\n id: 'sentiment',\n name: 'sentiment',\n xAxisIndex: 1,\n yAxisIndex: 1,\n encode: {\n x: 'dates',\n y: 'sentimentLongs',\n },\n dimensions: ['dates', 'sentimentLongs', 'sentimentShorts'],\n lineStyle: {\n width: styles.sentimentOutlineWidth,\n opacity: 1,\n shadowColor: styles.sentimentOutlineColor,\n shadowBlur: 3,\n },\n emphasis: {\n disabled: true,\n },\n tooltip: {\n show: false,\n },\n markLine: {\n animation: isLoading,\n silent: true,\n symbol: ['none', 'none'],\n label: {\n show: false,\n },\n lineStyle: {\n color: colorPalette.grayLight,\n width: 1,\n },\n data: [\n {\n yAxis: 20,\n },\n {\n yAxis: 50,\n lineStyle: {\n width: 1,\n },\n },\n {\n yAxis: 80,\n },\n ],\n },\n showSymbol: false,\n symbol: 'none',\n z: 2,\n connectNulls: true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M;IACdQ,CAAC,EAAE,CAAC;IACJC,YAAY,EAAE,IAAI;IAClBV,MAAM,EAAE;EACV,CAAC;AACH,CAAC;AAACW,OAAA,CAAAtC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTooltipConfig = void 0;
|
|
7
|
+
var _constants = require("../../../constants");
|
|
8
|
+
var _chartUtils = require("../chartUtils");
|
|
9
|
+
const getTooltipConfig = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
bookType,
|
|
12
|
+
bucketWidth,
|
|
13
|
+
buckets,
|
|
14
|
+
displayPrecision,
|
|
15
|
+
labelCallback,
|
|
16
|
+
selectedPriceRef,
|
|
17
|
+
tooltipLinesColor,
|
|
18
|
+
sentimentLongs,
|
|
19
|
+
sentimentShorts
|
|
20
|
+
} = _ref;
|
|
21
|
+
return {
|
|
22
|
+
trigger: 'axis',
|
|
23
|
+
formatter: params => (0, _chartUtils.getTooltipFormatter)({
|
|
24
|
+
bookType,
|
|
25
|
+
bucketWidth,
|
|
26
|
+
buckets,
|
|
27
|
+
labelCallback,
|
|
28
|
+
params: params,
|
|
29
|
+
selectedPrice: selectedPriceRef.current,
|
|
30
|
+
sentimentLongs,
|
|
31
|
+
sentimentShorts
|
|
32
|
+
}),
|
|
33
|
+
hideDelay: 0,
|
|
34
|
+
axisPointer: {
|
|
35
|
+
type: 'cross',
|
|
36
|
+
axis: 'x',
|
|
37
|
+
lineStyle: {
|
|
38
|
+
color: tooltipLinesColor
|
|
39
|
+
},
|
|
40
|
+
crossStyle: {
|
|
41
|
+
color: tooltipLinesColor
|
|
42
|
+
},
|
|
43
|
+
label: {
|
|
44
|
+
padding: 0,
|
|
45
|
+
lineHeight: 24,
|
|
46
|
+
formatter: params => {
|
|
47
|
+
if (params.axisDimension === 'y' && params.axisIndex === 0) {
|
|
48
|
+
selectedPriceRef.current = Number(params.value);
|
|
49
|
+
return " ".concat(Number(params.value).toFixed(displayPrecision), " ");
|
|
50
|
+
}
|
|
51
|
+
return '';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
confine: true,
|
|
56
|
+
position: point => [point[0] + _constants.CHART_CONFIG.TOOLTIP_OFFSET, point[1] + _constants.CHART_CONFIG.TOOLTIP_OFFSET]
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.getTooltipConfig = getTooltipConfig;
|
|
60
|
+
//# sourceMappingURL=getTooltipConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTooltipConfig.js","names":["_constants","require","_chartUtils","getTooltipConfig","_ref","bookType","bucketWidth","buckets","displayPrecision","labelCallback","selectedPriceRef","tooltipLinesColor","sentimentLongs","sentimentShorts","trigger","formatter","params","getTooltipFormatter","selectedPrice","current","hideDelay","axisPointer","type","axis","lineStyle","color","crossStyle","label","padding","lineHeight","axisDimension","axisIndex","Number","value","concat","toFixed","confine","position","point","CHART_CONFIG","TOOLTIP_OFFSET","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts"],"sourcesContent":["import type { TooltipComponentOption } from 'echarts';\n\nimport type { BookType } from '../../../../gql/types/graphql';\nimport { CHART_CONFIG } from '../../../constants';\nimport { getTooltipFormatter } from '../chartUtils';\nimport type { Bucket, TooltipParam } from '../types';\n\ninterface GetTooltipConfigParams {\n bookType: BookType;\n bucketWidth: number;\n buckets: Bucket[][];\n displayPrecision: number;\n labelCallback: (key: string, params?: Record<string, unknown>) => string;\n selectedPriceRef: { current: number };\n tooltipLinesColor: string;\n sentimentLongs: (number | null)[];\n sentimentShorts: (number | null)[];\n}\n\nexport const getTooltipConfig = ({\n bookType,\n bucketWidth,\n buckets,\n displayPrecision,\n labelCallback,\n selectedPriceRef,\n tooltipLinesColor,\n sentimentLongs,\n sentimentShorts,\n}: GetTooltipConfigParams): TooltipComponentOption => ({\n trigger: 'axis' as const,\n formatter: (params) =>\n getTooltipFormatter({\n bookType,\n bucketWidth,\n buckets,\n labelCallback,\n params: params as unknown as TooltipParam[],\n selectedPrice: selectedPriceRef.current,\n sentimentLongs,\n sentimentShorts,\n }),\n hideDelay: 0,\n axisPointer: {\n type: 'cross' as const,\n axis: 'x' as const,\n lineStyle: {\n color: tooltipLinesColor,\n },\n crossStyle: {\n color: tooltipLinesColor,\n },\n label: {\n padding: 0,\n lineHeight: 24,\n formatter: (params: {\n axisDimension?: string;\n axisIndex?: number;\n value: unknown;\n }) => {\n if (params.axisDimension === 'y' && params.axisIndex === 0) {\n selectedPriceRef.current = Number(params.value);\n return ` ${Number(params.value).toFixed(displayPrecision)} `;\n }\n return '';\n },\n },\n },\n confine: true,\n position: (point) => [\n point[0] + CHART_CONFIG.TOOLTIP_OFFSET,\n point[1] + CHART_CONFIG.TOOLTIP_OFFSET,\n ],\n});\n"],"mappings":";;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAeO,MAAME,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IAC/BC,QAAQ;IACRC,WAAW;IACXC,OAAO;IACPC,gBAAgB;IAChBC,aAAa;IACbC,gBAAgB;IAChBC,iBAAiB;IACjBC,cAAc;IACdC;EACsB,CAAC,GAAAT,IAAA;EAAA,OAA8B;IACrDU,OAAO,EAAE,MAAe;IACxBC,SAAS,EAAGC,MAAM,IAChB,IAAAC,+BAAmB,EAAC;MAClBZ,QAAQ;MACRC,WAAW;MACXC,OAAO;MACPE,aAAa;MACbO,MAAM,EAAEA,MAAmC;MAC3CE,aAAa,EAAER,gBAAgB,CAACS,OAAO;MACvCP,cAAc;MACdC;IACF,CAAC,CAAC;IACJO,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE;MACXC,IAAI,EAAE,OAAgB;MACtBC,IAAI,EAAE,GAAY;MAClBC,SAAS,EAAE;QACTC,KAAK,EAAEd;MACT,CAAC;MACDe,UAAU,EAAE;QACVD,KAAK,EAAEd;MACT,CAAC;MACDgB,KAAK,EAAE;QACLC,OAAO,EAAE,CAAC;QACVC,UAAU,EAAE,EAAE;QACdd,SAAS,EAAGC,MAIX,IAAK;UACJ,IAAIA,MAAM,CAACc,aAAa,KAAK,GAAG,IAAId,MAAM,CAACe,SAAS,KAAK,CAAC,EAAE;YAC1DrB,gBAAgB,CAACS,OAAO,GAAGa,MAAM,CAAChB,MAAM,CAACiB,KAAK,CAAC;YAC/C,WAAAC,MAAA,CAAWF,MAAM,CAAChB,MAAM,CAACiB,KAAK,CAAC,CAACE,OAAO,CAAC3B,gBAAgB,CAAC;UAC3D;UACA,OAAO,EAAE;QACX;MACF;IACF,CAAC;IACD4B,OAAO,EAAE,IAAI;IACbC,QAAQ,EAAGC,KAAK,IAAK,CACnBA,KAAK,CAAC,CAAC,CAAC,GAAGC,uBAAY,CAACC,cAAc,EACtCF,KAAK,CAAC,CAAC,CAAC,GAAGC,uBAAY,CAACC,cAAc;EAE1C,CAAC;AAAA,CAAC;AAACC,OAAA,CAAAtC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getVisualMapConfig = void 0;
|
|
7
|
+
var _constants = require("../../../constants");
|
|
8
|
+
const getVisualMapConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
sentimentLongColor,
|
|
11
|
+
sentimentShortColor
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
show: false,
|
|
15
|
+
dimension: 1,
|
|
16
|
+
seriesId: 'sentiment',
|
|
17
|
+
pieces: [{
|
|
18
|
+
lt: _constants.CHART_CONFIG.SENTIMENT_MAX / 2,
|
|
19
|
+
color: sentimentShortColor
|
|
20
|
+
}, {
|
|
21
|
+
gte: _constants.CHART_CONFIG.SENTIMENT_MAX / 2,
|
|
22
|
+
lte: _constants.CHART_CONFIG.SENTIMENT_MAX,
|
|
23
|
+
color: sentimentLongColor
|
|
24
|
+
}, {
|
|
25
|
+
gt: _constants.CHART_CONFIG.SENTIMENT_MAX,
|
|
26
|
+
color: sentimentLongColor
|
|
27
|
+
}]
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.getVisualMapConfig = getVisualMapConfig;
|
|
31
|
+
//# sourceMappingURL=getVisualMapConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVisualMapConfig.js","names":["_constants","require","getVisualMapConfig","_ref","sentimentLongColor","sentimentShortColor","show","dimension","seriesId","pieces","lt","CHART_CONFIG","SENTIMENT_MAX","color","gte","lte","gt","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.ts"],"sourcesContent":["import type { VisualMapComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface GetVisualMapConfigParams {\n sentimentLongColor: string;\n sentimentShortColor: string;\n}\n\nexport const getVisualMapConfig = ({\n sentimentLongColor,\n sentimentShortColor,\n}: GetVisualMapConfigParams): VisualMapComponentOption => ({\n show: false,\n dimension: 1,\n seriesId: 'sentiment',\n pieces: [\n {\n lt: CHART_CONFIG.SENTIMENT_MAX / 2,\n color: sentimentShortColor,\n },\n {\n gte: CHART_CONFIG.SENTIMENT_MAX / 2,\n lte: CHART_CONFIG.SENTIMENT_MAX,\n color: sentimentLongColor,\n },\n {\n gt: CHART_CONFIG.SENTIMENT_MAX,\n color: sentimentLongColor,\n },\n ],\n});\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAOO,MAAMC,kBAAkB,GAAGC,IAAA;EAAA,IAAC;IACjCC,kBAAkB;IAClBC;EACwB,CAAC,GAAAF,IAAA;EAAA,OAAgC;IACzDG,IAAI,EAAE,KAAK;IACXC,SAAS,EAAE,CAAC;IACZC,QAAQ,EAAE,WAAW;IACrBC,MAAM,EAAE,CACN;MACEC,EAAE,EAAEC,uBAAY,CAACC,aAAa,GAAG,CAAC;MAClCC,KAAK,EAAER;IACT,CAAC,EACD;MACES,GAAG,EAAEH,uBAAY,CAACC,aAAa,GAAG,CAAC;MACnCG,GAAG,EAAEJ,uBAAY,CAACC,aAAa;MAC/BC,KAAK,EAAET;IACT,CAAC,EACD;MACEY,EAAE,EAAEL,uBAAY,CAACC,aAAa;MAC9BC,KAAK,EAAET;IACT,CAAC;EAEL,CAAC;AAAA,CAAC;AAACa,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getXAxisConfig = void 0;
|
|
7
|
+
var _chartUtils = require("../chartUtils");
|
|
8
|
+
const getXAxisConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
dates,
|
|
11
|
+
isGreaterThanTwoWeeks
|
|
12
|
+
} = _ref;
|
|
13
|
+
const labelsData = (0, _chartUtils.getLabelData)({
|
|
14
|
+
dates,
|
|
15
|
+
isGreaterThanTwoWeeks
|
|
16
|
+
});
|
|
17
|
+
return [{
|
|
18
|
+
type: 'category',
|
|
19
|
+
id: 'main-xAxis',
|
|
20
|
+
name: isGreaterThanTwoWeeks ? 'xAxis-greater-than-two-weeks' : 'xAxis-less-than-two-weeks',
|
|
21
|
+
nameTextStyle: {
|
|
22
|
+
fontSize: 0
|
|
23
|
+
},
|
|
24
|
+
axisTick: {
|
|
25
|
+
show: false
|
|
26
|
+
},
|
|
27
|
+
axisLabel: {
|
|
28
|
+
padding: [8, 16, 8, 16],
|
|
29
|
+
margin: 0,
|
|
30
|
+
formatter: value => (0, _chartUtils.formatXAxisLabel)(value, isGreaterThanTwoWeeks)
|
|
31
|
+
},
|
|
32
|
+
boundaryGap: false
|
|
33
|
+
}, {
|
|
34
|
+
type: 'category',
|
|
35
|
+
id: 'additional-xAxis',
|
|
36
|
+
gridIndex: 1,
|
|
37
|
+
axisTick: {
|
|
38
|
+
show: false
|
|
39
|
+
},
|
|
40
|
+
axisLine: {
|
|
41
|
+
show: false
|
|
42
|
+
},
|
|
43
|
+
splitLine: {
|
|
44
|
+
show: false
|
|
45
|
+
},
|
|
46
|
+
axisLabel: {
|
|
47
|
+
margin: 24,
|
|
48
|
+
hideOverlap: true,
|
|
49
|
+
customValues: labelsData,
|
|
50
|
+
formatter: value => (0, _chartUtils.formatXAxisAdditionalLabel)(value, isGreaterThanTwoWeeks)
|
|
51
|
+
},
|
|
52
|
+
data: dates,
|
|
53
|
+
boundaryGap: false
|
|
54
|
+
}];
|
|
55
|
+
};
|
|
56
|
+
exports.getXAxisConfig = getXAxisConfig;
|
|
57
|
+
//# sourceMappingURL=getXAxisConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getXAxisConfig.js","names":["_chartUtils","require","getXAxisConfig","_ref","dates","isGreaterThanTwoWeeks","labelsData","getLabelData","type","id","name","nameTextStyle","fontSize","axisTick","show","axisLabel","padding","margin","formatter","value","formatXAxisLabel","boundaryGap","gridIndex","axisLine","splitLine","hideOverlap","customValues","formatXAxisAdditionalLabel","data","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts"],"sourcesContent":["import type { XAXisComponentOption } from 'echarts';\n\nimport {\n formatXAxisAdditionalLabel,\n formatXAxisLabel,\n getLabelData,\n} from '../chartUtils';\n\ninterface GetXAxisConfigParams {\n dates: string[];\n isGreaterThanTwoWeeks: boolean;\n}\n\nexport const getXAxisConfig = ({\n dates,\n isGreaterThanTwoWeeks,\n}: GetXAxisConfigParams): XAXisComponentOption[] => {\n const labelsData = getLabelData({\n dates,\n isGreaterThanTwoWeeks,\n });\n\n return [\n {\n type: 'category',\n id: 'main-xAxis',\n name: isGreaterThanTwoWeeks\n ? 'xAxis-greater-than-two-weeks'\n : 'xAxis-less-than-two-weeks',\n nameTextStyle: {\n fontSize: 0,\n },\n axisTick: {\n show: false,\n },\n axisLabel: {\n padding: [8, 16, 8, 16],\n margin: 0,\n formatter: (value: unknown) =>\n formatXAxisLabel(value, isGreaterThanTwoWeeks),\n },\n boundaryGap: false,\n },\n {\n type: 'category',\n id: 'additional-xAxis',\n gridIndex: 1,\n axisTick: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n axisLabel: {\n margin: 24,\n hideOverlap: true,\n customValues: labelsData,\n formatter: (value: unknown) =>\n formatXAxisAdditionalLabel(value, isGreaterThanTwoWeeks),\n },\n data: dates,\n boundaryGap: false,\n },\n ];\n};\n"],"mappings":";;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAWO,MAAMC,cAAc,GAAGC,IAAA,IAGsB;EAAA,IAHrB;IAC7BC,KAAK;IACLC;EACoB,CAAC,GAAAF,IAAA;EACrB,MAAMG,UAAU,GAAG,IAAAC,wBAAY,EAAC;IAC9BH,KAAK;IACLC;EACF,CAAC,CAAC;EAEF,OAAO,CACL;IACEG,IAAI,EAAE,UAAU;IAChBC,EAAE,EAAE,YAAY;IAChBC,IAAI,EAAEL,qBAAqB,GACvB,8BAA8B,GAC9B,2BAA2B;IAC/BM,aAAa,EAAE;MACbC,QAAQ,EAAE;IACZ,CAAC;IACDC,QAAQ,EAAE;MACRC,IAAI,EAAE;IACR,CAAC;IACDC,SAAS,EAAE;MACTC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;MACvBC,MAAM,EAAE,CAAC;MACTC,SAAS,EAAGC,KAAc,IACxB,IAAAC,4BAAgB,EAACD,KAAK,EAAEd,qBAAqB;IACjD,CAAC;IACDgB,WAAW,EAAE;EACf,CAAC,EACD;IACEb,IAAI,EAAE,UAAU;IAChBC,EAAE,EAAE,kBAAkB;IACtBa,SAAS,EAAE,CAAC;IACZT,QAAQ,EAAE;MACRC,IAAI,EAAE;IACR,CAAC;IACDS,QAAQ,EAAE;MACRT,IAAI,EAAE;IACR,CAAC;IACDU,SAAS,EAAE;MACTV,IAAI,EAAE;IACR,CAAC;IACDC,SAAS,EAAE;MACTE,MAAM,EAAE,EAAE;MACVQ,WAAW,EAAE,IAAI;MACjBC,YAAY,EAAEpB,UAAU;MACxBY,SAAS,EAAGC,KAAc,IACxB,IAAAQ,sCAA0B,EAACR,KAAK,EAAEd,qBAAqB;IAC3D,CAAC;IACDuB,IAAI,EAAExB,KAAK;IACXiB,WAAW,EAAE;EACf,CAAC,CACF;AACH,CAAC;AAACQ,OAAA,CAAA3B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getYAxisConfig = void 0;
|
|
7
|
+
var _constants = require("../../../constants");
|
|
8
|
+
const getYAxisConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
bucketWidth,
|
|
11
|
+
displayPrecision
|
|
12
|
+
} = _ref;
|
|
13
|
+
return [{
|
|
14
|
+
type: 'value',
|
|
15
|
+
gridIndex: 0,
|
|
16
|
+
position: 'right',
|
|
17
|
+
min: val => val.min - bucketWidth * _constants.BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,
|
|
18
|
+
max: val => val.max + bucketWidth * _constants.BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,
|
|
19
|
+
axisLine: {
|
|
20
|
+
show: false
|
|
21
|
+
},
|
|
22
|
+
axisTick: {
|
|
23
|
+
show: false
|
|
24
|
+
},
|
|
25
|
+
splitLine: {
|
|
26
|
+
show: false
|
|
27
|
+
},
|
|
28
|
+
axisLabel: {
|
|
29
|
+
lineHeight: 20,
|
|
30
|
+
margin: 4,
|
|
31
|
+
verticalAlignMinLabel: 'bottom',
|
|
32
|
+
verticalAlignMaxLabel: 'top',
|
|
33
|
+
formatter: value => value.toFixed(displayPrecision)
|
|
34
|
+
},
|
|
35
|
+
z: 30
|
|
36
|
+
}, {
|
|
37
|
+
type: 'value',
|
|
38
|
+
gridIndex: 1,
|
|
39
|
+
position: 'left',
|
|
40
|
+
min: _constants.CHART_CONFIG.SENTIMENT_MIN,
|
|
41
|
+
max: _constants.CHART_CONFIG.SENTIMENT_MAX,
|
|
42
|
+
axisLine: {
|
|
43
|
+
show: false
|
|
44
|
+
},
|
|
45
|
+
axisTick: {
|
|
46
|
+
show: false
|
|
47
|
+
},
|
|
48
|
+
axisPointer: {
|
|
49
|
+
show: false
|
|
50
|
+
},
|
|
51
|
+
splitLine: {
|
|
52
|
+
show: false
|
|
53
|
+
},
|
|
54
|
+
axisLabel: {
|
|
55
|
+
margin: 4,
|
|
56
|
+
lineHeight: 20,
|
|
57
|
+
verticalAlignMinLabel: 'bottom',
|
|
58
|
+
verticalAlignMaxLabel: 'middle',
|
|
59
|
+
customValues: [_constants.CHART_CONFIG.SENTIMENT_MIN, _constants.CHART_CONFIG.SENTIMENT_MAX / 5, _constants.CHART_CONFIG.SENTIMENT_MAX / 2, _constants.CHART_CONFIG.SENTIMENT_MAX * 4 / 5, _constants.CHART_CONFIG.SENTIMENT_MAX],
|
|
60
|
+
formatter: value => "".concat(value, "%")
|
|
61
|
+
},
|
|
62
|
+
z: 30
|
|
63
|
+
}];
|
|
64
|
+
};
|
|
65
|
+
exports.getYAxisConfig = getYAxisConfig;
|
|
66
|
+
//# sourceMappingURL=getYAxisConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getYAxisConfig.js","names":["_constants","require","getYAxisConfig","_ref","bucketWidth","displayPrecision","type","gridIndex","position","min","val","BUCKET_CONFIG","PRICE_MARGIN_MULTIPLIER","max","axisLine","show","axisTick","splitLine","axisLabel","lineHeight","margin","verticalAlignMinLabel","verticalAlignMaxLabel","formatter","value","toFixed","z","CHART_CONFIG","SENTIMENT_MIN","SENTIMENT_MAX","axisPointer","customValues","concat","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts"],"sourcesContent":["import type { YAXisComponentOption } from 'echarts';\n\nimport { BUCKET_CONFIG, CHART_CONFIG } from '../../../constants';\n\ninterface GetYAxisConfigParams {\n bucketWidth: number;\n displayPrecision: number;\n}\n\nexport const getYAxisConfig = ({\n bucketWidth,\n displayPrecision,\n}: GetYAxisConfigParams): YAXisComponentOption[] => [\n {\n type: 'value',\n gridIndex: 0,\n position: 'right',\n min: (val: { min: number }) =>\n val.min - bucketWidth * BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,\n max: (val: { max: number }) =>\n val.max + bucketWidth * BUCKET_CONFIG.PRICE_MARGIN_MULTIPLIER,\n axisLine: { show: false },\n axisTick: { show: false },\n splitLine: { show: false },\n axisLabel: {\n lineHeight: 20,\n margin: 4,\n verticalAlignMinLabel: 'bottom',\n verticalAlignMaxLabel: 'top',\n formatter: (value: number) => value.toFixed(displayPrecision),\n },\n z: 30,\n },\n {\n type: 'value',\n gridIndex: 1,\n position: 'left',\n min: CHART_CONFIG.SENTIMENT_MIN,\n max: CHART_CONFIG.SENTIMENT_MAX,\n axisLine: { show: false },\n axisTick: { show: false },\n axisPointer: { show: false },\n splitLine: { show: false },\n axisLabel: {\n margin: 4,\n lineHeight: 20,\n verticalAlignMinLabel: 'bottom',\n verticalAlignMaxLabel: 'middle',\n customValues: [\n CHART_CONFIG.SENTIMENT_MIN,\n CHART_CONFIG.SENTIMENT_MAX / 5,\n CHART_CONFIG.SENTIMENT_MAX / 2,\n (CHART_CONFIG.SENTIMENT_MAX * 4) / 5,\n CHART_CONFIG.SENTIMENT_MAX,\n ],\n formatter: (value: number) => `${value}%`,\n },\n z: 30,\n },\n];\n"],"mappings":";;;;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EAAE;MACdE,qBAAqB,EAAE,QAAQ;MAC/BC,qBAAqB,EAAE,QAAQ;MAC/BS,YAAY,EAAE,CACZJ,uBAAY,CAACC,aAAa,EAC1BD,uBAAY,CAACE,aAAa,GAAG,CAAC,EAC9BF,uBAAY,CAACE,aAAa,GAAG,CAAC,EAC7BF,uBAAY,CAACE,aAAa,GAAG,CAAC,GAAI,CAAC,EACpCF,uBAAY,CAACE,aAAa,CAC3B;MACDN,SAAS,EAAGC,KAAa,OAAAQ,MAAA,CAAQR,KAAK;IACxC,CAAC;IACDE,CAAC,EAAE;EACL,CAAC,CACF;AAAA;AAACO,OAAA,CAAA/B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _getDataZoomConfig = require("./getDataZoomConfig");
|
|
7
|
+
Object.keys(_getDataZoomConfig).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _getDataZoomConfig[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _getDataZoomConfig[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _getGridConfig = require("./getGridConfig");
|
|
18
|
+
Object.keys(_getGridConfig).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _getGridConfig[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _getGridConfig[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _getGridLines = require("./getGridLines");
|
|
29
|
+
Object.keys(_getGridLines).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _getGridLines[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _getGridLines[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _getLabelsConfig = require("./getLabelsConfig");
|
|
40
|
+
Object.keys(_getLabelsConfig).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _getLabelsConfig[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _getLabelsConfig[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _getSeriesCandlestickConfig = require("./getSeriesCandlestickConfig");
|
|
51
|
+
Object.keys(_getSeriesCandlestickConfig).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _getSeriesCandlestickConfig[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _getSeriesCandlestickConfig[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _getSeriesHeatmapConfig = require("./getSeriesHeatmapConfig");
|
|
62
|
+
Object.keys(_getSeriesHeatmapConfig).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _getSeriesHeatmapConfig[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _getSeriesHeatmapConfig[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _getSeriesSentimentConfig = require("./getSeriesSentimentConfig");
|
|
73
|
+
Object.keys(_getSeriesSentimentConfig).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _getSeriesSentimentConfig[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _getSeriesSentimentConfig[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _getTooltipConfig = require("./getTooltipConfig");
|
|
84
|
+
Object.keys(_getTooltipConfig).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _getTooltipConfig[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _getTooltipConfig[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
var _getVisualMapConfig = require("./getVisualMapConfig");
|
|
95
|
+
Object.keys(_getVisualMapConfig).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _getVisualMapConfig[key]) return;
|
|
98
|
+
Object.defineProperty(exports, key, {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return _getVisualMapConfig[key];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
var _getXAxisConfig = require("./getXAxisConfig");
|
|
106
|
+
Object.keys(_getXAxisConfig).forEach(function (key) {
|
|
107
|
+
if (key === "default" || key === "__esModule") return;
|
|
108
|
+
if (key in exports && exports[key] === _getXAxisConfig[key]) return;
|
|
109
|
+
Object.defineProperty(exports, key, {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return _getXAxisConfig[key];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
var _getYAxisConfig = require("./getYAxisConfig");
|
|
117
|
+
Object.keys(_getYAxisConfig).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (key in exports && exports[key] === _getYAxisConfig[key]) return;
|
|
120
|
+
Object.defineProperty(exports, key, {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _getYAxisConfig[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_getDataZoomConfig","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_getGridConfig","_getGridLines","_getLabelsConfig","_getSeriesCandlestickConfig","_getSeriesHeatmapConfig","_getSeriesSentimentConfig","_getTooltipConfig","_getVisualMapConfig","_getXAxisConfig","_getYAxisConfig"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/index.ts"],"sourcesContent":["export * from './getDataZoomConfig';\nexport * from './getGridConfig';\nexport * from './getGridLines';\nexport * from './getLabelsConfig';\nexport * from './getSeriesCandlestickConfig';\nexport * from './getSeriesHeatmapConfig';\nexport * from './getSeriesSentimentConfig';\nexport * from './getTooltipConfig';\nexport * from './getVisualMapConfig';\nexport * from './getXAxisConfig';\nexport * from './getYAxisConfig';\n"],"mappings":";;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,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}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatXAxisAdditionalLabel = void 0;
|
|
7
|
+
const formatXAxisAdditionalLabel = (value, isGreaterThanTwoWeeks) => {
|
|
8
|
+
const date = new Date(value);
|
|
9
|
+
if (isNaN(date.getTime())) {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
return "".concat(date.toLocaleDateString(undefined, {
|
|
13
|
+
month: isGreaterThanTwoWeeks ? 'short' : 'long',
|
|
14
|
+
day: isGreaterThanTwoWeeks ? 'numeric' : undefined
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
exports.formatXAxisAdditionalLabel = formatXAxisAdditionalLabel;
|
|
18
|
+
//# sourceMappingURL=formatXAxisAdditionalLabel.js.map
|
package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatXAxisAdditionalLabel.js","names":["formatXAxisAdditionalLabel","value","isGreaterThanTwoWeeks","date","Date","isNaN","getTime","concat","toLocaleDateString","undefined","month","day","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.ts"],"sourcesContent":["export const formatXAxisAdditionalLabel = (\n value: unknown,\n isGreaterThanTwoWeeks: boolean\n) => {\n const date = new Date(value as string);\n if (isNaN(date.getTime())) {\n return '';\n }\n return `${date.toLocaleDateString(undefined, {\n month: isGreaterThanTwoWeeks ? 'short' : 'long',\n day: isGreaterThanTwoWeeks ? 'numeric' : undefined,\n })}`;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,0BAA0B,GAAGA,CACxCC,KAAc,EACdC,qBAA8B,KAC3B;EACH,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACH,KAAe,CAAC;EACtC,IAAII,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,EAAE;IACzB,OAAO,EAAE;EACX;EACA,UAAAC,MAAA,CAAUJ,IAAI,CAACK,kBAAkB,CAACC,SAAS,EAAE;IAC3CC,KAAK,EAAER,qBAAqB,GAAG,OAAO,GAAG,MAAM;IAC/CS,GAAG,EAAET,qBAAqB,GAAG,SAAS,GAAGO;EAC3C,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAZ,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|