@elliemae/ds-dataviz 3.80.0-next.65 → 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
|
@@ -33,131 +33,142 @@ __export(Rect_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(Rect_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = require("react");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
37
38
|
var import_ChartContext = require("../ChartContext.js");
|
|
39
|
+
var import_chartInteractionStore = require("../config/chartInteractionStore.js");
|
|
38
40
|
var import_constants = require("../../constants.js");
|
|
39
41
|
var import_FocusableRegion = require("../parts/FocusableRegion.js");
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
yValue,
|
|
51
|
-
|
|
52
|
-
}) => {
|
|
53
|
-
const {
|
|
54
|
-
activePoint,
|
|
55
|
-
chartId,
|
|
56
|
-
isHorizontal,
|
|
57
|
-
setActivePoint,
|
|
58
|
-
getYValueFormatted,
|
|
59
|
-
getXValueFormatted,
|
|
60
|
-
props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis }
|
|
61
|
-
} = (0, import_react.useContext)(import_ChartContext.ChartContext);
|
|
62
|
-
const finalYAxis = datum.scale === "y2" ? y2Axis : yAxis;
|
|
63
|
-
const yValueFormatted = getYValueFormatted(datum);
|
|
64
|
-
const xValueFormatted = getXValueFormatted(datum);
|
|
65
|
-
const isFocused = activePoint?.key === id;
|
|
66
|
-
const clipPathSign = (0, import_react.useMemo)(() => {
|
|
67
|
-
if (isHorizontal) return "";
|
|
68
|
-
if (isNegative) return `url(#rects-negative-${chartId})`;
|
|
69
|
-
return `url(#rects-positive-${chartId})`;
|
|
70
|
-
}, [chartId, isHorizontal, isNegative]);
|
|
71
|
-
const transform = (0, import_react.useMemo)(() => {
|
|
72
|
-
if (isHorizontal) return ``;
|
|
73
|
-
return `scale(1,-1) translate(0,${-height})`;
|
|
74
|
-
}, [height, isHorizontal]);
|
|
75
|
-
const handleMouseEnter = (0, import_react.useCallback)(() => {
|
|
76
|
-
if (!scrapper) setActivePoint(datum);
|
|
77
|
-
}, [datum, scrapper, setActivePoint]);
|
|
78
|
-
const handleOnMouseLeave = (0, import_react.useCallback)(() => {
|
|
79
|
-
if (!scrapper) setActivePoint(null);
|
|
80
|
-
}, [scrapper, setActivePoint]);
|
|
81
|
-
return (0, import_react.useMemo)(
|
|
82
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: clipPathSign, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
83
|
-
"g",
|
|
84
|
-
{
|
|
85
|
-
id: isFocused ? `data-focused-${chartId}` : "",
|
|
86
|
-
transform,
|
|
87
|
-
onMouseEnter: handleMouseEnter,
|
|
88
|
-
onMouseLeave: handleOnMouseLeave,
|
|
89
|
-
"data-testid": import_DataTestIds.DataVizDataTestIds.BAR,
|
|
90
|
-
children: [
|
|
91
|
-
isFocused ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
-
"rect",
|
|
93
|
-
{
|
|
94
|
-
x: (isHorizontal ? x : 0) - import_constants.FOCUS_RING.STROKE_WIDTH,
|
|
95
|
-
y: (!isHorizontal ? -y : 0) - import_constants.FOCUS_RING.STROKE_WIDTH,
|
|
96
|
-
width: width + import_constants.FOCUS_RING.OFFSET,
|
|
97
|
-
height: height + import_constants.FOCUS_RING.OFFSET,
|
|
98
|
-
fill: "none",
|
|
99
|
-
rx: "1",
|
|
100
|
-
ry: "1",
|
|
101
|
-
stroke: import_constants.FOCUS_RING.COLOR,
|
|
102
|
-
strokeWidth: import_constants.FOCUS_RING.STROKE_WIDTH
|
|
103
|
-
}
|
|
104
|
-
) : null,
|
|
105
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
-
"rect",
|
|
107
|
-
{
|
|
108
|
-
width,
|
|
109
|
-
height,
|
|
110
|
-
y: -y,
|
|
111
|
-
x,
|
|
112
|
-
"aria-label": `${datum.serie} ${xAxis.label || ""} ${xValueFormatted} ${finalYAxis?.label || ""} ${yValueFormatted}`,
|
|
113
|
-
role: "img",
|
|
114
|
-
tabIndex: -1,
|
|
115
|
-
ref: (_ref) => {
|
|
116
|
-
if (isFocused) {
|
|
117
|
-
_ref?.focus();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
|
-
activePoint?.key === id && TooltipRenderer ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
-
import_FocusableRegion.FocusableRegion,
|
|
124
|
-
{
|
|
125
|
-
id,
|
|
126
|
-
y,
|
|
127
|
-
x,
|
|
128
|
-
width,
|
|
129
|
-
height,
|
|
130
|
-
transform,
|
|
131
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipRenderer, { data: [{ name, yValue, xValue, datum }] })
|
|
132
|
-
}
|
|
133
|
-
) : ""
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
) }),
|
|
137
|
-
[
|
|
138
|
-
clipPathSign,
|
|
139
|
-
isFocused,
|
|
42
|
+
var import_styles = require("../styles.js");
|
|
43
|
+
var import_barPath = require("../helpers/barPath.js");
|
|
44
|
+
var import_helpers = require("../helpers/index.js");
|
|
45
|
+
const FOCUS_RING_DISTANCE = import_constants.FOCUS_RING.GAP + import_constants.FOCUS_RING.STROKE_WIDTH / 2;
|
|
46
|
+
const getDataEnd = (isHorizontal, isNegativeValue, isStackEdge) => {
|
|
47
|
+
if (!isStackEdge) return "none";
|
|
48
|
+
if (isHorizontal) return isNegativeValue ? "left" : "right";
|
|
49
|
+
return isNegativeValue ? "bottom" : "top";
|
|
50
|
+
};
|
|
51
|
+
const Rect = import_react.default.memo(
|
|
52
|
+
({ name, width, height, isNegative = false, isStackEdge = true, x = 0, y = 0, id, xValue, yValue, datum }) => {
|
|
53
|
+
const {
|
|
140
54
|
chartId,
|
|
141
|
-
transform,
|
|
142
|
-
handleMouseEnter,
|
|
143
|
-
handleOnMouseLeave,
|
|
144
55
|
isHorizontal,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
xAxis
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
};
|
|
56
|
+
setActivePoint,
|
|
57
|
+
getYValueFormatted,
|
|
58
|
+
getXValueFormatted,
|
|
59
|
+
getOwnerProps,
|
|
60
|
+
containerRef,
|
|
61
|
+
props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis }
|
|
62
|
+
} = (0, import_react.useContext)(import_ChartContext.ChartContext);
|
|
63
|
+
const theme = (0, import_react.useContext)(import_ds_system.ThemeContext);
|
|
64
|
+
const focusRingColor = theme?.colors?.brand?.["700"] ?? import_constants.FOCUS_RING.COLOR;
|
|
65
|
+
const finalYAxis = datum.scale === "y2" ? y2Axis : yAxis;
|
|
66
|
+
const yValueFormatted = getYValueFormatted(datum);
|
|
67
|
+
const xValueFormatted = getXValueFormatted(datum);
|
|
68
|
+
const isFocused = (0, import_chartInteractionStore.useChartInteraction)((state) => state.activePoint?.key === id);
|
|
69
|
+
const clipPathSign = (0, import_react.useMemo)(() => {
|
|
70
|
+
if (isHorizontal) return "";
|
|
71
|
+
if (isNegative) return `url(#rects-negative-${chartId})`;
|
|
72
|
+
return `url(#rects-positive-${chartId})`;
|
|
73
|
+
}, [chartId, isHorizontal, isNegative]);
|
|
74
|
+
const bar = (0, import_react.useMemo)(() => {
|
|
75
|
+
const rawValue = typeof datum.value === "number" ? datum.value : datum.value?.[isHorizontal ? "x" : "y"];
|
|
76
|
+
const isNegativeValue = isNegative || (rawValue ?? 0) < 0;
|
|
77
|
+
if (isHorizontal) {
|
|
78
|
+
const thickness2 = Math.min(height, import_constants.MARKS.BAR_MAX_THICKNESS);
|
|
79
|
+
const dataEnd2 = getDataEnd(true, isNegativeValue, isStackEdge);
|
|
80
|
+
return { x, y: -y + (height - thickness2) / 2, width: Math.max(width, 0), height: thickness2, dataEnd: dataEnd2 };
|
|
81
|
+
}
|
|
82
|
+
const thickness = Math.min(width, import_constants.MARKS.BAR_MAX_THICKNESS);
|
|
83
|
+
const dataEnd = getDataEnd(false, isNegativeValue, isStackEdge);
|
|
84
|
+
return { x: x + (width - thickness) / 2, y, width: thickness, height: Math.max(height, 0), dataEnd };
|
|
85
|
+
}, [datum.value, height, isHorizontal, isNegative, isStackEdge, width, x, y]);
|
|
86
|
+
const handleMouseEnter = (0, import_react.useCallback)(() => {
|
|
87
|
+
if (!scrapper) setActivePoint(datum);
|
|
88
|
+
}, [datum, scrapper, setActivePoint]);
|
|
89
|
+
const handleOnMouseLeave = (0, import_react.useCallback)(() => {
|
|
90
|
+
if (!scrapper) setActivePoint(null);
|
|
91
|
+
}, [scrapper, setActivePoint]);
|
|
92
|
+
return (0, import_react.useMemo)(
|
|
93
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: clipPathSign, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
|
+
import_styles.StyledBarGroup,
|
|
95
|
+
{
|
|
96
|
+
id: isFocused ? `data-focused-${chartId}` : "",
|
|
97
|
+
onMouseEnter: handleMouseEnter,
|
|
98
|
+
onMouseLeave: handleOnMouseLeave,
|
|
99
|
+
getOwnerProps,
|
|
100
|
+
getOwnerPropsArguments: () => ({ datum }),
|
|
101
|
+
children: [
|
|
102
|
+
isFocused ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
"rect",
|
|
104
|
+
{
|
|
105
|
+
x: bar.x - FOCUS_RING_DISTANCE,
|
|
106
|
+
y: bar.y - FOCUS_RING_DISTANCE,
|
|
107
|
+
width: bar.width + FOCUS_RING_DISTANCE * 2,
|
|
108
|
+
height: bar.height + FOCUS_RING_DISTANCE * 2,
|
|
109
|
+
fill: "none",
|
|
110
|
+
rx: import_constants.MARKS.BAR_RADIUS + FOCUS_RING_DISTANCE,
|
|
111
|
+
stroke: focusRingColor,
|
|
112
|
+
strokeWidth: import_constants.FOCUS_RING.STROKE_WIDTH
|
|
113
|
+
}
|
|
114
|
+
) : null,
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
"path",
|
|
117
|
+
{
|
|
118
|
+
d: (0, import_barPath.getBarPath)({ ...bar, radius: import_constants.MARKS.BAR_RADIUS }),
|
|
119
|
+
"aria-label": (0, import_helpers.getDatumLabel)([
|
|
120
|
+
datum.serie,
|
|
121
|
+
xAxis.label,
|
|
122
|
+
xValueFormatted,
|
|
123
|
+
finalYAxis?.label,
|
|
124
|
+
yValueFormatted
|
|
125
|
+
]),
|
|
126
|
+
role: "img",
|
|
127
|
+
tabIndex: -1,
|
|
128
|
+
ref: (_ref) => {
|
|
129
|
+
if (isFocused && containerRef?.contains(document.activeElement)) {
|
|
130
|
+
_ref?.focus();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
isFocused && TooltipRenderer && !scrapper ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
+
import_FocusableRegion.FocusableRegion,
|
|
137
|
+
{
|
|
138
|
+
id,
|
|
139
|
+
y: bar.y,
|
|
140
|
+
x: bar.x,
|
|
141
|
+
width: bar.width,
|
|
142
|
+
height: bar.height,
|
|
143
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipRenderer, { data: [{ name, yValue, xValue, datum }] })
|
|
144
|
+
}
|
|
145
|
+
) : ""
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
) }),
|
|
149
|
+
[
|
|
150
|
+
clipPathSign,
|
|
151
|
+
isFocused,
|
|
152
|
+
chartId,
|
|
153
|
+
handleMouseEnter,
|
|
154
|
+
handleOnMouseLeave,
|
|
155
|
+
bar,
|
|
156
|
+
focusRingColor,
|
|
157
|
+
datum,
|
|
158
|
+
xAxis.label,
|
|
159
|
+
xValueFormatted,
|
|
160
|
+
finalYAxis?.label,
|
|
161
|
+
yValueFormatted,
|
|
162
|
+
id,
|
|
163
|
+
TooltipRenderer,
|
|
164
|
+
scrapper,
|
|
165
|
+
name,
|
|
166
|
+
yValue,
|
|
167
|
+
xValue,
|
|
168
|
+
getOwnerProps,
|
|
169
|
+
containerRef
|
|
170
|
+
]
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
);
|
|
163
174
|
//# sourceMappingURL=Rect.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/graphs/Chart/series/Rect.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { ChartContext } from '../ChartContext.js';\nimport { useChartInteraction } from '../config/chartInteractionStore.js';\nimport { FOCUS_RING, MARKS } from '../../constants.js';\nimport { FocusableRegion } from '../parts/FocusableRegion.js';\nimport { StyledBarGroup } from '../styles.js';\nimport { getBarPath, type BarDataEndT } from '../helpers/barPath.js';\nimport { getDatumLabel } from '../helpers/index.js';\nimport type { DSChartT } from '../../../react-desc-prop-types.js';\ninterface RectProps {\n name: string;\n width: number;\n height: number;\n isNegative?: boolean;\n // false for the inner segments of a stack: only the outer end of a stack is rounded\n isStackEdge?: boolean;\n x?: number;\n y?: number;\n id: string;\n xValue: number;\n yValue: number;\n datum: DSChartT.InternalDatum;\n}\n\n// distance from the bar to the middle of its focus ring stroke: the gap, then half the stroke\nconst FOCUS_RING_DISTANCE = FOCUS_RING.GAP + FOCUS_RING.STROKE_WIDTH / 2;\n\n// the end of the bar away from its baseline; none for the inner segments of a stack\nconst getDataEnd = (isHorizontal: boolean, isNegativeValue: boolean, isStackEdge: boolean): BarDataEndT => {\n if (!isStackEdge) return 'none';\n if (isHorizontal) return isNegativeValue ? 'left' : 'right';\n return isNegativeValue ? 'bottom' : 'top';\n};\n\n// Memoized, like Point: the bars that stay in the window of a scrollable chart skip the render when it moves\nexport const Rect = React.memo<RectProps>(\n ({ name, width, height, isNegative = false, isStackEdge = true, x = 0, y = 0, id, xValue, yValue, datum }) => {\n const {\n chartId,\n isHorizontal,\n setActivePoint,\n getYValueFormatted,\n getXValueFormatted,\n getOwnerProps,\n containerRef,\n props: { TooltipRenderer, scrapper, xAxis, yAxis, y2Axis },\n } = useContext(ChartContext);\n const theme = useContext(ThemeContext);\n const focusRingColor = theme?.colors?.brand?.['700'] ?? FOCUS_RING.COLOR;\n const finalYAxis = datum.scale === 'y2' ? y2Axis : yAxis;\n const yValueFormatted = getYValueFormatted(datum);\n const xValueFormatted = getXValueFormatted(datum);\n\n // its own slice of the hover state: a hover re-renders this bar only when it becomes active or stops being so\n const isFocused = useChartInteraction((state) => state.activePoint?.key === id);\n const clipPathSign = useMemo(() => {\n // @todo horizontal clip paths\n if (isHorizontal) return '';\n if (isNegative) return `url(#rects-negative-${chartId})`;\n return `url(#rects-positive-${chartId})`;\n }, [chartId, isHorizontal, isNegative]);\n\n // The visible bar: as thick as its band allows up to the maximum thickness, centered in the band, with its data end\n // (the end away from the baseline) rounded. The sign comes from the raw value, the stacked ones receive a length.\n const bar = useMemo(() => {\n const rawValue = typeof datum.value === 'number' ? datum.value : datum.value?.[isHorizontal ? 'x' : 'y'];\n const isNegativeValue = isNegative || (rawValue ?? 0) < 0;\n if (isHorizontal) {\n const thickness = Math.min(height, MARKS.BAR_MAX_THICKNESS);\n const dataEnd = getDataEnd(true, isNegativeValue, isStackEdge);\n return { x, y: -y + (height - thickness) / 2, width: Math.max(width, 0), height: thickness, dataEnd };\n }\n const thickness = Math.min(width, MARKS.BAR_MAX_THICKNESS);\n const dataEnd = getDataEnd(false, isNegativeValue, isStackEdge);\n return { x: x + (width - thickness) / 2, y, width: thickness, height: Math.max(height, 0), dataEnd };\n }, [datum.value, height, isHorizontal, isNegative, isStackEdge, width, x, y]);\n\n const handleMouseEnter = useCallback(() => {\n if (!scrapper) setActivePoint(datum);\n }, [datum, scrapper, setActivePoint]);\n\n const handleOnMouseLeave = useCallback(() => {\n if (!scrapper) setActivePoint(null);\n }, [scrapper, setActivePoint]);\n\n return useMemo(\n () => (\n <g clipPath={clipPathSign}>\n <StyledBarGroup\n id={isFocused ? `data-focused-${chartId}` : ''}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={() => ({ datum })}\n >\n {isFocused ? (\n <rect\n x={bar.x - FOCUS_RING_DISTANCE}\n y={bar.y - FOCUS_RING_DISTANCE}\n width={bar.width + FOCUS_RING_DISTANCE * 2}\n height={bar.height + FOCUS_RING_DISTANCE * 2}\n fill=\"none\"\n rx={MARKS.BAR_RADIUS + FOCUS_RING_DISTANCE}\n stroke={focusRingColor}\n strokeWidth={FOCUS_RING.STROKE_WIDTH}\n ></rect>\n ) : null}\n <path\n d={getBarPath({ ...bar, radius: MARKS.BAR_RADIUS })}\n aria-label={getDatumLabel([\n datum.serie,\n xAxis.label,\n xValueFormatted,\n finalYAxis?.label,\n yValueFormatted,\n ])}\n role=\"img\"\n tabIndex={-1}\n ref={(_ref) => {\n // the keyboard focus follows the active point only while it is already in the chart: hovering a bar\n // must not pull the focus away from the rest of the page\n if (isFocused && containerRef?.contains(document.activeElement)) {\n _ref?.focus();\n }\n }}\n ></path>\n {/* with a scrapper, its tooltip shows every series of the position, this one included */}\n {isFocused && TooltipRenderer && !scrapper ? (\n <FocusableRegion\n id={id}\n y={bar.y}\n x={bar.x}\n width={bar.width}\n height={bar.height}\n content={<TooltipRenderer data={[{ name, yValue, xValue, datum }]} />}\n />\n ) : (\n ''\n )}\n </StyledBarGroup>\n </g>\n ),\n [\n clipPathSign,\n isFocused,\n chartId,\n handleMouseEnter,\n handleOnMouseLeave,\n bar,\n focusRingColor,\n datum,\n xAxis.label,\n xValueFormatted,\n finalYAxis?.label,\n yValueFormatted,\n id,\n TooltipRenderer,\n scrapper,\n name,\n yValue,\n xValue,\n getOwnerProps,\n containerRef,\n ],\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0Fb;AAzFV,mBAAwD;AACxD,uBAA6B;AAC7B,0BAA6B;AAC7B,mCAAoC;AACpC,uBAAkC;AAClC,6BAAgC;AAChC,oBAA+B;AAC/B,qBAA6C;AAC7C,qBAA8B;AAkB9B,MAAM,sBAAsB,4BAAW,MAAM,4BAAW,eAAe;AAGvE,MAAM,aAAa,CAAC,cAAuB,iBAA0B,gBAAsC;AACzG,MAAI,CAAC,YAAa,QAAO;AACzB,MAAI,aAAc,QAAO,kBAAkB,SAAS;AACpD,SAAO,kBAAkB,WAAW;AACtC;AAGO,MAAM,OAAO,aAAAA,QAAM;AAAA,EACxB,CAAC,EAAE,MAAM,OAAO,QAAQ,aAAa,OAAO,cAAc,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,QAAQ,QAAQ,MAAM,MAAM;AAC5G,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,EAAE,iBAAiB,UAAU,OAAO,OAAO,OAAO;AAAA,IAC3D,QAAI,yBAAW,gCAAY;AAC3B,UAAM,YAAQ,yBAAW,6BAAY;A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AM,CAAC,EAAE,MAAM,QAAQ,QAAQ,MAAM,CAAC,GAAG;AAAA;AAAA,YACrE,IAEA;AAAA;AAAA;AAAA,MAEJ,GACF;AAAA,MAEF;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,QACA,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React", "thickness", "dataEnd"]
|
|
7
7
|
}
|
|
@@ -36,7 +36,9 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var import_Rect = require("./Rect.js");
|
|
38
38
|
var import_ChartContext = require("../ChartContext.js");
|
|
39
|
+
var import_useSerieDimming = require("../helpers/useSerieDimming.js");
|
|
39
40
|
var import_helpers = require("../helpers/index.js");
|
|
41
|
+
var import_constants = require("../../constants.js");
|
|
40
42
|
const StackedBar = ({ serie }) => {
|
|
41
43
|
const {
|
|
42
44
|
props: { groups },
|
|
@@ -44,6 +46,7 @@ const StackedBar = ({ serie }) => {
|
|
|
44
46
|
yScale,
|
|
45
47
|
stackedData,
|
|
46
48
|
subGroupScale,
|
|
49
|
+
getBandwidth,
|
|
47
50
|
colorScale,
|
|
48
51
|
chartId,
|
|
49
52
|
getXValue,
|
|
@@ -51,16 +54,20 @@ const StackedBar = ({ serie }) => {
|
|
|
51
54
|
} = (0, import_react.useContext)(import_ChartContext.ChartContext);
|
|
52
55
|
const serieWithStackedValues = (0, import_helpers.getStackedData)(stackedData, serie);
|
|
53
56
|
const stackIndex = (0, import_helpers.getStackedIndex)(groups, serie.name);
|
|
54
|
-
|
|
57
|
+
const dimmedStyle = (0, import_useSerieDimming.useSerieDimming)(serie.name);
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: `url(#rect-focus-ring-${chartId})`, style: dimmedStyle, children: serie.data.map((bar, i) => {
|
|
55
59
|
const sequence = serieWithStackedValues ? serieWithStackedValues[bar.position] : [0, 0];
|
|
56
|
-
const
|
|
60
|
+
const isNegativeSegment = sequence[0] < 0;
|
|
61
|
+
const gapBelow = !isNegativeSegment && sequence[0] > 0 ? import_constants.MARKS.STACK_GAP : 0;
|
|
62
|
+
const gapAbove = isNegativeSegment && sequence[1] < 0 ? import_constants.MARKS.STACK_GAP : 0;
|
|
57
63
|
const xValue = getXValue(bar);
|
|
58
64
|
const xScaleValue = getXScaleValue(bar) ?? 0;
|
|
59
65
|
const yValue = sequence[1] - sequence[0];
|
|
60
66
|
const width = subGroupScale?.bandwidth() ?? 0;
|
|
61
|
-
const height = (yScale?.get(sequence[0]) ?? 0) - (yScale?.get(sequence[1]) ?? 0) -
|
|
62
|
-
const transformY = (yScale?.get(sequence[1]) ?? 0) +
|
|
63
|
-
const
|
|
67
|
+
const height = (yScale?.get(sequence[0]) ?? 0) - (yScale?.get(sequence[1]) ?? 0) - gapBelow - gapAbove;
|
|
68
|
+
const transformY = (yScale?.get(sequence[1]) ?? 0) + gapAbove;
|
|
69
|
+
const slotStart = xScale?.type !== "BAND" ? xScaleValue - getBandwidth() / 2 : xScaleValue;
|
|
70
|
+
const transformX = slotStart + (subGroupScale ? subGroupScale(`stacked-data-${stackIndex}`) ?? 0 : 0);
|
|
64
71
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { fill: colorScale(serie.name), transform: `translate(${transformX},0)`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
72
|
import_Rect.Rect,
|
|
66
73
|
{
|
|
@@ -71,7 +78,8 @@ const StackedBar = ({ serie }) => {
|
|
|
71
78
|
y: transformY,
|
|
72
79
|
id: serie.data[i].key,
|
|
73
80
|
name: serie.name,
|
|
74
|
-
datum: bar
|
|
81
|
+
datum: bar,
|
|
82
|
+
isStackEdge: (0, import_helpers.isStackedSegmentEdge)(stackedData, serie, bar.position)
|
|
75
83
|
}
|
|
76
84
|
) }, serie.data[i].key);
|
|
77
85
|
}) });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/graphs/Chart/series/StackedBar.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* prettier-ignore */\nimport React, { useContext } from 'react';\nimport { Rect } from './Rect.js';\nimport { ChartContext } from '../ChartContext.js';\nimport { getStackedData, getStackedIndex } from '../helpers/index.js';\nimport type { DSChartT } from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* prettier-ignore */\nimport React, { useContext } from 'react';\nimport { Rect } from './Rect.js';\nimport { ChartContext } from '../ChartContext.js';\nimport { useSerieDimming } from '../helpers/useSerieDimming.js';\nimport { getStackedData, getStackedIndex, isStackedSegmentEdge } from '../helpers/index.js';\nimport { MARKS } from '../../constants.js';\nimport type { DSChartT } from '../../../react-desc-prop-types.js';\n\nexport const StackedBar: React.ComponentType<DSChartT.SerieComponentT> = ({ serie }) => {\n const {\n props: { groups },\n xScale,\n yScale,\n stackedData,\n subGroupScale,\n getBandwidth,\n colorScale,\n chartId,\n getXValue,\n getXScaleValue,\n } = useContext(ChartContext);\n\n const serieWithStackedValues = getStackedData(stackedData, serie);\n const stackIndex = getStackedIndex(groups, serie.name);\n const dimmedStyle = useSerieDimming(serie.name);\n return (\n <g clipPath={`url(#rect-focus-ring-${chartId})`} style={dimmedStyle}>\n {serie.data.map((bar, i) => {\n const sequence = serieWithStackedValues ? serieWithStackedValues[bar.position] : [0, 0];\n\n // the surface gap sits on the side of the previous segment: below a positive one, above a negative one\n const isNegativeSegment = sequence[0] < 0;\n const gapBelow = !isNegativeSegment && sequence[0] > 0 ? MARKS.STACK_GAP : 0;\n const gapAbove = isNegativeSegment && sequence[1] < 0 ? MARKS.STACK_GAP : 0;\n\n const xValue = getXValue(bar) as number;\n const xScaleValue = getXScaleValue(bar) ?? 0;\n const yValue = sequence[1] - sequence[0];\n const width = subGroupScale?.bandwidth() ?? 0;\n const height =\n (yScale?.get(sequence[0] as never) ?? 0) - (yScale?.get(sequence[1] as never) ?? 0) - gapBelow - gapAbove;\n const transformY = (yScale?.get(sequence[1] as never) ?? 0) + gapAbove;\n\n // the slot of the value, centered on it on a linear or a time axis, with each stack in its place (see Bars)\n const slotStart = xScale?.type !== 'BAND' ? xScaleValue - getBandwidth() / 2 : xScaleValue;\n const transformX = slotStart + (subGroupScale ? (subGroupScale(`stacked-data-${stackIndex}`) ?? 0) : 0);\n return (\n <g key={serie.data[i].key} fill={colorScale(serie.name) as string} transform={`translate(${transformX},0)`}>\n <Rect\n width={width}\n height={height}\n xValue={xValue}\n yValue={yValue}\n y={transformY}\n id={serie.data[i].key}\n name={serie.name}\n datum={bar}\n isStackEdge={isStackedSegmentEdge(stackedData, serie, bar.position)}\n />\n </g>\n );\n })}\n </g>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkDX;AAhDZ,mBAAkC;AAClC,kBAAqB;AACrB,0BAA6B;AAC7B,6BAAgC;AAChC,qBAAsE;AACtE,uBAAsB;AAGf,MAAM,aAA4D,CAAC,EAAE,MAAM,MAAM;AACtF,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,gCAAY;AAE3B,QAA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IACpE,KAXM,MAAM,KAAK,CAAC,EAAE,GAYtB;AAAA,EAEJ,CAAC,GACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,24 +28,31 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var styles_exports = {};
|
|
30
30
|
__export(styles_exports, {
|
|
31
|
-
StyleFocusableRegion: () => StyleFocusableRegion,
|
|
32
31
|
StyledArea: () => StyledArea,
|
|
33
32
|
StyledAxis: () => StyledAxis,
|
|
34
33
|
StyledAxisLabel: () => StyledAxisLabel,
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
StyledBarGroup: () => StyledBarGroup,
|
|
35
|
+
StyledLineGroup: () => StyledLineGroup,
|
|
37
36
|
StyledMouseOverDetectionBox: () => StyledMouseOverDetectionBox,
|
|
37
|
+
StyledPointGroup: () => StyledPointGroup,
|
|
38
|
+
StyledResetter: () => StyledResetter,
|
|
38
39
|
StyledSVGWrapper: () => StyledSVGWrapper,
|
|
39
|
-
StyledTooltipContainer: () => StyledTooltipContainer
|
|
40
|
+
StyledTooltipContainer: () => StyledTooltipContainer,
|
|
41
|
+
StyledZoomInButton: () => StyledZoomInButton,
|
|
42
|
+
StyledZoomOutButton: () => StyledZoomOutButton,
|
|
43
|
+
TOOLTIP_CONTENT_SLOT_PROPS: () => TOOLTIP_CONTENT_SLOT_PROPS
|
|
40
44
|
});
|
|
41
45
|
module.exports = __toCommonJS(styles_exports);
|
|
42
46
|
var React = __toESM(require("react"));
|
|
43
47
|
var import_ds_system = require("@elliemae/ds-system");
|
|
44
|
-
|
|
48
|
+
var import_constants = require("../../constants/index.js");
|
|
49
|
+
const StyledSVGWrapper = (0, import_ds_system.styled)("div", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.ROOT })`
|
|
45
50
|
rect:focus,
|
|
46
51
|
rect:focus-visible,
|
|
47
52
|
circle:focus,
|
|
48
|
-
circle:focus-visible
|
|
53
|
+
circle:focus-visible,
|
|
54
|
+
path:focus,
|
|
55
|
+
path:focus-visible {
|
|
49
56
|
outline: none;
|
|
50
57
|
}
|
|
51
58
|
|
|
@@ -54,51 +61,55 @@ const StyledSVGWrapper = import_ds_system.styled.div`
|
|
|
54
61
|
outline: none;
|
|
55
62
|
}
|
|
56
63
|
|
|
64
|
+
/* the series that step back while a legend item is hovered fade in and out (see useSerieDimming); the roots of the
|
|
65
|
+
series are the groups of the content, or of the groups that tell how each series enters */
|
|
66
|
+
g.content > g,
|
|
67
|
+
g.content > [data-entrance-animation] > g {
|
|
68
|
+
transition: opacity 150ms ease-out;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* a legend item reached with the keyboard, in the color of the focus ring of the data points */
|
|
72
|
+
g.cell:focus-visible {
|
|
73
|
+
outline: 2px solid ${({ theme }) => theme.colors.brand["700"]};
|
|
74
|
+
outline-offset: 2px;
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
cursor: ${({ isGrabbed }) => isGrabbed ? "grabbing" : "default"};
|
|
58
78
|
|
|
59
79
|
text {
|
|
60
|
-
font-size:
|
|
80
|
+
font-size: ${({ theme }) => theme.fontSizes.label[300]};
|
|
61
81
|
}
|
|
62
82
|
|
|
63
83
|
min-width: 300px;
|
|
64
84
|
`;
|
|
65
|
-
const StyledAxis = (0, import_ds_system.styled)("line")`
|
|
66
|
-
stroke-width:
|
|
67
|
-
|
|
85
|
+
const StyledAxis = (0, import_ds_system.styled)("line", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.AXIS_LINE })`
|
|
86
|
+
stroke-width: 1px;
|
|
87
|
+
shape-rendering: crispEdges;
|
|
88
|
+
/* a hairline baseline; the vertical axes rely on their labels and the grid unless they are given a color */
|
|
89
|
+
stroke: ${({ theme, isVertical }) => isVertical ? "transparent" : theme.colors.neutral["300"]};
|
|
68
90
|
${({ axisColor }) => axisColor ? `stroke: ${axisColor}` : ""}
|
|
69
91
|
`;
|
|
70
|
-
const StyledAxisLabel = (0, import_ds_system.styled)("text")`
|
|
71
|
-
font-size: 1rem;
|
|
92
|
+
const StyledAxisLabel = (0, import_ds_system.styled)("text", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.AXIS_LABEL })`
|
|
72
93
|
font-weight: 600;
|
|
94
|
+
fill: ${({ theme }) => theme.colors.neutral["700"]};
|
|
73
95
|
`;
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
opacity: 0.2;
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
const StyleFocusableRegion = import_ds_system.styled.div`
|
|
80
|
-
width: ${({ size = 1 }) => size * 2}px;
|
|
81
|
-
height: ${({ size = 1 }) => size * 2}px;
|
|
82
|
-
outline: none;
|
|
83
|
-
&:focus {
|
|
84
|
-
outline: none;
|
|
85
|
-
}
|
|
86
|
-
`;
|
|
87
|
-
const StyledLine = (0, import_ds_system.styled)("path")`
|
|
88
|
-
fill: none;
|
|
96
|
+
const StyledLineGroup = (0, import_ds_system.styled)("g", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.LINE })``;
|
|
97
|
+
const StyledArea = (0, import_ds_system.styled)("path", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.AREA })`
|
|
89
98
|
stroke-width: 3;
|
|
90
99
|
stroke-linejoin: round;
|
|
91
100
|
`;
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
opacity: 0.2;
|
|
96
|
-
`;
|
|
97
|
-
const StyledTooltipContainer = import_ds_system.styled.div`
|
|
101
|
+
const StyledBarGroup = (0, import_ds_system.styled)("g", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.BAR })``;
|
|
102
|
+
const StyledPointGroup = (0, import_ds_system.styled)("g", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.POINT })``;
|
|
103
|
+
const StyledTooltipContainer = (0, import_ds_system.styled)("div", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.TOOLTIP })`
|
|
98
104
|
max-width: 350px;
|
|
99
105
|
background-color: white;
|
|
106
|
+
border-radius: inherit;
|
|
100
107
|
`;
|
|
101
|
-
const
|
|
108
|
+
const TOOLTIP_CONTENT_SLOT_PROPS = { style: { borderRadius: "4px" } };
|
|
109
|
+
const StyledMouseOverDetectionBox = (0, import_ds_system.styled)("div", {
|
|
110
|
+
name: import_constants.DSDatavizName,
|
|
111
|
+
slot: import_constants.DATAVIZ_SLOTS.TOOLTIP_HOVER_AREA
|
|
112
|
+
})`
|
|
102
113
|
position: absolute;
|
|
103
114
|
top: -15px;
|
|
104
115
|
right: -15px;
|
|
@@ -106,4 +117,24 @@ const StyledMouseOverDetectionBox = import_ds_system.styled.div`
|
|
|
106
117
|
height: calc(100% + 30px);
|
|
107
118
|
z-index: -1;
|
|
108
119
|
`;
|
|
120
|
+
const toolbarButtonStyles = import_ds_system.css`
|
|
121
|
+
cursor: ${({ isDisabled }) => isDisabled ? "not-allowed" : "pointer"};
|
|
122
|
+
opacity: ${({ isDisabled }) => isDisabled ? "0.4" : "1"};
|
|
123
|
+
&:focus {
|
|
124
|
+
outline: none;
|
|
125
|
+
}
|
|
126
|
+
&:focus-visible {
|
|
127
|
+
outline: 2px solid ${({ theme }) => theme.colors.brand["700"]};
|
|
128
|
+
outline-offset: 2px;
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
const StyledResetter = (0, import_ds_system.styled)("g", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.RESET_ZOOM_BUTTON })`
|
|
132
|
+
${toolbarButtonStyles}
|
|
133
|
+
`;
|
|
134
|
+
const StyledZoomInButton = (0, import_ds_system.styled)("g", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.ZOOM_IN_BUTTON })`
|
|
135
|
+
${toolbarButtonStyles}
|
|
136
|
+
`;
|
|
137
|
+
const StyledZoomOutButton = (0, import_ds_system.styled)("g", { name: import_constants.DSDatavizName, slot: import_constants.DATAVIZ_SLOTS.ZOOM_OUT_BUTTON })`
|
|
138
|
+
${toolbarButtonStyles}
|
|
139
|
+
`;
|
|
109
140
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/graphs/Chart/styles.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\n\ninterface StyledAxisT {\n axisColor: string;\n}\nexport const StyledSVGWrapper = styled.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { css, styled } from '@elliemae/ds-system';\nimport { DATAVIZ_SLOTS, DSDatavizName } from '../../constants/index.js';\n\ninterface StyledAxisT {\n axisColor: string;\n isVertical: boolean;\n}\nexport const StyledSVGWrapper = styled('div', { name: DSDatavizName, slot: DATAVIZ_SLOTS.ROOT })<{\n isGrabbed: boolean;\n}>`\n rect:focus,\n rect:focus-visible,\n circle:focus,\n circle:focus-visible,\n path:focus,\n path:focus-visible {\n outline: none;\n }\n\n :focus,\n :focus-visible {\n outline: none;\n }\n\n /* the series that step back while a legend item is hovered fade in and out (see useSerieDimming); the roots of the\n series are the groups of the content, or of the groups that tell how each series enters */\n g.content > g,\n g.content > [data-entrance-animation] > g {\n transition: opacity 150ms ease-out;\n }\n\n /* a legend item reached with the keyboard, in the color of the focus ring of the data points */\n g.cell:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand['700']};\n outline-offset: 2px;\n }\n\n cursor: ${({ isGrabbed }) => (isGrabbed ? 'grabbing' : 'default')};\n\n text {\n font-size: ${({ theme }) => theme.fontSizes.label[300]};\n }\n\n min-width: 300px;\n`;\n\nexport const StyledAxis = styled('line', { name: DSDatavizName, slot: DATAVIZ_SLOTS.AXIS_LINE })<StyledAxisT>`\n stroke-width: 1px;\n shape-rendering: crispEdges;\n /* a hairline baseline; the vertical axes rely on their labels and the grid unless they are given a color */\n stroke: ${({ theme, isVertical }) => (isVertical ? 'transparent' : theme.colors.neutral['300'])};\n ${({ axisColor }) => (axisColor ? `stroke: ${axisColor}` : '')}\n`;\n\nexport const StyledAxisLabel = styled('text', { name: DSDatavizName, slot: DATAVIZ_SLOTS.AXIS_LABEL })`\n font-weight: 600;\n fill: ${({ theme }) => theme.colors.neutral['700']};\n`;\n\n// the line series is drawn with d3 inside this group, so the group is the slot\nexport const StyledLineGroup = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.LINE })``;\n\n// filled with a vertical gradient of the series color (see Area), so overlapping areas stay readable\nexport const StyledArea = styled('path', { name: DSDatavizName, slot: DATAVIZ_SLOTS.AREA })`\n stroke-width: 3;\n stroke-linejoin: round;\n`;\n\nexport const StyledBarGroup = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.BAR })``;\n\nexport const StyledPointGroup = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.POINT })``;\n\nexport const StyledTooltipContainer = styled('div', { name: DSDatavizName, slot: DATAVIZ_SLOTS.TOOLTIP })`\n max-width: 350px;\n background-color: white;\n border-radius: inherit;\n`;\n\n// slot props for the content box of the floating wrapper, the box that carries the tooltip shadow: rounded corners\nexport const TOOLTIP_CONTENT_SLOT_PROPS = { style: { borderRadius: '4px' } };\n\nexport const StyledMouseOverDetectionBox = styled('div', {\n name: DSDatavizName,\n slot: DATAVIZ_SLOTS.TOOLTIP_HOVER_AREA,\n})`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\n// the buttons of the zoom toolbar: a disabled one fades and keeps its place; the focus ring is the one of the data\n// points (the \"&focus\" selector it had matched nothing, so the buttons showed no focus)\nconst toolbarButtonStyles = css<{ isDisabled: boolean }>`\n cursor: ${({ isDisabled }) => (isDisabled ? 'not-allowed' : 'pointer')};\n opacity: ${({ isDisabled }) => (isDisabled ? '0.4' : '1')};\n &:focus {\n outline: none;\n }\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand['700']};\n outline-offset: 2px;\n }\n`;\n\nexport const StyledResetter = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.RESET_ZOOM_BUTTON })<{\n isDisabled: boolean;\n}>`\n ${toolbarButtonStyles}\n`;\n\nexport const StyledZoomInButton = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.ZOOM_IN_BUTTON })<{\n isDisabled: boolean;\n}>`\n ${toolbarButtonStyles}\n`;\n\nexport const StyledZoomOutButton = styled('g', { name: DSDatavizName, slot: DATAVIZ_SLOTS.ZOOM_OUT_BUTTON })<{\n isDisabled: boolean;\n}>`\n ${toolbarButtonStyles}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA4B;AAC5B,uBAA6C;AAMtC,MAAM,uBAAmB,yBAAO,OAAO,EAAE,MAAM,gCAAe,MAAM,+BAAc,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBA0BtE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA,YAIrD,CAAC,EAAE,UAAU,MA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