@mui/x-charts 8.0.0-beta.2 → 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/CHANGELOG.md +141 -0
- package/ChartContainer/ChartContainer.js +4 -0
- 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/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/ChartsTooltip/ChartsTooltip.js +2 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +3 -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 +71 -37
- 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 +16 -22
- package/LineChart/LineChart.js +2 -0
- package/LineChart/LineHighlightPlot.js +2 -3
- 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/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/ScatterChart/ScatterChart.js +2 -0
- 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/ChartContainer/ChartContainer.js +4 -0
- 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/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +4 -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/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/ScatterChart/ScatterChart.js +2 -0
- 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/useInteractionItemProps.js +11 -0
- 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/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +60 -26
- 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/useInteractionItemProps.js +11 -0
- 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/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +61 -27
- 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/ChartContainer/ChartContainer.js +4 -0
- 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/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +4 -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/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/ScatterChart/ScatterChart.js +2 -0
- 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/useInteractionItemProps.js +11 -0
- 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/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +60 -26
- 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
|
@@ -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 };
|