@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
|
@@ -2,13 +2,14 @@ import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
|
2
2
|
import seriesProcessor from "./seriesProcessor.js";
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
import legendGetter from "./legend.js";
|
|
5
|
-
import tooltipGetter from "./tooltip.js";
|
|
5
|
+
import tooltipGetter, { axisTooltipGetter } from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
export const seriesConfig = {
|
|
8
8
|
colorProcessor: getColor,
|
|
9
9
|
seriesProcessor,
|
|
10
10
|
legendGetter,
|
|
11
11
|
tooltipGetter,
|
|
12
|
+
axisTooltipGetter,
|
|
12
13
|
xExtremumGetter: getExtremumX,
|
|
13
14
|
yExtremumGetter: getExtremumY,
|
|
14
15
|
getSeriesWithDefaultValues
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { TooltipGetter } from '../../internals/plugins/models';
|
|
1
|
+
import type { AxisTooltipGetter, TooltipGetter } from '../../internals/plugins/models';
|
|
2
2
|
declare const tooltipGetter: TooltipGetter<'line'>;
|
|
3
|
+
export declare const axisTooltipGetter: AxisTooltipGetter<'line', 'x' | 'y'>;
|
|
3
4
|
export default tooltipGetter;
|
|
@@ -22,4 +22,10 @@ const tooltipGetter = params => {
|
|
|
22
22
|
markType: series.labelMarkType
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
export const axisTooltipGetter = series => {
|
|
26
|
+
return Object.values(series).map(s => ({
|
|
27
|
+
direction: 'x',
|
|
28
|
+
axisId: s.xAxisId
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
25
31
|
export default tooltipGetter;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SpringValue } from '@react-spring/web';
|
|
3
2
|
import { PieItemId } from "../models/index.js";
|
|
4
3
|
export interface PieArcClasses {
|
|
5
4
|
/** Styles applied to the root element. */
|
|
@@ -21,16 +20,25 @@ interface PieArcOwnerState {
|
|
|
21
20
|
export declare function getPieArcUtilityClass(slot: string): string;
|
|
22
21
|
export declare const pieArcClasses: PieArcClasses;
|
|
23
22
|
export type PieArcProps = Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> & PieArcOwnerState & {
|
|
24
|
-
cornerRadius:
|
|
25
|
-
endAngle:
|
|
26
|
-
innerRadius:
|
|
23
|
+
cornerRadius: number;
|
|
24
|
+
endAngle: number;
|
|
25
|
+
innerRadius: number;
|
|
27
26
|
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
28
|
-
outerRadius:
|
|
29
|
-
paddingAngle:
|
|
30
|
-
startAngle:
|
|
27
|
+
outerRadius: number;
|
|
28
|
+
paddingAngle: number;
|
|
29
|
+
startAngle: number;
|
|
30
|
+
/** @default false */
|
|
31
|
+
skipAnimation: boolean;
|
|
31
32
|
};
|
|
32
|
-
declare
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
declare const PieArc: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGPathElement>, "ref" | "id"> & PieArcOwnerState & {
|
|
34
|
+
cornerRadius: number;
|
|
35
|
+
endAngle: number;
|
|
36
|
+
innerRadius: number;
|
|
37
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
38
|
+
outerRadius: number;
|
|
39
|
+
paddingAngle: number;
|
|
40
|
+
startAngle: number;
|
|
41
|
+
/** @default false */
|
|
42
|
+
skipAnimation: boolean;
|
|
43
|
+
} & React.RefAttributes<SVGPathElement>>;
|
|
36
44
|
export { PieArc };
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["classes", "color", "
|
|
5
|
+
const _excluded = ["classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
9
|
-
import { animated, to } from '@react-spring/web';
|
|
10
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
9
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
12
10
|
import { styled } from '@mui/material/styles';
|
|
13
11
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
12
|
+
import { useAnimatePieArc } from "../hooks/index.js";
|
|
13
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
|
|
14
14
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export function getPieArcUtilityClass(slot) {
|
|
@@ -30,7 +30,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
};
|
|
31
31
|
return composeClasses(slots, getPieArcUtilityClass, classes);
|
|
32
32
|
};
|
|
33
|
-
const PieArcRoot = styled(
|
|
33
|
+
const PieArcRoot = styled('path', {
|
|
34
34
|
name: 'MuiPieArc',
|
|
35
35
|
slot: 'Root',
|
|
36
36
|
overridesResolver: (_, styles) => styles.arc
|
|
@@ -39,23 +39,26 @@ const PieArcRoot = styled(animated.path, {
|
|
|
39
39
|
}) => ({
|
|
40
40
|
// Got to move stroke to an element prop instead of style.
|
|
41
41
|
stroke: (theme.vars || theme).palette.background.paper,
|
|
42
|
-
|
|
42
|
+
transitionProperty: 'opacity, fill, filter',
|
|
43
|
+
transitionDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
44
|
+
transitionTimingFunction: ANIMATION_TIMING_FUNCTION
|
|
43
45
|
}));
|
|
44
|
-
function PieArc(props) {
|
|
46
|
+
const PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
|
|
45
47
|
const {
|
|
46
48
|
classes: innerClasses,
|
|
47
49
|
color,
|
|
48
|
-
cornerRadius,
|
|
49
50
|
dataIndex,
|
|
50
|
-
endAngle,
|
|
51
51
|
id,
|
|
52
|
-
innerRadius,
|
|
53
52
|
isFaded,
|
|
54
53
|
isHighlighted,
|
|
55
54
|
onClick,
|
|
55
|
+
cornerRadius,
|
|
56
|
+
startAngle,
|
|
57
|
+
endAngle,
|
|
58
|
+
innerRadius,
|
|
56
59
|
outerRadius,
|
|
57
60
|
paddingAngle,
|
|
58
|
-
|
|
61
|
+
skipAnimation
|
|
59
62
|
} = props,
|
|
60
63
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
61
64
|
const ownerState = {
|
|
@@ -72,17 +75,17 @@ function PieArc(props) {
|
|
|
72
75
|
seriesId: id,
|
|
73
76
|
dataIndex
|
|
74
77
|
});
|
|
78
|
+
const animatedProps = useAnimatePieArc({
|
|
79
|
+
cornerRadius,
|
|
80
|
+
startAngle,
|
|
81
|
+
endAngle,
|
|
82
|
+
innerRadius,
|
|
83
|
+
outerRadius,
|
|
84
|
+
paddingAngle,
|
|
85
|
+
skipAnimation,
|
|
86
|
+
ref
|
|
87
|
+
});
|
|
75
88
|
return /*#__PURE__*/_jsx(PieArcRoot, _extends({
|
|
76
|
-
d: to([startAngle, endAngle, paddingAngle, innerRadius, outerRadius, cornerRadius], (sA, eA, pA, iR, oR, cR) => d3Arc().cornerRadius(cR)({
|
|
77
|
-
padAngle: pA,
|
|
78
|
-
startAngle: sA,
|
|
79
|
-
endAngle: eA,
|
|
80
|
-
innerRadius: iR,
|
|
81
|
-
outerRadius: oR
|
|
82
|
-
})),
|
|
83
|
-
visibility: to([startAngle, endAngle], (sA, eA) => sA === eA ? 'hidden' : 'visible')
|
|
84
|
-
// @ts-expect-error
|
|
85
|
-
,
|
|
86
89
|
onClick: onClick,
|
|
87
90
|
cursor: onClick ? 'pointer' : 'unset',
|
|
88
91
|
ownerState: ownerState,
|
|
@@ -92,17 +95,27 @@ function PieArc(props) {
|
|
|
92
95
|
filter: ownerState.isHighlighted ? 'brightness(120%)' : 'none',
|
|
93
96
|
strokeWidth: 1,
|
|
94
97
|
strokeLinejoin: "round"
|
|
95
|
-
}, other, interactionProps));
|
|
96
|
-
}
|
|
98
|
+
}, other, interactionProps, animatedProps));
|
|
99
|
+
});
|
|
97
100
|
process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
98
101
|
// ----------------------------- Warning --------------------------------
|
|
99
102
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
100
103
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
101
104
|
// ----------------------------------------------------------------------
|
|
102
105
|
classes: PropTypes.object,
|
|
106
|
+
cornerRadius: PropTypes.number.isRequired,
|
|
103
107
|
dataIndex: PropTypes.number.isRequired,
|
|
108
|
+
endAngle: PropTypes.number.isRequired,
|
|
104
109
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
110
|
+
innerRadius: PropTypes.number.isRequired,
|
|
105
111
|
isFaded: PropTypes.bool.isRequired,
|
|
106
|
-
isHighlighted: PropTypes.bool.isRequired
|
|
112
|
+
isHighlighted: PropTypes.bool.isRequired,
|
|
113
|
+
outerRadius: PropTypes.number.isRequired,
|
|
114
|
+
paddingAngle: PropTypes.number.isRequired,
|
|
115
|
+
/**
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
118
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
119
|
+
startAngle: PropTypes.number.isRequired
|
|
107
120
|
} : void 0;
|
|
108
121
|
export { PieArc };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SpringValue } from '@react-spring/web';
|
|
3
2
|
import { PieItemId } from "../models/seriesType/pie.js";
|
|
4
3
|
export interface PieArcLabelClasses {
|
|
5
4
|
/** Styles applied to the root element. */
|
|
@@ -8,6 +7,8 @@ export interface PieArcLabelClasses {
|
|
|
8
7
|
highlighted: string;
|
|
9
8
|
/** Styles applied to the root element when faded. */
|
|
10
9
|
faded: string;
|
|
10
|
+
/** Styles applied to the root element when animation is not skipped. */
|
|
11
|
+
animate: string;
|
|
11
12
|
}
|
|
12
13
|
export type PieArcLabelClassKey = keyof PieArcLabelClasses;
|
|
13
14
|
interface PieArcLabelOwnerState {
|
|
@@ -15,23 +16,31 @@ interface PieArcLabelOwnerState {
|
|
|
15
16
|
color: string;
|
|
16
17
|
isFaded: boolean;
|
|
17
18
|
isHighlighted: boolean;
|
|
19
|
+
skipAnimation: boolean;
|
|
18
20
|
classes?: Partial<PieArcLabelClasses>;
|
|
19
21
|
}
|
|
20
22
|
export declare function getPieArcLabelUtilityClass(slot: string): string;
|
|
21
23
|
export declare const pieArcLabelClasses: PieArcLabelClasses;
|
|
22
24
|
export type PieArcLabelProps = PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, 'ref' | 'color' | 'id'> & {
|
|
23
|
-
startAngle:
|
|
24
|
-
endAngle:
|
|
25
|
-
innerRadius:
|
|
26
|
-
outerRadius:
|
|
27
|
-
arcLabelRadius:
|
|
28
|
-
cornerRadius:
|
|
29
|
-
paddingAngle:
|
|
30
|
-
|
|
25
|
+
startAngle: number;
|
|
26
|
+
endAngle: number;
|
|
27
|
+
innerRadius: number;
|
|
28
|
+
outerRadius: number;
|
|
29
|
+
arcLabelRadius: number;
|
|
30
|
+
cornerRadius: number;
|
|
31
|
+
paddingAngle: number;
|
|
32
|
+
skipAnimation: boolean;
|
|
31
33
|
formattedArcLabel?: string | null;
|
|
32
34
|
};
|
|
33
|
-
declare
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, "ref" | "color" | "id"> & {
|
|
36
|
+
startAngle: number;
|
|
37
|
+
endAngle: number;
|
|
38
|
+
innerRadius: number;
|
|
39
|
+
outerRadius: number;
|
|
40
|
+
arcLabelRadius: number;
|
|
41
|
+
cornerRadius: number;
|
|
42
|
+
paddingAngle: number;
|
|
43
|
+
skipAnimation: boolean;
|
|
44
|
+
formattedArcLabel?: string | null;
|
|
45
|
+
} & React.RefAttributes<SVGTextElement>>;
|
|
37
46
|
export { PieArcLabel };
|
|
@@ -2,33 +2,34 @@
|
|
|
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", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
|
|
5
|
+
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { animated, to } from '@react-spring/web';
|
|
9
|
-
import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
|
|
10
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
9
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
12
10
|
import { styled } from '@mui/material/styles';
|
|
13
11
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
12
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
|
|
13
|
+
import { useAnimatePieArcLabel } from "../hooks/animation/useAnimatePieArcLabel.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
export function getPieArcLabelUtilityClass(slot) {
|
|
16
16
|
return generateUtilityClass('MuiPieArcLabel', slot);
|
|
17
17
|
}
|
|
18
|
-
export const pieArcLabelClasses = generateUtilityClasses('MuiPieArcLabel', ['root', 'highlighted', 'faded']);
|
|
18
|
+
export const pieArcLabelClasses = generateUtilityClasses('MuiPieArcLabel', ['root', 'highlighted', 'faded', 'animate']);
|
|
19
19
|
const useUtilityClasses = ownerState => {
|
|
20
20
|
const {
|
|
21
21
|
classes,
|
|
22
22
|
id,
|
|
23
23
|
isFaded,
|
|
24
|
-
isHighlighted
|
|
24
|
+
isHighlighted,
|
|
25
|
+
skipAnimation
|
|
25
26
|
} = ownerState;
|
|
26
27
|
const slots = {
|
|
27
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
28
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
|
|
28
29
|
};
|
|
29
30
|
return composeClasses(slots, getPieArcLabelUtilityClass, classes);
|
|
30
31
|
};
|
|
31
|
-
const PieArcLabelRoot = styled(
|
|
32
|
+
const PieArcLabelRoot = styled('text', {
|
|
32
33
|
name: 'MuiPieArcLabel',
|
|
33
34
|
slot: 'Root',
|
|
34
35
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -38,29 +39,20 @@ const PieArcLabelRoot = styled(animated.text, {
|
|
|
38
39
|
fill: (theme.vars || theme).palette.text.primary,
|
|
39
40
|
textAnchor: 'middle',
|
|
40
41
|
dominantBaseline: 'middle',
|
|
41
|
-
pointerEvents: 'none'
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
padAngle,
|
|
53
|
-
startAngle,
|
|
54
|
-
endAngle,
|
|
55
|
-
innerRadius: arcLabelRadius,
|
|
56
|
-
outerRadius: arcLabelRadius
|
|
57
|
-
});
|
|
58
|
-
if (variable === 'x') {
|
|
59
|
-
return x;
|
|
42
|
+
pointerEvents: 'none',
|
|
43
|
+
animationName: 'animate-opacity',
|
|
44
|
+
animationDuration: '0s',
|
|
45
|
+
animationTimingFunction: ANIMATION_TIMING_FUNCTION,
|
|
46
|
+
[`&.${pieArcLabelClasses.animate}`]: {
|
|
47
|
+
animationDuration: `${ANIMATION_DURATION_MS}ms`
|
|
48
|
+
},
|
|
49
|
+
'@keyframes animate-opacity': {
|
|
50
|
+
from: {
|
|
51
|
+
opacity: 0
|
|
52
|
+
}
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function PieArcLabel(props) {
|
|
54
|
+
}));
|
|
55
|
+
const PieArcLabel = /*#__PURE__*/React.forwardRef(function PieArcLabel(props, ref) {
|
|
64
56
|
const {
|
|
65
57
|
id,
|
|
66
58
|
classes: innerClasses,
|
|
@@ -68,12 +60,13 @@ function PieArcLabel(props) {
|
|
|
68
60
|
startAngle,
|
|
69
61
|
endAngle,
|
|
70
62
|
paddingAngle,
|
|
71
|
-
|
|
63
|
+
innerRadius,
|
|
64
|
+
outerRadius,
|
|
72
65
|
cornerRadius,
|
|
73
66
|
formattedArcLabel,
|
|
74
67
|
isHighlighted,
|
|
75
68
|
isFaded,
|
|
76
|
-
|
|
69
|
+
skipAnimation
|
|
77
70
|
} = props,
|
|
78
71
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
79
72
|
const ownerState = {
|
|
@@ -81,33 +74,44 @@ function PieArcLabel(props) {
|
|
|
81
74
|
classes: innerClasses,
|
|
82
75
|
color,
|
|
83
76
|
isFaded,
|
|
84
|
-
isHighlighted
|
|
77
|
+
isHighlighted,
|
|
78
|
+
skipAnimation
|
|
85
79
|
};
|
|
86
80
|
const classes = useUtilityClasses(ownerState);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
const animatedProps = useAnimatePieArcLabel({
|
|
82
|
+
cornerRadius,
|
|
83
|
+
startAngle,
|
|
84
|
+
endAngle,
|
|
85
|
+
innerRadius,
|
|
86
|
+
outerRadius,
|
|
87
|
+
paddingAngle,
|
|
88
|
+
skipAnimation,
|
|
89
|
+
ref
|
|
90
|
+
});
|
|
91
|
+
return /*#__PURE__*/_jsx(PieArcLabelRoot, _extends({
|
|
92
|
+
className: classes.root
|
|
93
|
+
}, other, animatedProps, {
|
|
94
|
+
children: formattedArcLabel
|
|
95
|
+
}));
|
|
96
|
+
});
|
|
101
97
|
process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
102
98
|
// ----------------------------- Warning --------------------------------
|
|
103
99
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
100
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
105
101
|
// ----------------------------------------------------------------------
|
|
102
|
+
arcLabelRadius: PropTypes.number.isRequired,
|
|
106
103
|
classes: PropTypes.object,
|
|
107
104
|
color: PropTypes.string.isRequired,
|
|
105
|
+
cornerRadius: PropTypes.number.isRequired,
|
|
106
|
+
endAngle: PropTypes.number.isRequired,
|
|
108
107
|
formattedArcLabel: PropTypes.string,
|
|
109
108
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
109
|
+
innerRadius: PropTypes.number.isRequired,
|
|
110
110
|
isFaded: PropTypes.bool.isRequired,
|
|
111
|
-
isHighlighted: PropTypes.bool.isRequired
|
|
111
|
+
isHighlighted: PropTypes.bool.isRequired,
|
|
112
|
+
outerRadius: PropTypes.number.isRequired,
|
|
113
|
+
paddingAngle: PropTypes.number.isRequired,
|
|
114
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
115
|
+
startAngle: PropTypes.number.isRequired
|
|
112
116
|
} : void 0;
|
|
113
117
|
export { PieArcLabel };
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"]
|
|
6
|
-
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "arcLabelRadius", "cornerRadius"];
|
|
5
|
+
const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"];
|
|
7
6
|
import * as React from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
|
-
import { useTransition } from '@react-spring/web';
|
|
10
|
-
import { getDefaultLabelTransitionConfig } from "./dataTransform/transition.js";
|
|
11
8
|
import { useTransformData } from "./dataTransform/useTransformData.js";
|
|
12
9
|
import { PieArcLabel } from "./PieArcLabel.js";
|
|
13
10
|
import { getLabel } from "../internals/getLabel.js";
|
|
@@ -65,41 +62,26 @@ function PieArcLabelPlot(props) {
|
|
|
65
62
|
faded,
|
|
66
63
|
data
|
|
67
64
|
});
|
|
68
|
-
const transition = useTransition(transformedData, _extends({}, getDefaultLabelTransitionConfig(skipAnimation), {
|
|
69
|
-
immediate: skipAnimation
|
|
70
|
-
}));
|
|
71
65
|
if (data.length === 0) {
|
|
72
66
|
return null;
|
|
73
67
|
}
|
|
74
68
|
const ArcLabel = slots?.pieArcLabel ?? PieArcLabel;
|
|
75
69
|
return /*#__PURE__*/_jsx("g", _extends({}, other, {
|
|
76
|
-
children:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
innerRadius: iR,
|
|
92
|
-
outerRadius: oR,
|
|
93
|
-
arcLabelRadius: aLR,
|
|
94
|
-
cornerRadius: cR,
|
|
95
|
-
style: style,
|
|
96
|
-
id: id,
|
|
97
|
-
color: item.color,
|
|
98
|
-
isFaded: item.isFaded,
|
|
99
|
-
isHighlighted: item.isHighlighted,
|
|
100
|
-
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
101
|
-
}, slotProps?.pieArcLabel));
|
|
102
|
-
})
|
|
70
|
+
children: transformedData.map(item => /*#__PURE__*/_jsx(ArcLabel, _extends({
|
|
71
|
+
startAngle: item.startAngle,
|
|
72
|
+
endAngle: item.endAngle,
|
|
73
|
+
paddingAngle: item.paddingAngle,
|
|
74
|
+
innerRadius: item.innerRadius,
|
|
75
|
+
outerRadius: item.outerRadius,
|
|
76
|
+
arcLabelRadius: item.arcLabelRadius,
|
|
77
|
+
cornerRadius: item.cornerRadius,
|
|
78
|
+
id: id,
|
|
79
|
+
color: item.color,
|
|
80
|
+
isFaded: item.isFaded,
|
|
81
|
+
isHighlighted: item.isHighlighted,
|
|
82
|
+
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item),
|
|
83
|
+
skipAnimation: skipAnimation ?? false
|
|
84
|
+
}, slotProps?.pieArcLabel), item.id ?? item.dataIndex))
|
|
103
85
|
}));
|
|
104
86
|
}
|
|
105
87
|
process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
|
|
@@ -5,9 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useTransition } from '@react-spring/web';
|
|
9
8
|
import { PieArc } from "./PieArc.js";
|
|
10
|
-
import { getDefaultTransitionConfig } from "./dataTransform/transition.js";
|
|
11
9
|
import { useTransformData } from "./dataTransform/useTransformData.js";
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
function PieArcPlot(props) {
|
|
@@ -38,43 +36,32 @@ function PieArcPlot(props) {
|
|
|
38
36
|
faded,
|
|
39
37
|
data
|
|
40
38
|
});
|
|
41
|
-
const transition = useTransition(transformedData, _extends({}, getDefaultTransitionConfig(skipAnimation), {
|
|
42
|
-
immediate: skipAnimation
|
|
43
|
-
}));
|
|
44
39
|
if (data.length === 0) {
|
|
45
40
|
return null;
|
|
46
41
|
}
|
|
47
42
|
const Arc = slots?.pieArc ?? PieArc;
|
|
48
43
|
return /*#__PURE__*/_jsx("g", _extends({}, other, {
|
|
49
|
-
children:
|
|
50
|
-
startAngle,
|
|
51
|
-
endAngle,
|
|
52
|
-
paddingAngle:
|
|
53
|
-
innerRadius:
|
|
54
|
-
outerRadius:
|
|
55
|
-
cornerRadius:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onItemClick(event, {
|
|
71
|
-
type: 'pie',
|
|
72
|
-
seriesId: id,
|
|
73
|
-
dataIndex: index
|
|
74
|
-
}, item);
|
|
75
|
-
})
|
|
76
|
-
}, slotProps?.pieArc));
|
|
77
|
-
})
|
|
44
|
+
children: transformedData.map((item, index) => /*#__PURE__*/_jsx(Arc, _extends({
|
|
45
|
+
startAngle: item.startAngle,
|
|
46
|
+
endAngle: item.endAngle,
|
|
47
|
+
paddingAngle: item.paddingAngle,
|
|
48
|
+
innerRadius: item.innerRadius,
|
|
49
|
+
outerRadius: item.outerRadius,
|
|
50
|
+
cornerRadius: item.cornerRadius,
|
|
51
|
+
skipAnimation: skipAnimation ?? false,
|
|
52
|
+
id: id,
|
|
53
|
+
color: item.color,
|
|
54
|
+
dataIndex: index,
|
|
55
|
+
isFaded: item.isFaded,
|
|
56
|
+
isHighlighted: item.isHighlighted,
|
|
57
|
+
onClick: onItemClick && (event => {
|
|
58
|
+
onItemClick(event, {
|
|
59
|
+
type: 'pie',
|
|
60
|
+
seriesId: id,
|
|
61
|
+
dataIndex: index
|
|
62
|
+
}, item);
|
|
63
|
+
})
|
|
64
|
+
}, slotProps?.pieArc), item.dataIndex))
|
|
78
65
|
}));
|
|
79
66
|
}
|
|
80
67
|
process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
|
@@ -229,6 +229,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
229
229
|
height: PropTypes.number,
|
|
230
230
|
hideTooltip: PropTypes.bool,
|
|
231
231
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
232
|
+
ignoreTooltip: PropTypes.bool,
|
|
232
233
|
label: PropTypes.string,
|
|
233
234
|
labelStyle: PropTypes.object,
|
|
234
235
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -284,6 +285,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
284
285
|
fill: PropTypes.string,
|
|
285
286
|
hideTooltip: PropTypes.bool,
|
|
286
287
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
288
|
+
ignoreTooltip: PropTypes.bool,
|
|
287
289
|
label: PropTypes.string,
|
|
288
290
|
labelStyle: PropTypes.object,
|
|
289
291
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -292,6 +292,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
292
292
|
height: PropTypes.number,
|
|
293
293
|
hideTooltip: PropTypes.bool,
|
|
294
294
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
295
|
+
ignoreTooltip: PropTypes.bool,
|
|
295
296
|
label: PropTypes.string,
|
|
296
297
|
labelStyle: PropTypes.object,
|
|
297
298
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -346,6 +347,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
346
347
|
fill: PropTypes.string,
|
|
347
348
|
hideTooltip: PropTypes.bool,
|
|
348
349
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
350
|
+
ignoreTooltip: PropTypes.bool,
|
|
349
351
|
label: PropTypes.string,
|
|
350
352
|
labelStyle: PropTypes.object,
|
|
351
353
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const rainbowSurgePaletteLight = ['#4254FB', '#
|
|
2
|
-
export const rainbowSurgePaletteDark = ['#
|
|
1
|
+
export const rainbowSurgePaletteLight = ['#4254FB', '#FFB422', '#FA4F58', '#0DBEFF', '#22BF75', '#FA83B4', '#FF7511'];
|
|
2
|
+
export const rainbowSurgePaletteDark = ['#495AFB', '#FFC758', '#F35865', '#30C8FF', '#44CE8D', '#F286B3', '#FF8C39'];
|
|
3
3
|
export const rainbowSurgePalette = mode => mode === 'dark' ? rainbowSurgePaletteDark : rainbowSurgePaletteLight;
|
|
4
4
|
export const blueberryTwilightPaletteLight = ['#02B2AF', '#2E96FF', '#B800D8', '#60009B', '#2731C8', '#03008D'];
|
|
5
5
|
export const blueberryTwilightPaletteDark = ['#02B2AF', '#72CCFF', '#DA00FF', '#9001CB', '#2E96FF', '#3B48E0'];
|
|
@@ -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;
|
|
@@ -8,7 +8,7 @@ export const DEFAULT_MARGINS = {
|
|
|
8
8
|
left: 20,
|
|
9
9
|
right: 20
|
|
10
10
|
};
|
|
11
|
-
export const DEFAULT_AXIS_SIZE_WIDTH =
|
|
11
|
+
export const DEFAULT_AXIS_SIZE_WIDTH = 45;
|
|
12
12
|
export const DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
13
13
|
|
|
14
14
|
// How many pixels to add to the default axis size if that axis has a label
|