@oanda/labs-crowd-view-widget 1.0.52 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +436 -0
- package/dist/main/CrowdViewWidget/Main.js +4 -6
- package/dist/main/CrowdViewWidget/Main.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js +18 -31
- package/dist/main/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js +7 -5
- package/dist/main/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +30 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → chartOptions}/getGridLines.js +5 -52
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +54 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +65 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +60 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +53 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +31 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +42 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +75 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js +116 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.js +4 -4
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +14 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +42 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +14 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +108 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js +83 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +15 -0
- package/dist/main/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -0
- package/dist/main/CrowdViewWidget/{utils/instrumentUtils.js → components/Chart/dataUtils/getInstrumentConfigForDivision.js} +3 -3
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +18 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/index.js +8 -41
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +65 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +65 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +43 -0
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +8 -2
- package/dist/main/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js +103 -0
- package/dist/main/CrowdViewWidget/components/Chart/getOption.js.map +1 -0
- package/dist/main/CrowdViewWidget/components/Chart/index.js +11 -11
- package/dist/main/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js +53 -30
- package/dist/main/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js +15 -13
- package/dist/main/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js +5 -16
- package/dist/main/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/main/CrowdViewWidget/constants.js +12 -18
- package/dist/main/CrowdViewWidget/constants.js.map +1 -1
- package/dist/main/gql/getOrderPositionBooks.js +1 -1
- package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/main/gql/getPriceCandles.js +1 -1
- package/dist/main/gql/getPriceCandles.js.map +1 -1
- package/dist/main/gql/types/gql.js +2 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +111 -18
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/translations/sources/en.json +2 -1
- package/dist/module/CrowdViewWidget/Main.js +3 -5
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +20 -33
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +7 -5
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +23 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → chartOptions}/getGridLines.js +5 -52
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +46 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +58 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +53 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +46 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +24 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +35 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +68 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.js +4 -4
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +6 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +35 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +7 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +101 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +8 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +8 -0
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -0
- package/dist/module/CrowdViewWidget/{utils/instrumentUtils.js → components/Chart/dataUtils/getInstrumentConfigForDivision.js} +3 -3
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfigForDivision.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +11 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js +7 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +58 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +58 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +36 -0
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.js +8 -2
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js +96 -0
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -0
- package/dist/module/CrowdViewWidget/components/Chart/index.js +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/types.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +50 -27
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +15 -13
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +5 -16
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +10 -17
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/gql/getOrderPositionBooks.js +1 -1
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/getPriceCandles.js +1 -1
- package/dist/module/gql/getPriceCandles.js.map +1 -1
- package/dist/module/gql/types/gql.js +2 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +111 -18
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/translations/sources/en.json +2 -1
- package/dist/types/CrowdViewWidget/components/Chart/Chart.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getGridLines.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.d.ts +9 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.d.ts +11 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.d.ts +16 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.d.ts +9 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartOptions/index.d.ts +10 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.d.ts +2 -2
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getLabelData.d.ts +17 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getRectColor.d.ts +1 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.d.ts +10 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/index.d.ts +7 -0
- package/dist/types/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.d.ts +1 -0
- package/dist/types/CrowdViewWidget/{utils/instrumentUtils.d.ts → components/Chart/dataUtils/getInstrumentConfigForDivision.d.ts} +2 -2
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.d.ts +2 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/index.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.d.ts +11 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.d.ts +12 -0
- package/dist/types/CrowdViewWidget/components/Chart/dataUtils/processSentiments.d.ts +6 -0
- package/dist/types/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/index.d.ts +1 -1
- package/dist/types/CrowdViewWidget/components/Chart/types.d.ts +28 -11
- package/dist/types/CrowdViewWidget/components/Legend/Legend.d.ts +1 -4
- package/dist/types/CrowdViewWidget/components/Legend/LegendBar.d.ts +1 -3
- package/dist/types/CrowdViewWidget/constants.d.ts +4 -12
- package/dist/types/gql/types/gql.d.ts +6 -4
- package/dist/types/gql/types/graphql.d.ts +30 -11
- package/package.json +3 -3
- package/src/CrowdViewWidget/Main.tsx +3 -4
- package/src/CrowdViewWidget/components/Chart/Chart.tsx +25 -40
- package/src/CrowdViewWidget/components/Chart/ChartWithData.tsx +8 -4
- package/src/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.ts +13 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts +29 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts +84 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts +52 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts +82 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts +63 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts +63 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.ts +32 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts +43 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.ts +77 -0
- package/src/CrowdViewWidget/components/Chart/chartOptions/index.ts +10 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.ts +16 -0
- package/src/CrowdViewWidget/components/Chart/{utils → chartUtils}/getChartStyles.ts +9 -6
- package/src/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.ts +16 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getLabelData.ts +42 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getRectColor.ts +27 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.ts +183 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/index.ts +7 -0
- package/src/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.ts +13 -0
- package/src/CrowdViewWidget/{utils/instrumentUtils.ts → components/Chart/dataUtils/getInstrumentConfigForDivision.ts} +2 -2
- package/src/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.ts +14 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/index.ts +6 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.ts +92 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.ts +67 -0
- package/src/CrowdViewWidget/components/Chart/dataUtils/processSentiments.ts +55 -0
- package/src/CrowdViewWidget/components/Chart/{utils → dataUtils}/validateData.ts +10 -2
- package/src/CrowdViewWidget/components/Chart/getOption.ts +114 -0
- package/src/CrowdViewWidget/components/Chart/index.ts +1 -1
- package/src/CrowdViewWidget/components/Chart/types.ts +30 -19
- package/src/CrowdViewWidget/components/Chart/useCrowdViewData.ts +84 -67
- package/src/CrowdViewWidget/components/Legend/Legend.tsx +24 -23
- package/src/CrowdViewWidget/components/Legend/LegendBar.tsx +13 -26
- package/src/CrowdViewWidget/constants.ts +21 -23
- package/src/gql/getOrderPositionBooks.ts +13 -5
- package/src/gql/getPriceCandles.ts +1 -0
- package/src/gql/types/gql.ts +6 -6
- package/src/gql/types/graphql.ts +98 -16
- package/src/translations/sources/en.json +2 -1
- package/test/components/Chart/utils/chartUtils.test.ts +39 -21
- package/test/components/Chart/utils/getChartStyles.test.ts +10 -10
- package/test/components/Chart/utils/processSentiments.test.ts +138 -30
- package/test/components/Legend.test.tsx +13 -21
- package/test/components/LegendBar.test.tsx +31 -51
- package/test/utils/instrumentUtils.test.ts +1 -1
- package/test/utils/processOrderPositionBooks.test.ts +201 -84
- package/test/utils/processPriceCandles.test.ts +93 -67
- package/test/utils/validateData.test.ts +136 -38
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js +0 -359
- package/dist/main/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -37
- package/dist/main/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -127
- package/dist/main/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js +0 -14
- package/dist/main/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -29
- package/dist/main/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +0 -23
- package/dist/main/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +0 -43
- package/dist/main/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js +0 -28
- package/dist/main/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
- package/dist/main/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
- package/dist/main/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js +0 -351
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js +0 -29
- package/dist/module/CrowdViewWidget/components/Chart/utils/aggregateBuckets.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js +0 -114
- package/dist/module/CrowdViewWidget/components/Chart/utils/chartUtils.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getChartStyles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getGridLines.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js +0 -7
- package/dist/module/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js +0 -10
- package/dist/module/CrowdViewWidget/components/Chart/utils/index.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js +0 -22
- package/dist/module/CrowdViewWidget/components/Chart/utils/processBuckets.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js +0 -16
- package/dist/module/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js +0 -36
- package/dist/module/CrowdViewWidget/components/Chart/utils/processPriceCandles.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js +0 -21
- package/dist/module/CrowdViewWidget/components/Chart/utils/processSentiments.js.map +0 -1
- package/dist/module/CrowdViewWidget/components/Chart/utils/validateData.js.map +0 -1
- package/dist/module/CrowdViewWidget/utils/instrumentUtils.js.map +0 -1
- package/dist/types/CrowdViewWidget/components/Chart/utils/aggregateBuckets.d.ts +0 -2
- package/dist/types/CrowdViewWidget/components/Chart/utils/chartUtils.d.ts +0 -31
- package/dist/types/CrowdViewWidget/components/Chart/utils/getGridLines.d.ts +0 -97
- package/dist/types/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.d.ts +0 -3
- package/dist/types/CrowdViewWidget/components/Chart/utils/index.d.ts +0 -9
- package/dist/types/CrowdViewWidget/components/Chart/utils/processBuckets.d.ts +0 -3
- package/dist/types/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.d.ts +0 -8
- package/dist/types/CrowdViewWidget/components/Chart/utils/processPriceCandles.d.ts +0 -27
- package/dist/types/CrowdViewWidget/components/Chart/utils/processSentiments.d.ts +0 -3
- package/src/CrowdViewWidget/components/Chart/chartOptions.ts +0 -401
- package/src/CrowdViewWidget/components/Chart/utils/aggregateBuckets.ts +0 -44
- package/src/CrowdViewWidget/components/Chart/utils/chartUtils.ts +0 -216
- package/src/CrowdViewWidget/components/Chart/utils/getGridLines.ts +0 -148
- package/src/CrowdViewWidget/components/Chart/utils/getTargetBucketWidth.ts +0 -13
- package/src/CrowdViewWidget/components/Chart/utils/index.ts +0 -9
- package/src/CrowdViewWidget/components/Chart/utils/processBuckets.ts +0 -43
- package/src/CrowdViewWidget/components/Chart/utils/processOrderPositionBooks.ts +0 -30
- package/src/CrowdViewWidget/components/Chart/utils/processPriceCandles.ts +0 -53
- package/src/CrowdViewWidget/components/Chart/utils/processSentiments.ts +0 -42
- package/test/utils/aggregateBuckets.test.ts +0 -82
- package/test/utils/getTargetBucketWidth.test.ts +0 -37
- package/test/utils/processBuckets.test.ts +0 -153
- /package/dist/types/CrowdViewWidget/components/Chart/{chartOptions.d.ts → getOption.d.ts} +0 -0
|
@@ -21,7 +21,8 @@ const ChartWithData = _ref => {
|
|
|
21
21
|
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
22
22
|
const isDesktop = size === _labsWidgetCommon.Size.DESKTOP;
|
|
23
23
|
const {
|
|
24
|
-
|
|
24
|
+
mainData,
|
|
25
|
+
additionalData,
|
|
25
26
|
loading,
|
|
26
27
|
error
|
|
27
28
|
} = (0, _useCrowdViewData.useCrowdViewData)({
|
|
@@ -31,18 +32,19 @@ const ChartWithData = _ref => {
|
|
|
31
32
|
granularity
|
|
32
33
|
});
|
|
33
34
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
34
|
-
className: "lw-relative lw-h-[
|
|
35
|
+
className: "lw-relative lw-h-[440px] lw-w-full lw-overflow-hidden"
|
|
35
36
|
}, error && _react.default.createElement("div", {
|
|
36
37
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary"
|
|
37
38
|
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)), loading && _react.default.createElement("div", {
|
|
38
39
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary"
|
|
39
40
|
}, _react.default.createElement(_labsWidgetCommon.Spinner, {
|
|
40
41
|
size: _labsWidgetCommon.SpinnerSize.lg
|
|
41
|
-
})), !loading && !error && !!
|
|
42
|
+
})), !loading && !error && !!mainData && !!additionalData && _react.default.createElement("div", {
|
|
42
43
|
className: "lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full"
|
|
43
44
|
}, _react.default.createElement(_Chart.Chart, {
|
|
44
|
-
|
|
45
|
-
isDesktop: isDesktop
|
|
45
|
+
additionalData: additionalData,
|
|
46
|
+
isDesktop: isDesktop,
|
|
47
|
+
mainData: mainData
|
|
46
48
|
}))));
|
|
47
49
|
};
|
|
48
50
|
exports.ChartWithData = ChartWithData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["_labsWidgetCommon","require","_react","_interopRequireDefault","_Chart","_useCrowdViewData","e","__esModule","default","ChartWithData","_ref","instrument","bookType","division","granularity","size","useLayoutProvider","isDesktop","Size","DESKTOP","
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["_labsWidgetCommon","require","_react","_interopRequireDefault","_Chart","_useCrowdViewData","e","__esModule","default","ChartWithData","_ref","instrument","bookType","division","granularity","size","useLayoutProvider","isDesktop","Size","DESKTOP","mainData","additionalData","loading","error","useCrowdViewData","createElement","Fragment","className","ChartError","Spinner","SpinnerSize","lg","Chart","exports"],"sources":["../../../../../src/CrowdViewWidget/components/Chart/ChartWithData.tsx"],"sourcesContent":["import {\n ChartError,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport { Chart } from './Chart';\nimport type { ChartWithDataProps } from './types';\nimport { useCrowdViewData } from './useCrowdViewData';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n division,\n granularity,\n}: ChartWithDataProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n\n const { mainData, additionalData, loading, error } = useCrowdViewData({\n instrument,\n bookType,\n division,\n granularity,\n });\n\n return (\n <>\n <div className=\"lw-relative lw-h-[440px] lw-w-full lw-overflow-hidden\">\n {error && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )}\n {loading && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary\">\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && !error && !!mainData && !!additionalData && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full\">\n <Chart\n additionalData={additionalData}\n isDesktop={isDesktop}\n mainData={mainData}\n />\n </div>\n )}\n </div>\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,iBAAA,GAAAJ,OAAA;AAAsD,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,C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G,QAAQ,EAAEA;EAAS,CACpB,CACE,CAEJ,CACL,CAAC;AAEP,CAAC;AAACa,OAAA,CAAAxB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDataZoomConfig = void 0;
|
|
7
|
+
var _constants = require("../../../constants");
|
|
8
|
+
const getDataZoomConfig = () => ({
|
|
9
|
+
type: 'inside',
|
|
10
|
+
id: 'main',
|
|
11
|
+
xAxisIndex: [0, 1],
|
|
12
|
+
start: _constants.CHART_CONFIG.INITIAL_START_ZOOM,
|
|
13
|
+
end: _constants.CHART_CONFIG.INITIAL_END_ZOOM,
|
|
14
|
+
filterMode: 'filter',
|
|
15
|
+
minSpan: 10
|
|
16
|
+
});
|
|
17
|
+
exports.getDataZoomConfig = getDataZoomConfig;
|
|
18
|
+
//# sourceMappingURL=getDataZoomConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDataZoomConfig.js","names":["_constants","require","getDataZoomConfig","type","id","xAxisIndex","start","CHART_CONFIG","INITIAL_START_ZOOM","end","INITIAL_END_ZOOM","filterMode","minSpan","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.ts"],"sourcesContent":["import type { DataZoomComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\nexport const getDataZoomConfig = (): DataZoomComponentOption => ({\n type: 'inside',\n id: 'main',\n xAxisIndex: [0, 1],\n start: CHART_CONFIG.INITIAL_START_ZOOM,\n end: CHART_CONFIG.INITIAL_END_ZOOM,\n filterMode: 'filter',\n minSpan: 10,\n});\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,iBAAiB,GAAGA,CAAA,MAAgC;EAC/DC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,MAAM;EACVC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EAClBC,KAAK,EAAEC,uBAAY,CAACC,kBAAkB;EACtCC,GAAG,EAAEF,uBAAY,CAACG,gBAAgB;EAClCC,UAAU,EAAE,QAAQ;EACpBC,OAAO,EAAE;AACX,CAAC,CAAC;AAACC,OAAA,CAAAX,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getGridConfig = void 0;
|
|
7
|
+
var _constants = require("../../../constants");
|
|
8
|
+
const getGridConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
isDesktop
|
|
11
|
+
} = _ref;
|
|
12
|
+
return [{
|
|
13
|
+
id: 'main-grid',
|
|
14
|
+
name: 'main-grid',
|
|
15
|
+
left: "".concat(_constants.CHART_CONFIG.Y_SENTIMENT_LABEL_SIZE, "px"),
|
|
16
|
+
right: "".concat(isDesktop ? _constants.CHART_CONFIG.Y_LABEL_SIZE_DESKTOP : _constants.CHART_CONFIG.Y_LABEL_SIZE_MOBILE, "px"),
|
|
17
|
+
top: '0px',
|
|
18
|
+
bottom: "".concat(_constants.CHART_CONFIG.X_LABEL_SIZE, "px"),
|
|
19
|
+
height: "".concat(_constants.CHART_CONFIG.MAIN_HEIGHT, "px")
|
|
20
|
+
}, {
|
|
21
|
+
id: 'sentiment-grid',
|
|
22
|
+
name: 'sentiment-grid',
|
|
23
|
+
left: "".concat(_constants.CHART_CONFIG.Y_SENTIMENT_LABEL_SIZE, "px"),
|
|
24
|
+
right: "".concat(isDesktop ? _constants.CHART_CONFIG.Y_LABEL_SIZE_DESKTOP : _constants.CHART_CONFIG.Y_LABEL_SIZE_MOBILE, "px"),
|
|
25
|
+
top: "0px",
|
|
26
|
+
height: "".concat(_constants.CHART_CONFIG.MAIN_HEIGHT, "px")
|
|
27
|
+
}];
|
|
28
|
+
};
|
|
29
|
+
exports.getGridConfig = getGridConfig;
|
|
30
|
+
//# sourceMappingURL=getGridConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGridConfig.js","names":["_constants","require","getGridConfig","_ref","isDesktop","id","name","left","concat","CHART_CONFIG","Y_SENTIMENT_LABEL_SIZE","right","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","top","bottom","X_LABEL_SIZE","height","MAIN_HEIGHT","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts"],"sourcesContent":["import type { GridComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface GetGridConfigParams {\n isDesktop: boolean;\n}\n\nexport const getGridConfig = ({\n isDesktop,\n}: GetGridConfigParams): GridComponentOption[] => [\n {\n id: 'main-grid',\n name: 'main-grid',\n left: `${CHART_CONFIG.Y_SENTIMENT_LABEL_SIZE}px`,\n right: `${isDesktop ? CHART_CONFIG.Y_LABEL_SIZE_DESKTOP : CHART_CONFIG.Y_LABEL_SIZE_MOBILE}px`,\n top: '0px',\n bottom: `${CHART_CONFIG.X_LABEL_SIZE}px`,\n height: `${CHART_CONFIG.MAIN_HEIGHT}px`,\n },\n {\n id: 'sentiment-grid',\n name: 'sentiment-grid',\n left: `${CHART_CONFIG.Y_SENTIMENT_LABEL_SIZE}px`,\n right: `${isDesktop ? CHART_CONFIG.Y_LABEL_SIZE_DESKTOP : CHART_CONFIG.Y_LABEL_SIZE_MOBILE}px`,\n top: `0px`,\n height: `${CHART_CONFIG.MAIN_HEIGHT}px`,\n },\n];\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAMO,MAAMC,aAAa,GAAGC,IAAA;EAAA,IAAC;IAC5BC;EACmB,CAAC,GAAAD,IAAA;EAAA,OAA4B,CAChD;IACEE,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,WAAW;IACjBC,IAAI,KAAAC,MAAA,CAAKC,uBAAY,CAACC,sBAAsB,OAAI;IAChDC,KAAK,KAAAH,MAAA,CAAKJ,SAAS,GAAGK,uBAAY,CAACG,oBAAoB,GAAGH,uBAAY,CAACI,mBAAmB,OAAI;IAC9FC,GAAG,EAAE,KAAK;IACVC,MAAM,KAAAP,MAAA,CAAKC,uBAAY,CAACO,YAAY,OAAI;IACxCC,MAAM,KAAAT,MAAA,CAAKC,uBAAY,CAACS,WAAW;EACrC,CAAC,EACD;IACEb,EAAE,EAAE,gBAAgB;IACpBC,IAAI,EAAE,gBAAgB;IACtBC,IAAI,KAAAC,MAAA,CAAKC,uBAAY,CAACC,sBAAsB,OAAI;IAChDC,KAAK,KAAAH,MAAA,CAAKJ,SAAS,GAAGK,uBAAY,CAACG,oBAAoB,GAAGH,uBAAY,CAACI,mBAAmB,OAAI;IAC9FC,GAAG,OAAO;IACVG,MAAM,KAAAT,MAAA,CAAKC,uBAAY,CAACS,WAAW;EACrC,CAAC,CACF;AAAA;AAACC,OAAA,CAAAjB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -13,17 +13,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
13
13
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
const getGridLines = _ref => {
|
|
15
15
|
let {
|
|
16
|
-
isDark
|
|
17
|
-
isDesktop
|
|
16
|
+
isDark
|
|
18
17
|
} = _ref;
|
|
19
18
|
const {
|
|
20
19
|
WIDTH,
|
|
21
20
|
MAIN_HEIGHT,
|
|
22
|
-
MARGIN_BETWEEN,
|
|
23
|
-
SENTIMENT_HEIGHT,
|
|
24
21
|
X_LABEL_SIZE,
|
|
25
|
-
|
|
26
|
-
Y_LABEL_SIZE_MOBILE
|
|
22
|
+
Y_SENTIMENT_LABEL_SIZE
|
|
27
23
|
} = _constants.CHART_CONFIG;
|
|
28
24
|
return [_objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
29
25
|
top: -2,
|
|
@@ -42,7 +38,7 @@ const getGridLines = _ref => {
|
|
|
42
38
|
y2: MAIN_HEIGHT + X_LABEL_SIZE + 2
|
|
43
39
|
}
|
|
44
40
|
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
45
|
-
|
|
41
|
+
bottom: -2,
|
|
46
42
|
shape: {
|
|
47
43
|
x1: 0,
|
|
48
44
|
y1: 0,
|
|
@@ -58,7 +54,7 @@ const getGridLines = _ref => {
|
|
|
58
54
|
y2: MAIN_HEIGHT + X_LABEL_SIZE + 2
|
|
59
55
|
}
|
|
60
56
|
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
61
|
-
|
|
57
|
+
left: Y_SENTIMENT_LABEL_SIZE - 2,
|
|
62
58
|
top: -2,
|
|
63
59
|
shape: {
|
|
64
60
|
x1: 0,
|
|
@@ -67,56 +63,13 @@ const getGridLines = _ref => {
|
|
|
67
63
|
y2: MAIN_HEIGHT
|
|
68
64
|
}
|
|
69
65
|
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
70
|
-
top: MAIN_HEIGHT
|
|
71
|
-
shape: {
|
|
72
|
-
x1: 0,
|
|
73
|
-
y1: 0,
|
|
74
|
-
x2: WIDTH,
|
|
75
|
-
y2: 0
|
|
76
|
-
}
|
|
77
|
-
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
78
|
-
top: MAIN_HEIGHT + X_LABEL_SIZE + MARGIN_BETWEEN - 2,
|
|
79
|
-
shape: {
|
|
80
|
-
x1: 0,
|
|
81
|
-
y1: 0,
|
|
82
|
-
x2: WIDTH,
|
|
83
|
-
y2: 0
|
|
84
|
-
}
|
|
85
|
-
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
86
|
-
top: MAIN_HEIGHT + X_LABEL_SIZE + MARGIN_BETWEEN - 2,
|
|
87
|
-
right: -2,
|
|
88
|
-
shape: {
|
|
89
|
-
x1: 0,
|
|
90
|
-
y1: 0,
|
|
91
|
-
x2: 0,
|
|
92
|
-
y2: SENTIMENT_HEIGHT
|
|
93
|
-
}
|
|
94
|
-
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
95
|
-
top: MAIN_HEIGHT + X_LABEL_SIZE + MARGIN_BETWEEN + SENTIMENT_HEIGHT - 3,
|
|
66
|
+
top: MAIN_HEIGHT - 2,
|
|
96
67
|
shape: {
|
|
97
68
|
x1: 0,
|
|
98
69
|
y1: 0,
|
|
99
70
|
x2: WIDTH,
|
|
100
71
|
y2: 0
|
|
101
72
|
}
|
|
102
|
-
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
103
|
-
top: MAIN_HEIGHT + X_LABEL_SIZE + MARGIN_BETWEEN - 2,
|
|
104
|
-
left: -2,
|
|
105
|
-
shape: {
|
|
106
|
-
x1: 0,
|
|
107
|
-
y1: 0,
|
|
108
|
-
x2: 0,
|
|
109
|
-
y2: SENTIMENT_HEIGHT
|
|
110
|
-
}
|
|
111
|
-
}), _objectSpread(_objectSpread({}, (0, _labsWidgetCommon.getLineCommons)(isDark)), {}, {
|
|
112
|
-
right: (isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE) - 3,
|
|
113
|
-
top: MAIN_HEIGHT + X_LABEL_SIZE + MARGIN_BETWEEN - 2,
|
|
114
|
-
shape: {
|
|
115
|
-
x1: 0,
|
|
116
|
-
y1: 0,
|
|
117
|
-
x2: 0,
|
|
118
|
-
y2: SENTIMENT_HEIGHT
|
|
119
|
-
}
|
|
120
73
|
})];
|
|
121
74
|
};
|
|
122
75
|
exports.getGridLines = getGridLines;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getGridLines.js","names":["_labsWidgetCommon","require","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","getGridLines","_ref","isDark","WIDTH","MAIN_HEIGHT","X_LABEL_SIZE","Y_SENTIMENT_LABEL_SIZE","CHART_CONFIG","getLineCommons","top","shape","x1","y1","x2","y2","right","bottom","left","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts"],"sourcesContent":["import { getLineCommons } from '@oanda/labs-widget-common';\nimport type { GraphicComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface GetGridLinesParams {\n isDark: boolean;\n}\n\nexport const getGridLines = ({\n isDark,\n}: GetGridLinesParams): GraphicComponentOption[] => {\n const { WIDTH, MAIN_HEIGHT, X_LABEL_SIZE, Y_SENTIMENT_LABEL_SIZE } =\n CHART_CONFIG;\n return [\n // Top\n {\n ...getLineCommons(isDark),\n top: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n },\n // Right\n {\n ...getLineCommons(isDark),\n right: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: MAIN_HEIGHT + X_LABEL_SIZE + 2,\n },\n },\n // Bottom\n {\n ...getLineCommons(isDark),\n bottom: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n },\n // Left\n {\n ...getLineCommons(isDark),\n left: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: MAIN_HEIGHT + X_LABEL_SIZE + 2,\n },\n },\n // Y Sentiment Label\n {\n ...getLineCommons(isDark),\n left: Y_SENTIMENT_LABEL_SIZE - 2,\n top: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: MAIN_HEIGHT,\n },\n },\n // X Label\n {\n ...getLineCommons(isDark),\n top: MAIN_HEIGHT - 2,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n },\n ];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAAkD,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAA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C,EAAE,EAAEV,KAAK;MACTW,EAAE,EAAE;IACN;EAAC,GAEJ;AACH,CAAC;AAACI,OAAA,CAAAlB,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
var _chartUtils = require("../chartUtils");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const getSeriesCandlestickConfig = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
dates,
|
|
13
|
+
isGreaterThanTwoWeeks,
|
|
14
|
+
styles
|
|
15
|
+
} = _ref;
|
|
16
|
+
const {
|
|
17
|
+
candleLongColor,
|
|
18
|
+
candleShortColor
|
|
19
|
+
} = styles;
|
|
20
|
+
const labelsData = (0, _chartUtils.getLabelData)({
|
|
21
|
+
dates,
|
|
22
|
+
isGreaterThanTwoWeeks
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
type: 'candlestick',
|
|
26
|
+
id: 'candlestick',
|
|
27
|
+
xAxisIndex: 0,
|
|
28
|
+
yAxisIndex: 0,
|
|
29
|
+
encode: {
|
|
30
|
+
x: 'dates',
|
|
31
|
+
y: ['open', 'close', 'low', 'high']
|
|
32
|
+
},
|
|
33
|
+
itemStyle: {
|
|
34
|
+
color: (0, _chromaJs.default)(candleLongColor).desaturate().css(),
|
|
35
|
+
color0: (0, _chromaJs.default)(candleShortColor).desaturate().css(),
|
|
36
|
+
borderColor: candleLongColor,
|
|
37
|
+
borderColor0: candleShortColor
|
|
38
|
+
},
|
|
39
|
+
emphasis: {
|
|
40
|
+
itemStyle: {
|
|
41
|
+
color: candleLongColor,
|
|
42
|
+
color0: candleShortColor
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
markPoint: {
|
|
46
|
+
data: labelsData,
|
|
47
|
+
symbol: 'circle',
|
|
48
|
+
symbolSize: 0
|
|
49
|
+
},
|
|
50
|
+
z: 2
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports.getSeriesCandlestickConfig = getSeriesCandlestickConfig;
|
|
54
|
+
//# 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","_chartUtils","e","__esModule","default","getSeriesCandlestickConfig","_ref","dates","isGreaterThanTwoWeeks","styles","candleLongColor","candleShortColor","labelsData","getLabelData","type","id","xAxisIndex","yAxisIndex","encode","x","y","itemStyle","color","chroma","desaturate","css","color0","borderColor","borderColor0","emphasis","markPoint","data","symbol","symbolSize","z","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts"],"sourcesContent":["import chroma from 'chroma-js';\nimport type { CandlestickSeriesOption } from 'echarts';\n\nimport { getLabelData } from '../chartUtils';\nimport type { ChartStyles } from '../chartUtils/getChartStyles';\n\ninterface GetSeriesCandlestickConfigParams {\n dates: string[];\n isGreaterThanTwoWeeks: boolean;\n styles: ChartStyles;\n}\n\nexport const getSeriesCandlestickConfig = ({\n dates,\n isGreaterThanTwoWeeks,\n styles,\n}: GetSeriesCandlestickConfigParams): CandlestickSeriesOption => {\n const { candleLongColor, candleShortColor } = styles;\n const labelsData = getLabelData({\n dates,\n isGreaterThanTwoWeeks,\n });\n\n return {\n type: 'candlestick',\n id: 'candlestick',\n xAxisIndex: 0,\n yAxisIndex: 0,\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 markPoint: {\n data: labelsData,\n symbol: 'circle',\n symbolSize: 0,\n },\n z: 2,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AAA6C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAStC,MAAMG,0BAA0B,GAAGC,IAAA,IAIuB;EAAA,IAJtB;IACzCC,KAAK;IACLC,qBAAqB;IACrBC;EACgC,CAAC,GAAAH,IAAA;EACjC,MAAM;IAAEI,eAAe;IAAEC;EAAiB,CAAC,GAAGF,MAAM;EACpD,MAAMG,UAAU,GAAG,IAAAC,wBAAY,EAAC;IAC9BN,KAAK;IACLC;EACF,CAAC,CAAC;EAEF,OAAO;IACLM,IAAI,EAAE,aAAa;IACnBC,EAAE,EAAE,aAAa;IACjBC,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,CAAC;IACbC,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,EAACb,eAAe,CAAC,CAACc,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;MACjDC,MAAM,EAAE,IAAAH,iBAAM,EAACZ,gBAAgB,CAAC,CAACa,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;MACnDE,WAAW,EAAEjB,eAAe;MAC5BkB,YAAY,EAAEjB;IAChB,CAAC;IACDkB,QAAQ,EAAE;MACRR,SAAS,EAAE;QACTC,KAAK,EAAEZ,eAAe;QACtBgB,MAAM,EAAEf;MACV;IACF,CAAC;IACDmB,SAAS,EAAE;MACTC,IAAI,EAAEnB,UAAU;MAChBoB,MAAM,EAAE,QAAQ;MAChBC,UAAU,EAAE;IACd,CAAC;IACDC,CAAC,EAAE;EACL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA9B,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
} = _ref;
|
|
16
|
+
return {
|
|
17
|
+
type: 'custom',
|
|
18
|
+
id: 'heatmap',
|
|
19
|
+
name: 'heatmap',
|
|
20
|
+
xAxisIndex: 0,
|
|
21
|
+
yAxisIndex: 0,
|
|
22
|
+
encode: {
|
|
23
|
+
x: 'dates',
|
|
24
|
+
y: 'bookPrices'
|
|
25
|
+
},
|
|
26
|
+
dimensions: ['dates', 'bookPrices', 'bookIndexes'],
|
|
27
|
+
clip: true,
|
|
28
|
+
renderItem: (_params, api) => {
|
|
29
|
+
const xVal = api.value(0);
|
|
30
|
+
const bucketIndex = api.value(2);
|
|
31
|
+
if (bucketIndex == null) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const metaValues = buckets[bucketIndex];
|
|
35
|
+
const [rectWidth, rectHeight] = api.size([0, bucketWidth]);
|
|
36
|
+
const items = metaValues.map(_ref2 => {
|
|
37
|
+
let {
|
|
38
|
+
price,
|
|
39
|
+
sentiment
|
|
40
|
+
} = _ref2;
|
|
41
|
+
const start = api.coord([xVal, price]);
|
|
42
|
+
return {
|
|
43
|
+
shape: {
|
|
44
|
+
height: rectHeight,
|
|
45
|
+
width: rectWidth + 1,
|
|
46
|
+
x: start[0] - rectWidth / 2,
|
|
47
|
+
y: start[1] - rectHeight
|
|
48
|
+
},
|
|
49
|
+
style: {
|
|
50
|
+
fill: (0, _chartUtils.getRectColor)(sentiment, isDark, sentimentThresholdMin, sentimentThresholdMax)
|
|
51
|
+
},
|
|
52
|
+
type: 'rect'
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
children: items,
|
|
57
|
+
emphasisDisabled: true,
|
|
58
|
+
type: 'group'
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
z: 1
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
exports.getSeriesHeatmapConfig = getSeriesHeatmapConfig;
|
|
65
|
+
//# sourceMappingURL=getSeriesHeatmapConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSeriesHeatmapConfig.js","names":["_chartUtils","require","getSeriesHeatmapConfig","_ref","bucketWidth","buckets","isDark","sentimentThresholdMax","sentimentThresholdMin","type","id","name","xAxisIndex","yAxisIndex","encode","x","y","dimensions","clip","renderItem","_params","api","xVal","value","bucketIndex","metaValues","rectWidth","rectHeight","size","items","map","_ref2","price","sentiment","start","coord","shape","height","width","style","fill","getRectColor","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}\n\nexport const getSeriesHeatmapConfig = ({\n bucketWidth,\n buckets,\n isDark,\n sentimentThresholdMax,\n sentimentThresholdMin,\n}: GetSeriesHeatmapConfigParams): CustomSeriesOption => {\n return {\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 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 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 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 type: 'rect' as const,\n };\n });\n\n return {\n children: items,\n emphasisDisabled: true,\n type: 'group' as const,\n };\n },\n z: 1,\n };\n};\n"],"mappings":";;;;;;AAMA,IAAAA,WAAA,GAAAC,OAAA;AAWO,MAAMC,sBAAsB,GAAGC,IAAA,IAMkB;EAAA,IANjB;IACrCC,WAAW;IACXC,OAAO;IACPC,MAAM;IACNC,qBAAqB;IACrBC;EAC4B,CAAC,GAAAL,IAAA;EAC7B,OAAO;IACLM,IAAI,EAAE,QAAQ;IACdC,EAAE,EAAE,SAAS;IACbC,IAAI,EAAE,SAAS;IACfC,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,CAAC;IACbC,MAAM,EAAE;MACNC,CAAC,EAAE,OAAO;MACVC,CAAC,EAAE;IACL,CAAC;IACDC,UAAU,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC;IAClDC,IAAI,EAAE,IAAI;IACVC,UAA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
|
|
|
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
|
+
} = _ref;
|
|
12
|
+
return {
|
|
13
|
+
type: 'line',
|
|
14
|
+
id: 'sentiment',
|
|
15
|
+
name: 'sentiment',
|
|
16
|
+
xAxisIndex: 1,
|
|
17
|
+
yAxisIndex: 1,
|
|
18
|
+
encode: {
|
|
19
|
+
x: 'dates',
|
|
20
|
+
y: 'sentimentShorts'
|
|
21
|
+
},
|
|
22
|
+
dimensions: ['dates', 'sentimentShorts', 'sentimentLongs'],
|
|
23
|
+
lineStyle: {
|
|
24
|
+
width: styles.sentimentOutlineWidth,
|
|
25
|
+
opacity: 1,
|
|
26
|
+
shadowColor: styles.sentimentOutlineColor,
|
|
27
|
+
shadowBlur: 3
|
|
28
|
+
},
|
|
29
|
+
emphasis: {
|
|
30
|
+
disabled: true
|
|
31
|
+
},
|
|
32
|
+
markLine: {
|
|
33
|
+
silent: true,
|
|
34
|
+
symbol: ['none', 'none'],
|
|
35
|
+
label: {
|
|
36
|
+
show: false
|
|
37
|
+
},
|
|
38
|
+
lineStyle: {
|
|
39
|
+
color: _labsWidgetCommon.colorPalette.grayLight,
|
|
40
|
+
width: 1
|
|
41
|
+
},
|
|
42
|
+
data: [{
|
|
43
|
+
yAxis: 20
|
|
44
|
+
}, {
|
|
45
|
+
yAxis: 50,
|
|
46
|
+
lineStyle: {
|
|
47
|
+
width: 1
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
yAxis: 80
|
|
51
|
+
}]
|
|
52
|
+
},
|
|
53
|
+
stack: 'sentiment',
|
|
54
|
+
showSymbol: false,
|
|
55
|
+
symbol: 'none',
|
|
56
|
+
z: 3
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.getSeriesSentimentConfig = getSeriesSentimentConfig;
|
|
60
|
+
//# 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","type","id","name","xAxisIndex","yAxisIndex","encode","x","y","dimensions","lineStyle","width","sentimentOutlineWidth","opacity","shadowColor","sentimentOutlineColor","shadowBlur","emphasis","disabled","markLine","silent","symbol","label","show","color","colorPalette","grayLight","data","yAxis","stack","showSymbol","z","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}\n\nexport const getSeriesSentimentConfig = ({\n styles,\n}: GetSeriesSentimentConfigParams): LineSeriesOption => {\n return {\n type: 'line',\n id: 'sentiment',\n name: 'sentiment',\n xAxisIndex: 1,\n yAxisIndex: 1,\n encode: {\n x: 'dates',\n y: 'sentimentShorts',\n },\n dimensions: ['dates', 'sentimentShorts', 'sentimentLongs'],\n lineStyle: {\n width: styles.sentimentOutlineWidth,\n opacity: 1,\n shadowColor: styles.sentimentOutlineColor,\n shadowBlur: 3,\n },\n emphasis: {\n disabled: true,\n },\n markLine: {\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 stack: 'sentiment',\n showSymbol: false,\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,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTooltipConfig = void 0;
|
|
7
|
+
var _chartUtils = require("../chartUtils");
|
|
8
|
+
const getTooltipConfig = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
bookType,
|
|
11
|
+
bucketWidth,
|
|
12
|
+
buckets,
|
|
13
|
+
displayPrecision,
|
|
14
|
+
labelCallback,
|
|
15
|
+
selectedPriceRef,
|
|
16
|
+
tooltipLinesColor
|
|
17
|
+
} = _ref;
|
|
18
|
+
return {
|
|
19
|
+
trigger: 'axis',
|
|
20
|
+
formatter: params => (0, _chartUtils.getTooltipFormatter)({
|
|
21
|
+
bookType,
|
|
22
|
+
bucketWidth,
|
|
23
|
+
buckets,
|
|
24
|
+
labelCallback,
|
|
25
|
+
params: params,
|
|
26
|
+
selectedPrice: selectedPriceRef.current
|
|
27
|
+
}),
|
|
28
|
+
axisPointer: {
|
|
29
|
+
type: 'cross',
|
|
30
|
+
axis: 'x',
|
|
31
|
+
lineStyle: {
|
|
32
|
+
color: tooltipLinesColor
|
|
33
|
+
},
|
|
34
|
+
crossStyle: {
|
|
35
|
+
color: tooltipLinesColor
|
|
36
|
+
},
|
|
37
|
+
label: {
|
|
38
|
+
padding: 0,
|
|
39
|
+
lineHeight: 24,
|
|
40
|
+
formatter: params => {
|
|
41
|
+
if (params.axisDimension === 'y' && params.axisIndex === 0) {
|
|
42
|
+
selectedPriceRef.current = Number(params.value);
|
|
43
|
+
return " ".concat(Number(params.value).toFixed(displayPrecision), " ");
|
|
44
|
+
}
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
confine: true
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
exports.getTooltipConfig = getTooltipConfig;
|
|
53
|
+
//# sourceMappingURL=getTooltipConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTooltipConfig.js","names":["_chartUtils","require","getTooltipConfig","_ref","bookType","bucketWidth","buckets","displayPrecision","labelCallback","selectedPriceRef","tooltipLinesColor","trigger","formatter","params","getTooltipFormatter","selectedPrice","current","axisPointer","type","axis","lineStyle","color","crossStyle","label","padding","lineHeight","axisDimension","axisIndex","Number","value","concat","toFixed","confine","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts"],"sourcesContent":["import type { TooltipComponentOption } from 'echarts';\n\nimport type { BookType } from '../../../../gql/types/graphql';\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}\n\nexport const getTooltipConfig = ({\n bookType,\n bucketWidth,\n buckets,\n displayPrecision,\n labelCallback,\n selectedPriceRef,\n tooltipLinesColor,\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 }),\n\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});\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAaO,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IAC/BC,QAAQ;IACRC,WAAW;IACXC,OAAO;IACPC,gBAAgB;IAChBC,aAAa;IACbC,gBAAgB;IAChBC;EACsB,CAAC,GAAAP,IAAA;EAAA,OAA8B;IACrDQ,OAAO,EAAE,MAAe;IACxBC,SAAS,EAAGC,MAAM,IAChB,IAAAC,+BAAmB,EAAC;MAClBV,QAAQ;MACRC,WAAW;MACXC,OAAO;MACPE,aAAa;MACbK,MAAM,EAAEA,MAAmC;MAC3CE,aAAa,EAAEN,gBAAgB,CAACO;IAClC,CAAC,CAAC;IAEJC,WAAW,EAAE;MACXC,IAAI,EAAE,OAAgB;MACtBC,IAAI,EAAE,GAAY;MAClBC,SAAS,EAAE;QACTC,KAAK,EAAEX;MACT,CAAC;MACDY,UAAU,EAAE;QACVD,KAAK,EAAEX;MACT,CAAC;MACDa,KAAK,EAAE;QACLC,OAAO,EAAE,CAAC;QACVC,UAAU,EAAE,EAAE;QACdb,SAAS,EAAGC,MAIX,IAAK;UACJ,IAAIA,MAAM,CAACa,aAAa,KAAK,GAAG,IAAIb,MAAM,CAACc,SAAS,KAAK,CAAC,EAAE;YAC1DlB,gBAAgB,CAACO,OAAO,GAAGY,MAAM,CAACf,MAAM,CAACgB,KAAK,CAAC;YAC/C,WAAAC,MAAA,CAAWF,MAAM,CAACf,MAAM,CAACgB,KAAK,CAAC,CAACE,OAAO,CAACxB,gBAAgB,CAAC;UAC3D;UACA,OAAO,EAAE;QACX;MACF;IACF,CAAC;IACDyB,OAAO,EAAE;EACX,CAAC;AAAA,CAAC;AAACC,OAAA,CAAA/B,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,42 @@
|
|
|
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
|
+
return [{
|
|
14
|
+
type: 'category',
|
|
15
|
+
id: 'main-xAxis',
|
|
16
|
+
name: 'xAxis-less-than-two-weeks',
|
|
17
|
+
nameTextStyle: {
|
|
18
|
+
fontSize: 0
|
|
19
|
+
},
|
|
20
|
+
axisTick: {
|
|
21
|
+
show: false
|
|
22
|
+
},
|
|
23
|
+
axisLabel: {
|
|
24
|
+
padding: [8, 16, 8, 16],
|
|
25
|
+
margin: 0,
|
|
26
|
+
formatter: value => (0, _chartUtils.formatXAxisLabel)(value, isGreaterThanTwoWeeks)
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
type: 'category',
|
|
30
|
+
gridIndex: 1,
|
|
31
|
+
show: false,
|
|
32
|
+
axisTick: {
|
|
33
|
+
show: false
|
|
34
|
+
},
|
|
35
|
+
axisLabel: {
|
|
36
|
+
show: false
|
|
37
|
+
},
|
|
38
|
+
data: dates
|
|
39
|
+
}];
|
|
40
|
+
};
|
|
41
|
+
exports.getXAxisConfig = getXAxisConfig;
|
|
42
|
+
//# sourceMappingURL=getXAxisConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getXAxisConfig.js","names":["_chartUtils","require","getXAxisConfig","_ref","dates","isGreaterThanTwoWeeks","type","id","name","nameTextStyle","fontSize","axisTick","show","axisLabel","padding","margin","formatter","value","formatXAxisLabel","gridIndex","data","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.ts"],"sourcesContent":["import type { XAXisComponentOption } from 'echarts';\n\nimport { formatXAxisLabel } from '../chartUtils';\n\ninterface GetXAxisConfigParams {\n dates: string[];\n isGreaterThanTwoWeeks: boolean;\n}\n\nexport const getXAxisConfig = ({\n dates,\n isGreaterThanTwoWeeks,\n}: GetXAxisConfigParams): XAXisComponentOption[] => [\n {\n type: 'category',\n id: 'main-xAxis',\n name: '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 },\n {\n type: 'category',\n gridIndex: 1,\n show: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: false,\n },\n data: dates,\n },\n];\n"],"mappings":";;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAOO,MAAMC,cAAc,GAAGC,IAAA;EAAA,IAAC;IAC7BC,KAAK;IACLC;EACoB,CAAC,GAAAF,IAAA;EAAA,OAA6B,CAClD;IACEG,IAAI,EAAE,UAAU;IAChBC,EAAE,EAAE,YAAY;IAChBC,IAAI,EAAE,2BAA2B;IACjCC,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,EAAEZ,qBAAqB;IACjD;EACF,CAAC,EACD;IACEC,IAAI,EAAE,UAAU;IAChBa,SAAS,EAAE,CAAC;IACZP,IAAI,EAAE,KAAK;IACXD,QAAQ,EAAE;MACRC,IAAI,EAAE;IACR,CAAC;IACDC,SAAS,EAAE;MACTD,IAAI,EAAE;IACR,CAAC;IACDQ,IAAI,EAAEhB;EACR,CAAC,CACF;AAAA;AAACiB,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
|