@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
|
@@ -5,15 +5,23 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useTheme } from '@mui/material/styles';
|
|
9
|
-
import {
|
|
8
|
+
import { styled, useTheme } from '@mui/material/styles';
|
|
9
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
|
|
10
10
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
11
11
|
import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
|
|
12
|
-
import { useUtilityClasses } from "./markElementClasses.js";
|
|
12
|
+
import { markElementClasses, useUtilityClasses } from "./markElementClasses.js";
|
|
13
13
|
import { useSelector } from "../internals/store/useSelector.js";
|
|
14
|
-
import {
|
|
14
|
+
import { selectorChartsInteractionXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
15
15
|
import { useStore } from "../internals/store/useStore.js";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const Circle = styled('circle')({
|
|
18
|
+
[`&.${markElementClasses.animate}`]: {
|
|
19
|
+
transitionDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
20
|
+
transitionProperty: 'cx, cy',
|
|
21
|
+
transitionTimingFunction: ANIMATION_TIMING_FUNCTION
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
17
25
|
/**
|
|
18
26
|
* The line mark element that only render circle for performance improvement.
|
|
19
27
|
*
|
|
@@ -51,33 +59,19 @@ function CircleMarkElement(props) {
|
|
|
51
59
|
seriesId: id
|
|
52
60
|
});
|
|
53
61
|
const store = useStore();
|
|
54
|
-
const
|
|
55
|
-
const cx = useSpringValue(x, {
|
|
56
|
-
immediate: skipAnimation
|
|
57
|
-
});
|
|
58
|
-
const cy = useSpringValue(y, {
|
|
59
|
-
immediate: skipAnimation
|
|
60
|
-
});
|
|
61
|
-
React.useEffect(() => {
|
|
62
|
-
cy.start(y, {
|
|
63
|
-
immediate: skipAnimation
|
|
64
|
-
});
|
|
65
|
-
cx.start(x, {
|
|
66
|
-
immediate: skipAnimation
|
|
67
|
-
});
|
|
68
|
-
}, [cy, y, cx, x, skipAnimation]);
|
|
62
|
+
const xAxisInteractionIndex = useSelector(store, selectorChartsInteractionXAxisIndex);
|
|
69
63
|
const ownerState = {
|
|
70
64
|
id,
|
|
71
65
|
classes: innerClasses,
|
|
72
|
-
isHighlighted:
|
|
66
|
+
isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
|
|
73
67
|
isFaded,
|
|
74
|
-
color
|
|
68
|
+
color,
|
|
69
|
+
skipAnimation
|
|
75
70
|
};
|
|
76
71
|
const classes = useUtilityClasses(ownerState);
|
|
77
|
-
return /*#__PURE__*/_jsx(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
cy: cy,
|
|
72
|
+
return /*#__PURE__*/_jsx(Circle, _extends({}, other, {
|
|
73
|
+
cx: x,
|
|
74
|
+
cy: y,
|
|
81
75
|
r: 5,
|
|
82
76
|
fill: (theme.vars || theme).palette.background.paper,
|
|
83
77
|
stroke: color,
|
|
@@ -238,6 +238,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
238
238
|
height: PropTypes.number,
|
|
239
239
|
hideTooltip: PropTypes.bool,
|
|
240
240
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
241
|
+
ignoreTooltip: PropTypes.bool,
|
|
241
242
|
label: PropTypes.string,
|
|
242
243
|
labelStyle: PropTypes.object,
|
|
243
244
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -293,6 +294,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
293
294
|
fill: PropTypes.string,
|
|
294
295
|
hideTooltip: PropTypes.bool,
|
|
295
296
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
297
|
+
ignoreTooltip: PropTypes.bool,
|
|
296
298
|
label: PropTypes.string,
|
|
297
299
|
labelStyle: PropTypes.object,
|
|
298
300
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -13,7 +13,7 @@ import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
|
13
13
|
import { useLineSeriesContext } from "../hooks/useLineSeries.js";
|
|
14
14
|
import getColor from "./seriesConfig/getColor.js";
|
|
15
15
|
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
16
|
-
import {
|
|
16
|
+
import { selectorChartsInteractionXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
17
17
|
import { useXAxes, useYAxes } from "../hooks/useAxis.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
/**
|
|
@@ -45,9 +45,8 @@ function LineHighlightPlot(props) {
|
|
|
45
45
|
instance
|
|
46
46
|
} = useChartContext();
|
|
47
47
|
const store = useStore();
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
if (highlightedIndex === undefined) {
|
|
48
|
+
const highlightedIndex = useSelector(store, selectorChartsInteractionXAxisIndex);
|
|
49
|
+
if (highlightedIndex === null) {
|
|
51
50
|
return null;
|
|
52
51
|
}
|
|
53
52
|
if (seriesData === undefined) {
|
|
@@ -7,16 +7,16 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from '@mui/x-charts-vendor/d3-shape';
|
|
10
|
-
import {
|
|
10
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
|
|
11
11
|
import { getSymbol } from "../internals/getSymbol.js";
|
|
12
12
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
13
13
|
import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { selectorChartsInteractionXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
15
|
+
import { markElementClasses, useUtilityClasses } from "./markElementClasses.js";
|
|
16
16
|
import { useSelector } from "../internals/store/useSelector.js";
|
|
17
17
|
import { useStore } from "../internals/store/useStore.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
const MarkElementPath = styled(
|
|
19
|
+
const MarkElementPath = styled('path', {
|
|
20
20
|
name: 'MuiMarkElement',
|
|
21
21
|
slot: 'Root',
|
|
22
22
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -26,7 +26,12 @@ const MarkElementPath = styled(animated.path, {
|
|
|
26
26
|
}) => ({
|
|
27
27
|
fill: (theme.vars || theme).palette.background.paper,
|
|
28
28
|
stroke: ownerState.color,
|
|
29
|
-
strokeWidth: 2
|
|
29
|
+
strokeWidth: 2,
|
|
30
|
+
[`&.${markElementClasses.animate}`]: {
|
|
31
|
+
transitionDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
32
|
+
transitionProperty: 'transform, transform-origin',
|
|
33
|
+
transitionTimingFunction: ANIMATION_TIMING_FUNCTION
|
|
34
|
+
}
|
|
30
35
|
}));
|
|
31
36
|
/**
|
|
32
37
|
* Demos:
|
|
@@ -63,37 +68,22 @@ function MarkElement(props) {
|
|
|
63
68
|
seriesId: id
|
|
64
69
|
});
|
|
65
70
|
const store = useStore();
|
|
66
|
-
const
|
|
67
|
-
const cx = useSpringValue(x, {
|
|
68
|
-
immediate: skipAnimation
|
|
69
|
-
});
|
|
70
|
-
const cy = useSpringValue(y, {
|
|
71
|
-
immediate: skipAnimation
|
|
72
|
-
});
|
|
73
|
-
React.useEffect(() => {
|
|
74
|
-
cy.start(y, {
|
|
75
|
-
immediate: skipAnimation
|
|
76
|
-
});
|
|
77
|
-
cx.start(x, {
|
|
78
|
-
immediate: skipAnimation
|
|
79
|
-
});
|
|
80
|
-
}, [cy, y, cx, x, skipAnimation]);
|
|
71
|
+
const xAxisInteractionIndex = useSelector(store, selectorChartsInteractionXAxisIndex);
|
|
81
72
|
const ownerState = {
|
|
82
73
|
id,
|
|
83
74
|
classes: innerClasses,
|
|
84
|
-
isHighlighted:
|
|
75
|
+
isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
|
|
85
76
|
isFaded,
|
|
86
|
-
color
|
|
77
|
+
color,
|
|
78
|
+
skipAnimation
|
|
87
79
|
};
|
|
88
80
|
const classes = useUtilityClasses(ownerState);
|
|
89
81
|
return /*#__PURE__*/_jsx(MarkElementPath, _extends({}, other, {
|
|
90
82
|
style: {
|
|
91
|
-
transform:
|
|
92
|
-
transformOrigin:
|
|
83
|
+
transform: `translate(${x}px, ${y}px)`,
|
|
84
|
+
transformOrigin: `${x}px ${y}px`
|
|
93
85
|
},
|
|
94
|
-
ownerState: ownerState
|
|
95
|
-
// @ts-expect-error
|
|
96
|
-
,
|
|
86
|
+
ownerState: ownerState,
|
|
97
87
|
className: classes.root,
|
|
98
88
|
d: d3Symbol(d3SymbolsFill[getSymbol(shape)])(),
|
|
99
89
|
onClick: onClick,
|
|
@@ -117,7 +107,6 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
117
107
|
shape: PropTypes.oneOf(['circle', 'cross', 'diamond', 'square', 'star', 'triangle', 'wye']).isRequired,
|
|
118
108
|
/**
|
|
119
109
|
* If `true`, animations are skipped.
|
|
120
|
-
* @default false
|
|
121
110
|
*/
|
|
122
111
|
skipAnimation: PropTypes.bool
|
|
123
112
|
} : void 0;
|
|
@@ -6,6 +6,8 @@ export interface MarkElementClasses {
|
|
|
6
6
|
highlighted: string;
|
|
7
7
|
/** Styles applied to the root element when faded. */
|
|
8
8
|
faded: string;
|
|
9
|
+
/** Styles applied to the root element when animation is not skipped. */
|
|
10
|
+
animate: string;
|
|
9
11
|
}
|
|
10
12
|
export type MarkElementClassKey = keyof MarkElementClasses;
|
|
11
13
|
export interface MarkElementOwnerState {
|
|
@@ -14,6 +16,7 @@ export interface MarkElementOwnerState {
|
|
|
14
16
|
isFaded: boolean;
|
|
15
17
|
isHighlighted: boolean;
|
|
16
18
|
classes?: Partial<MarkElementClasses>;
|
|
19
|
+
skipAnimation?: boolean;
|
|
17
20
|
}
|
|
18
21
|
export declare function getMarkElementUtilityClass(slot: string): string;
|
|
19
22
|
export declare const markElementClasses: MarkElementClasses;
|
|
@@ -4,16 +4,17 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
4
4
|
export function getMarkElementUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiMarkElement', slot);
|
|
6
6
|
}
|
|
7
|
-
export const markElementClasses = generateUtilityClasses('MuiMarkElement', ['root', 'highlighted', 'faded']);
|
|
7
|
+
export const markElementClasses = generateUtilityClasses('MuiMarkElement', ['root', 'highlighted', 'faded', 'animate']);
|
|
8
8
|
export const useUtilityClasses = ownerState => {
|
|
9
9
|
const {
|
|
10
10
|
classes,
|
|
11
11
|
id,
|
|
12
12
|
isFaded,
|
|
13
|
-
isHighlighted
|
|
13
|
+
isHighlighted,
|
|
14
|
+
skipAnimation
|
|
14
15
|
} = ownerState;
|
|
15
16
|
const slots = {
|
|
16
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
17
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded', skipAnimation ? undefined : 'animate']
|
|
17
18
|
};
|
|
18
19
|
return composeClasses(slots, getMarkElementUtilityClass, classes);
|
|
19
20
|
};
|
|
@@ -2,13 +2,14 @@ import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
|
2
2
|
import seriesProcessor from "./seriesProcessor.js";
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
import legendGetter from "./legend.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
|
colorProcessor: getColor,
|
|
9
9
|
seriesProcessor,
|
|
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<'line'>;
|
|
3
|
+
export declare const axisTooltipGetter: AxisTooltipGetter<'line', 'x' | 'y'>;
|
|
3
4
|
export default tooltipGetter;
|
|
@@ -22,4 +22,10 @@ const tooltipGetter = params => {
|
|
|
22
22
|
markType: series.labelMarkType
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
export const axisTooltipGetter = series => {
|
|
26
|
+
return Object.values(series).map(s => ({
|
|
27
|
+
direction: 'x',
|
|
28
|
+
axisId: s.xAxisId
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
25
31
|
export default tooltipGetter;
|
|
@@ -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 { ChartsClipPathProps } from "../ChartsClipPath/index.js";
|
|
@@ -35,5 +36,5 @@ export declare const useLineChartProps: (props: LineChartProps) => {
|
|
|
35
36
|
axisHighlightProps: ChartsAxisHighlightProps;
|
|
36
37
|
lineHighlightPlotProps: LineHighlightPlotProps;
|
|
37
38
|
legendProps: ChartsLegendSlotExtension;
|
|
38
|
-
children:
|
|
39
|
+
children: React.ReactNode;
|
|
39
40
|
};
|
|
@@ -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", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
|
+
import * as React from 'react';
|
|
6
7
|
import useId from '@mui/utils/useId';
|
|
7
8
|
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
8
9
|
import { LINE_CHART_PLUGINS } from "./LineChart.plugins.js";
|
|
@@ -43,11 +44,12 @@ export const useLineChartProps = props => {
|
|
|
43
44
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
44
45
|
const id = useId();
|
|
45
46
|
const clipPathId = `${id}-clip-path`;
|
|
47
|
+
const seriesWithDefault = React.useMemo(() => series.map(s => _extends({
|
|
48
|
+
disableHighlight: !!disableLineItemHighlight,
|
|
49
|
+
type: 'line'
|
|
50
|
+
}, s)), [disableLineItemHighlight, series]);
|
|
46
51
|
const chartContainerProps = _extends({}, other, {
|
|
47
|
-
series:
|
|
48
|
-
disableHighlight: !!disableLineItemHighlight,
|
|
49
|
-
type: 'line'
|
|
50
|
-
}, s)),
|
|
52
|
+
series: seriesWithDefault,
|
|
51
53
|
width,
|
|
52
54
|
height,
|
|
53
55
|
margin,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SpringValue } from '@react-spring/web';
|
|
3
2
|
import { PieItemId } from "../models/index.js";
|
|
4
3
|
export interface PieArcClasses {
|
|
5
4
|
/** Styles applied to the root element. */
|
|
@@ -21,16 +20,25 @@ interface PieArcOwnerState {
|
|
|
21
20
|
export declare function getPieArcUtilityClass(slot: string): string;
|
|
22
21
|
export declare const pieArcClasses: PieArcClasses;
|
|
23
22
|
export type PieArcProps = Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> & PieArcOwnerState & {
|
|
24
|
-
cornerRadius:
|
|
25
|
-
endAngle:
|
|
26
|
-
innerRadius:
|
|
23
|
+
cornerRadius: number;
|
|
24
|
+
endAngle: number;
|
|
25
|
+
innerRadius: number;
|
|
27
26
|
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
28
|
-
outerRadius:
|
|
29
|
-
paddingAngle:
|
|
30
|
-
startAngle:
|
|
27
|
+
outerRadius: number;
|
|
28
|
+
paddingAngle: number;
|
|
29
|
+
startAngle: number;
|
|
30
|
+
/** @default false */
|
|
31
|
+
skipAnimation: boolean;
|
|
31
32
|
};
|
|
32
|
-
declare
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
declare const PieArc: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGPathElement>, "ref" | "id"> & PieArcOwnerState & {
|
|
34
|
+
cornerRadius: number;
|
|
35
|
+
endAngle: number;
|
|
36
|
+
innerRadius: number;
|
|
37
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
38
|
+
outerRadius: number;
|
|
39
|
+
paddingAngle: number;
|
|
40
|
+
startAngle: number;
|
|
41
|
+
/** @default false */
|
|
42
|
+
skipAnimation: boolean;
|
|
43
|
+
} & React.RefAttributes<SVGPathElement>>;
|
|
36
44
|
export { PieArc };
|
|
@@ -2,15 +2,15 @@
|
|
|
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 = ["classes", "color", "
|
|
5
|
+
const _excluded = ["classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
9
|
-
import { animated, to } from '@react-spring/web';
|
|
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 { useAnimatePieArc } from "../hooks/index.js";
|
|
13
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
|
|
14
14
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export function getPieArcUtilityClass(slot) {
|
|
@@ -30,7 +30,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
};
|
|
31
31
|
return composeClasses(slots, getPieArcUtilityClass, classes);
|
|
32
32
|
};
|
|
33
|
-
const PieArcRoot = styled(
|
|
33
|
+
const PieArcRoot = styled('path', {
|
|
34
34
|
name: 'MuiPieArc',
|
|
35
35
|
slot: 'Root',
|
|
36
36
|
overridesResolver: (_, styles) => styles.arc
|
|
@@ -39,23 +39,26 @@ const PieArcRoot = styled(animated.path, {
|
|
|
39
39
|
}) => ({
|
|
40
40
|
// Got to move stroke to an element prop instead of style.
|
|
41
41
|
stroke: (theme.vars || theme).palette.background.paper,
|
|
42
|
-
|
|
42
|
+
transitionProperty: 'opacity, fill, filter',
|
|
43
|
+
transitionDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
44
|
+
transitionTimingFunction: ANIMATION_TIMING_FUNCTION
|
|
43
45
|
}));
|
|
44
|
-
function PieArc(props) {
|
|
46
|
+
const PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
|
|
45
47
|
const {
|
|
46
48
|
classes: innerClasses,
|
|
47
49
|
color,
|
|
48
|
-
cornerRadius,
|
|
49
50
|
dataIndex,
|
|
50
|
-
endAngle,
|
|
51
51
|
id,
|
|
52
|
-
innerRadius,
|
|
53
52
|
isFaded,
|
|
54
53
|
isHighlighted,
|
|
55
54
|
onClick,
|
|
55
|
+
cornerRadius,
|
|
56
|
+
startAngle,
|
|
57
|
+
endAngle,
|
|
58
|
+
innerRadius,
|
|
56
59
|
outerRadius,
|
|
57
60
|
paddingAngle,
|
|
58
|
-
|
|
61
|
+
skipAnimation
|
|
59
62
|
} = props,
|
|
60
63
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
61
64
|
const ownerState = {
|
|
@@ -72,17 +75,17 @@ function PieArc(props) {
|
|
|
72
75
|
seriesId: id,
|
|
73
76
|
dataIndex
|
|
74
77
|
});
|
|
78
|
+
const animatedProps = useAnimatePieArc({
|
|
79
|
+
cornerRadius,
|
|
80
|
+
startAngle,
|
|
81
|
+
endAngle,
|
|
82
|
+
innerRadius,
|
|
83
|
+
outerRadius,
|
|
84
|
+
paddingAngle,
|
|
85
|
+
skipAnimation,
|
|
86
|
+
ref
|
|
87
|
+
});
|
|
75
88
|
return /*#__PURE__*/_jsx(PieArcRoot, _extends({
|
|
76
|
-
d: to([startAngle, endAngle, paddingAngle, innerRadius, outerRadius, cornerRadius], (sA, eA, pA, iR, oR, cR) => d3Arc().cornerRadius(cR)({
|
|
77
|
-
padAngle: pA,
|
|
78
|
-
startAngle: sA,
|
|
79
|
-
endAngle: eA,
|
|
80
|
-
innerRadius: iR,
|
|
81
|
-
outerRadius: oR
|
|
82
|
-
})),
|
|
83
|
-
visibility: to([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
84
|
-
// @ts-expect-error
|
|
85
|
-
,
|
|
86
89
|
onClick: onClick,
|
|
87
90
|
cursor: onClick ? 'pointer' : 'unset',
|
|
88
91
|
ownerState: ownerState,
|
|
@@ -92,17 +95,27 @@ function PieArc(props) {
|
|
|
92
95
|
filter: ownerState.isHighlighted ? 'brightness(120%)' : 'none',
|
|
93
96
|
strokeWidth: 1,
|
|
94
97
|
strokeLinejoin: "round"
|
|
95
|
-
}, other, interactionProps));
|
|
96
|
-
}
|
|
98
|
+
}, other, interactionProps, animatedProps));
|
|
99
|
+
});
|
|
97
100
|
process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
98
101
|
// ----------------------------- Warning --------------------------------
|
|
99
102
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
100
103
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
101
104
|
// ----------------------------------------------------------------------
|
|
102
105
|
classes: PropTypes.object,
|
|
106
|
+
cornerRadius: PropTypes.number.isRequired,
|
|
103
107
|
dataIndex: PropTypes.number.isRequired,
|
|
108
|
+
endAngle: PropTypes.number.isRequired,
|
|
104
109
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
110
|
+
innerRadius: PropTypes.number.isRequired,
|
|
105
111
|
isFaded: PropTypes.bool.isRequired,
|
|
106
|
-
isHighlighted: PropTypes.bool.isRequired
|
|
112
|
+
isHighlighted: PropTypes.bool.isRequired,
|
|
113
|
+
outerRadius: PropTypes.number.isRequired,
|
|
114
|
+
paddingAngle: PropTypes.number.isRequired,
|
|
115
|
+
/**
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
118
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
119
|
+
startAngle: PropTypes.number.isRequired
|
|
107
120
|
} : void 0;
|
|
108
121
|
export { PieArc };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SpringValue } from '@react-spring/web';
|
|
3
2
|
import { PieItemId } from "../models/seriesType/pie.js";
|
|
4
3
|
export interface PieArcLabelClasses {
|
|
5
4
|
/** Styles applied to the root element. */
|
|
@@ -8,6 +7,8 @@ export interface PieArcLabelClasses {
|
|
|
8
7
|
highlighted: string;
|
|
9
8
|
/** Styles applied to the root element when faded. */
|
|
10
9
|
faded: string;
|
|
10
|
+
/** Styles applied to the root element when animation is not skipped. */
|
|
11
|
+
animate: string;
|
|
11
12
|
}
|
|
12
13
|
export type PieArcLabelClassKey = keyof PieArcLabelClasses;
|
|
13
14
|
interface PieArcLabelOwnerState {
|
|
@@ -15,23 +16,31 @@ interface PieArcLabelOwnerState {
|
|
|
15
16
|
color: string;
|
|
16
17
|
isFaded: boolean;
|
|
17
18
|
isHighlighted: boolean;
|
|
19
|
+
skipAnimation: boolean;
|
|
18
20
|
classes?: Partial<PieArcLabelClasses>;
|
|
19
21
|
}
|
|
20
22
|
export declare function getPieArcLabelUtilityClass(slot: string): string;
|
|
21
23
|
export declare const pieArcLabelClasses: PieArcLabelClasses;
|
|
22
24
|
export type PieArcLabelProps = PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, 'ref' | 'color' | 'id'> & {
|
|
23
|
-
startAngle:
|
|
24
|
-
endAngle:
|
|
25
|
-
innerRadius:
|
|
26
|
-
outerRadius:
|
|
27
|
-
arcLabelRadius:
|
|
28
|
-
cornerRadius:
|
|
29
|
-
paddingAngle:
|
|
30
|
-
|
|
25
|
+
startAngle: number;
|
|
26
|
+
endAngle: number;
|
|
27
|
+
innerRadius: number;
|
|
28
|
+
outerRadius: number;
|
|
29
|
+
arcLabelRadius: number;
|
|
30
|
+
cornerRadius: number;
|
|
31
|
+
paddingAngle: number;
|
|
32
|
+
skipAnimation: boolean;
|
|
31
33
|
formattedArcLabel?: string | null;
|
|
32
34
|
};
|
|
33
|
-
declare
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, "ref" | "color" | "id"> & {
|
|
36
|
+
startAngle: number;
|
|
37
|
+
endAngle: number;
|
|
38
|
+
innerRadius: number;
|
|
39
|
+
outerRadius: number;
|
|
40
|
+
arcLabelRadius: number;
|
|
41
|
+
cornerRadius: number;
|
|
42
|
+
paddingAngle: number;
|
|
43
|
+
skipAnimation: boolean;
|
|
44
|
+
formattedArcLabel?: string | null;
|
|
45
|
+
} & React.RefAttributes<SVGTextElement>>;
|
|
37
46
|
export { PieArcLabel };
|