@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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Animates a ref. The animation can be skipped by setting {@link skip} to true.
|
|
2
|
+
*
|
|
3
|
+
* - If {@link skip} is false, a transition will be started.
|
|
4
|
+
* - If {@link skip} is true and no transition is in progress, no transition will be started and {@link applyProps} will
|
|
5
|
+
* never be called.
|
|
6
|
+
* - If {@link skip} becomes true and a transition is in progress, the transition will immediately end and
|
|
7
|
+
* {@link applyProps} be called with the final value.
|
|
8
|
+
* */
|
|
9
|
+
export declare function useAnimate<Props extends {}, Elem extends Element>(props: Props, {
|
|
10
|
+
createInterpolator,
|
|
11
|
+
applyProps,
|
|
12
|
+
skip,
|
|
13
|
+
initialProps
|
|
14
|
+
}: {
|
|
15
|
+
createInterpolator: (lastProps: Props, newProps: Props) => (t: number) => Props;
|
|
16
|
+
applyProps: (element: Elem, props: Props) => void;
|
|
17
|
+
skip?: boolean;
|
|
18
|
+
initialProps?: Props;
|
|
19
|
+
}): (element: Elem | null) => void;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
|
+
import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION_JS } from "./animation.js";
|
|
6
|
+
import { Transition } from "./Transition.js";
|
|
7
|
+
import { shallowEqual } from "../shallowEqual.js";
|
|
8
|
+
|
|
9
|
+
/** Animates a ref. The animation can be skipped by setting {@link skip} to true.
|
|
10
|
+
*
|
|
11
|
+
* - If {@link skip} is false, a transition will be started.
|
|
12
|
+
* - If {@link skip} is true and no transition is in progress, no transition will be started and {@link applyProps} will
|
|
13
|
+
* never be called.
|
|
14
|
+
* - If {@link skip} becomes true and a transition is in progress, the transition will immediately end and
|
|
15
|
+
* {@link applyProps} be called with the final value.
|
|
16
|
+
* */
|
|
17
|
+
export function useAnimate(props, {
|
|
18
|
+
createInterpolator,
|
|
19
|
+
applyProps,
|
|
20
|
+
skip,
|
|
21
|
+
initialProps = props
|
|
22
|
+
}) {
|
|
23
|
+
const lastInterpolatedPropsRef = React.useRef(initialProps);
|
|
24
|
+
const transitionRef = React.useRef(null);
|
|
25
|
+
const elementRef = React.useRef(null);
|
|
26
|
+
const lastPropsRef = React.useRef(props);
|
|
27
|
+
useEnhancedEffect(() => {
|
|
28
|
+
lastPropsRef.current = props;
|
|
29
|
+
}, [props]);
|
|
30
|
+
useEnhancedEffect(() => {
|
|
31
|
+
if (skip) {
|
|
32
|
+
transitionRef.current?.finish();
|
|
33
|
+
transitionRef.current = null;
|
|
34
|
+
elementRef.current = null;
|
|
35
|
+
lastInterpolatedPropsRef.current = props;
|
|
36
|
+
}
|
|
37
|
+
}, [props, skip]);
|
|
38
|
+
const animate = React.useCallback(element => {
|
|
39
|
+
const lastInterpolatedProps = lastInterpolatedPropsRef.current;
|
|
40
|
+
const interpolate = createInterpolator(lastInterpolatedProps, props);
|
|
41
|
+
transitionRef.current = new Transition(ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION_JS, t => {
|
|
42
|
+
const interpolatedProps = interpolate(t);
|
|
43
|
+
lastInterpolatedPropsRef.current = interpolatedProps;
|
|
44
|
+
applyProps(element, interpolatedProps);
|
|
45
|
+
});
|
|
46
|
+
}, [applyProps, createInterpolator, props]);
|
|
47
|
+
const setRef = React.useCallback(element => {
|
|
48
|
+
if (element === null) {
|
|
49
|
+
transitionRef.current?.stop();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const lastElement = elementRef.current;
|
|
53
|
+
if (lastElement === element) {
|
|
54
|
+
// If it's the same element and same props, resume the transition.
|
|
55
|
+
if (shallowEqual(lastPropsRef.current, props)) {
|
|
56
|
+
transitionRef.current?.resume();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// If props aren't the same, stop the transition and start a new animation.
|
|
61
|
+
transitionRef.current?.stop();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// If it's a different element, stop the transition of the last element and start a new animation.
|
|
65
|
+
if (lastElement) {
|
|
66
|
+
transitionRef.current?.stop();
|
|
67
|
+
}
|
|
68
|
+
elementRef.current = element;
|
|
69
|
+
if (transitionRef.current || !skip) {
|
|
70
|
+
animate(element);
|
|
71
|
+
}
|
|
72
|
+
}, [animate, props, skip]);
|
|
73
|
+
return setRef;
|
|
74
|
+
}
|
|
@@ -6,7 +6,7 @@ import { ChartSeriesConfig } from "../../models/seriesConfig/index.js";
|
|
|
6
6
|
import { DefaultizedAxisConfig, DefaultizedZoomOptions } from "./useChartCartesianAxis.types.js";
|
|
7
7
|
import { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
8
8
|
import { GetZoomAxisFilters, ZoomData } from "./zoom.types.js";
|
|
9
|
-
type ComputeResult<T extends ChartsAxisProps> = {
|
|
9
|
+
export type ComputeResult<T extends ChartsAxisProps> = {
|
|
10
10
|
axis: DefaultizedAxisConfig<T>;
|
|
11
11
|
axisIds: string[];
|
|
12
12
|
};
|
|
@@ -6,6 +6,7 @@ import { getTickNumber } from "../../../../hooks/useTicks.js";
|
|
|
6
6
|
import { getScale } from "../../../getScale.js";
|
|
7
7
|
import { zoomScaleRange } from "./zoom.js";
|
|
8
8
|
import { getAxisExtremum } from "./getAxisExtremum.js";
|
|
9
|
+
import { getAxisTriggerTooltip } from "./getAxisTriggerTooltip.js";
|
|
9
10
|
function getRange(drawingArea, axisDirection,
|
|
10
11
|
// | 'rotation' | 'radius',
|
|
11
12
|
axis) {
|
|
@@ -37,6 +38,7 @@ export function computeAxisValue({
|
|
|
37
38
|
axisIds: []
|
|
38
39
|
};
|
|
39
40
|
}
|
|
41
|
+
const axisIdsTriggeringTooltip = getAxisTriggerTooltip(axisDirection, seriesConfig, formattedSeries, allAxis[0].id);
|
|
40
42
|
const completeAxis = {};
|
|
41
43
|
allAxis.forEach((eachAxis, axisIndex) => {
|
|
42
44
|
const axis = eachAxis;
|
|
@@ -46,6 +48,7 @@ export function computeAxisValue({
|
|
|
46
48
|
const range = getRange(drawingArea, axisDirection, axis);
|
|
47
49
|
const [minData, maxData] = getAxisExtremum(axis, axisDirection, seriesConfig, axisIndex, formattedSeries, zoom === undefined && !zoomOption ? getFilters : undefined // Do not apply filtering if zoom is already defined.
|
|
48
50
|
);
|
|
51
|
+
const triggerTooltip = !axis.ignoreTooltip && axisIdsTriggeringTooltip.has(axis.id);
|
|
49
52
|
const data = axis.data ?? [];
|
|
50
53
|
if (isBandScaleConfig(axis)) {
|
|
51
54
|
const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
|
|
@@ -57,7 +60,8 @@ export function computeAxisValue({
|
|
|
57
60
|
offset: 0,
|
|
58
61
|
height: 0,
|
|
59
62
|
categoryGapRatio,
|
|
60
|
-
barGapRatio
|
|
63
|
+
barGapRatio,
|
|
64
|
+
triggerTooltip
|
|
61
65
|
}, axis, {
|
|
62
66
|
data,
|
|
63
67
|
scale: scaleBand(axis.data, zoomedRange).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2),
|
|
@@ -76,7 +80,8 @@ export function computeAxisValue({
|
|
|
76
80
|
const zoomedRange = zoomScaleRange(scaleRange, zoomRange);
|
|
77
81
|
completeAxis[axis.id] = _extends({
|
|
78
82
|
offset: 0,
|
|
79
|
-
height: 0
|
|
83
|
+
height: 0,
|
|
84
|
+
triggerTooltip
|
|
80
85
|
}, axis, {
|
|
81
86
|
data,
|
|
82
87
|
scale: scalePoint(axis.data, zoomedRange),
|
|
@@ -117,7 +122,8 @@ export function computeAxisValue({
|
|
|
117
122
|
const domain = [axis.min ?? minDomain, axis.max ?? maxDomain];
|
|
118
123
|
completeAxis[axis.id] = _extends({
|
|
119
124
|
offset: 0,
|
|
120
|
-
height: 0
|
|
125
|
+
height: 0,
|
|
126
|
+
triggerTooltip
|
|
121
127
|
}, axis, {
|
|
122
128
|
data,
|
|
123
129
|
scaleType: scaleType,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CartesianChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
2
|
+
import { ChartSeriesConfig } from "../../models/seriesConfig/index.js";
|
|
3
|
+
import { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
4
|
+
import { AxisId } from "../../../../models/axis.js";
|
|
5
|
+
export declare const getAxisTriggerTooltip: <TSeriesType extends CartesianChartSeriesType>(axisDirection: "x" | "y", seriesConfig: ChartSeriesConfig<TSeriesType>, formattedSeries: ProcessedSeries<TSeriesType>, defaultAxisId: AxisId) => Set<AxisId>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isCartesianSeriesType } from "../../../isCartesian.js";
|
|
2
|
+
export const getAxisTriggerTooltip = (axisDirection, seriesConfig, formattedSeries, defaultAxisId) => {
|
|
3
|
+
const tooltipAxesIds = new Set();
|
|
4
|
+
const chartTypes = Object.keys(seriesConfig).filter(isCartesianSeriesType);
|
|
5
|
+
chartTypes.forEach(chartType => {
|
|
6
|
+
const series = formattedSeries[chartType]?.series ?? {};
|
|
7
|
+
const tooltipAxes = seriesConfig[chartType].axisTooltipGetter?.(series);
|
|
8
|
+
if (tooltipAxes === undefined) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
tooltipAxes.forEach(({
|
|
12
|
+
axisId,
|
|
13
|
+
direction
|
|
14
|
+
}) => {
|
|
15
|
+
if (direction === axisDirection) {
|
|
16
|
+
tooltipAxesIds.add(axisId ?? defaultAxisId);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return tooltipAxesIds;
|
|
21
|
+
};
|
|
@@ -184,10 +184,7 @@ export declare const selectorChartZoomOptionsLookup: ((state: import("../../core
|
|
|
184
184
|
*/
|
|
185
185
|
export declare const selectorChartXAxis: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<import("./useChartCartesianAxis.types").UseChartCartesianAxisState> & {
|
|
186
186
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
187
|
-
} & Partial<{}> & import("./useChartCartesianAxis.types").UseChartCartesianAxisState) => {
|
|
188
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsXAxisProps>;
|
|
189
|
-
axisIds: string[];
|
|
190
|
-
}) & {
|
|
187
|
+
} & Partial<{}> & import("./useChartCartesianAxis.types").UseChartCartesianAxisState) => import("./computeAxisValue").ComputeResult<import("../../..").ChartsXAxisProps>) & {
|
|
191
188
|
clearCache: () => void;
|
|
192
189
|
resultsCount: () => number;
|
|
193
190
|
resetResultsCount: () => void;
|
|
@@ -202,10 +199,7 @@ export declare const selectorChartXAxis: ((state: import("../../corePlugins/useC
|
|
|
202
199
|
}, resultFuncArgs_2: import("../../..").ProcessedSeries<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_3: import("../../models").ChartSeriesConfig<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_4: Map<AxisId, ZoomData> | undefined, resultFuncArgs_5: {
|
|
203
200
|
[x: string]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
204
201
|
[x: number]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
205
|
-
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) =>
|
|
206
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsXAxisProps>;
|
|
207
|
-
axisIds: string[];
|
|
208
|
-
};
|
|
202
|
+
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) => import("./computeAxisValue").ComputeResult<import("../../..").ChartsXAxisProps>;
|
|
209
203
|
memoizedResultFunc: ((resultFuncArgs_0: import("../../..").AxisConfig<keyof import("../../..").AxisScaleConfig, any, import("../../..").ChartsXAxisProps>[] | undefined, resultFuncArgs_1: {
|
|
210
204
|
width: number;
|
|
211
205
|
left: number;
|
|
@@ -216,18 +210,12 @@ export declare const selectorChartXAxis: ((state: import("../../corePlugins/useC
|
|
|
216
210
|
}, resultFuncArgs_2: import("../../..").ProcessedSeries<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_3: import("../../models").ChartSeriesConfig<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_4: Map<AxisId, ZoomData> | undefined, resultFuncArgs_5: {
|
|
217
211
|
[x: string]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
218
212
|
[x: number]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
219
|
-
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) => {
|
|
220
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsXAxisProps>;
|
|
221
|
-
axisIds: string[];
|
|
222
|
-
}) & {
|
|
213
|
+
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) => import("./computeAxisValue").ComputeResult<import("../../..").ChartsXAxisProps>) & {
|
|
223
214
|
clearCache: () => void;
|
|
224
215
|
resultsCount: () => number;
|
|
225
216
|
resetResultsCount: () => void;
|
|
226
217
|
};
|
|
227
|
-
lastResult: () =>
|
|
228
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsXAxisProps>;
|
|
229
|
-
axisIds: string[];
|
|
230
|
-
};
|
|
218
|
+
lastResult: () => import("./computeAxisValue").ComputeResult<import("../../..").ChartsXAxisProps>;
|
|
231
219
|
dependencies: [((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<import("./useChartCartesianAxis.types").UseChartCartesianAxisState> & {
|
|
232
220
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
233
221
|
}) => import("../../..").AxisConfig<keyof import("../../..").AxisScaleConfig, any, import("../../..").ChartsXAxisProps>[] | undefined) & {
|
|
@@ -1645,10 +1633,7 @@ export declare const selectorChartXAxis: ((state: import("../../corePlugins/useC
|
|
|
1645
1633
|
};
|
|
1646
1634
|
export declare const selectorChartYAxis: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<import("./useChartCartesianAxis.types").UseChartCartesianAxisState> & {
|
|
1647
1635
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
1648
|
-
} & Partial<{}> & import("./useChartCartesianAxis.types").UseChartCartesianAxisState) => {
|
|
1649
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsYAxisProps>;
|
|
1650
|
-
axisIds: string[];
|
|
1651
|
-
}) & {
|
|
1636
|
+
} & Partial<{}> & import("./useChartCartesianAxis.types").UseChartCartesianAxisState) => import("./computeAxisValue").ComputeResult<import("../../..").ChartsYAxisProps>) & {
|
|
1652
1637
|
clearCache: () => void;
|
|
1653
1638
|
resultsCount: () => number;
|
|
1654
1639
|
resetResultsCount: () => void;
|
|
@@ -1663,10 +1648,7 @@ export declare const selectorChartYAxis: ((state: import("../../corePlugins/useC
|
|
|
1663
1648
|
}, resultFuncArgs_2: import("../../..").ProcessedSeries<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_3: import("../../models").ChartSeriesConfig<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_4: Map<AxisId, ZoomData> | undefined, resultFuncArgs_5: {
|
|
1664
1649
|
[x: string]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
1665
1650
|
[x: number]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
1666
|
-
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) =>
|
|
1667
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsYAxisProps>;
|
|
1668
|
-
axisIds: string[];
|
|
1669
|
-
};
|
|
1651
|
+
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) => import("./computeAxisValue").ComputeResult<import("../../..").ChartsYAxisProps>;
|
|
1670
1652
|
memoizedResultFunc: ((resultFuncArgs_0: import("../../..").AxisConfig<keyof import("../../..").AxisScaleConfig, any, import("../../..").ChartsYAxisProps>[] | undefined, resultFuncArgs_1: {
|
|
1671
1653
|
width: number;
|
|
1672
1654
|
left: number;
|
|
@@ -1677,18 +1659,12 @@ export declare const selectorChartYAxis: ((state: import("../../corePlugins/useC
|
|
|
1677
1659
|
}, resultFuncArgs_2: import("../../..").ProcessedSeries<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_3: import("../../models").ChartSeriesConfig<keyof import("../../..").ChartsSeriesConfig>, resultFuncArgs_4: Map<AxisId, ZoomData> | undefined, resultFuncArgs_5: {
|
|
1678
1660
|
[x: string]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
1679
1661
|
[x: number]: import("./useChartCartesianAxis.types").DefaultizedZoomOptions;
|
|
1680
|
-
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) => {
|
|
1681
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsYAxisProps>;
|
|
1682
|
-
axisIds: string[];
|
|
1683
|
-
}) & {
|
|
1662
|
+
}, resultFuncArgs_6: import("./zoom.types").GetZoomAxisFilters | undefined) => import("./computeAxisValue").ComputeResult<import("../../..").ChartsYAxisProps>) & {
|
|
1684
1663
|
clearCache: () => void;
|
|
1685
1664
|
resultsCount: () => number;
|
|
1686
1665
|
resetResultsCount: () => void;
|
|
1687
1666
|
};
|
|
1688
|
-
lastResult: () =>
|
|
1689
|
-
axis: import("./useChartCartesianAxis.types").DefaultizedAxisConfig<import("../../..").ChartsYAxisProps>;
|
|
1690
|
-
axisIds: string[];
|
|
1691
|
-
};
|
|
1667
|
+
lastResult: () => import("./computeAxisValue").ComputeResult<import("../../..").ChartsYAxisProps>;
|
|
1692
1668
|
dependencies: [((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("../../..").ChartsSeriesConfig> & Partial<import("./useChartCartesianAxis.types").UseChartCartesianAxisState> & {
|
|
1693
1669
|
cacheKey: import("../../models").ChartStateCacheKey;
|
|
1694
1670
|
}) => import("../../..").AxisConfig<keyof import("../../..").AxisScaleConfig, any, import("../../..").ChartsYAxisProps>[] | undefined) & {
|