@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
|
@@ -11,7 +11,7 @@ var _useSelector = require("../../internals/store/useSelector");
|
|
|
11
11
|
var _useStore = require("../../internals/store/useStore");
|
|
12
12
|
var _useChartContext = require("../../context/ChartProvider/useChartContext");
|
|
13
13
|
var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
|
|
14
|
-
var
|
|
14
|
+
var _useChartPolarInteraction = require("../../internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors");
|
|
15
15
|
function useRadarAxisHighlight(params) {
|
|
16
16
|
const {
|
|
17
17
|
includesNeighbors = false
|
|
@@ -26,10 +26,14 @@ function useRadarAxisHighlight(params) {
|
|
|
26
26
|
instance
|
|
27
27
|
} = (0, _useChartContext.useChartContext)();
|
|
28
28
|
const store = (0, _useStore.useStore)();
|
|
29
|
-
const
|
|
29
|
+
const rotationAxisIndex = (0, _useSelector.useSelector)(store, _useChartPolarInteraction.selectorChartsInteractionRotationAxisIndex);
|
|
30
|
+
const rotationAxisValue = (0, _useSelector.useSelector)(store, _useChartPolarInteraction.selectorChartsInteractionRotationAxisValue);
|
|
30
31
|
const center = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
|
|
31
|
-
const highlightedIndex =
|
|
32
|
-
if (
|
|
32
|
+
const highlightedIndex = rotationAxisIndex;
|
|
33
|
+
if (!rotationScale) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (highlightedIndex === null || highlightedIndex === -1) {
|
|
33
37
|
return null;
|
|
34
38
|
}
|
|
35
39
|
if (radarSeries === undefined || radarSeries.length === 0) {
|
|
@@ -37,7 +41,7 @@ function useRadarAxisHighlight(params) {
|
|
|
37
41
|
}
|
|
38
42
|
const metric = radiusAxisIds[highlightedIndex];
|
|
39
43
|
const radiusScale = radiusAxis[metric].scale;
|
|
40
|
-
const angle = rotationScale(
|
|
44
|
+
const angle = rotationScale(rotationAxisValue);
|
|
41
45
|
const radius = radiusScale.range()[1];
|
|
42
46
|
return {
|
|
43
47
|
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
|
}
|
|
@@ -17,11 +17,15 @@ function RadarGrid(props) {
|
|
|
17
17
|
divisions = 5,
|
|
18
18
|
shape = 'sharp'
|
|
19
19
|
} = props;
|
|
20
|
+
const gridData = (0, _useRadarGridData.useRadarGridData)();
|
|
21
|
+
if (gridData === null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
20
24
|
const {
|
|
21
25
|
center,
|
|
22
26
|
corners,
|
|
23
27
|
radius
|
|
24
|
-
} =
|
|
28
|
+
} = gridData;
|
|
25
29
|
return shape === 'sharp' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SharpRadarGrid.SharpRadarGrid, {
|
|
26
30
|
divisions: divisions,
|
|
27
31
|
corners: corners,
|
|
@@ -19,6 +19,9 @@ function useRadarGridData() {
|
|
|
19
19
|
const drawingArea = (0, _useDrawingArea.useDrawingArea)();
|
|
20
20
|
const cx = drawingArea.left + drawingArea.width / 2;
|
|
21
21
|
const cy = drawingArea.top + drawingArea.height / 2;
|
|
22
|
+
if (!rotationScale || rotationScale.domain().length === 0) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
22
25
|
const metrics = rotationScale.domain();
|
|
23
26
|
const angles = metrics.map(key => rotationScale(key));
|
|
24
27
|
return {
|
|
@@ -29,8 +29,8 @@ function useRadarSeriesData(querySeriesId) {
|
|
|
29
29
|
isFaded: isItemFaded,
|
|
30
30
|
isHighlighted: isItemHighlighted
|
|
31
31
|
} = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
|
|
32
|
-
const metrics = rotationScale
|
|
33
|
-
const angles = metrics.map(key => rotationScale(key));
|
|
32
|
+
const metrics = rotationScale?.domain() ?? [];
|
|
33
|
+
const angles = metrics.map(key => rotationScale?.(key));
|
|
34
34
|
return radarSeries.map(series => {
|
|
35
35
|
const seriesId = series.id;
|
|
36
36
|
const isSeriesHighlighted = isItemHighlighted({
|
|
@@ -236,6 +236,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
236
236
|
height: _propTypes.default.number,
|
|
237
237
|
hideTooltip: _propTypes.default.bool,
|
|
238
238
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
239
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
239
240
|
label: _propTypes.default.string,
|
|
240
241
|
labelStyle: _propTypes.default.object,
|
|
241
242
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -291,6 +292,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
291
292
|
fill: _propTypes.default.string,
|
|
292
293
|
hideTooltip: _propTypes.default.bool,
|
|
293
294
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
295
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
294
296
|
label: _propTypes.default.string,
|
|
295
297
|
labelStyle: _propTypes.default.object,
|
|
296
298
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.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
|
};
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.useScatterChartProps = void 0;
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
13
|
var _ScatterChart = require("./ScatterChart.plugins");
|
|
12
14
|
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
13
15
|
/**
|
|
@@ -42,10 +44,11 @@ const useScatterChartProps = props => {
|
|
|
42
44
|
className
|
|
43
45
|
} = props,
|
|
44
46
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
|
+
const seriesWithDefault = React.useMemo(() => series.map(s => (0, _extends2.default)({
|
|
48
|
+
type: 'scatter'
|
|
49
|
+
}, s)), [series]);
|
|
45
50
|
const chartContainerProps = (0, _extends2.default)({}, other, {
|
|
46
|
-
series:
|
|
47
|
-
type: 'scatter'
|
|
48
|
-
}, s)),
|
|
51
|
+
series: seriesWithDefault,
|
|
49
52
|
width,
|
|
50
53
|
height,
|
|
51
54
|
margin,
|
|
@@ -299,6 +299,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
299
299
|
height: _propTypes.default.number,
|
|
300
300
|
hideTooltip: _propTypes.default.bool,
|
|
301
301
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
302
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
302
303
|
label: _propTypes.default.string,
|
|
303
304
|
labelStyle: _propTypes.default.object,
|
|
304
305
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -353,6 +354,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
353
354
|
fill: _propTypes.default.string,
|
|
354
355
|
hideTooltip: _propTypes.default.bool,
|
|
355
356
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
357
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
356
358
|
label: _propTypes.default.string,
|
|
357
359
|
labelStyle: _propTypes.default.object,
|
|
358
360
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.rainbowSurgePaletteLight = exports.rainbowSurgePaletteDark = exports.rainbowSurgePalette = exports.mangoFusionPaletteLight = exports.mangoFusionPaletteDark = exports.mangoFusionPalette = exports.cheerfulFiestaPaletteLight = exports.cheerfulFiestaPaletteDark = exports.cheerfulFiestaPalette = exports.blueberryTwilightPaletteLight = exports.blueberryTwilightPaletteDark = exports.blueberryTwilightPalette = void 0;
|
|
7
|
-
const rainbowSurgePaletteLight = exports.rainbowSurgePaletteLight = ['#4254FB', '#
|
|
8
|
-
const rainbowSurgePaletteDark = exports.rainbowSurgePaletteDark = ['#
|
|
7
|
+
const rainbowSurgePaletteLight = exports.rainbowSurgePaletteLight = ['#4254FB', '#FFB422', '#FA4F58', '#0DBEFF', '#22BF75', '#FA83B4', '#FF7511'];
|
|
8
|
+
const rainbowSurgePaletteDark = exports.rainbowSurgePaletteDark = ['#495AFB', '#FFC758', '#F35865', '#30C8FF', '#44CE8D', '#F286B3', '#FF8C39'];
|
|
9
9
|
const rainbowSurgePalette = mode => mode === 'dark' ? rainbowSurgePaletteDark : rainbowSurgePaletteLight;
|
|
10
10
|
exports.rainbowSurgePalette = rainbowSurgePalette;
|
|
11
11
|
const blueberryTwilightPaletteLight = exports.blueberryTwilightPaletteLight = ['#02B2AF', '#2E96FF', '#B800D8', '#60009B', '#2731C8', '#03008D'];
|
package/constants/index.d.ts
CHANGED
|
@@ -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;
|
package/constants/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const DEFAULT_MARGINS = exports.DEFAULT_MARGINS = {
|
|
|
14
14
|
left: 20,
|
|
15
15
|
right: 20
|
|
16
16
|
};
|
|
17
|
-
const DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_WIDTH =
|
|
17
|
+
const DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_WIDTH = 45;
|
|
18
18
|
const DEFAULT_AXIS_SIZE_HEIGHT = exports.DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
19
19
|
|
|
20
20
|
// How many pixels to add to the default axis size if that axis has a label
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.AnimationProvider = AnimationProvider;
|
|
9
|
-
var _web = require("@react-spring/web");
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
11
12
|
var _AnimationContext = require("./AnimationContext");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function AnimationProvider(props) {
|
|
@@ -24,7 +25,7 @@ function AnimationProvider(props) {
|
|
|
24
25
|
// We use the value of `isAnimationDisabledEnvironment` as the initial value of `skipAnimation` to avoid
|
|
25
26
|
// re-rendering the component on environments where matchMedia is not supported, hence skipAnimation will always be true.
|
|
26
27
|
const [skipAnimation, setSkipAnimation] = React.useState(process.env.NODE_ENV === 'test' ? isAnimationDisabledEnvironment || undefined : undefined);
|
|
27
|
-
(0,
|
|
28
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
28
29
|
if (isAnimationDisabledEnvironment) {
|
|
29
30
|
return undefined;
|
|
30
31
|
}
|
|
@@ -32,9 +33,6 @@ function AnimationProvider(props) {
|
|
|
32
33
|
// This hook can remove animation but never activate it.
|
|
33
34
|
const inputValue = event.matches || undefined;
|
|
34
35
|
setSkipAnimation(inputValue);
|
|
35
|
-
_web.Globals.assign({
|
|
36
|
-
skipAnimation: inputValue
|
|
37
|
-
});
|
|
38
36
|
};
|
|
39
37
|
const mql = window.matchMedia('(prefers-reduced-motion)');
|
|
40
38
|
handleMediaChange(mql);
|
|
@@ -44,7 +42,7 @@ function AnimationProvider(props) {
|
|
|
44
42
|
return () => {
|
|
45
43
|
mql?.removeEventListener?.('change', handleMediaChange);
|
|
46
44
|
};
|
|
47
|
-
}, []);
|
|
45
|
+
}, [isAnimationDisabledEnvironment]);
|
|
48
46
|
const value = React.useMemo(() => ({
|
|
49
47
|
isInitialized: true,
|
|
50
48
|
data: {
|
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
export interface BarProps extends Omit<React.SVGProps<SVGRectElement>, 'id' | 'color' | 'ref' | 'x' | 'y' | 'height' | 'width'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
width?: string | number | undefined;
|
|
9
|
-
}> {
|
|
2
|
+
import { SeriesId } from "../models/seriesType/common.js";
|
|
3
|
+
import { BarElementOwnerState } from "./barElementClasses.js";
|
|
4
|
+
export interface BarProps extends Omit<React.SVGProps<SVGRectElement>, 'id' | 'color' | 'ref' | 'x' | 'y' | 'height' | 'width'> {
|
|
5
|
+
id: SeriesId;
|
|
6
|
+
dataIndex: number;
|
|
7
|
+
color: string;
|
|
10
8
|
ownerState: BarElementOwnerState;
|
|
9
|
+
/**
|
|
10
|
+
* The position in the x-axis of the stack this bar belongs to.
|
|
11
|
+
*/
|
|
12
|
+
xOrigin: number;
|
|
13
|
+
/**
|
|
14
|
+
* The position in the y-axis of the stack this bar belongs to.
|
|
15
|
+
*/
|
|
16
|
+
yOrigin: number;
|
|
17
|
+
/**
|
|
18
|
+
* The position of the bar in the x-axis.
|
|
19
|
+
*/
|
|
20
|
+
x: number;
|
|
21
|
+
/**
|
|
22
|
+
* The position of the bar in the y-axis.
|
|
23
|
+
*/
|
|
24
|
+
y: number;
|
|
25
|
+
/**
|
|
26
|
+
* The height of the bar.
|
|
27
|
+
*/
|
|
28
|
+
height: number;
|
|
29
|
+
/**
|
|
30
|
+
* The width of the bar.
|
|
31
|
+
*/
|
|
32
|
+
width: number;
|
|
33
|
+
/**
|
|
34
|
+
* The orientation of the bar.
|
|
35
|
+
*/
|
|
36
|
+
layout: 'vertical' | 'horizontal';
|
|
37
|
+
/**
|
|
38
|
+
* If true, no animations should be applied.
|
|
39
|
+
*/
|
|
40
|
+
skipAnimation: boolean;
|
|
11
41
|
}
|
|
12
42
|
export declare function AnimatedBarElement(props: BarProps): React.JSX.Element;
|
|
@@ -2,18 +2,18 @@
|
|
|
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 = ["ownerState"];
|
|
5
|
+
const _excluded = ["ownerState", "skipAnimation", "id", "dataIndex", "xOrigin", "yOrigin"];
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { useAnimateBar } from "../hooks/animation/useAnimateBar.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export function AnimatedBarElement(props) {
|
|
10
10
|
const {
|
|
11
11
|
ownerState
|
|
12
12
|
} = props,
|
|
13
13
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const animatedProps = useAnimateBar(props);
|
|
15
|
+
return /*#__PURE__*/_jsx("rect", _extends({}, other, {
|
|
16
16
|
filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
|
|
17
17
|
opacity: ownerState.isFaded ? 0.3 : 1
|
|
18
|
-
}));
|
|
18
|
+
}, animatedProps));
|
|
19
19
|
}
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -238,6 +238,7 @@ process.env.NODE_ENV !== "production" ? BarChart.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" ? BarChart.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]),
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { GetRadiusData } from "./getRadius.js";
|
|
3
|
+
type UseAnimateBarClipRectParams = Pick<BarClipRectProps, 'x' | 'y' | 'width' | 'height' | 'skipAnimation'> & {
|
|
4
|
+
ref?: React.Ref<SVGRectElement>;
|
|
5
|
+
borderRadius: number;
|
|
6
|
+
ownerState: Omit<GetRadiusData, 'borderRadius'>;
|
|
7
|
+
};
|
|
8
|
+
type UseAnimateBarClipRectReturn = {
|
|
9
|
+
ref: React.Ref<SVGRectElement>;
|
|
10
|
+
style: React.CSSProperties;
|
|
11
|
+
} & Pick<BarClipRectProps, 'x' | 'y' | 'width' | 'height'>;
|
|
12
|
+
export declare function useAnimateBarClipRect(props: UseAnimateBarClipRectParams): UseAnimateBarClipRectReturn;
|
|
13
|
+
interface BarClipRectProps extends Pick<BarClipPathProps, 'x' | 'y' | 'width' | 'height' | 'skipAnimation'> {
|
|
14
|
+
ownerState: GetRadiusData;
|
|
15
|
+
}
|
|
2
16
|
export interface BarClipPathProps {
|
|
3
17
|
maskId: string;
|
|
4
18
|
borderRadius?: number;
|
|
5
19
|
hasNegative: boolean;
|
|
6
20
|
hasPositive: boolean;
|
|
7
21
|
layout?: 'vertical' | 'horizontal';
|
|
8
|
-
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
skipAnimation: boolean;
|
|
9
27
|
}
|
|
10
28
|
/**
|
|
11
29
|
* @ignore - internal component.
|
|
@@ -1,31 +1,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["maskId", "x", "y", "width", "height", "skipAnimation"];
|
|
4
6
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
7
|
+
import { interpolateNumber } from '@mui/x-charts-vendor/d3-interpolate';
|
|
8
|
+
import { useAnimate } from "../internals/animation/useAnimate.js";
|
|
6
9
|
import { getRadius } from "./getRadius.js";
|
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return /*#__PURE__*/_jsx(animated.rect, {
|
|
12
|
-
style: _extends({}, props.style, {
|
|
13
|
-
clipPath: (props.ownerState.layout === 'vertical' ? props.style?.height : props.style?.width).to(value => buildInset({
|
|
14
|
-
topLeft: Math.min(value, getRadius('top-left', radiusData)),
|
|
15
|
-
topRight: Math.min(value, getRadius('top-right', radiusData)),
|
|
16
|
-
bottomRight: Math.min(value, getRadius('bottom-right', radiusData)),
|
|
17
|
-
bottomLeft: Math.min(value, getRadius('bottom-left', radiusData))
|
|
18
|
-
}))
|
|
19
|
-
})
|
|
11
|
+
function buildClipPath(size, borderRadius, ownerState) {
|
|
12
|
+
const radiusData = _extends({}, ownerState, {
|
|
13
|
+
borderRadius
|
|
20
14
|
});
|
|
15
|
+
const topLeft = Math.min(size, getRadius('top-left', radiusData));
|
|
16
|
+
const topRight = Math.min(size, getRadius('top-right', radiusData));
|
|
17
|
+
const bottomRight = Math.min(size, getRadius('bottom-right', radiusData));
|
|
18
|
+
const bottomLeft = Math.min(size, getRadius('bottom-left', radiusData));
|
|
19
|
+
return `inset(0px round ${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px)`;
|
|
20
|
+
}
|
|
21
|
+
function barClipRectPropsInterpolator(from, to) {
|
|
22
|
+
const interpolateX = interpolateNumber(from.x, to.x);
|
|
23
|
+
const interpolateY = interpolateNumber(from.y, to.y);
|
|
24
|
+
const interpolateWidth = interpolateNumber(from.width, to.width);
|
|
25
|
+
const interpolateHeight = interpolateNumber(from.height, to.height);
|
|
26
|
+
const interpolateBorderRadius = interpolateNumber(from.borderRadius, to.borderRadius);
|
|
27
|
+
return t => {
|
|
28
|
+
return {
|
|
29
|
+
x: interpolateX(t),
|
|
30
|
+
y: interpolateY(t),
|
|
31
|
+
width: interpolateWidth(t),
|
|
32
|
+
height: interpolateHeight(t),
|
|
33
|
+
borderRadius: interpolateBorderRadius(t)
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function useAnimateBarClipRect(props) {
|
|
38
|
+
const initialProps = {
|
|
39
|
+
x: props.x,
|
|
40
|
+
y: props.y + (props.ownerState.layout === 'vertical' ? props.height : 0),
|
|
41
|
+
width: props.ownerState.layout === 'vertical' ? props.width : 0,
|
|
42
|
+
height: props.ownerState.layout === 'vertical' ? 0 : props.height,
|
|
43
|
+
borderRadius: props.borderRadius
|
|
44
|
+
};
|
|
45
|
+
const ref = useAnimate({
|
|
46
|
+
x: props.x,
|
|
47
|
+
y: props.y,
|
|
48
|
+
width: props.width,
|
|
49
|
+
height: props.height,
|
|
50
|
+
borderRadius: props.borderRadius
|
|
51
|
+
}, {
|
|
52
|
+
createInterpolator: barClipRectPropsInterpolator,
|
|
53
|
+
applyProps(element, animatedProps) {
|
|
54
|
+
element.setAttribute('x', animatedProps.x.toString());
|
|
55
|
+
element.setAttribute('y', animatedProps.y.toString());
|
|
56
|
+
element.setAttribute('width', animatedProps.width.toString());
|
|
57
|
+
element.setAttribute('height', animatedProps.height.toString());
|
|
58
|
+
element.style.clipPath = buildClipPath(props.ownerState.layout === 'vertical' ? animatedProps.height : animatedProps.width, animatedProps.borderRadius, props.ownerState);
|
|
59
|
+
},
|
|
60
|
+
initialProps,
|
|
61
|
+
skip: props.skipAnimation
|
|
62
|
+
});
|
|
63
|
+
const usedProps = props.skipAnimation ? props : initialProps;
|
|
64
|
+
return {
|
|
65
|
+
ref,
|
|
66
|
+
x: usedProps.x,
|
|
67
|
+
y: usedProps.y,
|
|
68
|
+
width: usedProps.width,
|
|
69
|
+
height: usedProps.height,
|
|
70
|
+
style: {
|
|
71
|
+
clipPath: buildClipPath(props.ownerState.layout === 'vertical' ? usedProps.height : usedProps.width, usedProps.borderRadius, props.ownerState)
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function BarClipRect(props) {
|
|
76
|
+
const animatedProps = useAnimateBarClipRect(_extends({}, props, {
|
|
77
|
+
borderRadius: props.ownerState.borderRadius ?? 0
|
|
78
|
+
}));
|
|
79
|
+
return /*#__PURE__*/_jsx("rect", _extends({}, animatedProps));
|
|
21
80
|
}
|
|
22
81
|
/**
|
|
23
82
|
* @ignore - internal component.
|
|
24
83
|
*/
|
|
25
84
|
function BarClipPath(props) {
|
|
26
85
|
const {
|
|
27
|
-
|
|
28
|
-
|
|
86
|
+
maskId,
|
|
87
|
+
x,
|
|
88
|
+
y,
|
|
89
|
+
width,
|
|
90
|
+
height,
|
|
91
|
+
skipAnimation
|
|
29
92
|
} = props,
|
|
30
93
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
94
|
if (!props.borderRadius || props.borderRadius <= 0) {
|
|
@@ -35,7 +98,11 @@ function BarClipPath(props) {
|
|
|
35
98
|
id: maskId,
|
|
36
99
|
children: /*#__PURE__*/_jsx(BarClipRect, {
|
|
37
100
|
ownerState: rest,
|
|
38
|
-
|
|
101
|
+
x: x,
|
|
102
|
+
y: y,
|
|
103
|
+
width: width,
|
|
104
|
+
height: height,
|
|
105
|
+
skipAnimation: skipAnimation
|
|
39
106
|
})
|
|
40
107
|
});
|
|
41
108
|
}
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
3
|
-
import {
|
|
3
|
+
import { BarElementOwnerState } from "./barElementClasses.js";
|
|
4
4
|
import { BarProps } from "./AnimatedBarElement.js";
|
|
5
|
-
export interface BarElementClasses {
|
|
6
|
-
/** Styles applied to the root element. */
|
|
7
|
-
root: string;
|
|
8
|
-
/** Styles applied to the root element if it is highlighted. */
|
|
9
|
-
highlighted: string;
|
|
10
|
-
/** Styles applied to the root element if it is faded. */
|
|
11
|
-
faded: string;
|
|
12
|
-
}
|
|
13
|
-
export type BarElementClassKey = keyof BarElementClasses;
|
|
14
|
-
export interface BarElementOwnerState {
|
|
15
|
-
id: SeriesId;
|
|
16
|
-
dataIndex: number;
|
|
17
|
-
color: string;
|
|
18
|
-
isFaded: boolean;
|
|
19
|
-
isHighlighted: boolean;
|
|
20
|
-
classes?: Partial<BarElementClasses>;
|
|
21
|
-
}
|
|
22
|
-
export declare function getBarElementUtilityClass(slot: string): string;
|
|
23
|
-
export declare const barElementClasses: BarElementClasses;
|
|
24
5
|
export interface BarElementSlots {
|
|
25
6
|
/**
|
|
26
7
|
* The component that renders the bar.
|
|
@@ -42,6 +23,14 @@ export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighligh
|
|
|
42
23
|
* @default {}
|
|
43
24
|
*/
|
|
44
25
|
slots?: BarElementSlots;
|
|
26
|
+
x: number;
|
|
27
|
+
xOrigin: number;
|
|
28
|
+
y: number;
|
|
29
|
+
yOrigin: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
layout: 'horizontal' | 'vertical';
|
|
33
|
+
skipAnimation: boolean;
|
|
45
34
|
};
|
|
46
35
|
declare function BarElement(props: BarElementProps): React.JSX.Element;
|
|
47
36
|
declare namespace BarElement {
|
|
@@ -2,33 +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 = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick"];
|
|
5
|
+
const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick", "skipAnimation", "layout", "x", "xOrigin", "y", "yOrigin", "width", "height"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import composeClasses from '@mui/utils/composeClasses';
|
|
9
8
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
10
|
-
import
|
|
11
|
-
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
9
|
+
import { useUtilityClasses } from "./barElementClasses.js";
|
|
12
10
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
13
11
|
import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
|
|
14
12
|
import { AnimatedBarElement } from "./AnimatedBarElement.js";
|
|
15
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
export function getBarElementUtilityClass(slot) {
|
|
17
|
-
return generateUtilityClass('MuiBarElement', slot);
|
|
18
|
-
}
|
|
19
|
-
export const barElementClasses = generateUtilityClasses('MuiBarElement', ['root', 'highlighted', 'faded']);
|
|
20
|
-
const useUtilityClasses = ownerState => {
|
|
21
|
-
const {
|
|
22
|
-
classes,
|
|
23
|
-
id,
|
|
24
|
-
isHighlighted,
|
|
25
|
-
isFaded
|
|
26
|
-
} = ownerState;
|
|
27
|
-
const slots = {
|
|
28
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
29
|
-
};
|
|
30
|
-
return composeClasses(slots, getBarElementUtilityClass, classes);
|
|
31
|
-
};
|
|
32
14
|
function BarElement(props) {
|
|
33
15
|
const {
|
|
34
16
|
id,
|
|
@@ -38,7 +20,15 @@ function BarElement(props) {
|
|
|
38
20
|
slots,
|
|
39
21
|
slotProps,
|
|
40
22
|
style,
|
|
41
|
-
onClick
|
|
23
|
+
onClick,
|
|
24
|
+
skipAnimation,
|
|
25
|
+
layout,
|
|
26
|
+
x,
|
|
27
|
+
xOrigin,
|
|
28
|
+
y,
|
|
29
|
+
yOrigin,
|
|
30
|
+
width,
|
|
31
|
+
height
|
|
42
32
|
} = props,
|
|
43
33
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
44
34
|
const interactionProps = useInteractionItemProps({
|
|
@@ -68,11 +58,22 @@ function BarElement(props) {
|
|
|
68
58
|
externalSlotProps: slotProps?.bar,
|
|
69
59
|
externalForwardedProps: other,
|
|
70
60
|
additionalProps: _extends({}, interactionProps, {
|
|
61
|
+
id,
|
|
62
|
+
dataIndex,
|
|
63
|
+
color,
|
|
64
|
+
x,
|
|
65
|
+
xOrigin,
|
|
66
|
+
y,
|
|
67
|
+
yOrigin,
|
|
68
|
+
width,
|
|
69
|
+
height,
|
|
71
70
|
style,
|
|
72
71
|
onClick,
|
|
73
72
|
cursor: onClick ? 'pointer' : 'unset',
|
|
74
73
|
stroke: 'none',
|
|
75
|
-
fill: color
|
|
74
|
+
fill: color,
|
|
75
|
+
skipAnimation,
|
|
76
|
+
layout
|
|
76
77
|
}),
|
|
77
78
|
className: classes.root,
|
|
78
79
|
ownerState
|
|
@@ -87,6 +88,8 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
|
|
|
87
88
|
classes: PropTypes.object,
|
|
88
89
|
dataIndex: PropTypes.number.isRequired,
|
|
89
90
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
91
|
+
layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
|
|
92
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
90
93
|
/**
|
|
91
94
|
* The props used for each component slot.
|
|
92
95
|
* @default {}
|
|
@@ -96,6 +99,8 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
|
|
|
96
99
|
* Overridable component slots.
|
|
97
100
|
* @default {}
|
|
98
101
|
*/
|
|
99
|
-
slots: PropTypes.object
|
|
102
|
+
slots: PropTypes.object,
|
|
103
|
+
xOrigin: PropTypes.number.isRequired,
|
|
104
|
+
yOrigin: PropTypes.number.isRequired
|
|
100
105
|
} : void 0;
|
|
101
106
|
export { BarElement };
|