@mui/x-charts 8.0.0-beta.1 → 8.0.0-beta.3
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/BarChart/AnimatedBarElement.d.ts +38 -8
- package/BarChart/AnimatedBarElement.js +5 -5
- package/BarChart/BarChart.js +2 -0
- package/BarChart/BarClipPath.d.ts +19 -1
- package/BarChart/BarClipPath.js +84 -17
- package/BarChart/BarElement.d.ts +9 -20
- package/BarChart/BarElement.js +29 -26
- package/BarChart/BarLabel/BarLabel.d.ts +27 -854
- package/BarChart/BarLabel/BarLabel.js +32 -5
- package/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
- package/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
- package/BarChart/BarLabel/BarLabelItem.js +18 -6
- package/BarChart/BarLabel/BarLabelPlot.js +16 -46
- package/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
- package/BarChart/BarLabel/barLabelClasses.js +4 -3
- package/BarChart/BarPlot.js +37 -61
- package/BarChart/barElementClasses.d.ts +21 -0
- package/BarChart/barElementClasses.js +29 -0
- package/BarChart/getRadius.d.ts +1 -1
- package/BarChart/index.d.ts +2 -1
- package/BarChart/index.js +11 -0
- package/BarChart/seriesConfig/index.js +3 -1
- package/BarChart/seriesConfig/tooltip.d.ts +2 -1
- package/BarChart/seriesConfig/tooltip.js +14 -1
- package/BarChart/types.d.ts +2 -2
- package/BarChart/useBarChartProps.d.ts +2 -1
- package/BarChart/useBarChartProps.js +20 -13
- package/CHANGELOG.md +235 -0
- package/ChartContainer/ChartContainer.js +4 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
- package/ChartsLabel/ChartsLabelMark.js +0 -4
- package/ChartsLabel/index.d.ts +1 -0
- package/ChartsLabel/index.js +7 -0
- package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/ChartsTooltip/ChartsTooltip.js +2 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +4 -8
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
- package/ChartsTooltip/ChartsTooltipTable.js +24 -9
- package/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
- package/ChartsTooltip/chartsTooltipClasses.js +2 -2
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +12 -0
- package/ChartsTooltip/useAxesTooltip.d.ts +7 -0
- package/ChartsTooltip/useAxesTooltip.js +18 -0
- package/ChartsTooltip/useAxisTooltip.d.ts +24 -3
- package/ChartsTooltip/useAxisTooltip.js +72 -38
- package/ChartsTooltip/useItemTooltip.js +4 -1
- package/ChartsXAxis/ChartsXAxis.js +5 -2
- package/ChartsYAxis/ChartsYAxis.js +69 -17
- package/LineChart/AnimatedArea.js +5 -22
- package/LineChart/AnimatedLine.d.ts +1 -4
- package/LineChart/AnimatedLine.js +10 -25
- package/LineChart/AppearingMask.d.ts +5 -0
- package/LineChart/AppearingMask.js +25 -18
- package/LineChart/CircleMarkElement.js +17 -23
- package/LineChart/LineChart.js +2 -0
- package/LineChart/LineHighlightPlot.js +3 -4
- package/LineChart/MarkElement.js +16 -27
- package/LineChart/MarkPlot.js +0 -1
- package/LineChart/markElementClasses.d.ts +3 -0
- package/LineChart/markElementClasses.js +4 -3
- package/LineChart/seriesConfig/index.js +3 -1
- package/LineChart/seriesConfig/tooltip.d.ts +2 -1
- package/LineChart/seriesConfig/tooltip.js +8 -1
- package/LineChart/useLineChartProps.d.ts +2 -1
- package/LineChart/useLineChartProps.js +7 -4
- package/PieChart/PieArc.d.ts +19 -11
- package/PieChart/PieArc.js +37 -24
- package/PieChart/PieArcLabel.d.ts +22 -13
- package/PieChart/PieArcLabel.js +52 -48
- package/PieChart/PieArcLabelPlot.js +16 -34
- package/PieChart/PieArcPlot.js +21 -34
- package/PieChart/seriesConfig/tooltip.js +3 -0
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
- package/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
- package/RadarChart/RadarGrid/RadarGrid.js +5 -1
- package/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
- package/RadarChart/RadarGrid/useRadarGridData.js +3 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/ScatterChart/ScatterChart.js +2 -0
- package/ScatterChart/useScatterChartProps.d.ts +2 -1
- package/ScatterChart/useScatterChartProps.js +6 -3
- package/SparkLineChart/SparkLineChart.js +2 -0
- package/colorPalettes/colorPalettes.js +2 -2
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/context/AnimationProvider/AnimationProvider.js +4 -6
- package/esm/BarChart/AnimatedBarElement.d.ts +38 -8
- package/esm/BarChart/AnimatedBarElement.js +5 -5
- package/esm/BarChart/BarChart.js +2 -0
- package/esm/BarChart/BarClipPath.d.ts +19 -1
- package/esm/BarChart/BarClipPath.js +84 -17
- package/esm/BarChart/BarElement.d.ts +9 -20
- package/esm/BarChart/BarElement.js +28 -23
- package/esm/BarChart/BarLabel/BarLabel.d.ts +27 -854
- package/esm/BarChart/BarLabel/BarLabel.js +32 -5
- package/esm/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +18 -6
- package/esm/BarChart/BarLabel/BarLabelPlot.js +16 -46
- package/esm/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
- package/esm/BarChart/BarLabel/barLabelClasses.js +4 -3
- package/esm/BarChart/BarPlot.js +37 -61
- package/esm/BarChart/barElementClasses.d.ts +21 -0
- package/esm/BarChart/barElementClasses.js +19 -0
- package/esm/BarChart/getRadius.d.ts +1 -1
- package/esm/BarChart/index.d.ts +2 -1
- package/esm/BarChart/index.js +2 -1
- package/esm/BarChart/seriesConfig/index.js +2 -1
- package/esm/BarChart/seriesConfig/tooltip.d.ts +2 -1
- package/esm/BarChart/seriesConfig/tooltip.js +12 -0
- package/esm/BarChart/types.d.ts +2 -2
- package/esm/BarChart/useBarChartProps.d.ts +2 -1
- package/esm/BarChart/useBarChartProps.js +19 -13
- package/esm/ChartContainer/ChartContainer.js +4 -0
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
- package/esm/ChartsLabel/ChartsLabelMark.js +0 -4
- package/esm/ChartsLabel/index.d.ts +1 -0
- package/esm/ChartsLabel/index.js +1 -0
- package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +5 -9
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.js +23 -9
- package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
- package/esm/ChartsTooltip/chartsTooltipClasses.js +2 -2
- package/esm/ChartsTooltip/index.d.ts +1 -0
- package/esm/ChartsTooltip/index.js +1 -0
- package/esm/ChartsTooltip/useAxesTooltip.d.ts +7 -0
- package/esm/ChartsTooltip/useAxesTooltip.js +12 -0
- package/esm/ChartsTooltip/useAxisTooltip.d.ts +24 -3
- package/esm/ChartsTooltip/useAxisTooltip.js +72 -38
- package/esm/ChartsTooltip/useItemTooltip.js +4 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +5 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +69 -17
- package/esm/LineChart/AnimatedArea.js +5 -22
- package/esm/LineChart/AnimatedLine.d.ts +1 -4
- package/esm/LineChart/AnimatedLine.js +9 -24
- package/esm/LineChart/AppearingMask.d.ts +5 -0
- package/esm/LineChart/AppearingMask.js +23 -18
- package/esm/LineChart/CircleMarkElement.js +19 -25
- package/esm/LineChart/LineChart.js +2 -0
- package/esm/LineChart/LineHighlightPlot.js +3 -4
- package/esm/LineChart/MarkElement.js +17 -28
- package/esm/LineChart/MarkPlot.js +0 -1
- package/esm/LineChart/markElementClasses.d.ts +3 -0
- package/esm/LineChart/markElementClasses.js +4 -3
- package/esm/LineChart/seriesConfig/index.js +2 -1
- package/esm/LineChart/seriesConfig/tooltip.d.ts +2 -1
- package/esm/LineChart/seriesConfig/tooltip.js +6 -0
- package/esm/LineChart/useLineChartProps.d.ts +2 -1
- package/esm/LineChart/useLineChartProps.js +6 -4
- package/esm/PieChart/PieArc.d.ts +19 -11
- package/esm/PieChart/PieArc.js +36 -23
- package/esm/PieChart/PieArcLabel.d.ts +22 -13
- package/esm/PieChart/PieArcLabel.js +51 -47
- package/esm/PieChart/PieArcLabelPlot.js +16 -34
- package/esm/PieChart/PieArcPlot.js +21 -34
- package/esm/PieChart/seriesConfig/tooltip.js +3 -0
- package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
- package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
- package/esm/RadarChart/RadarGrid/RadarGrid.js +5 -1
- package/esm/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
- package/esm/RadarChart/RadarGrid/useRadarGridData.js +3 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/esm/ScatterChart/ScatterChart.js +2 -0
- package/esm/ScatterChart/useScatterChartProps.d.ts +2 -1
- package/esm/ScatterChart/useScatterChartProps.js +5 -3
- package/esm/SparkLineChart/SparkLineChart.js +2 -0
- package/esm/colorPalettes/colorPalettes.js +2 -2
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/context/AnimationProvider/AnimationProvider.js +3 -6
- package/esm/hooks/animation/index.d.ts +6 -0
- package/esm/hooks/animation/index.js +6 -0
- package/esm/hooks/animation/useAnimateArea.d.ts +15 -0
- package/esm/hooks/animation/useAnimateArea.js +27 -0
- package/esm/hooks/animation/useAnimateBar.d.ts +17 -0
- package/esm/hooks/animation/useAnimateBar.js +56 -0
- package/esm/hooks/animation/useAnimateBarLabel.d.ts +19 -0
- package/esm/hooks/animation/useAnimateBarLabel.js +59 -0
- package/esm/hooks/animation/useAnimateLine.d.ts +14 -0
- package/esm/hooks/animation/useAnimateLine.js +26 -0
- package/esm/hooks/animation/useAnimatePieArc.d.ts +15 -0
- package/esm/hooks/animation/useAnimatePieArc.js +70 -0
- package/esm/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
- package/esm/hooks/animation/useAnimatePieArcLabel.js +72 -0
- package/esm/hooks/index.d.ts +2 -1
- package/esm/hooks/index.js +2 -1
- package/esm/hooks/useAxis.d.ts +5 -5
- package/esm/hooks/useInteractionItemProps.js +11 -0
- package/esm/hooks/useScale.d.ts +2 -2
- package/esm/hooks/useScale.js +2 -2
- package/esm/index.js +1 -1
- package/esm/internals/animation/Transition.d.ts +37 -0
- package/esm/internals/animation/Transition.js +83 -0
- package/esm/internals/animation/animation.d.ts +4 -0
- package/esm/internals/animation/animation.js +4 -0
- package/esm/internals/animation/useAnimate.d.ts +19 -0
- package/esm/internals/animation/useAnimate.js +74 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +8 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +28 -22
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +9 -42
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +75 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +4 -10
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +8 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +18 -13
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +22 -0
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
- package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
- package/esm/internals/shallowEqual.d.ts +8 -0
- package/esm/internals/shallowEqual.js +31 -0
- package/esm/models/axis.d.ts +8 -0
- package/esm/themeAugmentation/overrides.d.ts +1 -1
- package/hooks/animation/index.d.ts +6 -0
- package/hooks/animation/index.js +71 -0
- package/hooks/animation/useAnimateArea.d.ts +15 -0
- package/hooks/animation/useAnimateArea.js +34 -0
- package/hooks/animation/useAnimateBar.d.ts +17 -0
- package/hooks/animation/useAnimateBar.js +62 -0
- package/hooks/animation/useAnimateBarLabel.d.ts +19 -0
- package/hooks/animation/useAnimateBarLabel.js +65 -0
- package/hooks/animation/useAnimateLine.d.ts +14 -0
- package/hooks/animation/useAnimateLine.js +33 -0
- package/hooks/animation/useAnimatePieArc.d.ts +15 -0
- package/hooks/animation/useAnimatePieArc.js +77 -0
- package/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
- package/hooks/animation/useAnimatePieArcLabel.js +79 -0
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +13 -1
- package/hooks/useAxis.d.ts +5 -5
- package/hooks/useInteractionItemProps.js +11 -0
- package/hooks/useScale.d.ts +2 -2
- package/hooks/useScale.js +2 -2
- package/index.js +1 -1
- package/internals/animation/Transition.d.ts +37 -0
- package/internals/animation/Transition.js +89 -0
- package/internals/animation/animation.d.ts +4 -0
- package/internals/animation/animation.js +11 -0
- package/internals/animation/useAnimate.d.ts +19 -0
- package/internals/animation/useAnimate.js +80 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +28 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +8 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +29 -22
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +7 -40
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +81 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +5 -11
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +17 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +19 -13
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +28 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
- package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
- package/internals/shallowEqual.d.ts +8 -0
- package/internals/shallowEqual.js +37 -0
- package/models/axis.d.ts +8 -0
- package/modern/BarChart/AnimatedBarElement.d.ts +38 -8
- package/modern/BarChart/AnimatedBarElement.js +5 -5
- package/modern/BarChart/BarChart.js +2 -0
- package/modern/BarChart/BarClipPath.d.ts +19 -1
- package/modern/BarChart/BarClipPath.js +84 -17
- package/modern/BarChart/BarElement.d.ts +9 -20
- package/modern/BarChart/BarElement.js +28 -23
- package/modern/BarChart/BarLabel/BarLabel.d.ts +27 -854
- package/modern/BarChart/BarLabel/BarLabel.js +32 -5
- package/modern/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
- package/modern/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
- package/modern/BarChart/BarLabel/BarLabelItem.js +18 -6
- package/modern/BarChart/BarLabel/BarLabelPlot.js +16 -46
- package/modern/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
- package/modern/BarChart/BarLabel/barLabelClasses.js +4 -3
- package/modern/BarChart/BarPlot.js +37 -61
- package/modern/BarChart/barElementClasses.d.ts +21 -0
- package/modern/BarChart/barElementClasses.js +19 -0
- package/modern/BarChart/getRadius.d.ts +1 -1
- package/modern/BarChart/index.d.ts +2 -1
- package/modern/BarChart/index.js +2 -1
- package/modern/BarChart/seriesConfig/index.js +2 -1
- package/modern/BarChart/seriesConfig/tooltip.d.ts +2 -1
- package/modern/BarChart/seriesConfig/tooltip.js +12 -0
- package/modern/BarChart/types.d.ts +2 -2
- package/modern/BarChart/useBarChartProps.d.ts +2 -1
- package/modern/BarChart/useBarChartProps.js +19 -13
- package/modern/ChartContainer/ChartContainer.js +4 -0
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
- package/modern/ChartsLabel/ChartsLabelMark.js +0 -4
- package/modern/ChartsLabel/index.d.ts +1 -0
- package/modern/ChartsLabel/index.js +1 -0
- package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +5 -9
- package/modern/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
- package/modern/ChartsTooltip/ChartsTooltipTable.js +23 -9
- package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
- package/modern/ChartsTooltip/chartsTooltipClasses.js +2 -2
- package/modern/ChartsTooltip/index.d.ts +1 -0
- package/modern/ChartsTooltip/index.js +1 -0
- package/modern/ChartsTooltip/useAxesTooltip.d.ts +7 -0
- package/modern/ChartsTooltip/useAxesTooltip.js +12 -0
- package/modern/ChartsTooltip/useAxisTooltip.d.ts +24 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +72 -38
- package/modern/ChartsTooltip/useItemTooltip.js +4 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +5 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +69 -17
- package/modern/LineChart/AnimatedArea.js +5 -22
- package/modern/LineChart/AnimatedLine.d.ts +1 -4
- package/modern/LineChart/AnimatedLine.js +9 -24
- package/modern/LineChart/AppearingMask.d.ts +5 -0
- package/modern/LineChart/AppearingMask.js +23 -18
- package/modern/LineChart/CircleMarkElement.js +19 -25
- package/modern/LineChart/LineChart.js +2 -0
- package/modern/LineChart/LineHighlightPlot.js +3 -4
- package/modern/LineChart/MarkElement.js +17 -28
- package/modern/LineChart/MarkPlot.js +0 -1
- package/modern/LineChart/markElementClasses.d.ts +3 -0
- package/modern/LineChart/markElementClasses.js +4 -3
- package/modern/LineChart/seriesConfig/index.js +2 -1
- package/modern/LineChart/seriesConfig/tooltip.d.ts +2 -1
- package/modern/LineChart/seriesConfig/tooltip.js +6 -0
- package/modern/LineChart/useLineChartProps.d.ts +2 -1
- package/modern/LineChart/useLineChartProps.js +6 -4
- package/modern/PieChart/PieArc.d.ts +19 -11
- package/modern/PieChart/PieArc.js +36 -23
- package/modern/PieChart/PieArcLabel.d.ts +22 -13
- package/modern/PieChart/PieArcLabel.js +51 -47
- package/modern/PieChart/PieArcLabelPlot.js +16 -34
- package/modern/PieChart/PieArcPlot.js +21 -34
- package/modern/PieChart/seriesConfig/tooltip.js +3 -0
- package/modern/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
- package/modern/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
- package/modern/RadarChart/RadarGrid/RadarGrid.js +5 -1
- package/modern/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
- package/modern/RadarChart/RadarGrid/useRadarGridData.js +3 -0
- package/modern/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/modern/ScatterChart/ScatterChart.js +2 -0
- package/modern/ScatterChart/useScatterChartProps.d.ts +2 -1
- package/modern/ScatterChart/useScatterChartProps.js +5 -3
- package/modern/SparkLineChart/SparkLineChart.js +2 -0
- package/modern/colorPalettes/colorPalettes.js +2 -2
- package/modern/constants/index.d.ts +1 -1
- package/modern/constants/index.js +1 -1
- package/modern/context/AnimationProvider/AnimationProvider.js +3 -6
- package/modern/hooks/animation/index.d.ts +6 -0
- package/modern/hooks/animation/index.js +6 -0
- package/modern/hooks/animation/useAnimateArea.d.ts +15 -0
- package/modern/hooks/animation/useAnimateArea.js +27 -0
- package/modern/hooks/animation/useAnimateBar.d.ts +17 -0
- package/modern/hooks/animation/useAnimateBar.js +56 -0
- package/modern/hooks/animation/useAnimateBarLabel.d.ts +19 -0
- package/modern/hooks/animation/useAnimateBarLabel.js +59 -0
- package/modern/hooks/animation/useAnimateLine.d.ts +14 -0
- package/modern/hooks/animation/useAnimateLine.js +26 -0
- package/modern/hooks/animation/useAnimatePieArc.d.ts +15 -0
- package/modern/hooks/animation/useAnimatePieArc.js +70 -0
- package/modern/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
- package/modern/hooks/animation/useAnimatePieArcLabel.js +72 -0
- package/modern/hooks/index.d.ts +2 -1
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/useAxis.d.ts +5 -5
- package/modern/hooks/useInteractionItemProps.js +11 -0
- package/modern/hooks/useScale.d.ts +2 -2
- package/modern/hooks/useScale.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internals/animation/Transition.d.ts +37 -0
- package/modern/internals/animation/Transition.js +83 -0
- package/modern/internals/animation/animation.d.ts +4 -0
- package/modern/internals/animation/animation.js +4 -0
- package/modern/internals/animation/useAnimate.d.ts +19 -0
- package/modern/internals/animation/useAnimate.js +74 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +8 -6
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +28 -22
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +9 -42
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +75 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +4 -10
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +8 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +18 -13
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +22 -0
- package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
- package/modern/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
- package/modern/internals/shallowEqual.d.ts +8 -0
- package/modern/internals/shallowEqual.js +31 -0
- package/modern/models/axis.d.ts +8 -0
- package/modern/themeAugmentation/overrides.d.ts +1 -1
- package/package.json +8 -9
- package/themeAugmentation/overrides.d.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/PieChart/dataTransform/transition.d.ts +0 -4
- package/PieChart/dataTransform/transition.js +0 -145
- package/esm/PieChart/dataTransform/transition.d.ts +0 -4
- package/esm/PieChart/dataTransform/transition.js +0 -137
- package/modern/PieChart/dataTransform/transition.d.ts +0 -4
- package/modern/PieChart/dataTransform/transition.js +0 -137
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
|
|
5
|
+
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
|
-
import { animated } from '@react-spring/web';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
9
|
+
import { useAnimateBarLabel } from "../../hooks/animation/useAnimateBarLabel.js";
|
|
10
10
|
import { barLabelClasses } from "./barLabelClasses.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export const BarLabelComponent = styled(
|
|
12
|
+
export const BarLabelComponent = styled('text', {
|
|
13
13
|
name: 'MuiBarLabel',
|
|
14
14
|
slot: 'Root',
|
|
15
15
|
overridesResolver: (_, styles) => [{
|
|
@@ -37,7 +37,8 @@ function BarLabel(inProps) {
|
|
|
37
37
|
name: 'MuiBarLabel'
|
|
38
38
|
});
|
|
39
39
|
const otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
|
-
|
|
40
|
+
const animatedProps = useAnimateBarLabel(props);
|
|
41
|
+
return /*#__PURE__*/_jsx(BarLabelComponent, _extends({}, otherProps, animatedProps));
|
|
41
42
|
}
|
|
42
43
|
process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
43
44
|
// ----------------------------- Warning --------------------------------
|
|
@@ -46,8 +47,34 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
|
46
47
|
// ----------------------------------------------------------------------
|
|
47
48
|
classes: PropTypes.object,
|
|
48
49
|
dataIndex: PropTypes.number.isRequired,
|
|
50
|
+
/**
|
|
51
|
+
* Height of the bar this label belongs to.
|
|
52
|
+
*/
|
|
53
|
+
height: PropTypes.number.isRequired,
|
|
49
54
|
isFaded: PropTypes.bool.isRequired,
|
|
50
55
|
isHighlighted: PropTypes.bool.isRequired,
|
|
51
|
-
|
|
56
|
+
layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
|
|
57
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
58
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
59
|
+
/**
|
|
60
|
+
* Width of the bar this label belongs to.
|
|
61
|
+
*/
|
|
62
|
+
width: PropTypes.number.isRequired,
|
|
63
|
+
/**
|
|
64
|
+
* Position in the x-axis of the bar this label belongs to.
|
|
65
|
+
*/
|
|
66
|
+
x: PropTypes.number.isRequired,
|
|
67
|
+
/**
|
|
68
|
+
* The x-coordinate of the stack this bar label belongs to.
|
|
69
|
+
*/
|
|
70
|
+
xOrigin: PropTypes.number.isRequired,
|
|
71
|
+
/**
|
|
72
|
+
* Position in the y-axis of the bar this label belongs to.
|
|
73
|
+
*/
|
|
74
|
+
y: PropTypes.number.isRequired,
|
|
75
|
+
/**
|
|
76
|
+
* The y-coordinate of the stack this bar label belongs to.
|
|
77
|
+
*/
|
|
78
|
+
yOrigin: PropTypes.number.isRequired
|
|
52
79
|
} : void 0;
|
|
53
80
|
export { BarLabel };
|
|
@@ -23,6 +23,22 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
|
|
|
23
23
|
* @default {}
|
|
24
24
|
*/
|
|
25
25
|
slots?: BarLabelSlots;
|
|
26
|
+
/**
|
|
27
|
+
* The position in the x-axis of the stack this bar label belongs to.
|
|
28
|
+
*/
|
|
29
|
+
xOrigin: number;
|
|
30
|
+
/**
|
|
31
|
+
* The position in the y-axis of the stack this bar label belongs to.
|
|
32
|
+
*/
|
|
33
|
+
yOrigin: number;
|
|
34
|
+
/**
|
|
35
|
+
* The position of the bar in the x-axis.
|
|
36
|
+
*/
|
|
37
|
+
x: number;
|
|
38
|
+
/**
|
|
39
|
+
* The position of the bar in the y-axis.
|
|
40
|
+
*/
|
|
41
|
+
y: number;
|
|
26
42
|
/**
|
|
27
43
|
* The height of the bar.
|
|
28
44
|
*/
|
|
@@ -31,10 +47,18 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
|
|
|
31
47
|
* The width of the bar.
|
|
32
48
|
*/
|
|
33
49
|
width: number;
|
|
50
|
+
/**
|
|
51
|
+
* The orientation of the bar.
|
|
52
|
+
*/
|
|
53
|
+
layout: 'vertical' | 'horizontal';
|
|
34
54
|
/**
|
|
35
55
|
* The value of the data point.
|
|
36
56
|
*/
|
|
37
57
|
value: number | null;
|
|
58
|
+
/**
|
|
59
|
+
* If true, no animations should be applied.
|
|
60
|
+
*/
|
|
61
|
+
skipAnimation: boolean;
|
|
38
62
|
/**
|
|
39
63
|
* If provided, the function will be used to format the label of the bar.
|
|
40
64
|
* It can be set to 'value' to display the current value.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId", "classes", "color", "
|
|
3
|
+
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
@@ -18,14 +18,19 @@ function BarLabelItem(props) {
|
|
|
18
18
|
seriesId,
|
|
19
19
|
classes: innerClasses,
|
|
20
20
|
color,
|
|
21
|
-
style,
|
|
22
21
|
dataIndex,
|
|
23
22
|
barLabel,
|
|
24
23
|
slots,
|
|
25
24
|
slotProps,
|
|
26
|
-
|
|
25
|
+
xOrigin,
|
|
26
|
+
yOrigin,
|
|
27
|
+
x,
|
|
28
|
+
y,
|
|
27
29
|
width,
|
|
28
|
-
|
|
30
|
+
height,
|
|
31
|
+
value,
|
|
32
|
+
skipAnimation,
|
|
33
|
+
layout
|
|
29
34
|
} = props,
|
|
30
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
36
|
const {
|
|
@@ -41,7 +46,9 @@ function BarLabelItem(props) {
|
|
|
41
46
|
color,
|
|
42
47
|
isFaded,
|
|
43
48
|
isHighlighted,
|
|
44
|
-
dataIndex
|
|
49
|
+
dataIndex,
|
|
50
|
+
skipAnimation,
|
|
51
|
+
layout
|
|
45
52
|
};
|
|
46
53
|
const classes = useUtilityClasses(ownerState);
|
|
47
54
|
const Component = slots?.barLabel ?? BarLabel;
|
|
@@ -49,7 +56,12 @@ function BarLabelItem(props) {
|
|
|
49
56
|
elementType: Component,
|
|
50
57
|
externalSlotProps: slotProps?.barLabel,
|
|
51
58
|
additionalProps: _extends({}, other, {
|
|
52
|
-
|
|
59
|
+
xOrigin,
|
|
60
|
+
yOrigin,
|
|
61
|
+
x,
|
|
62
|
+
y,
|
|
63
|
+
width,
|
|
64
|
+
height,
|
|
53
65
|
className: classes.root
|
|
54
66
|
}),
|
|
55
67
|
ownerState
|
|
@@ -1,40 +1,9 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["bars", "skipAnimation"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { useTransition } from '@react-spring/web';
|
|
6
5
|
import { BarLabelItem } from "./BarLabelItem.js";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const leaveStyle = ({
|
|
9
|
-
layout,
|
|
10
|
-
yOrigin,
|
|
11
|
-
x,
|
|
12
|
-
width,
|
|
13
|
-
y,
|
|
14
|
-
xOrigin,
|
|
15
|
-
height
|
|
16
|
-
}) => _extends({}, layout === 'vertical' ? {
|
|
17
|
-
y: yOrigin,
|
|
18
|
-
x: x + width / 2,
|
|
19
|
-
height: 0,
|
|
20
|
-
width
|
|
21
|
-
} : {
|
|
22
|
-
y: y + height / 2,
|
|
23
|
-
x: xOrigin,
|
|
24
|
-
height,
|
|
25
|
-
width: 0
|
|
26
|
-
});
|
|
27
|
-
const enterStyle = ({
|
|
28
|
-
x,
|
|
29
|
-
width,
|
|
30
|
-
y,
|
|
31
|
-
height
|
|
32
|
-
}) => ({
|
|
33
|
-
x: x + width / 2,
|
|
34
|
-
y: y + height / 2,
|
|
35
|
-
height,
|
|
36
|
-
width
|
|
37
|
-
});
|
|
38
7
|
/**
|
|
39
8
|
* @ignore - internal component.
|
|
40
9
|
*/
|
|
@@ -44,32 +13,33 @@ function BarLabelPlot(props) {
|
|
|
44
13
|
skipAnimation
|
|
45
14
|
} = props,
|
|
46
15
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
|
-
const barLabelTransition = useTransition(bars, {
|
|
48
|
-
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
49
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
50
|
-
leave: null,
|
|
51
|
-
enter: enterStyle,
|
|
52
|
-
update: enterStyle,
|
|
53
|
-
immediate: skipAnimation
|
|
54
|
-
});
|
|
55
16
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
56
|
-
children:
|
|
17
|
+
children: bars.map(({
|
|
18
|
+
xOrigin,
|
|
19
|
+
yOrigin,
|
|
20
|
+
x,
|
|
21
|
+
y,
|
|
57
22
|
seriesId,
|
|
58
23
|
dataIndex,
|
|
59
24
|
color,
|
|
60
25
|
value,
|
|
61
26
|
width,
|
|
62
|
-
height
|
|
27
|
+
height,
|
|
28
|
+
layout
|
|
63
29
|
}) => /*#__PURE__*/_jsx(BarLabelItem, _extends({
|
|
64
30
|
seriesId: seriesId,
|
|
65
31
|
dataIndex: dataIndex,
|
|
66
32
|
value: value,
|
|
67
33
|
color: color,
|
|
34
|
+
xOrigin: xOrigin,
|
|
35
|
+
yOrigin: yOrigin,
|
|
36
|
+
x: x,
|
|
37
|
+
y: y,
|
|
68
38
|
width: width,
|
|
69
|
-
height: height
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})))
|
|
39
|
+
height: height,
|
|
40
|
+
skipAnimation: skipAnimation ?? false,
|
|
41
|
+
layout: layout ?? 'vertical'
|
|
42
|
+
}, other), `${seriesId}-${dataIndex}`))
|
|
73
43
|
});
|
|
74
44
|
}
|
|
75
45
|
export { BarLabelPlot };
|
|
@@ -6,8 +6,10 @@ export interface BarLabelClasses {
|
|
|
6
6
|
highlighted: string;
|
|
7
7
|
/** Styles applied to the root element if it is faded. */
|
|
8
8
|
faded: string;
|
|
9
|
+
/** Styles applied to the root element if it is animated. */
|
|
10
|
+
animate: string;
|
|
9
11
|
}
|
|
10
12
|
export type BarLabelClassKey = keyof BarLabelClasses;
|
|
11
13
|
export declare function getBarLabelUtilityClass(slot: string): string;
|
|
12
|
-
export declare const barLabelClasses: Record<"root" | "highlighted" | "faded", string>;
|
|
14
|
+
export declare const barLabelClasses: Record<"root" | "animate" | "highlighted" | "faded", string>;
|
|
13
15
|
export declare const useUtilityClasses: (ownerState: BarLabelOwnerState) => Record<"root", string>;
|
|
@@ -4,16 +4,17 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
4
4
|
export function getBarLabelUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiBarLabel', slot);
|
|
6
6
|
}
|
|
7
|
-
export const barLabelClasses = generateUtilityClasses('MuiBarLabel', ['root', 'highlighted', 'faded']);
|
|
7
|
+
export const barLabelClasses = generateUtilityClasses('MuiBarLabel', ['root', 'highlighted', 'faded', 'animate']);
|
|
8
8
|
export const useUtilityClasses = ownerState => {
|
|
9
9
|
const {
|
|
10
10
|
classes,
|
|
11
11
|
seriesId,
|
|
12
12
|
isFaded,
|
|
13
|
-
isHighlighted
|
|
13
|
+
isHighlighted,
|
|
14
|
+
skipAnimation
|
|
14
15
|
} = ownerState;
|
|
15
16
|
const slots = {
|
|
16
|
-
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
17
|
+
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
|
|
17
18
|
};
|
|
18
19
|
return composeClasses(slots, getBarLabelUtilityClass, classes);
|
|
19
20
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["skipAnimation", "onItemClick", "borderRadius", "barLabel"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useTransition } from '@react-spring/web';
|
|
9
8
|
import { styled } from '@mui/material/styles';
|
|
10
|
-
import {
|
|
9
|
+
import { barElementClasses } from "./barElementClasses.js";
|
|
10
|
+
import { BarElement } from "./BarElement.js";
|
|
11
11
|
import getColor from "./seriesConfig/getColor.js";
|
|
12
12
|
import { useChartId, useDrawingArea, useXAxes, useYAxes } from "../hooks/index.js";
|
|
13
13
|
import { BarClipPath } from "./BarClipPath.js";
|
|
@@ -113,8 +113,8 @@ const useAggregatedData = () => {
|
|
|
113
113
|
layout,
|
|
114
114
|
x: verticalLayout ? xScale(baseValue) + barOffset : minValueCoord,
|
|
115
115
|
y: verticalLayout ? minValueCoord : yScale(baseValue) + barOffset,
|
|
116
|
-
xOrigin: xScale(0),
|
|
117
|
-
yOrigin: yScale(0),
|
|
116
|
+
xOrigin: xScale(0) ?? 0,
|
|
117
|
+
yOrigin: yScale(0) ?? 0,
|
|
118
118
|
height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
|
|
119
119
|
width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
|
|
120
120
|
color: colorGetter(dataIndex),
|
|
@@ -154,36 +154,6 @@ const useAggregatedData = () => {
|
|
|
154
154
|
masksData: Object.values(masks)
|
|
155
155
|
};
|
|
156
156
|
};
|
|
157
|
-
const leaveStyle = ({
|
|
158
|
-
layout,
|
|
159
|
-
yOrigin,
|
|
160
|
-
x,
|
|
161
|
-
width,
|
|
162
|
-
y,
|
|
163
|
-
xOrigin,
|
|
164
|
-
height
|
|
165
|
-
}) => _extends({}, layout === 'vertical' ? {
|
|
166
|
-
y: yOrigin,
|
|
167
|
-
x,
|
|
168
|
-
height: 0,
|
|
169
|
-
width
|
|
170
|
-
} : {
|
|
171
|
-
y,
|
|
172
|
-
x: xOrigin,
|
|
173
|
-
height,
|
|
174
|
-
width: 0
|
|
175
|
-
});
|
|
176
|
-
const enterStyle = ({
|
|
177
|
-
x,
|
|
178
|
-
width,
|
|
179
|
-
y,
|
|
180
|
-
height
|
|
181
|
-
}) => ({
|
|
182
|
-
y,
|
|
183
|
-
x,
|
|
184
|
-
height,
|
|
185
|
-
width
|
|
186
|
-
});
|
|
187
157
|
const BarPlotRoot = styled('g', {
|
|
188
158
|
name: 'MuiBarPlot',
|
|
189
159
|
slot: 'Root',
|
|
@@ -220,25 +190,13 @@ function BarPlot(props) {
|
|
|
220
190
|
const isZoomInteracting = useInternalIsZoomInteracting();
|
|
221
191
|
const skipAnimation = useSkipAnimation(isZoomInteracting || inSkipAnimation);
|
|
222
192
|
const withoutBorderRadius = !borderRadius || borderRadius <= 0;
|
|
223
|
-
const transition = useTransition(completedData, {
|
|
224
|
-
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
225
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
226
|
-
leave: leaveStyle,
|
|
227
|
-
enter: enterStyle,
|
|
228
|
-
update: enterStyle,
|
|
229
|
-
immediate: skipAnimation
|
|
230
|
-
});
|
|
231
|
-
const maskTransition = useTransition(withoutBorderRadius ? [] : masksData, {
|
|
232
|
-
keys: v => v.id,
|
|
233
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
234
|
-
leave: leaveStyle,
|
|
235
|
-
enter: enterStyle,
|
|
236
|
-
update: enterStyle,
|
|
237
|
-
immediate: skipAnimation
|
|
238
|
-
});
|
|
239
193
|
return /*#__PURE__*/_jsxs(BarPlotRoot, {
|
|
240
|
-
children: [!withoutBorderRadius &&
|
|
194
|
+
children: [!withoutBorderRadius && masksData.map(({
|
|
241
195
|
id,
|
|
196
|
+
x,
|
|
197
|
+
y,
|
|
198
|
+
width,
|
|
199
|
+
height,
|
|
242
200
|
hasPositive,
|
|
243
201
|
hasNegative,
|
|
244
202
|
layout
|
|
@@ -249,18 +207,37 @@ function BarPlot(props) {
|
|
|
249
207
|
hasNegative: hasNegative,
|
|
250
208
|
hasPositive: hasPositive,
|
|
251
209
|
layout: layout,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
210
|
+
x: x,
|
|
211
|
+
y: y,
|
|
212
|
+
width: width,
|
|
213
|
+
height: height,
|
|
214
|
+
skipAnimation: skipAnimation ?? false
|
|
215
|
+
}, id);
|
|
216
|
+
}), completedData.map(({
|
|
255
217
|
seriesId,
|
|
256
218
|
dataIndex,
|
|
257
219
|
color,
|
|
258
|
-
maskId
|
|
220
|
+
maskId,
|
|
221
|
+
layout,
|
|
222
|
+
x,
|
|
223
|
+
xOrigin,
|
|
224
|
+
y,
|
|
225
|
+
yOrigin,
|
|
226
|
+
width,
|
|
227
|
+
height
|
|
259
228
|
}) => {
|
|
260
229
|
const barElement = /*#__PURE__*/_jsx(BarElement, _extends({
|
|
261
230
|
id: seriesId,
|
|
262
231
|
dataIndex: dataIndex,
|
|
263
|
-
color: color
|
|
232
|
+
color: color,
|
|
233
|
+
skipAnimation: skipAnimation ?? false,
|
|
234
|
+
layout: layout ?? 'vertical',
|
|
235
|
+
x: x,
|
|
236
|
+
xOrigin: xOrigin,
|
|
237
|
+
y: y,
|
|
238
|
+
yOrigin: yOrigin,
|
|
239
|
+
width: width,
|
|
240
|
+
height: height
|
|
264
241
|
}, other, {
|
|
265
242
|
onClick: onItemClick && (event => {
|
|
266
243
|
onItemClick(event, {
|
|
@@ -268,16 +245,15 @@ function BarPlot(props) {
|
|
|
268
245
|
seriesId,
|
|
269
246
|
dataIndex
|
|
270
247
|
});
|
|
271
|
-
})
|
|
272
|
-
|
|
273
|
-
}));
|
|
248
|
+
})
|
|
249
|
+
}), `${seriesId}-${dataIndex}`);
|
|
274
250
|
if (withoutBorderRadius) {
|
|
275
251
|
return barElement;
|
|
276
252
|
}
|
|
277
253
|
return /*#__PURE__*/_jsx("g", {
|
|
278
254
|
clipPath: `url(#${maskId})`,
|
|
279
255
|
children: barElement
|
|
280
|
-
});
|
|
256
|
+
}, `${seriesId}-${dataIndex}`);
|
|
281
257
|
}), barLabel && /*#__PURE__*/_jsx(BarLabelPlot, _extends({
|
|
282
258
|
bars: completedData,
|
|
283
259
|
skipAnimation: skipAnimation,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SeriesId } from "../models/seriesType/common.js";
|
|
2
|
+
export interface BarElementClasses {
|
|
3
|
+
/** Styles applied to the root element. */
|
|
4
|
+
root: string;
|
|
5
|
+
/** Styles applied to the root element if it is highlighted. */
|
|
6
|
+
highlighted: string;
|
|
7
|
+
/** Styles applied to the root element if it is faded. */
|
|
8
|
+
faded: string;
|
|
9
|
+
}
|
|
10
|
+
export type BarElementClassKey = keyof BarElementClasses;
|
|
11
|
+
export interface BarElementOwnerState {
|
|
12
|
+
id: SeriesId;
|
|
13
|
+
dataIndex: number;
|
|
14
|
+
color: string;
|
|
15
|
+
isFaded: boolean;
|
|
16
|
+
isHighlighted: boolean;
|
|
17
|
+
classes?: Partial<BarElementClasses>;
|
|
18
|
+
}
|
|
19
|
+
export declare function getBarElementUtilityClass(slot: string): string;
|
|
20
|
+
export declare const barElementClasses: BarElementClasses;
|
|
21
|
+
export declare const useUtilityClasses: (ownerState: BarElementOwnerState) => Record<"root", string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
3
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
4
|
+
export function getBarElementUtilityClass(slot) {
|
|
5
|
+
return generateUtilityClass('MuiBarElement', slot);
|
|
6
|
+
}
|
|
7
|
+
export const barElementClasses = generateUtilityClasses('MuiBarElement', ['root', 'highlighted', 'faded']);
|
|
8
|
+
export const useUtilityClasses = ownerState => {
|
|
9
|
+
const {
|
|
10
|
+
classes,
|
|
11
|
+
id,
|
|
12
|
+
isHighlighted,
|
|
13
|
+
isFaded
|
|
14
|
+
} = ownerState;
|
|
15
|
+
const slots = {
|
|
16
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
17
|
+
};
|
|
18
|
+
return composeClasses(slots, getBarElementUtilityClass, classes);
|
|
19
|
+
};
|
package/modern/BarChart/index.js
CHANGED
|
@@ -2,13 +2,14 @@ import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
|
2
2
|
import seriesProcessor from "./seriesProcessor.js";
|
|
3
3
|
import legendGetter from "./legend.js";
|
|
4
4
|
import getColor from "./getColor.js";
|
|
5
|
-
import tooltipGetter from "./tooltip.js";
|
|
5
|
+
import tooltipGetter, { axisTooltipGetter } from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
export const seriesConfig = {
|
|
8
8
|
seriesProcessor,
|
|
9
9
|
colorProcessor: getColor,
|
|
10
10
|
legendGetter,
|
|
11
11
|
tooltipGetter,
|
|
12
|
+
axisTooltipGetter,
|
|
12
13
|
xExtremumGetter: getExtremumX,
|
|
13
14
|
yExtremumGetter: getExtremumY,
|
|
14
15
|
getSeriesWithDefaultValues
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { TooltipGetter } from '../../internals/plugins/models';
|
|
1
|
+
import type { AxisTooltipGetter, TooltipGetter } from '../../internals/plugins/models';
|
|
2
2
|
declare const tooltipGetter: TooltipGetter<'bar'>;
|
|
3
|
+
export declare const axisTooltipGetter: AxisTooltipGetter<'bar', 'x' | 'y'>;
|
|
3
4
|
export default tooltipGetter;
|
|
@@ -10,6 +10,9 @@ const tooltipGetter = params => {
|
|
|
10
10
|
}
|
|
11
11
|
const label = getLabel(series.label, 'tooltip');
|
|
12
12
|
const value = series.data[identifier.dataIndex];
|
|
13
|
+
if (value == null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
13
16
|
const formattedValue = series.valueFormatter(value, {
|
|
14
17
|
dataIndex: identifier.dataIndex
|
|
15
18
|
});
|
|
@@ -22,4 +25,13 @@ const tooltipGetter = params => {
|
|
|
22
25
|
markType: series.labelMarkType
|
|
23
26
|
};
|
|
24
27
|
};
|
|
28
|
+
export const axisTooltipGetter = series => {
|
|
29
|
+
return Object.values(series).map(s => s.layout === 'horizontal' ? {
|
|
30
|
+
direction: 'y',
|
|
31
|
+
axisId: s.yAxisId
|
|
32
|
+
} : {
|
|
33
|
+
direction: 'x',
|
|
34
|
+
axisId: s.xAxisId
|
|
35
|
+
});
|
|
36
|
+
};
|
|
25
37
|
export default tooltipGetter;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { BarChartProps } from './BarChart';
|
|
2
3
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
3
4
|
import { BarPlotProps } from "./BarPlot.js";
|
|
@@ -29,5 +30,5 @@ export declare const useBarChartProps: (props: BarChartProps) => {
|
|
|
29
30
|
chartsAxisProps: ChartsAxisProps;
|
|
30
31
|
axisHighlightProps: ChartsAxisHighlightProps;
|
|
31
32
|
legendProps: ChartsLegendSlotExtension;
|
|
32
|
-
children:
|
|
33
|
+
children: React.ReactNode;
|
|
33
34
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
|
|
6
|
+
import * as React from 'react';
|
|
6
7
|
import useId from '@mui/utils/useId';
|
|
7
8
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
|
|
8
9
|
import { BAR_CHART_PLUGINS } from "./BarChart.plugins.js";
|
|
@@ -44,29 +45,34 @@ export const useBarChartProps = props => {
|
|
|
44
45
|
const id = useId();
|
|
45
46
|
const clipPathId = `${id}-clip-path`;
|
|
46
47
|
const hasHorizontalSeries = layout === 'horizontal' || layout === undefined && series.some(item => item.layout === 'horizontal');
|
|
47
|
-
const
|
|
48
|
+
const defaultBandXAxis = React.useMemo(() => [{
|
|
49
|
+
id: DEFAULT_X_AXIS_KEY,
|
|
48
50
|
scaleType: 'band',
|
|
49
51
|
data: Array.from({
|
|
50
52
|
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
51
53
|
}, (_, index) => index)
|
|
52
|
-
};
|
|
54
|
+
}], [dataset, series]);
|
|
55
|
+
const defaultBandYAxis = React.useMemo(() => [{
|
|
56
|
+
id: DEFAULT_Y_AXIS_KEY,
|
|
57
|
+
scaleType: 'band',
|
|
58
|
+
data: Array.from({
|
|
59
|
+
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
60
|
+
}, (_, index) => index)
|
|
61
|
+
}], [dataset, series]);
|
|
62
|
+
const seriesWithDefault = React.useMemo(() => series.map(s => _extends({
|
|
63
|
+
type: 'bar'
|
|
64
|
+
}, s, {
|
|
65
|
+
layout: hasHorizontalSeries ? 'horizontal' : 'vertical'
|
|
66
|
+
})), [hasHorizontalSeries, series]);
|
|
53
67
|
const chartContainerProps = _extends({}, rest, {
|
|
54
|
-
series:
|
|
55
|
-
type: 'bar'
|
|
56
|
-
}, s, {
|
|
57
|
-
layout: hasHorizontalSeries ? 'horizontal' : 'vertical'
|
|
58
|
-
})),
|
|
68
|
+
series: seriesWithDefault,
|
|
59
69
|
width,
|
|
60
70
|
height,
|
|
61
71
|
margin,
|
|
62
72
|
colors,
|
|
63
73
|
dataset,
|
|
64
|
-
xAxis: xAxis ?? (hasHorizontalSeries ? undefined :
|
|
65
|
-
|
|
66
|
-
}, defaultAxisConfig)]),
|
|
67
|
-
yAxis: yAxis ?? (hasHorizontalSeries ? [_extends({
|
|
68
|
-
id: DEFAULT_Y_AXIS_KEY
|
|
69
|
-
}, defaultAxisConfig)] : undefined),
|
|
74
|
+
xAxis: xAxis ?? (hasHorizontalSeries ? undefined : defaultBandXAxis),
|
|
75
|
+
yAxis: yAxis ?? (hasHorizontalSeries ? defaultBandYAxis : undefined),
|
|
70
76
|
highlightedItem,
|
|
71
77
|
onHighlightChange,
|
|
72
78
|
disableAxisListener: slotProps?.tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|