@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,33 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
|
|
5
|
+
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { animated, to } from '@react-spring/web';
|
|
9
|
-
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
10
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
9
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
12
10
|
import { styled } from '@mui/material/styles';
|
|
13
11
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
12
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
|
|
13
|
+
import { useAnimatePieArcLabel } from "../hooks/animation/useAnimatePieArcLabel.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
export function getPieArcLabelUtilityClass(slot) {
|
|
16
16
|
return generateUtilityClass('MuiPieArcLabel', slot);
|
|
17
17
|
}
|
|
18
|
-
export const pieArcLabelClasses = generateUtilityClasses('MuiPieArcLabel', ['root', 'highlighted', 'faded']);
|
|
18
|
+
export const pieArcLabelClasses = generateUtilityClasses('MuiPieArcLabel', ['root', 'highlighted', 'faded', 'animate']);
|
|
19
19
|
const useUtilityClasses = ownerState => {
|
|
20
20
|
const {
|
|
21
21
|
classes,
|
|
22
22
|
id,
|
|
23
23
|
isFaded,
|
|
24
|
-
isHighlighted
|
|
24
|
+
isHighlighted,
|
|
25
|
+
skipAnimation
|
|
25
26
|
} = ownerState;
|
|
26
27
|
const slots = {
|
|
27
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
28
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
|
|
28
29
|
};
|
|
29
30
|
return composeClasses(slots, getPieArcLabelUtilityClass, classes);
|
|
30
31
|
};
|
|
31
|
-
const PieArcLabelRoot = styled(
|
|
32
|
+
const PieArcLabelRoot = styled('text', {
|
|
32
33
|
name: 'MuiPieArcLabel',
|
|
33
34
|
slot: 'Root',
|
|
34
35
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -38,29 +39,20 @@ const PieArcLabelRoot = styled(animated.text, {
|
|
|
38
39
|
fill: (theme.vars || theme).palette.text.primary,
|
|
39
40
|
textAnchor: 'middle',
|
|
40
41
|
dominantBaseline: 'middle',
|
|
41
|
-
pointerEvents: 'none'
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
padAngle,
|
|
53
|
-
startAngle,
|
|
54
|
-
endAngle,
|
|
55
|
-
innerRadius: arcLabelRadius,
|
|
56
|
-
outerRadius: arcLabelRadius
|
|
57
|
-
});
|
|
58
|
-
if (variable === 'x') {
|
|
59
|
-
return x;
|
|
42
|
+
pointerEvents: 'none',
|
|
43
|
+
animationName: 'animate-opacity',
|
|
44
|
+
animationDuration: '0s',
|
|
45
|
+
animationTimingFunction: ANIMATION_TIMING_FUNCTION,
|
|
46
|
+
[`&.${pieArcLabelClasses.animate}`]: {
|
|
47
|
+
animationDuration: `${ANIMATION_DURATION_MS}ms`
|
|
48
|
+
},
|
|
49
|
+
'@keyframes animate-opacity': {
|
|
50
|
+
from: {
|
|
51
|
+
opacity: 0
|
|
52
|
+
}
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function PieArcLabel(props) {
|
|
54
|
+
}));
|
|
55
|
+
const PieArcLabel = /*#__PURE__*/React.forwardRef(function PieArcLabel(props, ref) {
|
|
64
56
|
const {
|
|
65
57
|
id,
|
|
66
58
|
classes: innerClasses,
|
|
@@ -68,12 +60,13 @@ function PieArcLabel(props) {
|
|
|
68
60
|
startAngle,
|
|
69
61
|
endAngle,
|
|
70
62
|
paddingAngle,
|
|
71
|
-
|
|
63
|
+
innerRadius,
|
|
64
|
+
outerRadius,
|
|
72
65
|
cornerRadius,
|
|
73
66
|
formattedArcLabel,
|
|
74
67
|
isHighlighted,
|
|
75
68
|
isFaded,
|
|
76
|
-
|
|
69
|
+
skipAnimation
|
|
77
70
|
} = props,
|
|
78
71
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
79
72
|
const ownerState = {
|
|
@@ -81,33 +74,44 @@ function PieArcLabel(props) {
|
|
|
81
74
|
classes: innerClasses,
|
|
82
75
|
color,
|
|
83
76
|
isFaded,
|
|
84
|
-
isHighlighted
|
|
77
|
+
isHighlighted,
|
|
78
|
+
skipAnimation
|
|
85
79
|
};
|
|
86
80
|
const classes = useUtilityClasses(ownerState);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
const animatedProps = useAnimatePieArcLabel({
|
|
82
|
+
cornerRadius,
|
|
83
|
+
startAngle,
|
|
84
|
+
endAngle,
|
|
85
|
+
innerRadius,
|
|
86
|
+
outerRadius,
|
|
87
|
+
paddingAngle,
|
|
88
|
+
skipAnimation,
|
|
89
|
+
ref
|
|
90
|
+
});
|
|
91
|
+
return /*#__PURE__*/_jsx(PieArcLabelRoot, _extends({
|
|
92
|
+
className: classes.root
|
|
93
|
+
}, other, animatedProps, {
|
|
94
|
+
children: formattedArcLabel
|
|
95
|
+
}));
|
|
96
|
+
});
|
|
101
97
|
process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
102
98
|
// ----------------------------- Warning --------------------------------
|
|
103
99
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
100
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
105
101
|
// ----------------------------------------------------------------------
|
|
102
|
+
arcLabelRadius: PropTypes.number.isRequired,
|
|
106
103
|
classes: PropTypes.object,
|
|
107
104
|
color: PropTypes.string.isRequired,
|
|
105
|
+
cornerRadius: PropTypes.number.isRequired,
|
|
106
|
+
endAngle: PropTypes.number.isRequired,
|
|
108
107
|
formattedArcLabel: PropTypes.string,
|
|
109
108
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
109
|
+
innerRadius: PropTypes.number.isRequired,
|
|
110
110
|
isFaded: PropTypes.bool.isRequired,
|
|
111
|
-
isHighlighted: PropTypes.bool.isRequired
|
|
111
|
+
isHighlighted: PropTypes.bool.isRequired,
|
|
112
|
+
outerRadius: PropTypes.number.isRequired,
|
|
113
|
+
paddingAngle: PropTypes.number.isRequired,
|
|
114
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
115
|
+
startAngle: PropTypes.number.isRequired
|
|
112
116
|
} : void 0;
|
|
113
117
|
export { PieArcLabel };
|
|
@@ -2,12 +2,9 @@
|
|
|
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 = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"]
|
|
6
|
-
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "arcLabelRadius", "cornerRadius"];
|
|
5
|
+
const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"];
|
|
7
6
|
import * as React from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
|
-
import { useTransition } from '@react-spring/web';
|
|
10
|
-
import { getDefaultLabelTransitionConfig } from "./dataTransform/transition.js";
|
|
11
8
|
import { useTransformData } from "./dataTransform/useTransformData.js";
|
|
12
9
|
import { PieArcLabel } from "./PieArcLabel.js";
|
|
13
10
|
import { getLabel } from "../internals/getLabel.js";
|
|
@@ -65,41 +62,26 @@ function PieArcLabelPlot(props) {
|
|
|
65
62
|
faded,
|
|
66
63
|
data
|
|
67
64
|
});
|
|
68
|
-
const transition = useTransition(transformedData, _extends({}, getDefaultLabelTransitionConfig(skipAnimation), {
|
|
69
|
-
immediate: skipAnimation
|
|
70
|
-
}));
|
|
71
65
|
if (data.length === 0) {
|
|
72
66
|
return null;
|
|
73
67
|
}
|
|
74
68
|
const ArcLabel = slots?.pieArcLabel ?? PieArcLabel;
|
|
75
69
|
return /*#__PURE__*/_jsx("g", _extends({}, other, {
|
|
76
|
-
children:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
innerRadius: iR,
|
|
92
|
-
outerRadius: oR,
|
|
93
|
-
arcLabelRadius: aLR,
|
|
94
|
-
cornerRadius: cR,
|
|
95
|
-
style: style,
|
|
96
|
-
id: id,
|
|
97
|
-
color: item.color,
|
|
98
|
-
isFaded: item.isFaded,
|
|
99
|
-
isHighlighted: item.isHighlighted,
|
|
100
|
-
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
101
|
-
}, slotProps?.pieArcLabel));
|
|
102
|
-
})
|
|
70
|
+
children: transformedData.map(item => /*#__PURE__*/_jsx(ArcLabel, _extends({
|
|
71
|
+
startAngle: item.startAngle,
|
|
72
|
+
endAngle: item.endAngle,
|
|
73
|
+
paddingAngle: item.paddingAngle,
|
|
74
|
+
innerRadius: item.innerRadius,
|
|
75
|
+
outerRadius: item.outerRadius,
|
|
76
|
+
arcLabelRadius: item.arcLabelRadius,
|
|
77
|
+
cornerRadius: item.cornerRadius,
|
|
78
|
+
id: id,
|
|
79
|
+
color: item.color,
|
|
80
|
+
isFaded: item.isFaded,
|
|
81
|
+
isHighlighted: item.isHighlighted,
|
|
82
|
+
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item),
|
|
83
|
+
skipAnimation: skipAnimation ?? false
|
|
84
|
+
}, slotProps?.pieArcLabel), item.id ?? item.dataIndex))
|
|
103
85
|
}));
|
|
104
86
|
}
|
|
105
87
|
process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
@@ -5,9 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useTransition } from '@react-spring/web';
|
|
9
8
|
import { PieArc } from "./PieArc.js";
|
|
10
|
-
import { getDefaultTransitionConfig } from "./dataTransform/transition.js";
|
|
11
9
|
import { useTransformData } from "./dataTransform/useTransformData.js";
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
function PieArcPlot(props) {
|
|
@@ -38,43 +36,32 @@ function PieArcPlot(props) {
|
|
|
38
36
|
faded,
|
|
39
37
|
data
|
|
40
38
|
});
|
|
41
|
-
const transition = useTransition(transformedData, _extends({}, getDefaultTransitionConfig(skipAnimation), {
|
|
42
|
-
immediate: skipAnimation
|
|
43
|
-
}));
|
|
44
39
|
if (data.length === 0) {
|
|
45
40
|
return null;
|
|
46
41
|
}
|
|
47
42
|
const Arc = slots?.pieArc ?? PieArc;
|
|
48
43
|
return /*#__PURE__*/_jsx("g", _extends({}, other, {
|
|
49
|
-
children:
|
|
50
|
-
startAngle,
|
|
51
|
-
endAngle,
|
|
52
|
-
paddingAngle:
|
|
53
|
-
innerRadius:
|
|
54
|
-
outerRadius:
|
|
55
|
-
cornerRadius:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onItemClick(event, {
|
|
71
|
-
type: 'pie',
|
|
72
|
-
seriesId: id,
|
|
73
|
-
dataIndex: index
|
|
74
|
-
}, item);
|
|
75
|
-
})
|
|
76
|
-
}, slotProps?.pieArc));
|
|
77
|
-
})
|
|
44
|
+
children: transformedData.map((item, index) => /*#__PURE__*/_jsx(Arc, _extends({
|
|
45
|
+
startAngle: item.startAngle,
|
|
46
|
+
endAngle: item.endAngle,
|
|
47
|
+
paddingAngle: item.paddingAngle,
|
|
48
|
+
innerRadius: item.innerRadius,
|
|
49
|
+
outerRadius: item.outerRadius,
|
|
50
|
+
cornerRadius: item.cornerRadius,
|
|
51
|
+
skipAnimation: skipAnimation ?? false,
|
|
52
|
+
id: id,
|
|
53
|
+
color: item.color,
|
|
54
|
+
dataIndex: index,
|
|
55
|
+
isFaded: item.isFaded,
|
|
56
|
+
isHighlighted: item.isHighlighted,
|
|
57
|
+
onClick: onItemClick && (event => {
|
|
58
|
+
onItemClick(event, {
|
|
59
|
+
type: 'pie',
|
|
60
|
+
seriesId: id,
|
|
61
|
+
dataIndex: index
|
|
62
|
+
}, item);
|
|
63
|
+
})
|
|
64
|
+
}, slotProps?.pieArc), item.dataIndex))
|
|
78
65
|
}));
|
|
79
66
|
}
|
|
80
67
|
process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
@@ -5,7 +5,7 @@ import { useSelector } from "../../internals/store/useSelector.js";
|
|
|
5
5
|
import { useStore } from "../../internals/store/useStore.js";
|
|
6
6
|
import { useChartContext } from "../../context/ChartProvider/useChartContext.js";
|
|
7
7
|
import { selectorChartPolarCenter } from "../../internals/plugins/featurePlugins/useChartPolarAxis/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { selectorChartsInteractionRotationAxisIndex, selectorChartsInteractionRotationAxisValue } from "../../internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js";
|
|
9
9
|
export function useRadarAxisHighlight(params) {
|
|
10
10
|
const {
|
|
11
11
|
includesNeighbors = false
|
|
@@ -20,10 +20,14 @@ export function useRadarAxisHighlight(params) {
|
|
|
20
20
|
instance
|
|
21
21
|
} = useChartContext();
|
|
22
22
|
const store = useStore();
|
|
23
|
-
const
|
|
23
|
+
const rotationAxisIndex = useSelector(store, selectorChartsInteractionRotationAxisIndex);
|
|
24
|
+
const rotationAxisValue = useSelector(store, selectorChartsInteractionRotationAxisValue);
|
|
24
25
|
const center = useSelector(store, selectorChartPolarCenter);
|
|
25
|
-
const highlightedIndex =
|
|
26
|
-
if (
|
|
26
|
+
const highlightedIndex = rotationAxisIndex;
|
|
27
|
+
if (!rotationScale) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
if (highlightedIndex === null || highlightedIndex === -1) {
|
|
27
31
|
return null;
|
|
28
32
|
}
|
|
29
33
|
if (radarSeries === undefined || radarSeries.length === 0) {
|
|
@@ -31,7 +35,7 @@ export function useRadarAxisHighlight(params) {
|
|
|
31
35
|
}
|
|
32
36
|
const metric = radiusAxisIds[highlightedIndex];
|
|
33
37
|
const radiusScale = radiusAxis[metric].scale;
|
|
34
|
-
const angle = rotationScale(
|
|
38
|
+
const angle = rotationScale(rotationAxisValue);
|
|
35
39
|
const radius = radiusScale.range()[1];
|
|
36
40
|
return {
|
|
37
41
|
center,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RadarGridProps } from "./RadarGrid.types.js";
|
|
3
|
-
declare function RadarGrid(props: RadarGridProps): React.JSX.Element;
|
|
3
|
+
declare function RadarGrid(props: RadarGridProps): React.JSX.Element | null;
|
|
4
4
|
declare namespace RadarGrid {
|
|
5
5
|
var propTypes: any;
|
|
6
6
|
}
|
|
@@ -9,11 +9,15 @@ function RadarGrid(props) {
|
|
|
9
9
|
divisions = 5,
|
|
10
10
|
shape = 'sharp'
|
|
11
11
|
} = props;
|
|
12
|
+
const gridData = useRadarGridData();
|
|
13
|
+
if (gridData === null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
12
16
|
const {
|
|
13
17
|
center,
|
|
14
18
|
corners,
|
|
15
19
|
radius
|
|
16
|
-
} =
|
|
20
|
+
} = gridData;
|
|
17
21
|
return shape === 'sharp' ? /*#__PURE__*/_jsx(SharpRadarGrid, {
|
|
18
22
|
divisions: divisions,
|
|
19
23
|
corners: corners,
|
|
@@ -13,6 +13,9 @@ export function useRadarGridData() {
|
|
|
13
13
|
const drawingArea = useDrawingArea();
|
|
14
14
|
const cx = drawingArea.left + drawingArea.width / 2;
|
|
15
15
|
const cy = drawingArea.top + drawingArea.height / 2;
|
|
16
|
+
if (!rotationScale || rotationScale.domain().length === 0) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
16
19
|
const metrics = rotationScale.domain();
|
|
17
20
|
const angles = metrics.map(key => rotationScale(key));
|
|
18
21
|
return {
|
|
@@ -23,8 +23,8 @@ export function useRadarSeriesData(querySeriesId) {
|
|
|
23
23
|
isFaded: isItemFaded,
|
|
24
24
|
isHighlighted: isItemHighlighted
|
|
25
25
|
} = useItemHighlightedGetter();
|
|
26
|
-
const metrics = rotationScale
|
|
27
|
-
const angles = metrics.map(key => rotationScale(key));
|
|
26
|
+
const metrics = rotationScale?.domain() ?? [];
|
|
27
|
+
const angles = metrics.map(key => rotationScale?.(key));
|
|
28
28
|
return radarSeries.map(series => {
|
|
29
29
|
const seriesId = series.id;
|
|
30
30
|
const isSeriesHighlighted = isItemHighlighted({
|
|
@@ -229,6 +229,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
229
229
|
height: PropTypes.number,
|
|
230
230
|
hideTooltip: PropTypes.bool,
|
|
231
231
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
232
|
+
ignoreTooltip: PropTypes.bool,
|
|
232
233
|
label: PropTypes.string,
|
|
233
234
|
labelStyle: PropTypes.object,
|
|
234
235
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -284,6 +285,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
284
285
|
fill: PropTypes.string,
|
|
285
286
|
hideTooltip: PropTypes.bool,
|
|
286
287
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
288
|
+
ignoreTooltip: PropTypes.bool,
|
|
287
289
|
label: PropTypes.string,
|
|
288
290
|
labelStyle: PropTypes.object,
|
|
289
291
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
2
3
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
3
4
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
@@ -24,5 +25,5 @@ export declare const useScatterChartProps: (props: ScatterChartProps) => {
|
|
|
24
25
|
overlayProps: ChartsOverlayProps;
|
|
25
26
|
legendProps: ChartsLegendSlotExtension;
|
|
26
27
|
axisHighlightProps: ChartsAxisHighlightProps;
|
|
27
|
-
children:
|
|
28
|
+
children: React.ReactNode;
|
|
28
29
|
};
|
|
@@ -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", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
|
+
import * as React from 'react';
|
|
6
7
|
import { SCATTER_CHART_PLUGINS } from "./ScatterChart.plugins.js";
|
|
7
8
|
/**
|
|
8
9
|
* A helper function that extracts ScatterChartProps from the input props
|
|
@@ -36,10 +37,11 @@ export const useScatterChartProps = props => {
|
|
|
36
37
|
className
|
|
37
38
|
} = props,
|
|
38
39
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
|
+
const seriesWithDefault = React.useMemo(() => series.map(s => _extends({
|
|
41
|
+
type: 'scatter'
|
|
42
|
+
}, s)), [series]);
|
|
39
43
|
const chartContainerProps = _extends({}, other, {
|
|
40
|
-
series:
|
|
41
|
-
type: 'scatter'
|
|
42
|
-
}, s)),
|
|
44
|
+
series: seriesWithDefault,
|
|
43
45
|
width,
|
|
44
46
|
height,
|
|
45
47
|
margin,
|
|
@@ -292,6 +292,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
292
292
|
height: PropTypes.number,
|
|
293
293
|
hideTooltip: PropTypes.bool,
|
|
294
294
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
295
|
+
ignoreTooltip: PropTypes.bool,
|
|
295
296
|
label: PropTypes.string,
|
|
296
297
|
labelStyle: PropTypes.object,
|
|
297
298
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -346,6 +347,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
346
347
|
fill: PropTypes.string,
|
|
347
348
|
hideTooltip: PropTypes.bool,
|
|
348
349
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
350
|
+
ignoreTooltip: PropTypes.bool,
|
|
349
351
|
label: PropTypes.string,
|
|
350
352
|
labelStyle: PropTypes.object,
|
|
351
353
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const rainbowSurgePaletteLight = ['#4254FB', '#
|
|
2
|
-
export const rainbowSurgePaletteDark = ['#
|
|
1
|
+
export const rainbowSurgePaletteLight = ['#4254FB', '#FFB422', '#FA4F58', '#0DBEFF', '#22BF75', '#FA83B4', '#FF7511'];
|
|
2
|
+
export const rainbowSurgePaletteDark = ['#495AFB', '#FFC758', '#F35865', '#30C8FF', '#44CE8D', '#F286B3', '#FF8C39'];
|
|
3
3
|
export const rainbowSurgePalette = mode => mode === 'dark' ? rainbowSurgePaletteDark : rainbowSurgePaletteLight;
|
|
4
4
|
export const blueberryTwilightPaletteLight = ['#02B2AF', '#2E96FF', '#B800D8', '#60009B', '#2731C8', '#03008D'];
|
|
5
5
|
export const blueberryTwilightPaletteDark = ['#02B2AF', '#72CCFF', '#DA00FF', '#9001CB', '#2E96FF', '#3B48E0'];
|
|
@@ -8,6 +8,6 @@ export declare const DEFAULT_MARGINS: {
|
|
|
8
8
|
left: number;
|
|
9
9
|
right: number;
|
|
10
10
|
};
|
|
11
|
-
export declare const DEFAULT_AXIS_SIZE_WIDTH =
|
|
11
|
+
export declare const DEFAULT_AXIS_SIZE_WIDTH = 45;
|
|
12
12
|
export declare const DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
13
13
|
export declare const AXIS_LABEL_DEFAULT_HEIGHT = 20;
|
|
@@ -8,7 +8,7 @@ export const DEFAULT_MARGINS = {
|
|
|
8
8
|
left: 20,
|
|
9
9
|
right: 20
|
|
10
10
|
};
|
|
11
|
-
export const DEFAULT_AXIS_SIZE_WIDTH =
|
|
11
|
+
export const DEFAULT_AXIS_SIZE_WIDTH = 45;
|
|
12
12
|
export const DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
13
13
|
|
|
14
14
|
// How many pixels to add to the default axis size if that axis has a label
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Globals, useIsomorphicLayoutEffect } from '@react-spring/web';
|
|
4
3
|
import * as React from 'react';
|
|
4
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
5
|
import { AnimationContext } from "./AnimationContext.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
function AnimationProvider(props) {
|
|
@@ -18,7 +18,7 @@ function AnimationProvider(props) {
|
|
|
18
18
|
// We use the value of `isAnimationDisabledEnvironment` as the initial value of `skipAnimation` to avoid
|
|
19
19
|
// re-rendering the component on environments where matchMedia is not supported, hence skipAnimation will always be true.
|
|
20
20
|
const [skipAnimation, setSkipAnimation] = React.useState(process.env.NODE_ENV === 'test' ? isAnimationDisabledEnvironment || undefined : undefined);
|
|
21
|
-
|
|
21
|
+
useEnhancedEffect(() => {
|
|
22
22
|
if (isAnimationDisabledEnvironment) {
|
|
23
23
|
return undefined;
|
|
24
24
|
}
|
|
@@ -26,9 +26,6 @@ function AnimationProvider(props) {
|
|
|
26
26
|
// This hook can remove animation but never activate it.
|
|
27
27
|
const inputValue = event.matches || undefined;
|
|
28
28
|
setSkipAnimation(inputValue);
|
|
29
|
-
Globals.assign({
|
|
30
|
-
skipAnimation: inputValue
|
|
31
|
-
});
|
|
32
29
|
};
|
|
33
30
|
const mql = window.matchMedia('(prefers-reduced-motion)');
|
|
34
31
|
handleMediaChange(mql);
|
|
@@ -38,7 +35,7 @@ function AnimationProvider(props) {
|
|
|
38
35
|
return () => {
|
|
39
36
|
mql?.removeEventListener?.('change', handleMediaChange);
|
|
40
37
|
};
|
|
41
|
-
}, []);
|
|
38
|
+
}, [isAnimationDisabledEnvironment]);
|
|
42
39
|
const value = React.useMemo(() => ({
|
|
43
40
|
isInitialized: true,
|
|
44
41
|
data: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AnimatedAreaProps } from '../../LineChart';
|
|
3
|
+
type UseAnimateAreaParams = Pick<AnimatedAreaProps, 'd' | 'skipAnimation'> & {
|
|
4
|
+
ref?: React.Ref<SVGPathElement>;
|
|
5
|
+
};
|
|
6
|
+
type UseAnimatedAreaReturn = {
|
|
7
|
+
ref: React.Ref<SVGPathElement>;
|
|
8
|
+
d: string;
|
|
9
|
+
};
|
|
10
|
+
/** Animates an area of a line chart using a `path` element.
|
|
11
|
+
* The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can
|
|
12
|
+
* pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useAnimateArea(props: UseAnimateAreaParams): UseAnimatedAreaReturn;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { interpolateString } from '@mui/x-charts-vendor/d3-interpolate';
|
|
2
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
3
|
+
import { useAnimate } from "../../internals/animation/useAnimate.js";
|
|
4
|
+
/** Animates an area of a line chart using a `path` element.
|
|
5
|
+
* The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can
|
|
6
|
+
* pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
|
|
7
|
+
*/
|
|
8
|
+
export function useAnimateArea(props) {
|
|
9
|
+
const ref = useAnimate({
|
|
10
|
+
d: props.d
|
|
11
|
+
}, {
|
|
12
|
+
createInterpolator: (lastProps, newProps) => {
|
|
13
|
+
const interpolate = interpolateString(lastProps.d, newProps.d);
|
|
14
|
+
return t => ({
|
|
15
|
+
d: interpolate(t)
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
applyProps: (element, {
|
|
19
|
+
d
|
|
20
|
+
}) => element.setAttribute('d', d),
|
|
21
|
+
skip: props.skipAnimation
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
ref: useForkRef(ref, props.ref),
|
|
25
|
+
d: props.d
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { BarProps } from '../../BarChart/AnimatedBarElement';
|
|
3
|
+
type UseAnimateBarParams = Pick<BarProps, 'x' | 'y' | 'xOrigin' | 'yOrigin' | 'width' | 'height' | 'skipAnimation' | 'layout'> & {
|
|
4
|
+
ref?: React.Ref<SVGRectElement>;
|
|
5
|
+
};
|
|
6
|
+
type UseAnimateBarReturnValue = {
|
|
7
|
+
ref: React.Ref<SVGRectElement>;
|
|
8
|
+
} & Pick<BarProps, 'x' | 'y' | 'width' | 'height'>;
|
|
9
|
+
/**
|
|
10
|
+
* Animates a bar from the start of the axis (x-axis for vertical layout, y-axis for horizontal layout) to its
|
|
11
|
+
* final position.
|
|
12
|
+
*
|
|
13
|
+
* The props object also accepts a `ref` which will be merged with the ref returned from this hook. This means you can
|
|
14
|
+
* pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAnimateBar(props: UseAnimateBarParams): UseAnimateBarReturnValue;
|
|
17
|
+
export {};
|