@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,14 +2,14 @@
|
|
|
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 = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
|
|
5
|
+
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
|
-
import { animated } from '@react-spring/web';
|
|
9
8
|
import PropTypes from 'prop-types';
|
|
9
|
+
import { useAnimateBarLabel } from "../../hooks/animation/useAnimateBarLabel.js";
|
|
10
10
|
import { barLabelClasses } from "./barLabelClasses.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export const BarLabelComponent = styled(
|
|
12
|
+
export const BarLabelComponent = styled('text', {
|
|
13
13
|
name: 'MuiBarLabel',
|
|
14
14
|
slot: 'Root',
|
|
15
15
|
overridesResolver: (_, styles) => [{
|
|
@@ -37,7 +37,8 @@ function BarLabel(inProps) {
|
|
|
37
37
|
name: 'MuiBarLabel'
|
|
38
38
|
});
|
|
39
39
|
const otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
|
-
|
|
40
|
+
const animatedProps = useAnimateBarLabel(props);
|
|
41
|
+
return /*#__PURE__*/_jsx(BarLabelComponent, _extends({}, otherProps, animatedProps));
|
|
41
42
|
}
|
|
42
43
|
process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
43
44
|
// ----------------------------- Warning --------------------------------
|
|
@@ -46,8 +47,34 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
|
46
47
|
// ----------------------------------------------------------------------
|
|
47
48
|
classes: PropTypes.object,
|
|
48
49
|
dataIndex: PropTypes.number.isRequired,
|
|
50
|
+
/**
|
|
51
|
+
* Height of the bar this label belongs to.
|
|
52
|
+
*/
|
|
53
|
+
height: PropTypes.number.isRequired,
|
|
49
54
|
isFaded: PropTypes.bool.isRequired,
|
|
50
55
|
isHighlighted: PropTypes.bool.isRequired,
|
|
51
|
-
|
|
56
|
+
layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
|
|
57
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
58
|
+
skipAnimation: PropTypes.bool.isRequired,
|
|
59
|
+
/**
|
|
60
|
+
* Width of the bar this label belongs to.
|
|
61
|
+
*/
|
|
62
|
+
width: PropTypes.number.isRequired,
|
|
63
|
+
/**
|
|
64
|
+
* Position in the x-axis of the bar this label belongs to.
|
|
65
|
+
*/
|
|
66
|
+
x: PropTypes.number.isRequired,
|
|
67
|
+
/**
|
|
68
|
+
* The x-coordinate of the stack this bar label belongs to.
|
|
69
|
+
*/
|
|
70
|
+
xOrigin: PropTypes.number.isRequired,
|
|
71
|
+
/**
|
|
72
|
+
* Position in the y-axis of the bar this label belongs to.
|
|
73
|
+
*/
|
|
74
|
+
y: PropTypes.number.isRequired,
|
|
75
|
+
/**
|
|
76
|
+
* The y-coordinate of the stack this bar label belongs to.
|
|
77
|
+
*/
|
|
78
|
+
yOrigin: PropTypes.number.isRequired
|
|
52
79
|
} : void 0;
|
|
53
80
|
export { BarLabel };
|
|
@@ -23,6 +23,22 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
|
|
|
23
23
|
* @default {}
|
|
24
24
|
*/
|
|
25
25
|
slots?: BarLabelSlots;
|
|
26
|
+
/**
|
|
27
|
+
* The position in the x-axis of the stack this bar label belongs to.
|
|
28
|
+
*/
|
|
29
|
+
xOrigin: number;
|
|
30
|
+
/**
|
|
31
|
+
* The position in the y-axis of the stack this bar label belongs to.
|
|
32
|
+
*/
|
|
33
|
+
yOrigin: number;
|
|
34
|
+
/**
|
|
35
|
+
* The position of the bar in the x-axis.
|
|
36
|
+
*/
|
|
37
|
+
x: number;
|
|
38
|
+
/**
|
|
39
|
+
* The position of the bar in the y-axis.
|
|
40
|
+
*/
|
|
41
|
+
y: number;
|
|
26
42
|
/**
|
|
27
43
|
* The height of the bar.
|
|
28
44
|
*/
|
|
@@ -31,10 +47,18 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
|
|
|
31
47
|
* The width of the bar.
|
|
32
48
|
*/
|
|
33
49
|
width: number;
|
|
50
|
+
/**
|
|
51
|
+
* The orientation of the bar.
|
|
52
|
+
*/
|
|
53
|
+
layout: 'vertical' | 'horizontal';
|
|
34
54
|
/**
|
|
35
55
|
* The value of the data point.
|
|
36
56
|
*/
|
|
37
57
|
value: number | null;
|
|
58
|
+
/**
|
|
59
|
+
* If true, no animations should be applied.
|
|
60
|
+
*/
|
|
61
|
+
skipAnimation: boolean;
|
|
38
62
|
/**
|
|
39
63
|
* If provided, the function will be used to format the label of the bar.
|
|
40
64
|
* It can be set to 'value' to display the current value.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId", "classes", "color", "
|
|
3
|
+
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
@@ -18,14 +18,19 @@ function BarLabelItem(props) {
|
|
|
18
18
|
seriesId,
|
|
19
19
|
classes: innerClasses,
|
|
20
20
|
color,
|
|
21
|
-
style,
|
|
22
21
|
dataIndex,
|
|
23
22
|
barLabel,
|
|
24
23
|
slots,
|
|
25
24
|
slotProps,
|
|
26
|
-
|
|
25
|
+
xOrigin,
|
|
26
|
+
yOrigin,
|
|
27
|
+
x,
|
|
28
|
+
y,
|
|
27
29
|
width,
|
|
28
|
-
|
|
30
|
+
height,
|
|
31
|
+
value,
|
|
32
|
+
skipAnimation,
|
|
33
|
+
layout
|
|
29
34
|
} = props,
|
|
30
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
36
|
const {
|
|
@@ -41,7 +46,9 @@ function BarLabelItem(props) {
|
|
|
41
46
|
color,
|
|
42
47
|
isFaded,
|
|
43
48
|
isHighlighted,
|
|
44
|
-
dataIndex
|
|
49
|
+
dataIndex,
|
|
50
|
+
skipAnimation,
|
|
51
|
+
layout
|
|
45
52
|
};
|
|
46
53
|
const classes = useUtilityClasses(ownerState);
|
|
47
54
|
const Component = slots?.barLabel ?? BarLabel;
|
|
@@ -49,7 +56,12 @@ function BarLabelItem(props) {
|
|
|
49
56
|
elementType: Component,
|
|
50
57
|
externalSlotProps: slotProps?.barLabel,
|
|
51
58
|
additionalProps: _extends({}, other, {
|
|
52
|
-
|
|
59
|
+
xOrigin,
|
|
60
|
+
yOrigin,
|
|
61
|
+
x,
|
|
62
|
+
y,
|
|
63
|
+
width,
|
|
64
|
+
height,
|
|
53
65
|
className: classes.root
|
|
54
66
|
}),
|
|
55
67
|
ownerState
|
|
@@ -1,40 +1,9 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["bars", "skipAnimation"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { useTransition } from '@react-spring/web';
|
|
6
5
|
import { BarLabelItem } from "./BarLabelItem.js";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const leaveStyle = ({
|
|
9
|
-
layout,
|
|
10
|
-
yOrigin,
|
|
11
|
-
x,
|
|
12
|
-
width,
|
|
13
|
-
y,
|
|
14
|
-
xOrigin,
|
|
15
|
-
height
|
|
16
|
-
}) => _extends({}, layout === 'vertical' ? {
|
|
17
|
-
y: yOrigin,
|
|
18
|
-
x: x + width / 2,
|
|
19
|
-
height: 0,
|
|
20
|
-
width
|
|
21
|
-
} : {
|
|
22
|
-
y: y + height / 2,
|
|
23
|
-
x: xOrigin,
|
|
24
|
-
height,
|
|
25
|
-
width: 0
|
|
26
|
-
});
|
|
27
|
-
const enterStyle = ({
|
|
28
|
-
x,
|
|
29
|
-
width,
|
|
30
|
-
y,
|
|
31
|
-
height
|
|
32
|
-
}) => ({
|
|
33
|
-
x: x + width / 2,
|
|
34
|
-
y: y + height / 2,
|
|
35
|
-
height,
|
|
36
|
-
width
|
|
37
|
-
});
|
|
38
7
|
/**
|
|
39
8
|
* @ignore - internal component.
|
|
40
9
|
*/
|
|
@@ -44,32 +13,33 @@ function BarLabelPlot(props) {
|
|
|
44
13
|
skipAnimation
|
|
45
14
|
} = props,
|
|
46
15
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
|
-
const barLabelTransition = useTransition(bars, {
|
|
48
|
-
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
49
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
50
|
-
leave: null,
|
|
51
|
-
enter: enterStyle,
|
|
52
|
-
update: enterStyle,
|
|
53
|
-
immediate: skipAnimation
|
|
54
|
-
});
|
|
55
16
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
56
|
-
children:
|
|
17
|
+
children: bars.map(({
|
|
18
|
+
xOrigin,
|
|
19
|
+
yOrigin,
|
|
20
|
+
x,
|
|
21
|
+
y,
|
|
57
22
|
seriesId,
|
|
58
23
|
dataIndex,
|
|
59
24
|
color,
|
|
60
25
|
value,
|
|
61
26
|
width,
|
|
62
|
-
height
|
|
27
|
+
height,
|
|
28
|
+
layout
|
|
63
29
|
}) => /*#__PURE__*/_jsx(BarLabelItem, _extends({
|
|
64
30
|
seriesId: seriesId,
|
|
65
31
|
dataIndex: dataIndex,
|
|
66
32
|
value: value,
|
|
67
33
|
color: color,
|
|
34
|
+
xOrigin: xOrigin,
|
|
35
|
+
yOrigin: yOrigin,
|
|
36
|
+
x: x,
|
|
37
|
+
y: y,
|
|
68
38
|
width: width,
|
|
69
|
-
height: height
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})))
|
|
39
|
+
height: height,
|
|
40
|
+
skipAnimation: skipAnimation ?? false,
|
|
41
|
+
layout: layout ?? 'vertical'
|
|
42
|
+
}, other), `${seriesId}-${dataIndex}`))
|
|
73
43
|
});
|
|
74
44
|
}
|
|
75
45
|
export { BarLabelPlot };
|
|
@@ -6,8 +6,10 @@ export interface BarLabelClasses {
|
|
|
6
6
|
highlighted: string;
|
|
7
7
|
/** Styles applied to the root element if it is faded. */
|
|
8
8
|
faded: string;
|
|
9
|
+
/** Styles applied to the root element if it is animated. */
|
|
10
|
+
animate: string;
|
|
9
11
|
}
|
|
10
12
|
export type BarLabelClassKey = keyof BarLabelClasses;
|
|
11
13
|
export declare function getBarLabelUtilityClass(slot: string): string;
|
|
12
|
-
export declare const barLabelClasses: Record<"root" | "highlighted" | "faded", string>;
|
|
14
|
+
export declare const barLabelClasses: Record<"root" | "animate" | "highlighted" | "faded", string>;
|
|
13
15
|
export declare const useUtilityClasses: (ownerState: BarLabelOwnerState) => Record<"root", string>;
|
|
@@ -4,16 +4,17 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
4
4
|
export function getBarLabelUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiBarLabel', slot);
|
|
6
6
|
}
|
|
7
|
-
export const barLabelClasses = generateUtilityClasses('MuiBarLabel', ['root', 'highlighted', 'faded']);
|
|
7
|
+
export const barLabelClasses = generateUtilityClasses('MuiBarLabel', ['root', 'highlighted', 'faded', 'animate']);
|
|
8
8
|
export const useUtilityClasses = ownerState => {
|
|
9
9
|
const {
|
|
10
10
|
classes,
|
|
11
11
|
seriesId,
|
|
12
12
|
isFaded,
|
|
13
|
-
isHighlighted
|
|
13
|
+
isHighlighted,
|
|
14
|
+
skipAnimation
|
|
14
15
|
} = ownerState;
|
|
15
16
|
const slots = {
|
|
16
|
-
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
17
|
+
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
|
|
17
18
|
};
|
|
18
19
|
return composeClasses(slots, getBarLabelUtilityClass, classes);
|
|
19
20
|
};
|
package/esm/BarChart/BarPlot.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["skipAnimation", "onItemClick", "borderRadius", "barLabel"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useTransition } from '@react-spring/web';
|
|
9
8
|
import { styled } from '@mui/material/styles';
|
|
10
|
-
import {
|
|
9
|
+
import { barElementClasses } from "./barElementClasses.js";
|
|
10
|
+
import { BarElement } from "./BarElement.js";
|
|
11
11
|
import getColor from "./seriesConfig/getColor.js";
|
|
12
12
|
import { useChartId, useDrawingArea, useXAxes, useYAxes } from "../hooks/index.js";
|
|
13
13
|
import { BarClipPath } from "./BarClipPath.js";
|
|
@@ -113,8 +113,8 @@ const useAggregatedData = () => {
|
|
|
113
113
|
layout,
|
|
114
114
|
x: verticalLayout ? xScale(baseValue) + barOffset : minValueCoord,
|
|
115
115
|
y: verticalLayout ? minValueCoord : yScale(baseValue) + barOffset,
|
|
116
|
-
xOrigin: xScale(0),
|
|
117
|
-
yOrigin: yScale(0),
|
|
116
|
+
xOrigin: xScale(0) ?? 0,
|
|
117
|
+
yOrigin: yScale(0) ?? 0,
|
|
118
118
|
height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
|
|
119
119
|
width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
|
|
120
120
|
color: colorGetter(dataIndex),
|
|
@@ -154,36 +154,6 @@ const useAggregatedData = () => {
|
|
|
154
154
|
masksData: Object.values(masks)
|
|
155
155
|
};
|
|
156
156
|
};
|
|
157
|
-
const leaveStyle = ({
|
|
158
|
-
layout,
|
|
159
|
-
yOrigin,
|
|
160
|
-
x,
|
|
161
|
-
width,
|
|
162
|
-
y,
|
|
163
|
-
xOrigin,
|
|
164
|
-
height
|
|
165
|
-
}) => _extends({}, layout === 'vertical' ? {
|
|
166
|
-
y: yOrigin,
|
|
167
|
-
x,
|
|
168
|
-
height: 0,
|
|
169
|
-
width
|
|
170
|
-
} : {
|
|
171
|
-
y,
|
|
172
|
-
x: xOrigin,
|
|
173
|
-
height,
|
|
174
|
-
width: 0
|
|
175
|
-
});
|
|
176
|
-
const enterStyle = ({
|
|
177
|
-
x,
|
|
178
|
-
width,
|
|
179
|
-
y,
|
|
180
|
-
height
|
|
181
|
-
}) => ({
|
|
182
|
-
y,
|
|
183
|
-
x,
|
|
184
|
-
height,
|
|
185
|
-
width
|
|
186
|
-
});
|
|
187
157
|
const BarPlotRoot = styled('g', {
|
|
188
158
|
name: 'MuiBarPlot',
|
|
189
159
|
slot: 'Root',
|
|
@@ -220,25 +190,13 @@ function BarPlot(props) {
|
|
|
220
190
|
const isZoomInteracting = useInternalIsZoomInteracting();
|
|
221
191
|
const skipAnimation = useSkipAnimation(isZoomInteracting || inSkipAnimation);
|
|
222
192
|
const withoutBorderRadius = !borderRadius || borderRadius <= 0;
|
|
223
|
-
const transition = useTransition(completedData, {
|
|
224
|
-
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
225
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
226
|
-
leave: leaveStyle,
|
|
227
|
-
enter: enterStyle,
|
|
228
|
-
update: enterStyle,
|
|
229
|
-
immediate: skipAnimation
|
|
230
|
-
});
|
|
231
|
-
const maskTransition = useTransition(withoutBorderRadius ? [] : masksData, {
|
|
232
|
-
keys: v => v.id,
|
|
233
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
234
|
-
leave: leaveStyle,
|
|
235
|
-
enter: enterStyle,
|
|
236
|
-
update: enterStyle,
|
|
237
|
-
immediate: skipAnimation
|
|
238
|
-
});
|
|
239
193
|
return /*#__PURE__*/_jsxs(BarPlotRoot, {
|
|
240
|
-
children: [!withoutBorderRadius &&
|
|
194
|
+
children: [!withoutBorderRadius && masksData.map(({
|
|
241
195
|
id,
|
|
196
|
+
x,
|
|
197
|
+
y,
|
|
198
|
+
width,
|
|
199
|
+
height,
|
|
242
200
|
hasPositive,
|
|
243
201
|
hasNegative,
|
|
244
202
|
layout
|
|
@@ -249,18 +207,37 @@ function BarPlot(props) {
|
|
|
249
207
|
hasNegative: hasNegative,
|
|
250
208
|
hasPositive: hasPositive,
|
|
251
209
|
layout: layout,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
210
|
+
x: x,
|
|
211
|
+
y: y,
|
|
212
|
+
width: width,
|
|
213
|
+
height: height,
|
|
214
|
+
skipAnimation: skipAnimation ?? false
|
|
215
|
+
}, id);
|
|
216
|
+
}), completedData.map(({
|
|
255
217
|
seriesId,
|
|
256
218
|
dataIndex,
|
|
257
219
|
color,
|
|
258
|
-
maskId
|
|
220
|
+
maskId,
|
|
221
|
+
layout,
|
|
222
|
+
x,
|
|
223
|
+
xOrigin,
|
|
224
|
+
y,
|
|
225
|
+
yOrigin,
|
|
226
|
+
width,
|
|
227
|
+
height
|
|
259
228
|
}) => {
|
|
260
229
|
const barElement = /*#__PURE__*/_jsx(BarElement, _extends({
|
|
261
230
|
id: seriesId,
|
|
262
231
|
dataIndex: dataIndex,
|
|
263
|
-
color: color
|
|
232
|
+
color: color,
|
|
233
|
+
skipAnimation: skipAnimation ?? false,
|
|
234
|
+
layout: layout ?? 'vertical',
|
|
235
|
+
x: x,
|
|
236
|
+
xOrigin: xOrigin,
|
|
237
|
+
y: y,
|
|
238
|
+
yOrigin: yOrigin,
|
|
239
|
+
width: width,
|
|
240
|
+
height: height
|
|
264
241
|
}, other, {
|
|
265
242
|
onClick: onItemClick && (event => {
|
|
266
243
|
onItemClick(event, {
|
|
@@ -268,16 +245,15 @@ function BarPlot(props) {
|
|
|
268
245
|
seriesId,
|
|
269
246
|
dataIndex
|
|
270
247
|
});
|
|
271
|
-
})
|
|
272
|
-
|
|
273
|
-
}));
|
|
248
|
+
})
|
|
249
|
+
}), `${seriesId}-${dataIndex}`);
|
|
274
250
|
if (withoutBorderRadius) {
|
|
275
251
|
return barElement;
|
|
276
252
|
}
|
|
277
253
|
return /*#__PURE__*/_jsx("g", {
|
|
278
254
|
clipPath: `url(#${maskId})`,
|
|
279
255
|
children: barElement
|
|
280
|
-
});
|
|
256
|
+
}, `${seriesId}-${dataIndex}`);
|
|
281
257
|
}), barLabel && /*#__PURE__*/_jsx(BarLabelPlot, _extends({
|
|
282
258
|
bars: completedData,
|
|
283
259
|
skipAnimation: skipAnimation,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SeriesId } from "../models/seriesType/common.js";
|
|
2
|
+
export interface BarElementClasses {
|
|
3
|
+
/** Styles applied to the root element. */
|
|
4
|
+
root: string;
|
|
5
|
+
/** Styles applied to the root element if it is highlighted. */
|
|
6
|
+
highlighted: string;
|
|
7
|
+
/** Styles applied to the root element if it is faded. */
|
|
8
|
+
faded: string;
|
|
9
|
+
}
|
|
10
|
+
export type BarElementClassKey = keyof BarElementClasses;
|
|
11
|
+
export interface BarElementOwnerState {
|
|
12
|
+
id: SeriesId;
|
|
13
|
+
dataIndex: number;
|
|
14
|
+
color: string;
|
|
15
|
+
isFaded: boolean;
|
|
16
|
+
isHighlighted: boolean;
|
|
17
|
+
classes?: Partial<BarElementClasses>;
|
|
18
|
+
}
|
|
19
|
+
export declare function getBarElementUtilityClass(slot: string): string;
|
|
20
|
+
export declare const barElementClasses: BarElementClasses;
|
|
21
|
+
export declare const useUtilityClasses: (ownerState: BarElementOwnerState) => Record<"root", string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
3
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
4
|
+
export function getBarElementUtilityClass(slot) {
|
|
5
|
+
return generateUtilityClass('MuiBarElement', slot);
|
|
6
|
+
}
|
|
7
|
+
export const barElementClasses = generateUtilityClasses('MuiBarElement', ['root', 'highlighted', 'faded']);
|
|
8
|
+
export const useUtilityClasses = ownerState => {
|
|
9
|
+
const {
|
|
10
|
+
classes,
|
|
11
|
+
id,
|
|
12
|
+
isHighlighted,
|
|
13
|
+
isFaded
|
|
14
|
+
} = ownerState;
|
|
15
|
+
const slots = {
|
|
16
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
17
|
+
};
|
|
18
|
+
return composeClasses(slots, getBarElementUtilityClass, classes);
|
|
19
|
+
};
|
package/esm/BarChart/index.d.ts
CHANGED
package/esm/BarChart/index.js
CHANGED
|
@@ -2,13 +2,14 @@ import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
|
2
2
|
import seriesProcessor from "./seriesProcessor.js";
|
|
3
3
|
import legendGetter from "./legend.js";
|
|
4
4
|
import getColor from "./getColor.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
|
seriesProcessor,
|
|
9
9
|
colorProcessor: getColor,
|
|
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<'bar'>;
|
|
3
|
+
export declare const axisTooltipGetter: AxisTooltipGetter<'bar', 'x' | 'y'>;
|
|
3
4
|
export default tooltipGetter;
|
|
@@ -10,6 +10,9 @@ const tooltipGetter = params => {
|
|
|
10
10
|
}
|
|
11
11
|
const label = getLabel(series.label, 'tooltip');
|
|
12
12
|
const value = series.data[identifier.dataIndex];
|
|
13
|
+
if (value == null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
13
16
|
const formattedValue = series.valueFormatter(value, {
|
|
14
17
|
dataIndex: identifier.dataIndex
|
|
15
18
|
});
|
|
@@ -22,4 +25,13 @@ const tooltipGetter = params => {
|
|
|
22
25
|
markType: series.labelMarkType
|
|
23
26
|
};
|
|
24
27
|
};
|
|
28
|
+
export const axisTooltipGetter = series => {
|
|
29
|
+
return Object.values(series).map(s => s.layout === 'horizontal' ? {
|
|
30
|
+
direction: 'y',
|
|
31
|
+
axisId: s.yAxisId
|
|
32
|
+
} : {
|
|
33
|
+
direction: 'x',
|
|
34
|
+
axisId: s.xAxisId
|
|
35
|
+
});
|
|
36
|
+
};
|
|
25
37
|
export default tooltipGetter;
|
package/esm/BarChart/types.d.ts
CHANGED
|
@@ -151,6 +151,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
151
151
|
height: PropTypes.number,
|
|
152
152
|
hideTooltip: PropTypes.bool,
|
|
153
153
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
154
|
+
ignoreTooltip: PropTypes.bool,
|
|
154
155
|
label: PropTypes.string,
|
|
155
156
|
labelStyle: PropTypes.object,
|
|
156
157
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -208,6 +209,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
208
209
|
height: PropTypes.number,
|
|
209
210
|
hideTooltip: PropTypes.bool,
|
|
210
211
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
212
|
+
ignoreTooltip: PropTypes.bool,
|
|
211
213
|
label: PropTypes.string,
|
|
212
214
|
labelGap: PropTypes.number,
|
|
213
215
|
labelStyle: PropTypes.object,
|
|
@@ -288,6 +290,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
288
290
|
height: PropTypes.number,
|
|
289
291
|
hideTooltip: PropTypes.bool,
|
|
290
292
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
293
|
+
ignoreTooltip: PropTypes.bool,
|
|
291
294
|
label: PropTypes.string,
|
|
292
295
|
labelStyle: PropTypes.object,
|
|
293
296
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -343,6 +346,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
343
346
|
fill: PropTypes.string,
|
|
344
347
|
hideTooltip: PropTypes.bool,
|
|
345
348
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
349
|
+
ignoreTooltip: PropTypes.bool,
|
|
346
350
|
label: PropTypes.string,
|
|
347
351
|
labelStyle: PropTypes.object,
|
|
348
352
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -17,15 +17,11 @@ const Root = styled('div', {
|
|
|
17
17
|
})(() => {
|
|
18
18
|
return {
|
|
19
19
|
display: 'flex',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
justifyContent: 'center',
|
|
22
|
-
flexShrink: 0,
|
|
23
20
|
width: 14,
|
|
24
21
|
height: 14,
|
|
25
22
|
[`&.${labelMarkClasses.line}`]: {
|
|
26
23
|
width: 16,
|
|
27
24
|
height: 'unset',
|
|
28
|
-
display: 'flex',
|
|
29
25
|
alignItems: 'center',
|
|
30
26
|
[`.${labelMarkClasses.mask}`]: {
|
|
31
27
|
height: 4,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { ChartsLabelMarkProps, ChartsLabelCustomMarkProps } from './ChartsLabelMark';
|
|
2
|
+
export { ChartsLabelMark } from "./ChartsLabelMark.js";
|
|
2
3
|
export { labelClasses } from "./labelClasses.js";
|
|
3
4
|
export type { ChartsLabelClasses } from './labelClasses';
|
|
4
5
|
export { labelMarkClasses } from "./labelMarkClasses.js";
|
package/esm/ChartsLabel/index.js
CHANGED
|
@@ -22,5 +22,5 @@ export interface ContinuousColorLegendClasses {
|
|
|
22
22
|
/** Styles applied to the series label. */
|
|
23
23
|
label: string;
|
|
24
24
|
}
|
|
25
|
-
export declare const useUtilityClasses: (props: ContinuousColorLegendProps & ChartsLegendSlotExtension) => Record<"root" | "label" | "mark" | "
|
|
25
|
+
export declare const useUtilityClasses: (props: ContinuousColorLegendProps & ChartsLegendSlotExtension) => Record<"root" | "label" | "mark" | "gradient" | "minLabel" | "maxLabel", string>;
|
|
26
26
|
export declare const continuousColorLegendClasses: ContinuousColorLegendClasses;
|