@elliemae/ds-dataviz 3.80.0-next.67 → 3.80.0-next.69
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/dist/cjs/constants/index.js +73 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/graphs/Chart/Chart.js +6 -1
- package/dist/cjs/graphs/Chart/Chart.js.map +2 -2
- package/dist/cjs/graphs/Chart/ChartContext.js.map +2 -2
- package/dist/cjs/graphs/Chart/SingleStackedBar/SingleStackedBar.js +36 -24
- package/dist/cjs/graphs/Chart/SingleStackedBar/SingleStackedBar.js.map +3 -3
- package/dist/cjs/graphs/Chart/SingleStackedBar/styles.js +12 -5
- package/dist/cjs/graphs/Chart/SingleStackedBar/styles.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/chartInteractionStore.js +98 -0
- package/dist/cjs/graphs/Chart/config/chartInteractionStore.js.map +7 -0
- package/dist/cjs/graphs/Chart/config/useChart.js +56 -40
- package/dist/cjs/graphs/Chart/config/useChart.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/useChartDescription.js +62 -0
- package/dist/cjs/graphs/Chart/config/useChartDescription.js.map +7 -0
- package/dist/cjs/graphs/Chart/config/useEntranceAnimation.js +141 -0
- package/dist/cjs/graphs/Chart/config/useEntranceAnimation.js.map +7 -0
- package/dist/cjs/graphs/Chart/config/useGetters.js +10 -0
- package/dist/cjs/graphs/Chart/config/useGetters.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/useInternalMargins.js +25 -5
- package/dist/cjs/graphs/Chart/config/useInternalMargins.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/useKeyboardNavigation.js +35 -51
- package/dist/cjs/graphs/Chart/config/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/useScales.js +200 -67
- package/dist/cjs/graphs/Chart/config/useScales.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/useValidateProps.js +53 -4
- package/dist/cjs/graphs/Chart/config/useValidateProps.js.map +2 -2
- package/dist/cjs/graphs/Chart/config/useValueAxisTransition.js +128 -0
- package/dist/cjs/graphs/Chart/config/useValueAxisTransition.js.map +7 -0
- package/dist/cjs/graphs/Chart/config/useWheelScroll.js +111 -0
- package/dist/cjs/graphs/Chart/config/useWheelScroll.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/alignedTicks.js +56 -0
- package/dist/cjs/graphs/Chart/helpers/alignedTicks.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/barPath.js +53 -0
- package/dist/cjs/graphs/Chart/helpers/barPath.js.map +7 -0
- package/dist/cjs/graphs/Chart/{react-desc-prop-types.js → helpers/dataInView.js} +26 -27
- package/dist/cjs/graphs/Chart/helpers/dataInView.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/index.js +34 -0
- package/dist/cjs/graphs/Chart/helpers/index.js.map +2 -2
- package/dist/cjs/graphs/Chart/{SingleStackedBar/exported-related/theming.js → helpers/logAxis.js} +13 -9
- package/dist/cjs/graphs/Chart/helpers/logAxis.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/tickRotation.js +54 -0
- package/dist/cjs/graphs/Chart/helpers/tickRotation.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/timeTicks.js +56 -0
- package/dist/cjs/graphs/Chart/helpers/timeTicks.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/trend.js +45 -0
- package/dist/cjs/graphs/Chart/helpers/trend.js.map +7 -0
- package/dist/cjs/graphs/Chart/{SingleStackedBar/exported-related/index.js → helpers/useSerieDimming.js} +20 -6
- package/dist/cjs/graphs/Chart/helpers/useSerieDimming.js.map +7 -0
- package/dist/cjs/graphs/Chart/helpers/useUniqueData.js +15 -18
- package/dist/cjs/graphs/Chart/helpers/useUniqueData.js.map +2 -2
- package/dist/cjs/graphs/Chart/helpers/useVirtualizedSeries.js +12 -5
- package/dist/cjs/graphs/Chart/helpers/useVirtualizedSeries.js.map +2 -2
- package/dist/cjs/graphs/Chart/{DataTestIds.js → helpers/zeroLine.js} +12 -9
- package/dist/cjs/graphs/Chart/helpers/zeroLine.js.map +7 -0
- package/dist/cjs/graphs/Chart/parts/A11yRegion.js +8 -2
- package/dist/cjs/graphs/Chart/parts/A11yRegion.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/Axis.js +40 -4
- package/dist/cjs/graphs/Chart/parts/Axis/Axis.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/AxisBottom.js +18 -4
- package/dist/cjs/graphs/Chart/parts/Axis/AxisBottom.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/AxisLeft.js +14 -6
- package/dist/cjs/graphs/Chart/parts/Axis/AxisLeft.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/AxisRight.js +14 -4
- package/dist/cjs/graphs/Chart/parts/Axis/AxisRight.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/GridLine.js +15 -1
- package/dist/cjs/graphs/Chart/parts/Axis/GridLine.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/Tick.js +10 -4
- package/dist/cjs/graphs/Chart/parts/Axis/Tick.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Axis/useTickTransition.js +170 -0
- package/dist/cjs/graphs/Chart/parts/Axis/useTickTransition.js.map +7 -0
- package/dist/cjs/graphs/Chart/parts/ChartContainer.js +41 -19
- package/dist/cjs/graphs/Chart/parts/ChartContainer.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/FocusableRegion.js +6 -3
- package/dist/cjs/graphs/Chart/parts/FocusableRegion.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/HoverBand.js +86 -0
- package/dist/cjs/graphs/Chart/parts/HoverBand.js.map +7 -0
- package/dist/cjs/graphs/Chart/parts/Labels/Label.js +12 -1
- package/dist/cjs/graphs/Chart/parts/Labels/Label.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Labels/index.js +12 -4
- package/dist/cjs/graphs/Chart/parts/Labels/index.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Legend/BottomLegend.js +6 -3
- package/dist/cjs/graphs/Chart/parts/Legend/BottomLegend.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Legend/LeftLegend.js +2 -6
- package/dist/cjs/graphs/Chart/parts/Legend/LeftLegend.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Legend/LegendItem.js +91 -9
- package/dist/cjs/graphs/Chart/parts/Legend/LegendItem.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Legend/RightLegend.js +3 -4
- package/dist/cjs/graphs/Chart/parts/Legend/RightLegend.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Legend/TopLegend.js +8 -6
- package/dist/cjs/graphs/Chart/parts/Legend/TopLegend.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scrapper/Scrapper.js +29 -3
- package/dist/cjs/graphs/Chart/parts/Scrapper/Scrapper.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scrapper/ScrapperLine.js +82 -55
- package/dist/cjs/graphs/Chart/parts/Scrapper/ScrapperLine.js.map +3 -3
- package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapper.js +14 -6
- package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapper.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js +67 -43
- package/dist/cjs/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js.map +2 -2
- package/dist/cjs/graphs/Chart/{SingleStackedBar/exported-related/data-test-ids.js → parts/ScreenReaderText.js} +17 -7
- package/dist/cjs/graphs/Chart/parts/ScreenReaderText.js.map +7 -0
- package/dist/cjs/graphs/Chart/parts/Scroller/BlurMask.js +14 -9
- package/dist/cjs/graphs/Chart/parts/Scroller/BlurMask.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scroller/Controllers.js +152 -49
- package/dist/cjs/graphs/Chart/parts/Scroller/Controllers.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarX.js +22 -6
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarX.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarY.js +13 -6
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollBarY.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerX.js +42 -35
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerX.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerY.js +9 -4
- package/dist/cjs/graphs/Chart/parts/Scroller/ScrollableContainerY.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/SeriesFactory.js +39 -30
- package/dist/cjs/graphs/Chart/parts/SeriesFactory.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/TrendHighlight.js +57 -19
- package/dist/cjs/graphs/Chart/parts/TrendHighlight.js.map +2 -2
- package/dist/cjs/graphs/Chart/parts/ZeroLine.js +66 -0
- package/dist/cjs/graphs/Chart/parts/ZeroLine.js.map +7 -0
- package/dist/cjs/graphs/Chart/scales/index.js +50 -20
- package/dist/cjs/graphs/Chart/scales/index.js.map +3 -3
- package/dist/cjs/graphs/Chart/series/Area.js +76 -9
- package/dist/cjs/graphs/Chart/series/Area.js.map +2 -2
- package/dist/cjs/graphs/Chart/series/Bars.js +3 -1
- package/dist/cjs/graphs/Chart/series/Bars.js.map +2 -2
- package/dist/cjs/graphs/Chart/series/HorizontalBars.js +4 -1
- package/dist/cjs/graphs/Chart/series/HorizontalBars.js.map +2 -2
- package/dist/cjs/graphs/Chart/series/HorizontalStackedBars.js +14 -7
- package/dist/cjs/graphs/Chart/series/HorizontalStackedBars.js.map +2 -2
- package/dist/cjs/graphs/Chart/series/Line.js +9 -7
- package/dist/cjs/graphs/Chart/series/Line.js.map +2 -2
- package/dist/cjs/graphs/Chart/series/Point.js +114 -128
- package/dist/cjs/graphs/Chart/series/Point.js.map +3 -3
- package/dist/cjs/graphs/Chart/series/Points.js +8 -2
- package/dist/cjs/graphs/Chart/series/Points.js.map +2 -2
- package/dist/cjs/graphs/Chart/series/Rect.js +133 -122
- package/dist/cjs/graphs/Chart/series/Rect.js.map +3 -3
- package/dist/cjs/graphs/Chart/series/StackedBar.js +14 -6
- package/dist/cjs/graphs/Chart/series/StackedBar.js.map +2 -2
- package/dist/cjs/graphs/Chart/styles.js +65 -34
- package/dist/cjs/graphs/Chart/styles.js.map +2 -2
- package/dist/cjs/graphs/constants.js +24 -9
- package/dist/cjs/graphs/constants.js.map +2 -2
- package/dist/cjs/index.js +17 -6
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/react-desc-prop-types.js +150 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/typescript-testing/slot-props.js +69 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-data-viz-valid.js +34 -2
- package/dist/cjs/typescript-testing/typescript-data-viz-valid.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-single-stacked-bar-valid.js +93 -0
- package/dist/cjs/typescript-testing/typescript-single-stacked-bar-valid.js.map +7 -0
- package/dist/esm/constants/index.js +43 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/graphs/Chart/Chart.js +6 -1
- package/dist/esm/graphs/Chart/Chart.js.map +2 -2
- package/dist/esm/graphs/Chart/ChartContext.js.map +2 -2
- package/dist/esm/graphs/Chart/SingleStackedBar/SingleStackedBar.js +40 -23
- package/dist/esm/graphs/Chart/SingleStackedBar/SingleStackedBar.js.map +2 -2
- package/dist/esm/graphs/Chart/SingleStackedBar/styles.js +12 -5
- package/dist/esm/graphs/Chart/SingleStackedBar/styles.js.map +2 -2
- package/dist/esm/graphs/Chart/config/chartInteractionStore.js +68 -0
- package/dist/esm/graphs/Chart/config/chartInteractionStore.js.map +7 -0
- package/dist/esm/graphs/Chart/config/useChart.js +58 -42
- package/dist/esm/graphs/Chart/config/useChart.js.map +2 -2
- package/dist/esm/graphs/Chart/config/useChartDescription.js +32 -0
- package/dist/esm/graphs/Chart/config/useChartDescription.js.map +7 -0
- package/dist/esm/graphs/Chart/config/useEntranceAnimation.js +111 -0
- package/dist/esm/graphs/Chart/config/useEntranceAnimation.js.map +7 -0
- package/dist/esm/graphs/Chart/config/useGetters.js +10 -0
- package/dist/esm/graphs/Chart/config/useGetters.js.map +2 -2
- package/dist/esm/graphs/Chart/config/useInternalMargins.js +26 -6
- package/dist/esm/graphs/Chart/config/useInternalMargins.js.map +2 -2
- package/dist/esm/graphs/Chart/config/useKeyboardNavigation.js +35 -51
- package/dist/esm/graphs/Chart/config/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/graphs/Chart/config/useScales.js +202 -69
- package/dist/esm/graphs/Chart/config/useScales.js.map +2 -2
- package/dist/esm/graphs/Chart/config/useValidateProps.js +53 -4
- package/dist/esm/graphs/Chart/config/useValidateProps.js.map +2 -2
- package/dist/esm/graphs/Chart/config/useValueAxisTransition.js +98 -0
- package/dist/esm/graphs/Chart/config/useValueAxisTransition.js.map +7 -0
- package/dist/esm/graphs/Chart/config/useWheelScroll.js +81 -0
- package/dist/esm/graphs/Chart/config/useWheelScroll.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/alignedTicks.js +26 -0
- package/dist/esm/graphs/Chart/helpers/alignedTicks.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/barPath.js +23 -0
- package/dist/esm/graphs/Chart/helpers/barPath.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/dataInView.js +28 -0
- package/dist/esm/graphs/Chart/helpers/dataInView.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/index.js +34 -0
- package/dist/esm/graphs/Chart/helpers/index.js.map +2 -2
- package/dist/esm/graphs/Chart/helpers/logAxis.js +14 -0
- package/dist/esm/graphs/Chart/helpers/logAxis.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/tickRotation.js +24 -0
- package/dist/esm/graphs/Chart/helpers/tickRotation.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/timeTicks.js +26 -0
- package/dist/esm/graphs/Chart/helpers/timeTicks.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/trend.js +15 -0
- package/dist/esm/graphs/Chart/helpers/trend.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/useSerieDimming.js +15 -0
- package/dist/esm/graphs/Chart/helpers/useSerieDimming.js.map +7 -0
- package/dist/esm/graphs/Chart/helpers/useUniqueData.js +15 -18
- package/dist/esm/graphs/Chart/helpers/useUniqueData.js.map +2 -2
- package/dist/esm/graphs/Chart/helpers/useVirtualizedSeries.js +12 -5
- package/dist/esm/graphs/Chart/helpers/useVirtualizedSeries.js.map +2 -2
- package/dist/esm/graphs/Chart/helpers/zeroLine.js +13 -0
- package/dist/esm/graphs/Chart/helpers/zeroLine.js.map +7 -0
- package/dist/esm/graphs/Chart/parts/A11yRegion.js +7 -1
- package/dist/esm/graphs/Chart/parts/A11yRegion.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/Axis.js +40 -4
- package/dist/esm/graphs/Chart/parts/Axis/Axis.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/AxisBottom.js +18 -4
- package/dist/esm/graphs/Chart/parts/Axis/AxisBottom.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/AxisLeft.js +14 -6
- package/dist/esm/graphs/Chart/parts/Axis/AxisLeft.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/AxisRight.js +14 -4
- package/dist/esm/graphs/Chart/parts/Axis/AxisRight.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/GridLine.js +16 -2
- package/dist/esm/graphs/Chart/parts/Axis/GridLine.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/Tick.js +11 -5
- package/dist/esm/graphs/Chart/parts/Axis/Tick.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Axis/useTickTransition.js +140 -0
- package/dist/esm/graphs/Chart/parts/Axis/useTickTransition.js.map +7 -0
- package/dist/esm/graphs/Chart/parts/ChartContainer.js +41 -19
- package/dist/esm/graphs/Chart/parts/ChartContainer.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/FocusableRegion.js +7 -4
- package/dist/esm/graphs/Chart/parts/FocusableRegion.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/HoverBand.js +56 -0
- package/dist/esm/graphs/Chart/parts/HoverBand.js.map +7 -0
- package/dist/esm/graphs/Chart/parts/Labels/Label.js +12 -1
- package/dist/esm/graphs/Chart/parts/Labels/Label.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Labels/index.js +12 -4
- package/dist/esm/graphs/Chart/parts/Labels/index.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Legend/BottomLegend.js +7 -4
- package/dist/esm/graphs/Chart/parts/Legend/BottomLegend.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Legend/LeftLegend.js +3 -7
- package/dist/esm/graphs/Chart/parts/Legend/LeftLegend.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Legend/LegendItem.js +91 -9
- package/dist/esm/graphs/Chart/parts/Legend/LegendItem.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Legend/RightLegend.js +4 -5
- package/dist/esm/graphs/Chart/parts/Legend/RightLegend.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Legend/TopLegend.js +9 -7
- package/dist/esm/graphs/Chart/parts/Legend/TopLegend.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scrapper/Scrapper.js +29 -3
- package/dist/esm/graphs/Chart/parts/Scrapper/Scrapper.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scrapper/ScrapperLine.js +83 -56
- package/dist/esm/graphs/Chart/parts/Scrapper/ScrapperLine.js.map +3 -3
- package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapper.js +14 -6
- package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapper.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js +68 -44
- package/dist/esm/graphs/Chart/parts/Scrapper/VerticalScrapperLine.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/ScreenReaderText.js +18 -0
- package/dist/esm/graphs/Chart/parts/ScreenReaderText.js.map +7 -0
- package/dist/esm/graphs/Chart/parts/Scroller/BlurMask.js +14 -9
- package/dist/esm/graphs/Chart/parts/Scroller/BlurMask.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scroller/Controllers.js +154 -51
- package/dist/esm/graphs/Chart/parts/Scroller/Controllers.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarX.js +22 -6
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarX.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarY.js +13 -6
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollBarY.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerX.js +43 -36
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerX.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerY.js +10 -5
- package/dist/esm/graphs/Chart/parts/Scroller/ScrollableContainerY.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/SeriesFactory.js +40 -31
- package/dist/esm/graphs/Chart/parts/SeriesFactory.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/TrendHighlight.js +58 -20
- package/dist/esm/graphs/Chart/parts/TrendHighlight.js.map +2 -2
- package/dist/esm/graphs/Chart/parts/ZeroLine.js +36 -0
- package/dist/esm/graphs/Chart/parts/ZeroLine.js.map +7 -0
- package/dist/esm/graphs/Chart/scales/index.js +51 -21
- package/dist/esm/graphs/Chart/scales/index.js.map +3 -3
- package/dist/esm/graphs/Chart/series/Area.js +77 -10
- package/dist/esm/graphs/Chart/series/Area.js.map +2 -2
- package/dist/esm/graphs/Chart/series/Bars.js +3 -1
- package/dist/esm/graphs/Chart/series/Bars.js.map +2 -2
- package/dist/esm/graphs/Chart/series/HorizontalBars.js +4 -1
- package/dist/esm/graphs/Chart/series/HorizontalBars.js.map +2 -2
- package/dist/esm/graphs/Chart/series/HorizontalStackedBars.js +15 -8
- package/dist/esm/graphs/Chart/series/HorizontalStackedBars.js.map +2 -2
- package/dist/esm/graphs/Chart/series/Line.js +9 -7
- package/dist/esm/graphs/Chart/series/Line.js.map +2 -2
- package/dist/esm/graphs/Chart/series/Point.js +120 -130
- package/dist/esm/graphs/Chart/series/Point.js.map +3 -3
- package/dist/esm/graphs/Chart/series/Points.js +8 -2
- package/dist/esm/graphs/Chart/series/Points.js.map +2 -2
- package/dist/esm/graphs/Chart/series/Rect.js +134 -123
- package/dist/esm/graphs/Chart/series/Rect.js.map +3 -3
- package/dist/esm/graphs/Chart/series/StackedBar.js +15 -7
- package/dist/esm/graphs/Chart/series/StackedBar.js.map +2 -2
- package/dist/esm/graphs/Chart/styles.js +66 -35
- package/dist/esm/graphs/Chart/styles.js.map +2 -2
- package/dist/esm/graphs/constants.js +25 -10
- package/dist/esm/graphs/constants.js.map +2 -2
- package/dist/esm/index.js +19 -7
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +125 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/typescript-testing/slot-props.js +46 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-data-viz-valid.js +35 -3
- package/dist/esm/typescript-testing/typescript-data-viz-valid.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-single-stacked-bar-valid.js +70 -0
- package/dist/esm/typescript-testing/typescript-single-stacked-bar-valid.js.map +7 -0
- package/dist/types/constants/index.d.ts +42 -0
- package/dist/types/graphs/Chart/Chart.d.ts +4 -2
- package/dist/types/graphs/Chart/ChartContext.d.ts +9 -11
- package/dist/types/graphs/Chart/SingleStackedBar/SingleStackedBar.d.ts +1 -1
- package/dist/types/graphs/Chart/config/chartInteractionStore.d.ts +32 -0
- package/dist/types/graphs/Chart/config/useChart.d.ts +9 -11
- package/dist/types/graphs/Chart/config/useChartDescription.d.ts +5 -0
- package/dist/types/graphs/Chart/config/useEntranceAnimation.d.ts +16 -0
- package/dist/types/graphs/Chart/config/useGetters.d.ts +1 -1
- package/dist/types/graphs/Chart/config/useInternalMargins.d.ts +4 -1
- package/dist/types/graphs/Chart/config/useKeyboardNavigation.d.ts +1 -1
- package/dist/types/graphs/Chart/config/useScales.d.ts +8 -2
- package/dist/types/graphs/Chart/config/useValidateProps.d.ts +7 -1
- package/dist/types/graphs/Chart/config/useValueAxisTransition.d.ts +6 -0
- package/dist/types/graphs/Chart/config/useWheelScroll.d.ts +2 -0
- package/dist/types/graphs/Chart/helpers/alignedTicks.d.ts +1 -0
- package/dist/types/graphs/Chart/helpers/barPath.d.ts +11 -0
- package/dist/types/graphs/Chart/helpers/dataInView.d.ts +6 -0
- package/dist/types/graphs/Chart/helpers/index.d.ts +10 -1
- package/dist/types/graphs/Chart/helpers/logAxis.d.ts +8 -0
- package/dist/types/graphs/Chart/helpers/tickRotation.d.ts +2 -0
- package/dist/types/graphs/Chart/helpers/timeTicks.d.ts +2 -0
- package/dist/types/graphs/Chart/helpers/trend.d.ts +3 -0
- package/dist/types/graphs/Chart/helpers/useSerieDimming.d.ts +3 -0
- package/dist/types/graphs/Chart/helpers/useUniqueData.d.ts +1 -1
- package/dist/types/graphs/Chart/helpers/useVirtualizedSeries.d.ts +1 -1
- package/dist/types/graphs/Chart/helpers/zeroLine.d.ts +2 -0
- package/dist/types/graphs/Chart/parts/Axis/Axis.d.ts +4 -1
- package/dist/types/graphs/Chart/parts/Axis/Tick.d.ts +1 -0
- package/dist/types/graphs/Chart/parts/Axis/useTickTransition.d.ts +24 -0
- package/dist/types/graphs/Chart/parts/HoverBand.d.ts +2 -0
- package/dist/types/graphs/Chart/parts/Labels/Label.d.ts +3 -0
- package/dist/types/graphs/Chart/parts/Scrapper/ScrapperLine.d.ts +11 -1
- package/dist/types/graphs/Chart/parts/Scrapper/VerticalScrapperLine.d.ts +6 -7
- package/dist/types/graphs/Chart/parts/ScreenReaderText.d.ts +5 -0
- package/dist/types/graphs/Chart/parts/TrendHighlight.d.ts +3 -2
- package/dist/types/graphs/Chart/parts/ZeroLine.d.ts +2 -0
- package/dist/types/graphs/Chart/scales/index.d.ts +10 -3
- package/dist/types/graphs/Chart/series/Area.d.ts +1 -1
- package/dist/types/graphs/Chart/series/Bars.d.ts +1 -1
- package/dist/types/graphs/Chart/series/HorizontalBars.d.ts +1 -1
- package/dist/types/graphs/Chart/series/HorizontalStackedBars.d.ts +1 -1
- package/dist/types/graphs/Chart/series/Line.d.ts +1 -1
- package/dist/types/graphs/Chart/series/Point.d.ts +3 -2
- package/dist/types/graphs/Chart/series/Points.d.ts +1 -1
- package/dist/types/graphs/Chart/series/Rect.d.ts +3 -2
- package/dist/types/graphs/Chart/series/StackedBar.d.ts +1 -1
- package/dist/types/graphs/Chart/styles.d.ts +18 -5
- package/dist/types/graphs/constants.d.ts +13 -1
- package/dist/types/index.d.ts +6 -1
- package/dist/types/react-desc-prop-types.d.ts +228 -0
- package/package.json +8 -7
- package/dist/cjs/graphs/Chart/DataTestIds.js.map +0 -7
- package/dist/cjs/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.js.map +0 -7
- package/dist/cjs/graphs/Chart/SingleStackedBar/exported-related/index.js.map +0 -7
- package/dist/cjs/graphs/Chart/SingleStackedBar/exported-related/theming.js.map +0 -7
- package/dist/cjs/graphs/Chart/SingleStackedBar/index.js +0 -31
- package/dist/cjs/graphs/Chart/SingleStackedBar/index.js.map +0 -7
- package/dist/cjs/graphs/Chart/SingleStackedBar/react-desc-prop-types.js +0 -51
- package/dist/cjs/graphs/Chart/SingleStackedBar/react-desc-prop-types.js.map +0 -7
- package/dist/cjs/graphs/Chart/index.js +0 -33
- package/dist/cjs/graphs/Chart/index.js.map +0 -7
- package/dist/cjs/graphs/Chart/react-desc-prop-types.js.map +0 -7
- package/dist/cjs/graphs/index.js +0 -31
- package/dist/cjs/graphs/index.js.map +0 -7
- package/dist/esm/graphs/Chart/DataTestIds.js +0 -10
- package/dist/esm/graphs/Chart/DataTestIds.js.map +0 -7
- package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.js +0 -8
- package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.js.map +0 -7
- package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/index.js +0 -4
- package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/index.js.map +0 -7
- package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/theming.js +0 -10
- package/dist/esm/graphs/Chart/SingleStackedBar/exported-related/theming.js.map +0 -7
- package/dist/esm/graphs/Chart/SingleStackedBar/index.js +0 -4
- package/dist/esm/graphs/Chart/SingleStackedBar/index.js.map +0 -7
- package/dist/esm/graphs/Chart/SingleStackedBar/react-desc-prop-types.js +0 -21
- package/dist/esm/graphs/Chart/SingleStackedBar/react-desc-prop-types.js.map +0 -7
- package/dist/esm/graphs/Chart/index.js +0 -6
- package/dist/esm/graphs/Chart/index.js.map +0 -7
- package/dist/esm/graphs/Chart/react-desc-prop-types.js +0 -29
- package/dist/esm/graphs/Chart/react-desc-prop-types.js.map +0 -7
- package/dist/esm/graphs/index.js +0 -4
- package/dist/esm/graphs/index.js.map +0 -7
- package/dist/types/graphs/Chart/DataTestIds.d.ts +0 -5
- package/dist/types/graphs/Chart/SingleStackedBar/exported-related/data-test-ids.d.ts +0 -3
- package/dist/types/graphs/Chart/SingleStackedBar/exported-related/index.d.ts +0 -2
- package/dist/types/graphs/Chart/SingleStackedBar/exported-related/theming.d.ts +0 -4
- package/dist/types/graphs/Chart/SingleStackedBar/index.d.ts +0 -3
- package/dist/types/graphs/Chart/SingleStackedBar/react-desc-prop-types.d.ts +0 -44
- package/dist/types/graphs/Chart/index.d.ts +0 -4
- package/dist/types/graphs/Chart/react-desc-prop-types.d.ts +0 -510
- package/dist/types/graphs/index.d.ts +0 -2
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useCallback, useMemo } from "react";
|
|
4
|
+
import { ThemeContext } from "@elliemae/ds-system";
|
|
4
5
|
import { ChartContext } from "../../ChartContext.js";
|
|
6
|
+
import { useChartInteraction } from "../../config/chartInteractionStore.js";
|
|
5
7
|
import { AxisBottom } from "../Axis/AxisBottom.js";
|
|
6
8
|
import { SeriesFactory } from "../SeriesFactory.js";
|
|
7
9
|
import { ScrollBarX } from "./ScrollBarX.js";
|
|
8
10
|
import { Scrapper } from "../Scrapper/Scrapper.js";
|
|
9
11
|
import { VerticalScrapper } from "../Scrapper/VerticalScrapper.js";
|
|
12
|
+
const ZoomSelection = () => {
|
|
13
|
+
const { innerHeight } = useContext(ChartContext);
|
|
14
|
+
const theme = useContext(ThemeContext);
|
|
15
|
+
const isZooming = useChartInteraction((state) => state.isZooming);
|
|
16
|
+
const start = useChartInteraction((state) => state.zoomStartingPosition);
|
|
17
|
+
const end = useChartInteraction((state) => state.movingPosition);
|
|
18
|
+
if (!isZooming || end === 0) return null;
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"rect",
|
|
21
|
+
{
|
|
22
|
+
x: Math.min(start, end),
|
|
23
|
+
width: Math.abs(end - start),
|
|
24
|
+
height: innerHeight,
|
|
25
|
+
fill: theme?.colors?.brand?.["500"] ?? "#1394E5",
|
|
26
|
+
style: { opacity: 0.15 }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
10
30
|
const ScrollableContainerX = () => {
|
|
11
31
|
const {
|
|
12
32
|
props: { scrapper },
|
|
13
|
-
xScrollbarPosition,
|
|
14
33
|
xScale,
|
|
15
34
|
containerRatio,
|
|
16
35
|
innerWidth,
|
|
@@ -19,16 +38,11 @@ const ScrollableContainerX = () => {
|
|
|
19
38
|
setXScrollbarPosition,
|
|
20
39
|
setContainerRatio,
|
|
21
40
|
lastScrollbarPosition,
|
|
22
|
-
innerHeight,
|
|
23
41
|
internalMargin,
|
|
24
42
|
chartId,
|
|
25
|
-
|
|
26
|
-
setIsZooming,
|
|
27
|
-
zoomStartingPosition,
|
|
28
|
-
setZoomStartingPosition,
|
|
29
|
-
movingPosition,
|
|
30
|
-
setMovingPosition
|
|
43
|
+
interactionStore
|
|
31
44
|
} = useContext(ChartContext);
|
|
45
|
+
const xScrollbarPosition = useChartInteraction((state) => state.xScrollbarPosition);
|
|
32
46
|
const getRealClientX = useCallback(
|
|
33
47
|
(clientX) => clientX - internalMargin.left - (containerRef?.getBoundingClientRect().left || 0),
|
|
34
48
|
[containerRef, internalMargin.left]
|
|
@@ -38,27 +52,36 @@ const ScrollableContainerX = () => {
|
|
|
38
52
|
if (scrapper && scrapper?.type === "vertical") return /* @__PURE__ */ jsx(VerticalScrapper, {});
|
|
39
53
|
return null;
|
|
40
54
|
}, [scrapper]);
|
|
55
|
+
const content = useMemo(
|
|
56
|
+
() => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(AxisBottom, {}),
|
|
58
|
+
/* @__PURE__ */ jsx(SeriesFactory, {}),
|
|
59
|
+
Scrappers
|
|
60
|
+
] }),
|
|
61
|
+
[Scrappers]
|
|
62
|
+
);
|
|
41
63
|
const handleOnMouseDown = useCallback(
|
|
42
64
|
({ clientX }) => {
|
|
43
65
|
if (!isGrabbed && xScale?.type !== "BAND") {
|
|
44
|
-
setIsZooming(true);
|
|
45
|
-
setZoomStartingPosition(getRealClientX(clientX));
|
|
46
|
-
setMovingPosition(0);
|
|
66
|
+
interactionStore.setIsZooming(true);
|
|
67
|
+
interactionStore.setZoomStartingPosition(getRealClientX(clientX));
|
|
68
|
+
interactionStore.setMovingPosition(0);
|
|
47
69
|
}
|
|
48
70
|
},
|
|
49
|
-
[getRealClientX,
|
|
71
|
+
[getRealClientX, interactionStore, isGrabbed, xScale?.type]
|
|
50
72
|
);
|
|
51
73
|
const handleOnMouseMove = useCallback(
|
|
52
74
|
({ clientX }) => {
|
|
53
|
-
if (isZooming) setMovingPosition(getRealClientX(clientX));
|
|
75
|
+
if (interactionStore.getState().isZooming) interactionStore.setMovingPosition(getRealClientX(clientX));
|
|
54
76
|
},
|
|
55
|
-
[getRealClientX,
|
|
77
|
+
[getRealClientX, interactionStore]
|
|
56
78
|
);
|
|
57
79
|
const handleOnMouseUp = useCallback(
|
|
58
80
|
(e) => {
|
|
81
|
+
const { isZooming, zoomStartingPosition } = interactionStore.getState();
|
|
59
82
|
if (!isZooming) return;
|
|
60
|
-
setIsZooming(false);
|
|
61
|
-
setMovingPosition(0);
|
|
83
|
+
interactionStore.setIsZooming(false);
|
|
84
|
+
interactionStore.setMovingPosition(0);
|
|
62
85
|
const endingPosition = getRealClientX(e.clientX);
|
|
63
86
|
const diff = Math.abs(zoomStartingPosition - endingPosition);
|
|
64
87
|
if (diff <= 0) return;
|
|
@@ -71,11 +94,8 @@ const ScrollableContainerX = () => {
|
|
|
71
94
|
e.stopPropagation();
|
|
72
95
|
},
|
|
73
96
|
[
|
|
74
|
-
|
|
75
|
-
setIsZooming,
|
|
76
|
-
setMovingPosition,
|
|
97
|
+
interactionStore,
|
|
77
98
|
getRealClientX,
|
|
78
|
-
zoomStartingPosition,
|
|
79
99
|
innerWidth,
|
|
80
100
|
containerRatio,
|
|
81
101
|
lastScrollbarPosition,
|
|
@@ -92,21 +112,8 @@ const ScrollableContainerX = () => {
|
|
|
92
112
|
onMouseUp: handleOnMouseUp,
|
|
93
113
|
children: [
|
|
94
114
|
/* @__PURE__ */ jsxs("g", { mask: `url(#mask-${chartId})`, children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
97
|
-
/* @__PURE__ */ jsx(SeriesFactory, {}),
|
|
98
|
-
Scrappers
|
|
99
|
-
] }),
|
|
100
|
-
isZooming && movingPosition !== 0 ? /* @__PURE__ */ jsx(
|
|
101
|
-
"rect",
|
|
102
|
-
{
|
|
103
|
-
x: movingPosition < zoomStartingPosition ? movingPosition : zoomStartingPosition,
|
|
104
|
-
width: Math.abs(movingPosition - zoomStartingPosition),
|
|
105
|
-
height: innerHeight,
|
|
106
|
-
fill: "orange",
|
|
107
|
-
style: { opacity: 0.2 }
|
|
108
|
-
}
|
|
109
|
-
) : null
|
|
115
|
+
/* @__PURE__ */ jsx("g", { transform: `translate(${-xScrollbarPosition * containerRatio},0)`, children: content }),
|
|
116
|
+
/* @__PURE__ */ jsx(ZoomSelection, {})
|
|
110
117
|
] }),
|
|
111
118
|
/* @__PURE__ */ jsx(ScrollBarX, {})
|
|
112
119
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/graphs/Chart/parts/Scroller/ScrollableContainerX.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable arrow-body-style */\n/* eslint-disable indent */\nimport React, { useContext, useCallback, useMemo } from 'react';\nimport { ChartContext } from '../../ChartContext.js';\nimport { AxisBottom } from '../Axis/AxisBottom.js';\nimport { SeriesFactory } from '../SeriesFactory.js';\nimport { ScrollBarX } from './ScrollBarX.js';\nimport { Scrapper } from '../Scrapper/Scrapper.js';\nimport { VerticalScrapper } from '../Scrapper/VerticalScrapper.js';\nexport const ScrollableContainerX = () => {\n const {\n props: { scrapper },\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable arrow-body-style */\n/* eslint-disable indent */\nimport React, { useContext, useCallback, useMemo } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { ChartContext } from '../../ChartContext.js';\nimport { useChartInteraction } from '../../config/chartInteractionStore.js';\nimport { AxisBottom } from '../Axis/AxisBottom.js';\nimport { SeriesFactory } from '../SeriesFactory.js';\nimport { ScrollBarX } from './ScrollBarX.js';\nimport { Scrapper } from '../Scrapper/Scrapper.js';\nimport { VerticalScrapper } from '../Scrapper/VerticalScrapper.js';\n\n// The range being dragged to zoom into, in the brand color. It is the only part of the chart that follows the pointer\n// during the drag: it subscribes to the selection, which moves on every pointer move.\nconst ZoomSelection = () => {\n const { innerHeight } = useContext(ChartContext);\n const theme = useContext(ThemeContext);\n const isZooming = useChartInteraction((state) => state.isZooming);\n const start = useChartInteraction((state) => state.zoomStartingPosition);\n const end = useChartInteraction((state) => state.movingPosition);\n if (!isZooming || end === 0) return null;\n return (\n <rect\n x={Math.min(start, end)}\n width={Math.abs(end - start)}\n height={innerHeight}\n fill={theme?.colors?.brand?.['500'] ?? '#1394E5'}\n style={{ opacity: 0.15 }}\n />\n );\n};\n\nexport const ScrollableContainerX = () => {\n const {\n props: { scrapper },\n xScale,\n containerRatio,\n innerWidth,\n isGrabbed,\n containerRef,\n setXScrollbarPosition,\n setContainerRatio,\n lastScrollbarPosition,\n internalMargin,\n chartId,\n interactionStore,\n } = useContext(ChartContext);\n const xScrollbarPosition = useChartInteraction((state) => state.xScrollbarPosition);\n\n const getRealClientX = useCallback(\n (clientX: number) => clientX - internalMargin.left - (containerRef?.getBoundingClientRect().left || 0),\n [containerRef, internalMargin.left],\n );\n\n const Scrappers = useMemo(() => {\n if (scrapper && scrapper?.type === 'horizontal') return <Scrapper />;\n if (scrapper && scrapper?.type === 'vertical') return <VerticalScrapper />;\n return null;\n }, [scrapper]);\n\n // built once per change of its inputs, not on every scroll step: a scroll step only moves it (the series, the\n // scrapper and the axis subscribe to what they need themselves)\n const content = useMemo(\n () => (\n <>\n <AxisBottom />\n <SeriesFactory />\n {Scrappers}\n </>\n ),\n [Scrappers],\n );\n\n // the selection is read from the store when the pointer moves, not subscribed to: this group holds the whole plot\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n ({ clientX }) => {\n if (!isGrabbed && xScale?.type !== 'BAND') {\n interactionStore.setIsZooming(true);\n interactionStore.setZoomStartingPosition(getRealClientX(clientX));\n interactionStore.setMovingPosition(0);\n }\n },\n [getRealClientX, interactionStore, isGrabbed, xScale?.type],\n );\n\n const handleOnMouseMove: React.MouseEventHandler = useCallback(\n ({ clientX }) => {\n if (interactionStore.getState().isZooming) interactionStore.setMovingPosition(getRealClientX(clientX));\n },\n [getRealClientX, interactionStore],\n );\n const handleOnMouseUp: React.MouseEventHandler = useCallback(\n (e) => {\n const { isZooming, zoomStartingPosition } = interactionStore.getState();\n if (!isZooming) return;\n interactionStore.setIsZooming(false);\n interactionStore.setMovingPosition(0);\n const endingPosition = getRealClientX(e.clientX);\n\n const diff = Math.abs(zoomStartingPosition - endingPosition);\n if (diff <= 0) return;\n const newRatio =\n innerWidth / ((innerWidth * containerRatio) / diff) < 40\n ? innerWidth / 40\n : (innerWidth * containerRatio) / diff;\n const newPosition =\n lastScrollbarPosition.current +\n (zoomStartingPosition > endingPosition ? endingPosition : zoomStartingPosition) / containerRatio;\n\n // if (newPosition < 0) setXScrollbarPosition(0);\n // if is bigger thant innerwidth possible we force the end\n if (newPosition > innerWidth - innerWidth / newRatio) setXScrollbarPosition(innerWidth - innerWidth / newRatio);\n else setXScrollbarPosition(newPosition);\n\n setContainerRatio(newRatio);\n lastScrollbarPosition.current = newPosition;\n e.stopPropagation();\n },\n [\n interactionStore,\n getRealClientX,\n innerWidth,\n containerRatio,\n lastScrollbarPosition,\n setXScrollbarPosition,\n setContainerRatio,\n ],\n );\n return (\n <g\n className=\"scrollable-container-x\"\n onMouseDown={handleOnMouseDown}\n onMouseMove={handleOnMouseMove}\n onMouseUp={handleOnMouseUp}\n >\n <g mask={`url(#mask-${chartId})`}>\n <g transform={`translate(${-xScrollbarPosition * containerRatio},0)`}>{content}</g>\n <ZoomSelection />\n </g>\n <ScrollBarX />\n </g>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsBnB,SA0CE,UA1CF,KA0CE,YA1CF;AApBJ,SAAgB,YAAY,aAAa,eAAe;AACxD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AAIjC,MAAM,gBAAgB,MAAM;AAC1B,QAAM,EAAE,YAAY,IAAI,WAAW,YAAY;AAC/C,QAAM,QAAQ,WAAW,YAAY;AACrC,QAAM,YAAY,oBAAoB,CAAC,UAAU,MAAM,SAAS;AAChE,QAAM,QAAQ,oBAAoB,CAAC,UAAU,MAAM,oBAAoB;AACvE,QAAM,MAAM,oBAAoB,CAAC,UAAU,MAAM,cAAc;AAC/D,MAAI,CAAC,aAAa,QAAQ,EAAG,QAAO;AACpC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,GAAG,KAAK,IAAI,OAAO,GAAG;AAAA,MACtB,OAAO,KAAK,IAAI,MAAM,KAAK;AAAA,MAC3B,QAAQ;AAAA,MACR,MAAM,OAAO,QAAQ,QAAQ,KAAK,KAAK;AAAA,MACvC,OAAO,EAAE,SAAS,KAAK;AAAA;AAAA,EACzB;AAEJ;AAEO,MAAM,uBAAuB,MAAM;AACxC,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,YAAY;AAC3B,QAAM,qBAAqB,oBAAoB,CAAC,UAAU,MAAM,kBAAkB;AAElF,QAAM,iBAAiB;AAAA,IACrB,CAAC,YAAoB,UAAU,eAAe,QAAQ,cAAc,sBAAsB,EAAE,QAAQ;AAAA,IACpG,CAAC,cAAc,eAAe,IAAI;AAAA,EACpC;AAEA,QAAM,YAAY,QAAQ,MAAM;AAC9B,QAAI,YAAY,UAAU,SAAS,aAAc,QAAO,oBAAC,YAAS;AAClE,QAAI,YAAY,UAAU,SAAS,WAAY,QAAO,oBAAC,oBAAiB;AACxE,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,CAAC;AAIb,QAAM,UAAU;AAAA,IACd,MACE,iCACE;AAAA,0BAAC,cAAW;AAAA,MACZ,oBAAC,iBAAc;AAAA,MACd;AAAA,OACH;AAAA,IAEF,CAAC,SAAS;AAAA,EACZ;AAGA,QAAM,oBAA6C;AAAA,IACjD,CAAC,EAAE,QAAQ,MAAM;AACf,UAAI,CAAC,aAAa,QAAQ,SAAS,QAAQ;AACzC,yBAAiB,aAAa,IAAI;AAClC,yBAAiB,wBAAwB,eAAe,OAAO,CAAC;AAChE,yBAAiB,kBAAkB,CAAC;AAAA,MACtC;AAAA,IACF;AAAA,IACA,CAAC,gBAAgB,kBAAkB,WAAW,QAAQ,IAAI;AAAA,EAC5D;AAEA,QAAM,oBAA6C;AAAA,IACjD,CAAC,EAAE,QAAQ,MAAM;AACf,UAAI,iBAAiB,SAAS,EAAE,UAAW,kBAAiB,kBAAkB,eAAe,OAAO,CAAC;AAAA,IACvG;AAAA,IACA,CAAC,gBAAgB,gBAAgB;AAAA,EACnC;AACA,QAAM,kBAA2C;AAAA,IAC/C,CAAC,MAAM;AACL,YAAM,EAAE,WAAW,qBAAqB,IAAI,iBAAiB,SAAS;AACtE,UAAI,CAAC,UAAW;AAChB,uBAAiB,aAAa,KAAK;AACnC,uBAAiB,kBAAkB,CAAC;AACpC,YAAM,iBAAiB,eAAe,EAAE,OAAO;AAE/C,YAAM,OAAO,KAAK,IAAI,uBAAuB,cAAc;AAC3D,UAAI,QAAQ,EAAG;AACf,YAAM,WACJ,cAAe,aAAa,iBAAkB,QAAQ,KAClD,aAAa,KACZ,aAAa,iBAAkB;AACtC,YAAM,cACJ,sBAAsB,WACrB,uBAAuB,iBAAiB,iBAAiB,wBAAwB;AAIpF,UAAI,cAAc,aAAa,aAAa,SAAU,uBAAsB,aAAa,aAAa,QAAQ;AAAA,UACzG,uBAAsB,WAAW;AAEtC,wBAAkB,QAAQ;AAC1B,4BAAsB,UAAU;AAChC,QAAE,gBAAgB;AAAA,IACpB;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,aAAa;AAAA,MACb,aAAa;AAAA,MACb,WAAW;AAAA,MAEX;AAAA,6BAAC,OAAE,MAAM,aAAa,OAAO,KAC3B;AAAA,8BAAC,OAAE,WAAW,aAAa,CAAC,qBAAqB,cAAc,OAAQ,mBAAQ;AAAA,UAC/E,oBAAC,iBAAc;AAAA,WACjB;AAAA,QACA,oBAAC,cAAW;AAAA;AAAA;AAAA,EACd;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useMemo } from "react";
|
|
4
4
|
import { ChartContext } from "../../ChartContext.js";
|
|
5
|
+
import { useChartInteraction } from "../../config/chartInteractionStore.js";
|
|
5
6
|
import { SeriesFactory } from "../SeriesFactory.js";
|
|
6
7
|
import { ScrollBarY } from "./ScrollBarY.js";
|
|
7
8
|
import { Scrapper } from "../Scrapper/Scrapper.js";
|
|
@@ -10,21 +11,25 @@ import { AxisLeft } from "../Axis/AxisLeft.js";
|
|
|
10
11
|
const ScrollableContainerY = () => {
|
|
11
12
|
const {
|
|
12
13
|
props: { scrapper },
|
|
13
|
-
xScrollbarPosition,
|
|
14
14
|
containerRatio,
|
|
15
15
|
chartId
|
|
16
16
|
} = useContext(ChartContext);
|
|
17
|
+
const xScrollbarPosition = useChartInteraction((state) => state.xScrollbarPosition);
|
|
17
18
|
const Scrappers = useMemo(() => {
|
|
18
19
|
if (scrapper?.type === "horizontal") return /* @__PURE__ */ jsx(Scrapper, {});
|
|
19
20
|
if (scrapper?.type === "vertical") return /* @__PURE__ */ jsx(VerticalScrapper, {});
|
|
20
21
|
return null;
|
|
21
22
|
}, [scrapper?.type]);
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const content = useMemo(
|
|
24
|
+
() => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
25
|
/* @__PURE__ */ jsx(SeriesFactory, {}),
|
|
25
26
|
Scrappers,
|
|
26
27
|
/* @__PURE__ */ jsx(AxisLeft, {})
|
|
27
|
-
] })
|
|
28
|
+
] }),
|
|
29
|
+
[Scrappers]
|
|
30
|
+
);
|
|
31
|
+
return /* @__PURE__ */ jsxs("g", { className: "scrollable-container-y", children: [
|
|
32
|
+
/* @__PURE__ */ jsx("g", { mask: `url(#mask-y-${chartId})`, children: /* @__PURE__ */ jsx("g", { transform: `translate(0,${-xScrollbarPosition * containerRatio})`, children: content }) }),
|
|
28
33
|
/* @__PURE__ */ jsx(ScrollBarY, {})
|
|
29
34
|
] });
|
|
30
35
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/graphs/Chart/parts/Scroller/ScrollableContainerY.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable arrow-body-style */\n/* eslint-disable indent */\nimport React, { useContext, useMemo } from 'react';\nimport { ChartContext } from '../../ChartContext.js';\nimport { SeriesFactory } from '../SeriesFactory.js';\nimport { ScrollBarY } from './ScrollBarY.js';\nimport { Scrapper } from '../Scrapper/Scrapper.js';\nimport { VerticalScrapper } from '../Scrapper/VerticalScrapper.js';\nimport { AxisLeft } from '../Axis/AxisLeft.js';\nexport const ScrollableContainerY = () => {\n const {\n props: { scrapper },\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable arrow-body-style */\n/* eslint-disable indent */\nimport React, { useContext, useMemo } from 'react';\nimport { ChartContext } from '../../ChartContext.js';\nimport { useChartInteraction } from '../../config/chartInteractionStore.js';\nimport { SeriesFactory } from '../SeriesFactory.js';\nimport { ScrollBarY } from './ScrollBarY.js';\nimport { Scrapper } from '../Scrapper/Scrapper.js';\nimport { VerticalScrapper } from '../Scrapper/VerticalScrapper.js';\nimport { AxisLeft } from '../Axis/AxisLeft.js';\nexport const ScrollableContainerY = () => {\n const {\n props: { scrapper },\n containerRatio,\n chartId,\n } = useContext(ChartContext);\n const xScrollbarPosition = useChartInteraction((state) => state.xScrollbarPosition);\n\n const Scrappers = useMemo(() => {\n if (scrapper?.type === 'horizontal') return <Scrapper />;\n if (scrapper?.type === 'vertical') return <VerticalScrapper />;\n return null;\n }, [scrapper?.type]);\n\n // built once per change of its inputs, not on every scroll step: a scroll step only moves it (the series, the\n // scrapper and the axis subscribe to what they need themselves)\n const content = useMemo(\n () => (\n <>\n <SeriesFactory />\n {Scrappers}\n <AxisLeft />\n </>\n ),\n [Scrappers],\n );\n\n return (\n <g className=\"scrollable-container-y\">\n <g mask={`url(#mask-y-${chartId})`}>\n <g transform={`translate(0,${-xScrollbarPosition * containerRatio})`}>{content}</g>\n </g>\n <ScrollBarY />\n </g>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmByB,SAS1C,UAT0C,KAS1C,YAT0C;AAjBhD,SAAgB,YAAY,eAAe;AAC3C,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAClB,MAAM,uBAAuB,MAAM;AACxC,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS;AAAA,IAClB;AAAA,IACA;AAAA,EACF,IAAI,WAAW,YAAY;AAC3B,QAAM,qBAAqB,oBAAoB,CAAC,UAAU,MAAM,kBAAkB;AAElF,QAAM,YAAY,QAAQ,MAAM;AAC9B,QAAI,UAAU,SAAS,aAAc,QAAO,oBAAC,YAAS;AACtD,QAAI,UAAU,SAAS,WAAY,QAAO,oBAAC,oBAAiB;AAC5D,WAAO;AAAA,EACT,GAAG,CAAC,UAAU,IAAI,CAAC;AAInB,QAAM,UAAU;AAAA,IACd,MACE,iCACE;AAAA,0BAAC,iBAAc;AAAA,MACd;AAAA,MACD,oBAAC,YAAS;AAAA,OACZ;AAAA,IAEF,CAAC,SAAS;AAAA,EACZ;AAEA,SACE,qBAAC,OAAE,WAAU,0BACX;AAAA,wBAAC,OAAE,MAAM,eAAe,OAAO,KAC7B,8BAAC,OAAE,WAAW,eAAe,CAAC,qBAAqB,cAAc,KAAM,mBAAQ,GACjF;AAAA,IACA,oBAAC,cAAW;AAAA,KACd;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,46 +1,55 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, useMemo } from "react";
|
|
4
4
|
import { ChartContext } from "../ChartContext.js";
|
|
5
5
|
import { Line, Points, Bars, StackedBar, Area, HorizontalBars, HorizontalStackedBars } from "../series/index.js";
|
|
6
6
|
import { getStackedIndex } from "../helpers/index.js";
|
|
7
7
|
import { useVirtualizedSeries } from "../helpers/useVirtualizedSeries.js";
|
|
8
|
+
import { HoverBand } from "./HoverBand.js";
|
|
9
|
+
import { ZeroLine } from "./ZeroLine.js";
|
|
10
|
+
import { ENTRANCE_ATTRIBUTE, getSerieEntrance, useEntranceAnimation } from "../config/useEntranceAnimation.js";
|
|
11
|
+
import { VALUE_AXIS_TRANSITION, useValueAxisTransition } from "../config/useValueAxisTransition.js";
|
|
12
|
+
const getSerieComponent = (serie, { groups, types, isHorizontal }) => {
|
|
13
|
+
const isStacked = Boolean(groups) && getStackedIndex(groups, serie.name) > -1;
|
|
14
|
+
if (serie.type === "bar" && isStacked) return isHorizontal ? HorizontalStackedBars : StackedBar;
|
|
15
|
+
if (serie.type === "bar") return isHorizontal ? HorizontalBars : Bars;
|
|
16
|
+
if (types === "scatter" && !serie.type || serie.type === "point") return Points;
|
|
17
|
+
if (serie.type === "line") return Line;
|
|
18
|
+
if (serie.type === "area") return Area;
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
8
21
|
const SeriesFactory = () => {
|
|
9
22
|
const {
|
|
10
|
-
props: { groups, types },
|
|
23
|
+
props: { groups, types, y2Axis },
|
|
11
24
|
isHorizontal
|
|
12
25
|
} = useContext(ChartContext);
|
|
13
26
|
const virtualizedSeries = useVirtualizedSeries();
|
|
27
|
+
const { setSeriesGroup, seriesGroup, withAnimation, transformOrigin } = useEntranceAnimation();
|
|
28
|
+
useValueAxisTransition(seriesGroup);
|
|
29
|
+
const eases = !isHorizontal;
|
|
14
30
|
return useMemo(
|
|
15
|
-
() => /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (serie.type === "area") {
|
|
39
|
-
return /* @__PURE__ */ jsx(Area, { ...serieProps });
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
}) }),
|
|
43
|
-
[groups, isHorizontal, types, virtualizedSeries]
|
|
31
|
+
() => /* @__PURE__ */ jsxs("g", { className: "content", ref: setSeriesGroup, children: [
|
|
32
|
+
/* @__PURE__ */ jsx(HoverBand, {}),
|
|
33
|
+
eases ? /* @__PURE__ */ jsx("g", { ...{ [VALUE_AXIS_TRANSITION.ATTRIBUTE]: "y" }, children: /* @__PURE__ */ jsx(ZeroLine, {}) }) : /* @__PURE__ */ jsx(ZeroLine, {}),
|
|
34
|
+
virtualizedSeries.map((serie) => {
|
|
35
|
+
const Serie = getSerieComponent(serie, { groups, types, isHorizontal });
|
|
36
|
+
if (!Serie) return null;
|
|
37
|
+
const valueAxis = serie.scale === "y2" && y2Axis ? "y2" : "y";
|
|
38
|
+
const drawn = (key) => eases ? /* @__PURE__ */ jsx("g", { ...{ [VALUE_AXIS_TRANSITION.ATTRIBUTE]: valueAxis }, children: /* @__PURE__ */ jsx(Serie, { serie }) }, key) : /* @__PURE__ */ jsx(Serie, { serie }, key);
|
|
39
|
+
if (!withAnimation) return drawn(serie.key);
|
|
40
|
+
const entrance = getSerieEntrance(serie);
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"g",
|
|
43
|
+
{
|
|
44
|
+
...{ [ENTRANCE_ATTRIBUTE]: entrance },
|
|
45
|
+
style: entrance === "grow" ? { transformOrigin } : void 0,
|
|
46
|
+
children: drawn()
|
|
47
|
+
},
|
|
48
|
+
serie.key
|
|
49
|
+
);
|
|
50
|
+
})
|
|
51
|
+
] }),
|
|
52
|
+
[eases, groups, isHorizontal, setSeriesGroup, transformOrigin, types, virtualizedSeries, withAnimation, y2Axis]
|
|
44
53
|
);
|
|
45
54
|
};
|
|
46
55
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/graphs/Chart/parts/SeriesFactory.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable arrow-body-style */\n/* eslint-disable indent */\nimport React, { useContext, useMemo } from 'react';\nimport { ChartContext } from '../ChartContext.js';\nimport { Line, Points, Bars, StackedBar, Area, HorizontalBars, HorizontalStackedBars } from '../series/index.js';\nimport { getStackedIndex } from '../helpers/index.js';\nimport { useVirtualizedSeries } from '../helpers/useVirtualizedSeries.js';\n\nexport const SeriesFactory = () => {\n const {\n props: { groups, types },\n isHorizontal,\n } = useContext(ChartContext);\n\n const virtualizedSeries = useVirtualizedSeries();\n\n return useMemo(\n () => (\n <g className=\"content\">\n {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable arrow-body-style */\n/* eslint-disable indent */\nimport React, { useContext, useMemo } from 'react';\nimport { ChartContext } from '../ChartContext.js';\nimport { Line, Points, Bars, StackedBar, Area, HorizontalBars, HorizontalStackedBars } from '../series/index.js';\nimport { getStackedIndex } from '../helpers/index.js';\nimport { useVirtualizedSeries } from '../helpers/useVirtualizedSeries.js';\nimport { HoverBand } from './HoverBand.js';\nimport { ZeroLine } from './ZeroLine.js';\nimport { ENTRANCE_ATTRIBUTE, getSerieEntrance, useEntranceAnimation } from '../config/useEntranceAnimation.js';\nimport { VALUE_AXIS_TRANSITION, useValueAxisTransition } from '../config/useValueAxisTransition.js';\nimport type { DSChartT } from '../../../react-desc-prop-types.js';\n\ntype SerieComponentT = React.ComponentType<{ serie: DSChartT.InternalSerie }>;\n\nconst getSerieComponent = (\n serie: DSChartT.InternalSerie,\n { groups, types, isHorizontal }: { groups?: string[][]; types?: string; isHorizontal: boolean },\n): SerieComponentT | null => {\n const isStacked = Boolean(groups) && getStackedIndex(groups as string[][], serie.name) > -1;\n if (serie.type === 'bar' && isStacked) return isHorizontal ? HorizontalStackedBars : StackedBar;\n if (serie.type === 'bar') return isHorizontal ? HorizontalBars : Bars;\n if ((types === 'scatter' && !serie.type) || serie.type === 'point') return Points;\n if (serie.type === 'line') return Line;\n if (serie.type === 'area') return Area;\n return null;\n};\n\nexport const SeriesFactory = () => {\n const {\n props: { groups, types, y2Axis },\n isHorizontal,\n } = useContext(ChartContext);\n\n const virtualizedSeries = useVirtualizedSeries();\n const { setSeriesGroup, seriesGroup, withAnimation, transformOrigin } = useEntranceAnimation();\n useValueAxisTransition(seriesGroup);\n // on a vertical chart, the series of each vertical axis, and the zero line, have a group that eases them to a new\n // domain of the axis (see useValueAxisTransition)\n const eases = !isHorizontal;\n\n return useMemo(\n () => (\n <g className=\"content\" ref={setSeriesGroup}>\n <HoverBand />\n {eases ? (\n <g {...{ [VALUE_AXIS_TRANSITION.ATTRIBUTE]: 'y' }}>\n <ZeroLine />\n </g>\n ) : (\n <ZeroLine />\n )}\n {virtualizedSeries.map((serie) => {\n const Serie = getSerieComponent(serie, { groups, types, isHorizontal });\n if (!Serie) return null;\n const valueAxis = serie.scale === 'y2' && y2Axis ? 'y2' : 'y';\n const drawn = (key?: string) =>\n eases ? (\n <g key={key} {...{ [VALUE_AXIS_TRANSITION.ATTRIBUTE]: valueAxis }}>\n <Serie serie={serie} />\n </g>\n ) : (\n <Serie key={key} serie={serie} />\n );\n if (!withAnimation) return drawn(serie.key);\n // with withAnimation, each series has a group that tells how it enters (see useEntranceAnimation)\n const entrance = getSerieEntrance(serie);\n return (\n <g\n key={serie.key}\n {...{ [ENTRANCE_ATTRIBUTE]: entrance }}\n style={entrance === 'grow' ? { transformOrigin } : undefined}\n >\n {drawn()}\n </g>\n );\n })}\n </g>\n ),\n [eases, groups, isHorizontal, setSeriesGroup, transformOrigin, types, virtualizedSeries, withAnimation, y2Axis],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4CjB,SACE,KADF;AAzCN,SAAgB,YAAY,eAAe;AAC3C,SAAS,oBAAoB;AAC7B,SAAS,MAAM,QAAQ,MAAM,YAAY,MAAM,gBAAgB,6BAA6B;AAC5F,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,kBAAkB,4BAA4B;AAC3E,SAAS,uBAAuB,8BAA8B;AAK9D,MAAM,oBAAoB,CACxB,OACA,EAAE,QAAQ,OAAO,aAAa,MACH;AAC3B,QAAM,YAAY,QAAQ,MAAM,KAAK,gBAAgB,QAAsB,MAAM,IAAI,IAAI;AACzF,MAAI,MAAM,SAAS,SAAS,UAAW,QAAO,eAAe,wBAAwB;AACrF,MAAI,MAAM,SAAS,MAAO,QAAO,eAAe,iBAAiB;AACjE,MAAK,UAAU,aAAa,CAAC,MAAM,QAAS,MAAM,SAAS,QAAS,QAAO;AAC3E,MAAI,MAAM,SAAS,OAAQ,QAAO;AAClC,MAAI,MAAM,SAAS,OAAQ,QAAO;AAClC,SAAO;AACT;AAEO,MAAM,gBAAgB,MAAM;AACjC,QAAM;AAAA,IACJ,OAAO,EAAE,QAAQ,OAAO,OAAO;AAAA,IAC/B;AAAA,EACF,IAAI,WAAW,YAAY;AAE3B,QAAM,oBAAoB,qBAAqB;AAC/C,QAAM,EAAE,gBAAgB,aAAa,eAAe,gBAAgB,IAAI,qBAAqB;AAC7F,yBAAuB,WAAW;AAGlC,QAAM,QAAQ,CAAC;AAEf,SAAO;AAAA,IACL,MACE,qBAAC,OAAE,WAAU,WAAU,KAAK,gBAC1B;AAAA,0BAAC,aAAU;AAAA,MACV,QACC,oBAAC,OAAG,GAAG,EAAE,CAAC,sBAAsB,SAAS,GAAG,IAAI,GAC9C,8BAAC,YAAS,GACZ,IAEA,oBAAC,YAAS;AAAA,MAEX,kBAAkB,IAAI,CAAC,UAAU;AAChC,cAAM,QAAQ,kBAAkB,OAAO,EAAE,QAAQ,OAAO,aAAa,CAAC;AACtE,YAAI,CAAC,MAAO,QAAO;AACnB,cAAM,YAAY,MAAM,UAAU,QAAQ,SAAS,OAAO;AAC1D,cAAM,QAAQ,CAAC,QACb,QACE,oBAAC,OAAa,GAAG,EAAE,CAAC,sBAAsB,SAAS,GAAG,UAAU,GAC9D,8BAAC,SAAM,OAAc,KADf,GAER,IAEA,oBAAC,SAAgB,SAAL,GAAmB;AAEnC,YAAI,CAAC,cAAe,QAAO,MAAM,MAAM,GAAG;AAE1C,cAAM,WAAW,iBAAiB,KAAK;AACvC,eACE;AAAA,UAAC;AAAA;AAAA,YAEE,GAAG,EAAE,CAAC,kBAAkB,GAAG,SAAS;AAAA,YACrC,OAAO,aAAa,SAAS,EAAE,gBAAgB,IAAI;AAAA,YAElD,gBAAM;AAAA;AAAA,UAJF,MAAM;AAAA,QAKb;AAAA,MAEJ,CAAC;AAAA,OACH;AAAA,IAEF,CAAC,OAAO,QAAQ,cAAc,gBAAgB,iBAAiB,OAAO,mBAAmB,eAAe,MAAM;AAAA,EAChH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,65 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext } from "react";
|
|
4
|
+
import { ThemeContext } from "@elliemae/ds-system";
|
|
4
5
|
import { ChartContext } from "../ChartContext.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
y2: yCurrentPosition
|
|
6
|
+
import { getPointerScrapperPosX, useChartInteraction } from "../config/chartInteractionStore.js";
|
|
7
|
+
import { getTrend } from "../helpers/trend.js";
|
|
8
|
+
import { SCRAPPER } from "../../constants.js";
|
|
9
|
+
const TREND_STROKE_WIDTH = 3;
|
|
10
|
+
const TrendHighlight = ({ serie, linePath }) => {
|
|
11
|
+
const {
|
|
12
|
+
props: { withTrendHighlight, scrapper },
|
|
13
|
+
getXScaleValue,
|
|
14
|
+
getYValue,
|
|
15
|
+
innerHeight,
|
|
16
|
+
chartId
|
|
17
|
+
} = useContext(ChartContext);
|
|
18
|
+
const theme = useContext(ThemeContext);
|
|
19
|
+
const focusedIndex = useChartInteraction((state) => {
|
|
20
|
+
if (!withTrendHighlight) return -1;
|
|
21
|
+
if (state.activePoint?.serie === serie.name) {
|
|
22
|
+
return serie.data.findIndex((datum) => datum.key === state.activePoint?.key);
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
if (scrapper?.type !== SCRAPPER.TYPE_VERTICAL) return -1;
|
|
25
|
+
const scrapperX = state.activePoint ? getXScaleValue(state.activePoint) : getPointerScrapperPosX(state);
|
|
26
|
+
return serie.data.findIndex((datum) => getXScaleValue(datum) === scrapperX);
|
|
27
|
+
});
|
|
28
|
+
if (focusedIndex < 1 || !linePath) return null;
|
|
29
|
+
const previous = serie.data[focusedIndex - 1];
|
|
30
|
+
const current = serie.data[focusedIndex];
|
|
31
|
+
const trend = getTrend(getYValue(previous), getYValue(current), serie.higherIsBetter);
|
|
32
|
+
const colors = {
|
|
33
|
+
good: theme?.colors?.success?.["900"] ?? "#207E56",
|
|
34
|
+
bad: theme?.colors?.danger?.["900"] ?? "#C64252",
|
|
35
|
+
flat: theme?.colors?.neutral?.["500"] ?? "#697489"
|
|
36
|
+
};
|
|
37
|
+
const previousX = getXScaleValue(previous) ?? 0;
|
|
38
|
+
const currentX = getXScaleValue(current) ?? 0;
|
|
39
|
+
const clipId = `trend-highlight-${chartId}-${serie.key.replace(/[^\w-]/g, "_")}`;
|
|
40
|
+
return /* @__PURE__ */ jsxs("g", { className: "trend-highlight", "data-trend": trend, children: [
|
|
41
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: clipId, children: /* @__PURE__ */ jsx(
|
|
42
|
+
"rect",
|
|
43
|
+
{
|
|
44
|
+
x: Math.min(previousX, currentX) - TREND_STROKE_WIDTH / 2,
|
|
45
|
+
y: -TREND_STROKE_WIDTH,
|
|
46
|
+
width: Math.abs(currentX - previousX) + TREND_STROKE_WIDTH,
|
|
47
|
+
height: innerHeight + TREND_STROKE_WIDTH * 2
|
|
48
|
+
}
|
|
49
|
+
) }) }),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
d: linePath,
|
|
54
|
+
clipPath: `url(#${clipId})`,
|
|
55
|
+
fill: "none",
|
|
56
|
+
stroke: colors[trend],
|
|
57
|
+
strokeWidth: TREND_STROKE_WIDTH,
|
|
58
|
+
strokeLinecap: "round",
|
|
59
|
+
strokeLinejoin: "round"
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] });
|
|
25
63
|
};
|
|
26
64
|
export {
|
|
27
65
|
TrendHighlight
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/graphs/Chart/parts/TrendHighlight.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ChartContext } from '../ChartContext.js';\nimport { type DSChartT } from '
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { ChartContext } from '../ChartContext.js';\nimport { getPointerScrapperPosX, useChartInteraction } from '../config/chartInteractionStore.js';\nimport { getTrend, type TrendT } from '../helpers/trend.js';\nimport { SCRAPPER } from '../../constants.js';\nimport { type DSChartT } from '../../../react-desc-prop-types.js';\n\ninterface TrendHighlightProps {\n serie: DSChartT.InternalSerie;\n // the path of the line of the series, which the highlight follows\n linePath: string | null;\n}\n\nconst TREND_STROKE_WIDTH = 3;\n\n// With withTrendHighlight, the stretch of a line (or of the top of an area) that leads to its focused point, from the\n// previous point the line joins, is drawn over in the color of its trend: success when it goes the good way, danger\n// when it goes the bad way, neutral when the value does not change. The focused point is the active point of the\n// keyboard or of the pointer, or the point under the vertical scrapper. The stretch is the line itself, clipped between\n// the two points, so it follows a spline as well, and it is drawn under the markers.\nexport const TrendHighlight: React.ComponentType<TrendHighlightProps> = ({ serie, linePath }) => {\n const {\n props: { withTrendHighlight, scrapper },\n getXScaleValue,\n getYValue,\n innerHeight,\n chartId,\n } = useContext(ChartContext);\n const theme = useContext(ThemeContext);\n\n // the index of the focused point in the series, -1 when it has none\n const focusedIndex = useChartInteraction((state) => {\n if (!withTrendHighlight) return -1;\n if (state.activePoint?.serie === serie.name) {\n return serie.data.findIndex((datum) => datum.key === state.activePoint?.key);\n }\n if (scrapper?.type !== SCRAPPER.TYPE_VERTICAL) return -1;\n const scrapperX = state.activePoint ? getXScaleValue(state.activePoint) : getPointerScrapperPosX(state);\n return serie.data.findIndex((datum) => getXScaleValue(datum) === scrapperX);\n });\n\n // the first point has no stretch before it; the data has no gaps, as the line joins the points around a missing value\n if (focusedIndex < 1 || !linePath) return null;\n const previous = serie.data[focusedIndex - 1];\n const current = serie.data[focusedIndex];\n const trend = getTrend(getYValue(previous) as number, getYValue(current) as number, serie.higherIsBetter);\n const colors: Record<TrendT, string> = {\n good: theme?.colors?.success?.['900'] ?? '#207E56',\n bad: theme?.colors?.danger?.['900'] ?? '#C64252',\n flat: theme?.colors?.neutral?.['500'] ?? '#697489',\n };\n\n const previousX = getXScaleValue(previous) ?? 0;\n const currentX = getXScaleValue(current) ?? 0;\n const clipId = `trend-highlight-${chartId}-${serie.key.replace(/[^\\w-]/g, '_')}`;\n return (\n <g className=\"trend-highlight\" data-trend={trend}>\n <defs>\n <clipPath id={clipId}>\n {/* the round caps of the stroke reach a bit past each point */}\n <rect\n x={Math.min(previousX, currentX) - TREND_STROKE_WIDTH / 2}\n y={-TREND_STROKE_WIDTH}\n width={Math.abs(currentX - previousX) + TREND_STROKE_WIDTH}\n height={innerHeight + TREND_STROKE_WIDTH * 2}\n />\n </clipPath>\n </defs>\n <path\n d={linePath}\n clipPath={`url(#${clipId})`}\n fill=\"none\"\n stroke={colors[trend]}\n strokeWidth={TREND_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyDnB,SAIM,KAJN;AAzDJ,SAAgB,kBAAkB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB,2BAA2B;AAC5D,SAAS,gBAA6B;AACtC,SAAS,gBAAgB;AASzB,MAAM,qBAAqB;AAOpB,MAAM,iBAA2D,CAAC,EAAE,OAAO,SAAS,MAAM;AAC/F,QAAM;AAAA,IACJ,OAAO,EAAE,oBAAoB,SAAS;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,YAAY;AAC3B,QAAM,QAAQ,WAAW,YAAY;AAGrC,QAAM,eAAe,oBAAoB,CAAC,UAAU;AAClD,QAAI,CAAC,mBAAoB,QAAO;AAChC,QAAI,MAAM,aAAa,UAAU,MAAM,MAAM;AAC3C,aAAO,MAAM,KAAK,UAAU,CAAC,UAAU,MAAM,QAAQ,MAAM,aAAa,GAAG;AAAA,IAC7E;AACA,QAAI,UAAU,SAAS,SAAS,cAAe,QAAO;AACtD,UAAM,YAAY,MAAM,cAAc,eAAe,MAAM,WAAW,IAAI,uBAAuB,KAAK;AACtG,WAAO,MAAM,KAAK,UAAU,CAAC,UAAU,eAAe,KAAK,MAAM,SAAS;AAAA,EAC5E,CAAC;AAGD,MAAI,eAAe,KAAK,CAAC,SAAU,QAAO;AAC1C,QAAM,WAAW,MAAM,KAAK,eAAe,CAAC;AAC5C,QAAM,UAAU,MAAM,KAAK,YAAY;AACvC,QAAM,QAAQ,SAAS,UAAU,QAAQ,GAAa,UAAU,OAAO,GAAa,MAAM,cAAc;AACxG,QAAM,SAAiC;AAAA,IACrC,MAAM,OAAO,QAAQ,UAAU,KAAK,KAAK;AAAA,IACzC,KAAK,OAAO,QAAQ,SAAS,KAAK,KAAK;AAAA,IACvC,MAAM,OAAO,QAAQ,UAAU,KAAK,KAAK;AAAA,EAC3C;AAEA,QAAM,YAAY,eAAe,QAAQ,KAAK;AAC9C,QAAM,WAAW,eAAe,OAAO,KAAK;AAC5C,QAAM,SAAS,mBAAmB,OAAO,IAAI,MAAM,IAAI,QAAQ,WAAW,GAAG,CAAC;AAC9E,SACE,qBAAC,OAAE,WAAU,mBAAkB,cAAY,OACzC;AAAA,wBAAC,UACC,8BAAC,cAAS,IAAI,QAEZ;AAAA,MAAC;AAAA;AAAA,QACC,GAAG,KAAK,IAAI,WAAW,QAAQ,IAAI,qBAAqB;AAAA,QACxD,GAAG,CAAC;AAAA,QACJ,OAAO,KAAK,IAAI,WAAW,SAAS,IAAI;AAAA,QACxC,QAAQ,cAAc,qBAAqB;AAAA;AAAA,IAC7C,GACF,GACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,GAAG;AAAA,QACH,UAAU,QAAQ,MAAM;AAAA,QACxB,MAAK;AAAA,QACL,QAAQ,OAAO,KAAK;AAAA,QACpB,aAAa;AAAA,QACb,eAAc;AAAA,QACd,gBAAe;AAAA;AAAA,IACjB;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { ThemeContext } from "@elliemae/ds-system";
|
|
5
|
+
import { ChartContext } from "../ChartContext.js";
|
|
6
|
+
import { getZeroLinePosition } from "../helpers/zeroLine.js";
|
|
7
|
+
const ZeroLine = () => {
|
|
8
|
+
const {
|
|
9
|
+
xScale,
|
|
10
|
+
yScale,
|
|
11
|
+
innerWidth,
|
|
12
|
+
innerHeight,
|
|
13
|
+
containerRatio,
|
|
14
|
+
props: { xScroll, yScroll }
|
|
15
|
+
} = useContext(ChartContext);
|
|
16
|
+
const theme = useContext(ThemeContext);
|
|
17
|
+
const yZero = getZeroLinePosition(yScale);
|
|
18
|
+
const xZero = getZeroLinePosition(xScale);
|
|
19
|
+
if (yZero === null && xZero === null) return null;
|
|
20
|
+
const width = innerWidth * (xScroll ? containerRatio : 1);
|
|
21
|
+
const height = innerHeight * (yScroll ? containerRatio : 1);
|
|
22
|
+
const lineProps = {
|
|
23
|
+
stroke: theme?.colors?.neutral?.["500"] ?? "#697489",
|
|
24
|
+
strokeWidth: 1,
|
|
25
|
+
shapeRendering: "crispEdges",
|
|
26
|
+
pointerEvents: "none"
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsxs("g", { className: "zero-line", children: [
|
|
29
|
+
yZero !== null ? /* @__PURE__ */ jsx("line", { x1: 0, x2: width, y1: yZero, y2: yZero, ...lineProps }) : null,
|
|
30
|
+
xZero !== null ? /* @__PURE__ */ jsx("line", { x1: xZero, x2: xZero, y1: 0, y2: height, ...lineProps }) : null
|
|
31
|
+
] });
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
ZeroLine
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=ZeroLine.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/graphs/Chart/parts/ZeroLine.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { ChartContext } from '../ChartContext.js';\nimport { getZeroLinePosition } from '../helpers/zeroLine.js';\n\n// The zero of the axes that go below it (see getZeroLinePosition): a hairline across the plot, stronger than the grid\n// and than the domain line of the axis, drawn under the series. A horizontal line for the vertical axis, a vertical one\n// for the horizontal axis, so a scatter plot with negative values on both axes shows its four quadrants. It spans the\n// whole content of a scrollable chart, as it scrolls with the series.\nexport const ZeroLine = () => {\n const {\n xScale,\n yScale,\n innerWidth,\n innerHeight,\n containerRatio,\n props: { xScroll, yScroll },\n } = useContext(ChartContext);\n const theme = useContext(ThemeContext);\n\n const yZero = getZeroLinePosition(yScale);\n const xZero = getZeroLinePosition(xScale);\n if (yZero === null && xZero === null) return null;\n\n const width = innerWidth * (xScroll ? containerRatio : 1);\n const height = innerHeight * (yScroll ? containerRatio : 1);\n const lineProps = {\n stroke: theme?.colors?.neutral?.['500'] ?? '#697489',\n strokeWidth: 1,\n shapeRendering: 'crispEdges',\n pointerEvents: 'none',\n } as const;\n\n return (\n <g className=\"zero-line\">\n {yZero !== null ? <line x1={0} x2={width} y1={yZero} y2={yZero} {...lineProps} /> : null}\n {xZero !== null ? <line x1={xZero} x2={xZero} y1={0} y2={height} {...lineProps} /> : null}\n </g>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkCnB,SACoB,KADpB;AAlCJ,SAAgB,kBAAkB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AAM7B,MAAM,WAAW,MAAM;AAC5B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS,QAAQ;AAAA,EAC5B,IAAI,WAAW,YAAY;AAC3B,QAAM,QAAQ,WAAW,YAAY;AAErC,QAAM,QAAQ,oBAAoB,MAAM;AACxC,QAAM,QAAQ,oBAAoB,MAAM;AACxC,MAAI,UAAU,QAAQ,UAAU,KAAM,QAAO;AAE7C,QAAM,QAAQ,cAAc,UAAU,iBAAiB;AACvD,QAAM,SAAS,eAAe,UAAU,iBAAiB;AACzD,QAAM,YAAY;AAAA,IAChB,QAAQ,OAAO,QAAQ,UAAU,KAAK,KAAK;AAAA,IAC3C,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,eAAe;AAAA,EACjB;AAEA,SACE,qBAAC,OAAE,WAAU,aACV;AAAA,cAAU,OAAO,oBAAC,UAAK,IAAI,GAAG,IAAI,OAAO,IAAI,OAAO,IAAI,OAAQ,GAAG,WAAW,IAAK;AAAA,IACnF,UAAU,OAAO,oBAAC,UAAK,IAAI,OAAO,IAAI,OAAO,IAAI,GAAG,IAAI,QAAS,GAAG,WAAW,IAAK;AAAA,KACvF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|