@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
|
@@ -12,7 +12,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
|
-
var
|
|
15
|
+
var _animation = require("../internals/animation/animation");
|
|
16
16
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
17
17
|
var _useItemHighlighted = require("../hooks/useItemHighlighted");
|
|
18
18
|
var _markElementClasses = require("./markElementClasses");
|
|
@@ -21,6 +21,14 @@ var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useCha
|
|
|
21
21
|
var _useStore = require("../internals/store/useStore");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation"];
|
|
24
|
+
const Circle = (0, _styles.styled)('circle')({
|
|
25
|
+
[`&.${_markElementClasses.markElementClasses.animate}`]: {
|
|
26
|
+
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
27
|
+
transitionProperty: 'cx, cy',
|
|
28
|
+
transitionTimingFunction: _animation.ANIMATION_TIMING_FUNCTION
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
24
32
|
/**
|
|
25
33
|
* The line mark element that only render circle for performance improvement.
|
|
26
34
|
*
|
|
@@ -58,33 +66,19 @@ function CircleMarkElement(props) {
|
|
|
58
66
|
seriesId: id
|
|
59
67
|
});
|
|
60
68
|
const store = (0, _useStore.useStore)();
|
|
61
|
-
const
|
|
62
|
-
const cx = (0, _web.useSpringValue)(x, {
|
|
63
|
-
immediate: skipAnimation
|
|
64
|
-
});
|
|
65
|
-
const cy = (0, _web.useSpringValue)(y, {
|
|
66
|
-
immediate: skipAnimation
|
|
67
|
-
});
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
cy.start(y, {
|
|
70
|
-
immediate: skipAnimation
|
|
71
|
-
});
|
|
72
|
-
cx.start(x, {
|
|
73
|
-
immediate: skipAnimation
|
|
74
|
-
});
|
|
75
|
-
}, [cy, y, cx, x, skipAnimation]);
|
|
69
|
+
const xAxisInteractionIndex = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisIndex);
|
|
76
70
|
const ownerState = {
|
|
77
71
|
id,
|
|
78
72
|
classes: innerClasses,
|
|
79
|
-
isHighlighted:
|
|
73
|
+
isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
|
|
80
74
|
isFaded,
|
|
81
|
-
color
|
|
75
|
+
color,
|
|
76
|
+
skipAnimation
|
|
82
77
|
};
|
|
83
78
|
const classes = (0, _markElementClasses.useUtilityClasses)(ownerState);
|
|
84
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
cy: cy,
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Circle, (0, _extends2.default)({}, other, {
|
|
80
|
+
cx: x,
|
|
81
|
+
cy: y,
|
|
88
82
|
r: 5,
|
|
89
83
|
fill: (theme.vars || theme).palette.background.paper,
|
|
90
84
|
stroke: color,
|
package/LineChart/LineChart.js
CHANGED
|
@@ -245,6 +245,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
245
245
|
height: _propTypes.default.number,
|
|
246
246
|
hideTooltip: _propTypes.default.bool,
|
|
247
247
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
248
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
248
249
|
label: _propTypes.default.string,
|
|
249
250
|
labelStyle: _propTypes.default.object,
|
|
250
251
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -300,6 +301,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
300
301
|
fill: _propTypes.default.string,
|
|
301
302
|
hideTooltip: _propTypes.default.bool,
|
|
302
303
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
304
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
303
305
|
label: _propTypes.default.string,
|
|
304
306
|
labelStyle: _propTypes.default.object,
|
|
305
307
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -52,9 +52,8 @@ function LineHighlightPlot(props) {
|
|
|
52
52
|
instance
|
|
53
53
|
} = (0, _ChartProvider.useChartContext)();
|
|
54
54
|
const store = (0, _useStore.useStore)();
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
if (highlightedIndex === undefined) {
|
|
55
|
+
const highlightedIndex = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisIndex);
|
|
56
|
+
if (highlightedIndex === null) {
|
|
58
57
|
return null;
|
|
59
58
|
}
|
|
60
59
|
if (seriesData === undefined) {
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -13,17 +13,17 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
16
|
-
var
|
|
16
|
+
var _animation = require("../internals/animation/animation");
|
|
17
17
|
var _getSymbol = require("../internals/getSymbol");
|
|
18
18
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
19
19
|
var _useItemHighlighted = require("../hooks/useItemHighlighted");
|
|
20
|
-
var _markElementClasses = require("./markElementClasses");
|
|
21
20
|
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
21
|
+
var _markElementClasses = require("./markElementClasses");
|
|
22
22
|
var _useSelector = require("../internals/store/useSelector");
|
|
23
23
|
var _useStore = require("../internals/store/useStore");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation"];
|
|
26
|
-
const MarkElementPath = (0, _styles.styled)(
|
|
26
|
+
const MarkElementPath = (0, _styles.styled)('path', {
|
|
27
27
|
name: 'MuiMarkElement',
|
|
28
28
|
slot: 'Root',
|
|
29
29
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -33,7 +33,12 @@ const MarkElementPath = (0, _styles.styled)(_web.animated.path, {
|
|
|
33
33
|
}) => ({
|
|
34
34
|
fill: (theme.vars || theme).palette.background.paper,
|
|
35
35
|
stroke: ownerState.color,
|
|
36
|
-
strokeWidth: 2
|
|
36
|
+
strokeWidth: 2,
|
|
37
|
+
[`&.${_markElementClasses.markElementClasses.animate}`]: {
|
|
38
|
+
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
39
|
+
transitionProperty: 'transform, transform-origin',
|
|
40
|
+
transitionTimingFunction: _animation.ANIMATION_TIMING_FUNCTION
|
|
41
|
+
}
|
|
37
42
|
}));
|
|
38
43
|
/**
|
|
39
44
|
* Demos:
|
|
@@ -70,37 +75,22 @@ function MarkElement(props) {
|
|
|
70
75
|
seriesId: id
|
|
71
76
|
});
|
|
72
77
|
const store = (0, _useStore.useStore)();
|
|
73
|
-
const
|
|
74
|
-
const cx = (0, _web.useSpringValue)(x, {
|
|
75
|
-
immediate: skipAnimation
|
|
76
|
-
});
|
|
77
|
-
const cy = (0, _web.useSpringValue)(y, {
|
|
78
|
-
immediate: skipAnimation
|
|
79
|
-
});
|
|
80
|
-
React.useEffect(() => {
|
|
81
|
-
cy.start(y, {
|
|
82
|
-
immediate: skipAnimation
|
|
83
|
-
});
|
|
84
|
-
cx.start(x, {
|
|
85
|
-
immediate: skipAnimation
|
|
86
|
-
});
|
|
87
|
-
}, [cy, y, cx, x, skipAnimation]);
|
|
78
|
+
const xAxisInteractionIndex = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisIndex);
|
|
88
79
|
const ownerState = {
|
|
89
80
|
id,
|
|
90
81
|
classes: innerClasses,
|
|
91
|
-
isHighlighted:
|
|
82
|
+
isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
|
|
92
83
|
isFaded,
|
|
93
|
-
color
|
|
84
|
+
color,
|
|
85
|
+
skipAnimation
|
|
94
86
|
};
|
|
95
87
|
const classes = (0, _markElementClasses.useUtilityClasses)(ownerState);
|
|
96
88
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MarkElementPath, (0, _extends2.default)({}, other, {
|
|
97
89
|
style: {
|
|
98
|
-
transform:
|
|
99
|
-
transformOrigin:
|
|
90
|
+
transform: `translate(${x}px, ${y}px)`,
|
|
91
|
+
transformOrigin: `${x}px ${y}px`
|
|
100
92
|
},
|
|
101
|
-
ownerState: ownerState
|
|
102
|
-
// @ts-expect-error
|
|
103
|
-
,
|
|
93
|
+
ownerState: ownerState,
|
|
104
94
|
className: classes.root,
|
|
105
95
|
d: (0, _d3Shape.symbol)(_d3Shape.symbolsFill[(0, _getSymbol.getSymbol)(shape)])(),
|
|
106
96
|
onClick: onClick,
|
|
@@ -124,7 +114,6 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
124
114
|
shape: _propTypes.default.oneOf(['circle', 'cross', 'diamond', 'square', 'star', 'triangle', 'wye']).isRequired,
|
|
125
115
|
/**
|
|
126
116
|
* If `true`, animations are skipped.
|
|
127
|
-
* @default false
|
|
128
117
|
*/
|
|
129
118
|
skipAnimation: _propTypes.default.bool
|
|
130
119
|
} : void 0;
|
package/LineChart/MarkPlot.js
CHANGED
|
@@ -6,6 +6,8 @@ export interface MarkElementClasses {
|
|
|
6
6
|
highlighted: string;
|
|
7
7
|
/** Styles applied to the root element when faded. */
|
|
8
8
|
faded: string;
|
|
9
|
+
/** Styles applied to the root element when animation is not skipped. */
|
|
10
|
+
animate: string;
|
|
9
11
|
}
|
|
10
12
|
export type MarkElementClassKey = keyof MarkElementClasses;
|
|
11
13
|
export interface MarkElementOwnerState {
|
|
@@ -14,6 +16,7 @@ export interface MarkElementOwnerState {
|
|
|
14
16
|
isFaded: boolean;
|
|
15
17
|
isHighlighted: boolean;
|
|
16
18
|
classes?: Partial<MarkElementClasses>;
|
|
19
|
+
skipAnimation?: boolean;
|
|
17
20
|
}
|
|
18
21
|
export declare function getMarkElementUtilityClass(slot: string): string;
|
|
19
22
|
export declare const markElementClasses: MarkElementClasses;
|
|
@@ -12,16 +12,17 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
12
12
|
function getMarkElementUtilityClass(slot) {
|
|
13
13
|
return (0, _generateUtilityClass.default)('MuiMarkElement', slot);
|
|
14
14
|
}
|
|
15
|
-
const markElementClasses = exports.markElementClasses = (0, _generateUtilityClasses.default)('MuiMarkElement', ['root', 'highlighted', 'faded']);
|
|
15
|
+
const markElementClasses = exports.markElementClasses = (0, _generateUtilityClasses.default)('MuiMarkElement', ['root', 'highlighted', 'faded', 'animate']);
|
|
16
16
|
const useUtilityClasses = ownerState => {
|
|
17
17
|
const {
|
|
18
18
|
classes,
|
|
19
19
|
id,
|
|
20
20
|
isFaded,
|
|
21
|
-
isHighlighted
|
|
21
|
+
isHighlighted,
|
|
22
|
+
skipAnimation
|
|
22
23
|
} = ownerState;
|
|
23
24
|
const slots = {
|
|
24
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
25
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded', skipAnimation ? undefined : 'animate']
|
|
25
26
|
};
|
|
26
27
|
return (0, _composeClasses.default)(slots, getMarkElementUtilityClass, classes);
|
|
27
28
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
@@ -9,13 +10,14 @@ var _extremums = require("./extremums");
|
|
|
9
10
|
var _seriesProcessor = _interopRequireDefault(require("./seriesProcessor"));
|
|
10
11
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
11
12
|
var _legend = _interopRequireDefault(require("./legend"));
|
|
12
|
-
var _tooltip =
|
|
13
|
+
var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
13
14
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
15
|
const seriesConfig = exports.seriesConfig = {
|
|
15
16
|
colorProcessor: _getColor.default,
|
|
16
17
|
seriesProcessor: _seriesProcessor.default,
|
|
17
18
|
legendGetter: _legend.default,
|
|
18
19
|
tooltipGetter: _tooltip.default,
|
|
20
|
+
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
19
21
|
xExtremumGetter: _extremums.getExtremumX,
|
|
20
22
|
yExtremumGetter: _extremums.getExtremumY,
|
|
21
23
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { TooltipGetter } from '../../internals/plugins/models';
|
|
1
|
+
import type { AxisTooltipGetter, TooltipGetter } from '../../internals/plugins/models';
|
|
2
2
|
declare const tooltipGetter: TooltipGetter<'line'>;
|
|
3
|
+
export declare const axisTooltipGetter: AxisTooltipGetter<'line', 'x' | 'y'>;
|
|
3
4
|
export default tooltipGetter;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.axisTooltipGetter = void 0;
|
|
7
7
|
var _getLabel = require("../../internals/getLabel");
|
|
8
8
|
const tooltipGetter = params => {
|
|
9
9
|
const {
|
|
@@ -28,4 +28,11 @@ const tooltipGetter = params => {
|
|
|
28
28
|
markType: series.labelMarkType
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
const axisTooltipGetter = series => {
|
|
32
|
+
return Object.values(series).map(s => ({
|
|
33
|
+
direction: 'x',
|
|
34
|
+
axisId: s.xAxisId
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
exports.axisTooltipGetter = axisTooltipGetter;
|
|
31
38
|
var _default = exports.default = tooltipGetter;
|
package/PieChart/PieArc.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SpringValue } from '@react-spring/web';
|
|
3
2
|
import { PieItemId } from "../models/index.js";
|
|
4
3
|
export interface PieArcClasses {
|
|
5
4
|
/** Styles applied to the root element. */
|
|
@@ -21,16 +20,25 @@ interface PieArcOwnerState {
|
|
|
21
20
|
export declare function getPieArcUtilityClass(slot: string): string;
|
|
22
21
|
export declare const pieArcClasses: PieArcClasses;
|
|
23
22
|
export type PieArcProps = Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> & PieArcOwnerState & {
|
|
24
|
-
cornerRadius:
|
|
25
|
-
endAngle:
|
|
26
|
-
innerRadius:
|
|
23
|
+
cornerRadius: number;
|
|
24
|
+
endAngle: number;
|
|
25
|
+
innerRadius: number;
|
|
27
26
|
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
28
|
-
outerRadius:
|
|
29
|
-
paddingAngle:
|
|
30
|
-
startAngle:
|
|
27
|
+
outerRadius: number;
|
|
28
|
+
paddingAngle: number;
|
|
29
|
+
startAngle: number;
|
|
30
|
+
/** @default false */
|
|
31
|
+
skipAnimation: boolean;
|
|
31
32
|
};
|
|
32
|
-
declare
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
declare const PieArc: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGPathElement>, "ref" | "id"> & PieArcOwnerState & {
|
|
34
|
+
cornerRadius: number;
|
|
35
|
+
endAngle: number;
|
|
36
|
+
innerRadius: number;
|
|
37
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
38
|
+
outerRadius: number;
|
|
39
|
+
paddingAngle: number;
|
|
40
|
+
startAngle: number;
|
|
41
|
+
/** @default false */
|
|
42
|
+
skipAnimation: boolean;
|
|
43
|
+
} & React.RefAttributes<SVGPathElement>>;
|
|
36
44
|
export { PieArc };
|
package/PieChart/PieArc.js
CHANGED
|
@@ -6,22 +6,22 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.PieArc =
|
|
9
|
+
exports.PieArc = void 0;
|
|
10
10
|
exports.getPieArcUtilityClass = getPieArcUtilityClass;
|
|
11
11
|
exports.pieArcClasses = 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 _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
17
|
-
var _web = require("@react-spring/web");
|
|
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 _hooks = require("../hooks");
|
|
21
|
+
var _animation = require("../internals/animation/animation");
|
|
22
22
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
const _excluded = ["classes", "color", "
|
|
24
|
+
const _excluded = ["classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation"];
|
|
25
25
|
function getPieArcUtilityClass(slot) {
|
|
26
26
|
return (0, _generateUtilityClass.default)('MuiPieArc', slot);
|
|
27
27
|
}
|
|
@@ -39,7 +39,7 @@ const useUtilityClasses = ownerState => {
|
|
|
39
39
|
};
|
|
40
40
|
return (0, _composeClasses.default)(slots, getPieArcUtilityClass, classes);
|
|
41
41
|
};
|
|
42
|
-
const PieArcRoot = (0, _styles.styled)(
|
|
42
|
+
const PieArcRoot = (0, _styles.styled)('path', {
|
|
43
43
|
name: 'MuiPieArc',
|
|
44
44
|
slot: 'Root',
|
|
45
45
|
overridesResolver: (_, styles) => styles.arc
|
|
@@ -48,23 +48,26 @@ const PieArcRoot = (0, _styles.styled)(_web.animated.path, {
|
|
|
48
48
|
}) => ({
|
|
49
49
|
// Got to move stroke to an element prop instead of style.
|
|
50
50
|
stroke: (theme.vars || theme).palette.background.paper,
|
|
51
|
-
|
|
51
|
+
transitionProperty: 'opacity, fill, filter',
|
|
52
|
+
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
53
|
+
transitionTimingFunction: _animation.ANIMATION_TIMING_FUNCTION
|
|
52
54
|
}));
|
|
53
|
-
function PieArc(props) {
|
|
55
|
+
const PieArc = exports.PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
|
|
54
56
|
const {
|
|
55
57
|
classes: innerClasses,
|
|
56
58
|
color,
|
|
57
|
-
cornerRadius,
|
|
58
59
|
dataIndex,
|
|
59
|
-
endAngle,
|
|
60
60
|
id,
|
|
61
|
-
innerRadius,
|
|
62
61
|
isFaded,
|
|
63
62
|
isHighlighted,
|
|
64
63
|
onClick,
|
|
64
|
+
cornerRadius,
|
|
65
|
+
startAngle,
|
|
66
|
+
endAngle,
|
|
67
|
+
innerRadius,
|
|
65
68
|
outerRadius,
|
|
66
69
|
paddingAngle,
|
|
67
|
-
|
|
70
|
+
skipAnimation
|
|
68
71
|
} = props,
|
|
69
72
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
70
73
|
const ownerState = {
|
|
@@ -81,17 +84,17 @@ function PieArc(props) {
|
|
|
81
84
|
seriesId: id,
|
|
82
85
|
dataIndex
|
|
83
86
|
});
|
|
87
|
+
const animatedProps = (0, _hooks.useAnimatePieArc)({
|
|
88
|
+
cornerRadius,
|
|
89
|
+
startAngle,
|
|
90
|
+
endAngle,
|
|
91
|
+
innerRadius,
|
|
92
|
+
outerRadius,
|
|
93
|
+
paddingAngle,
|
|
94
|
+
skipAnimation,
|
|
95
|
+
ref
|
|
96
|
+
});
|
|
84
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PieArcRoot, (0, _extends2.default)({
|
|
85
|
-
d: (0, _web.to)([startAngle, endAngle, paddingAngle, innerRadius, outerRadius, cornerRadius], (sA, eA, pA, iR, oR, cR) => (0, _d3Shape.arc)().cornerRadius(cR)({
|
|
86
|
-
padAngle: pA,
|
|
87
|
-
startAngle: sA,
|
|
88
|
-
endAngle: eA,
|
|
89
|
-
innerRadius: iR,
|
|
90
|
-
outerRadius: oR
|
|
91
|
-
})),
|
|
92
|
-
visibility: (0, _web.to)([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
93
|
-
// @ts-expect-error
|
|
94
|
-
,
|
|
95
98
|
onClick: onClick,
|
|
96
99
|
cursor: onClick ? 'pointer' : 'unset',
|
|
97
100
|
ownerState: ownerState,
|
|
@@ -101,16 +104,26 @@ function PieArc(props) {
|
|
|
101
104
|
filter: ownerState.isHighlighted ? 'brightness(120%)' : 'none',
|
|
102
105
|
strokeWidth: 1,
|
|
103
106
|
strokeLinejoin: "round"
|
|
104
|
-
}, other, interactionProps));
|
|
105
|
-
}
|
|
107
|
+
}, other, interactionProps, animatedProps));
|
|
108
|
+
});
|
|
106
109
|
process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
107
110
|
// ----------------------------- Warning --------------------------------
|
|
108
111
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
109
112
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
110
113
|
// ----------------------------------------------------------------------
|
|
111
114
|
classes: _propTypes.default.object,
|
|
115
|
+
cornerRadius: _propTypes.default.number.isRequired,
|
|
112
116
|
dataIndex: _propTypes.default.number.isRequired,
|
|
117
|
+
endAngle: _propTypes.default.number.isRequired,
|
|
113
118
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
119
|
+
innerRadius: _propTypes.default.number.isRequired,
|
|
114
120
|
isFaded: _propTypes.default.bool.isRequired,
|
|
115
|
-
isHighlighted: _propTypes.default.bool.isRequired
|
|
121
|
+
isHighlighted: _propTypes.default.bool.isRequired,
|
|
122
|
+
outerRadius: _propTypes.default.number.isRequired,
|
|
123
|
+
paddingAngle: _propTypes.default.number.isRequired,
|
|
124
|
+
/**
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
skipAnimation: _propTypes.default.bool.isRequired,
|
|
128
|
+
startAngle: _propTypes.default.number.isRequired
|
|
116
129
|
} : void 0;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SpringValue } from '@react-spring/web';
|
|
3
2
|
import { PieItemId } from "../models/seriesType/pie.js";
|
|
4
3
|
export interface PieArcLabelClasses {
|
|
5
4
|
/** Styles applied to the root element. */
|
|
@@ -8,6 +7,8 @@ export interface PieArcLabelClasses {
|
|
|
8
7
|
highlighted: string;
|
|
9
8
|
/** Styles applied to the root element when faded. */
|
|
10
9
|
faded: string;
|
|
10
|
+
/** Styles applied to the root element when animation is not skipped. */
|
|
11
|
+
animate: string;
|
|
11
12
|
}
|
|
12
13
|
export type PieArcLabelClassKey = keyof PieArcLabelClasses;
|
|
13
14
|
interface PieArcLabelOwnerState {
|
|
@@ -15,23 +16,31 @@ interface PieArcLabelOwnerState {
|
|
|
15
16
|
color: string;
|
|
16
17
|
isFaded: boolean;
|
|
17
18
|
isHighlighted: boolean;
|
|
19
|
+
skipAnimation: boolean;
|
|
18
20
|
classes?: Partial<PieArcLabelClasses>;
|
|
19
21
|
}
|
|
20
22
|
export declare function getPieArcLabelUtilityClass(slot: string): string;
|
|
21
23
|
export declare const pieArcLabelClasses: PieArcLabelClasses;
|
|
22
24
|
export type PieArcLabelProps = PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, 'ref' | 'color' | 'id'> & {
|
|
23
|
-
startAngle:
|
|
24
|
-
endAngle:
|
|
25
|
-
innerRadius:
|
|
26
|
-
outerRadius:
|
|
27
|
-
arcLabelRadius:
|
|
28
|
-
cornerRadius:
|
|
29
|
-
paddingAngle:
|
|
30
|
-
|
|
25
|
+
startAngle: number;
|
|
26
|
+
endAngle: number;
|
|
27
|
+
innerRadius: number;
|
|
28
|
+
outerRadius: number;
|
|
29
|
+
arcLabelRadius: number;
|
|
30
|
+
cornerRadius: number;
|
|
31
|
+
paddingAngle: number;
|
|
32
|
+
skipAnimation: boolean;
|
|
31
33
|
formattedArcLabel?: string | null;
|
|
32
34
|
};
|
|
33
|
-
declare
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, "ref" | "color" | "id"> & {
|
|
36
|
+
startAngle: number;
|
|
37
|
+
endAngle: number;
|
|
38
|
+
innerRadius: number;
|
|
39
|
+
outerRadius: number;
|
|
40
|
+
arcLabelRadius: number;
|
|
41
|
+
cornerRadius: number;
|
|
42
|
+
paddingAngle: number;
|
|
43
|
+
skipAnimation: boolean;
|
|
44
|
+
formattedArcLabel?: string | null;
|
|
45
|
+
} & React.RefAttributes<SVGTextElement>>;
|
|
37
46
|
export { PieArcLabel };
|