@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
package/PieChart/PieArcLabel.js
CHANGED
|
@@ -6,38 +6,39 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.PieArcLabel =
|
|
9
|
+
exports.PieArcLabel = void 0;
|
|
10
10
|
exports.getPieArcLabelUtilityClass = getPieArcLabelUtilityClass;
|
|
11
11
|
exports.pieArcLabelClasses = void 0;
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
14
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _web = require("@react-spring/web");
|
|
17
|
-
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
18
16
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
19
17
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
20
18
|
var _styles = require("@mui/material/styles");
|
|
21
19
|
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
20
|
+
var _animation = require("../internals/animation/animation");
|
|
21
|
+
var _useAnimatePieArcLabel = require("../hooks/animation/useAnimatePieArcLabel");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
|
|
23
|
+
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style", "skipAnimation"];
|
|
24
24
|
function getPieArcLabelUtilityClass(slot) {
|
|
25
25
|
return (0, _generateUtilityClass.default)('MuiPieArcLabel', slot);
|
|
26
26
|
}
|
|
27
|
-
const pieArcLabelClasses = exports.pieArcLabelClasses = (0, _generateUtilityClasses.default)('MuiPieArcLabel', ['root', 'highlighted', 'faded']);
|
|
27
|
+
const pieArcLabelClasses = exports.pieArcLabelClasses = (0, _generateUtilityClasses.default)('MuiPieArcLabel', ['root', 'highlighted', 'faded', 'animate']);
|
|
28
28
|
const useUtilityClasses = ownerState => {
|
|
29
29
|
const {
|
|
30
30
|
classes,
|
|
31
31
|
id,
|
|
32
32
|
isFaded,
|
|
33
|
-
isHighlighted
|
|
33
|
+
isHighlighted,
|
|
34
|
+
skipAnimation
|
|
34
35
|
} = ownerState;
|
|
35
36
|
const slots = {
|
|
36
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
37
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
|
|
37
38
|
};
|
|
38
39
|
return (0, _composeClasses.default)(slots, getPieArcLabelUtilityClass, classes);
|
|
39
40
|
};
|
|
40
|
-
const PieArcLabelRoot = (0, _styles.styled)(
|
|
41
|
+
const PieArcLabelRoot = (0, _styles.styled)('text', {
|
|
41
42
|
name: 'MuiPieArcLabel',
|
|
42
43
|
slot: 'Root',
|
|
43
44
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -47,29 +48,20 @@ const PieArcLabelRoot = (0, _styles.styled)(_web.animated.text, {
|
|
|
47
48
|
fill: (theme.vars || theme).palette.text.primary,
|
|
48
49
|
textAnchor: 'middle',
|
|
49
50
|
dominantBaseline: 'middle',
|
|
50
|
-
pointerEvents: 'none'
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
padAngle,
|
|
62
|
-
startAngle,
|
|
63
|
-
endAngle,
|
|
64
|
-
innerRadius: arcLabelRadius,
|
|
65
|
-
outerRadius: arcLabelRadius
|
|
66
|
-
});
|
|
67
|
-
if (variable === 'x') {
|
|
68
|
-
return x;
|
|
51
|
+
pointerEvents: 'none',
|
|
52
|
+
animationName: 'animate-opacity',
|
|
53
|
+
animationDuration: '0s',
|
|
54
|
+
animationTimingFunction: _animation.ANIMATION_TIMING_FUNCTION,
|
|
55
|
+
[`&.${pieArcLabelClasses.animate}`]: {
|
|
56
|
+
animationDuration: `${_animation.ANIMATION_DURATION_MS}ms`
|
|
57
|
+
},
|
|
58
|
+
'@keyframes animate-opacity': {
|
|
59
|
+
from: {
|
|
60
|
+
opacity: 0
|
|
61
|
+
}
|
|
69
62
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
function PieArcLabel(props) {
|
|
63
|
+
}));
|
|
64
|
+
const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function PieArcLabel(props, ref) {
|
|
73
65
|
const {
|
|
74
66
|
id,
|
|
75
67
|
classes: innerClasses,
|
|
@@ -77,12 +69,13 @@ function PieArcLabel(props) {
|
|
|
77
69
|
startAngle,
|
|
78
70
|
endAngle,
|
|
79
71
|
paddingAngle,
|
|
80
|
-
|
|
72
|
+
innerRadius,
|
|
73
|
+
outerRadius,
|
|
81
74
|
cornerRadius,
|
|
82
75
|
formattedArcLabel,
|
|
83
76
|
isHighlighted,
|
|
84
77
|
isFaded,
|
|
85
|
-
|
|
78
|
+
skipAnimation
|
|
86
79
|
} = props,
|
|
87
80
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
88
81
|
const ownerState = {
|
|
@@ -90,32 +83,43 @@ function PieArcLabel(props) {
|
|
|
90
83
|
classes: innerClasses,
|
|
91
84
|
color,
|
|
92
85
|
isFaded,
|
|
93
|
-
isHighlighted
|
|
86
|
+
isHighlighted,
|
|
87
|
+
skipAnimation
|
|
94
88
|
};
|
|
95
89
|
const classes = useUtilityClasses(ownerState);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
const animatedProps = (0, _useAnimatePieArcLabel.useAnimatePieArcLabel)({
|
|
91
|
+
cornerRadius,
|
|
92
|
+
startAngle,
|
|
93
|
+
endAngle,
|
|
94
|
+
innerRadius,
|
|
95
|
+
outerRadius,
|
|
96
|
+
paddingAngle,
|
|
97
|
+
skipAnimation,
|
|
98
|
+
ref
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PieArcLabelRoot, (0, _extends2.default)({
|
|
101
|
+
className: classes.root
|
|
102
|
+
}, other, animatedProps, {
|
|
103
|
+
children: formattedArcLabel
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
110
106
|
process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
111
107
|
// ----------------------------- Warning --------------------------------
|
|
112
108
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
113
109
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
114
110
|
// ----------------------------------------------------------------------
|
|
111
|
+
arcLabelRadius: _propTypes.default.number.isRequired,
|
|
115
112
|
classes: _propTypes.default.object,
|
|
116
113
|
color: _propTypes.default.string.isRequired,
|
|
114
|
+
cornerRadius: _propTypes.default.number.isRequired,
|
|
115
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
117
116
|
formattedArcLabel: _propTypes.default.string,
|
|
118
117
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
118
|
+
innerRadius: _propTypes.default.number.isRequired,
|
|
119
119
|
isFaded: _propTypes.default.bool.isRequired,
|
|
120
|
-
isHighlighted: _propTypes.default.bool.isRequired
|
|
120
|
+
isHighlighted: _propTypes.default.bool.isRequired,
|
|
121
|
+
outerRadius: _propTypes.default.number.isRequired,
|
|
122
|
+
paddingAngle: _propTypes.default.number.isRequired,
|
|
123
|
+
skipAnimation: _propTypes.default.bool.isRequired,
|
|
124
|
+
startAngle: _propTypes.default.number.isRequired
|
|
121
125
|
} : void 0;
|
|
@@ -11,14 +11,11 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var _web = require("@react-spring/web");
|
|
15
|
-
var _transition = require("./dataTransform/transition");
|
|
16
14
|
var _useTransformData = require("./dataTransform/useTransformData");
|
|
17
15
|
var _PieArcLabel = require("./PieArcLabel");
|
|
18
16
|
var _getLabel = require("../internals/getLabel");
|
|
19
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"]
|
|
21
|
-
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "arcLabelRadius", "cornerRadius"];
|
|
18
|
+
const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"];
|
|
22
19
|
const RATIO = 180 / Math.PI;
|
|
23
20
|
function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
|
24
21
|
if (!arcLabel) {
|
|
@@ -72,41 +69,26 @@ function PieArcLabelPlot(props) {
|
|
|
72
69
|
faded,
|
|
73
70
|
data
|
|
74
71
|
});
|
|
75
|
-
const transition = (0, _web.useTransition)(transformedData, (0, _extends2.default)({}, (0, _transition.getDefaultLabelTransitionConfig)(skipAnimation), {
|
|
76
|
-
immediate: skipAnimation
|
|
77
|
-
}));
|
|
78
72
|
if (data.length === 0) {
|
|
79
73
|
return null;
|
|
80
74
|
}
|
|
81
75
|
const ArcLabel = slots?.pieArcLabel ?? _PieArcLabel.PieArcLabel;
|
|
82
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, other, {
|
|
83
|
-
children:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
innerRadius: iR,
|
|
99
|
-
outerRadius: oR,
|
|
100
|
-
arcLabelRadius: aLR,
|
|
101
|
-
cornerRadius: cR,
|
|
102
|
-
style: style,
|
|
103
|
-
id: id,
|
|
104
|
-
color: item.color,
|
|
105
|
-
isFaded: item.isFaded,
|
|
106
|
-
isHighlighted: item.isHighlighted,
|
|
107
|
-
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
108
|
-
}, slotProps?.pieArcLabel));
|
|
109
|
-
})
|
|
77
|
+
children: transformedData.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(ArcLabel, (0, _extends2.default)({
|
|
78
|
+
startAngle: item.startAngle,
|
|
79
|
+
endAngle: item.endAngle,
|
|
80
|
+
paddingAngle: item.paddingAngle,
|
|
81
|
+
innerRadius: item.innerRadius,
|
|
82
|
+
outerRadius: item.outerRadius,
|
|
83
|
+
arcLabelRadius: item.arcLabelRadius,
|
|
84
|
+
cornerRadius: item.cornerRadius,
|
|
85
|
+
id: id,
|
|
86
|
+
color: item.color,
|
|
87
|
+
isFaded: item.isFaded,
|
|
88
|
+
isHighlighted: item.isHighlighted,
|
|
89
|
+
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item),
|
|
90
|
+
skipAnimation: skipAnimation ?? false
|
|
91
|
+
}, slotProps?.pieArcLabel), item.id ?? item.dataIndex))
|
|
110
92
|
}));
|
|
111
93
|
}
|
|
112
94
|
process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -11,9 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var _web = require("@react-spring/web");
|
|
15
14
|
var _PieArc = require("./PieArc");
|
|
16
|
-
var _transition = require("./dataTransform/transition");
|
|
17
15
|
var _useTransformData = require("./dataTransform/useTransformData");
|
|
18
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
17
|
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"];
|
|
@@ -45,43 +43,32 @@ function PieArcPlot(props) {
|
|
|
45
43
|
faded,
|
|
46
44
|
data
|
|
47
45
|
});
|
|
48
|
-
const transition = (0, _web.useTransition)(transformedData, (0, _extends2.default)({}, (0, _transition.getDefaultTransitionConfig)(skipAnimation), {
|
|
49
|
-
immediate: skipAnimation
|
|
50
|
-
}));
|
|
51
46
|
if (data.length === 0) {
|
|
52
47
|
return null;
|
|
53
48
|
}
|
|
54
49
|
const Arc = slots?.pieArc ?? _PieArc.PieArc;
|
|
55
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, other, {
|
|
56
|
-
children:
|
|
57
|
-
startAngle,
|
|
58
|
-
endAngle,
|
|
59
|
-
paddingAngle:
|
|
60
|
-
innerRadius:
|
|
61
|
-
outerRadius:
|
|
62
|
-
cornerRadius:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onItemClick(event, {
|
|
78
|
-
type: 'pie',
|
|
79
|
-
seriesId: id,
|
|
80
|
-
dataIndex: index
|
|
81
|
-
}, item);
|
|
82
|
-
})
|
|
83
|
-
}, slotProps?.pieArc));
|
|
84
|
-
})
|
|
51
|
+
children: transformedData.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Arc, (0, _extends2.default)({
|
|
52
|
+
startAngle: item.startAngle,
|
|
53
|
+
endAngle: item.endAngle,
|
|
54
|
+
paddingAngle: item.paddingAngle,
|
|
55
|
+
innerRadius: item.innerRadius,
|
|
56
|
+
outerRadius: item.outerRadius,
|
|
57
|
+
cornerRadius: item.cornerRadius,
|
|
58
|
+
skipAnimation: skipAnimation ?? false,
|
|
59
|
+
id: id,
|
|
60
|
+
color: item.color,
|
|
61
|
+
dataIndex: index,
|
|
62
|
+
isFaded: item.isFaded,
|
|
63
|
+
isHighlighted: item.isHighlighted,
|
|
64
|
+
onClick: onItemClick && (event => {
|
|
65
|
+
onItemClick(event, {
|
|
66
|
+
type: 'pie',
|
|
67
|
+
seriesId: id,
|
|
68
|
+
dataIndex: index
|
|
69
|
+
}, item);
|
|
70
|
+
})
|
|
71
|
+
}, slotProps?.pieArc), item.dataIndex))
|
|
85
72
|
}));
|
|
86
73
|
}
|
|
87
74
|
process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
@@ -17,6 +17,9 @@ const tooltipGetter = params => {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
const point = series.data[identifier.dataIndex];
|
|
20
|
+
if (point == null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
20
23
|
const label = (0, _getLabel.getLabel)(point.label, 'tooltip');
|
|
21
24
|
const value = (0, _extends2.default)({}, point, {
|
|
22
25
|
label
|
|
@@ -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]),
|
|
@@ -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.
|