@mui/x-charts 8.0.0-beta.2 → 8.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/AnimatedBarElement.d.ts +38 -8
- package/BarChart/AnimatedBarElement.js +5 -5
- package/BarChart/BarChart.js +2 -0
- package/BarChart/BarClipPath.d.ts +19 -1
- package/BarChart/BarClipPath.js +84 -17
- package/BarChart/BarElement.d.ts +9 -20
- package/BarChart/BarElement.js +29 -26
- package/BarChart/BarLabel/BarLabel.d.ts +27 -854
- package/BarChart/BarLabel/BarLabel.js +32 -5
- package/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
- package/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
- package/BarChart/BarLabel/BarLabelItem.js +18 -6
- package/BarChart/BarLabel/BarLabelPlot.js +16 -46
- package/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
- package/BarChart/BarLabel/barLabelClasses.js +4 -3
- package/BarChart/BarPlot.js +37 -61
- package/BarChart/barElementClasses.d.ts +21 -0
- package/BarChart/barElementClasses.js +29 -0
- package/BarChart/getRadius.d.ts +1 -1
- package/BarChart/index.d.ts +2 -1
- package/BarChart/index.js +11 -0
- package/BarChart/seriesConfig/index.js +3 -1
- package/BarChart/seriesConfig/tooltip.d.ts +2 -1
- package/BarChart/seriesConfig/tooltip.js +14 -1
- package/BarChart/types.d.ts +2 -2
- package/CHANGELOG.md +141 -0
- package/ChartContainer/ChartContainer.js +4 -0
- package/ChartsLabel/ChartsLabelMark.js +0 -4
- package/ChartsLabel/index.d.ts +1 -0
- package/ChartsLabel/index.js +7 -0
- package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/ChartsTooltip/ChartsTooltip.js +2 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +3 -8
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
- package/ChartsTooltip/ChartsTooltipTable.js +24 -9
- package/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
- package/ChartsTooltip/chartsTooltipClasses.js +2 -2
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +12 -0
- package/ChartsTooltip/useAxesTooltip.d.ts +7 -0
- package/ChartsTooltip/useAxesTooltip.js +18 -0
- package/ChartsTooltip/useAxisTooltip.d.ts +24 -3
- package/ChartsTooltip/useAxisTooltip.js +71 -37
- package/ChartsTooltip/useItemTooltip.js +4 -1
- package/ChartsXAxis/ChartsXAxis.js +5 -2
- package/ChartsYAxis/ChartsYAxis.js +69 -17
- package/LineChart/AnimatedArea.js +5 -22
- package/LineChart/AnimatedLine.d.ts +1 -4
- package/LineChart/AnimatedLine.js +10 -25
- package/LineChart/AppearingMask.d.ts +5 -0
- package/LineChart/AppearingMask.js +25 -18
- package/LineChart/CircleMarkElement.js +16 -22
- package/LineChart/LineChart.js +2 -0
- package/LineChart/LineHighlightPlot.js +2 -3
- package/LineChart/MarkElement.js +16 -27
- package/LineChart/MarkPlot.js +0 -1
- package/LineChart/markElementClasses.d.ts +3 -0
- package/LineChart/markElementClasses.js +4 -3
- package/LineChart/seriesConfig/index.js +3 -1
- package/LineChart/seriesConfig/tooltip.d.ts +2 -1
- package/LineChart/seriesConfig/tooltip.js +8 -1
- package/PieChart/PieArc.d.ts +19 -11
- package/PieChart/PieArc.js +37 -24
- package/PieChart/PieArcLabel.d.ts +22 -13
- package/PieChart/PieArcLabel.js +52 -48
- package/PieChart/PieArcLabelPlot.js +16 -34
- package/PieChart/PieArcPlot.js +21 -34
- package/PieChart/seriesConfig/tooltip.js +3 -0
- package/ScatterChart/ScatterChart.js +2 -0
- package/SparkLineChart/SparkLineChart.js +2 -0
- package/colorPalettes/colorPalettes.js +2 -2
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/context/AnimationProvider/AnimationProvider.js +4 -6
- package/esm/BarChart/AnimatedBarElement.d.ts +38 -8
- package/esm/BarChart/AnimatedBarElement.js +5 -5
- package/esm/BarChart/BarChart.js +2 -0
- package/esm/BarChart/BarClipPath.d.ts +19 -1
- package/esm/BarChart/BarClipPath.js +84 -17
- package/esm/BarChart/BarElement.d.ts +9 -20
- package/esm/BarChart/BarElement.js +28 -23
- package/esm/BarChart/BarLabel/BarLabel.d.ts +27 -854
- package/esm/BarChart/BarLabel/BarLabel.js +32 -5
- package/esm/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +18 -6
- package/esm/BarChart/BarLabel/BarLabelPlot.js +16 -46
- package/esm/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
- package/esm/BarChart/BarLabel/barLabelClasses.js +4 -3
- package/esm/BarChart/BarPlot.js +37 -61
- package/esm/BarChart/barElementClasses.d.ts +21 -0
- package/esm/BarChart/barElementClasses.js +19 -0
- package/esm/BarChart/getRadius.d.ts +1 -1
- package/esm/BarChart/index.d.ts +2 -1
- package/esm/BarChart/index.js +2 -1
- package/esm/BarChart/seriesConfig/index.js +2 -1
- package/esm/BarChart/seriesConfig/tooltip.d.ts +2 -1
- package/esm/BarChart/seriesConfig/tooltip.js +12 -0
- package/esm/BarChart/types.d.ts +2 -2
- package/esm/ChartContainer/ChartContainer.js +4 -0
- package/esm/ChartsLabel/ChartsLabelMark.js +0 -4
- package/esm/ChartsLabel/index.d.ts +1 -0
- package/esm/ChartsLabel/index.js +1 -0
- package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +4 -9
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.js +23 -9
- package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
- package/esm/ChartsTooltip/chartsTooltipClasses.js +2 -2
- package/esm/ChartsTooltip/index.d.ts +1 -0
- package/esm/ChartsTooltip/index.js +1 -0
- package/esm/ChartsTooltip/useAxesTooltip.d.ts +7 -0
- package/esm/ChartsTooltip/useAxesTooltip.js +12 -0
- package/esm/ChartsTooltip/useAxisTooltip.d.ts +24 -3
- package/esm/ChartsTooltip/useAxisTooltip.js +72 -38
- package/esm/ChartsTooltip/useItemTooltip.js +4 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +5 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +69 -17
- package/esm/LineChart/AnimatedArea.js +5 -22
- package/esm/LineChart/AnimatedLine.d.ts +1 -4
- package/esm/LineChart/AnimatedLine.js +9 -24
- package/esm/LineChart/AppearingMask.d.ts +5 -0
- package/esm/LineChart/AppearingMask.js +23 -18
- package/esm/LineChart/CircleMarkElement.js +19 -25
- package/esm/LineChart/LineChart.js +2 -0
- package/esm/LineChart/LineHighlightPlot.js +3 -4
- package/esm/LineChart/MarkElement.js +17 -28
- package/esm/LineChart/MarkPlot.js +0 -1
- package/esm/LineChart/markElementClasses.d.ts +3 -0
- package/esm/LineChart/markElementClasses.js +4 -3
- package/esm/LineChart/seriesConfig/index.js +2 -1
- package/esm/LineChart/seriesConfig/tooltip.d.ts +2 -1
- package/esm/LineChart/seriesConfig/tooltip.js +6 -0
- package/esm/PieChart/PieArc.d.ts +19 -11
- package/esm/PieChart/PieArc.js +36 -23
- package/esm/PieChart/PieArcLabel.d.ts +22 -13
- package/esm/PieChart/PieArcLabel.js +51 -47
- package/esm/PieChart/PieArcLabelPlot.js +16 -34
- package/esm/PieChart/PieArcPlot.js +21 -34
- package/esm/PieChart/seriesConfig/tooltip.js +3 -0
- package/esm/ScatterChart/ScatterChart.js +2 -0
- package/esm/SparkLineChart/SparkLineChart.js +2 -0
- package/esm/colorPalettes/colorPalettes.js +2 -2
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/context/AnimationProvider/AnimationProvider.js +3 -6
- package/esm/hooks/animation/index.d.ts +6 -0
- package/esm/hooks/animation/index.js +6 -0
- package/esm/hooks/animation/useAnimateArea.d.ts +15 -0
- package/esm/hooks/animation/useAnimateArea.js +27 -0
- package/esm/hooks/animation/useAnimateBar.d.ts +17 -0
- package/esm/hooks/animation/useAnimateBar.js +56 -0
- package/esm/hooks/animation/useAnimateBarLabel.d.ts +19 -0
- package/esm/hooks/animation/useAnimateBarLabel.js +59 -0
- package/esm/hooks/animation/useAnimateLine.d.ts +14 -0
- package/esm/hooks/animation/useAnimateLine.js +26 -0
- package/esm/hooks/animation/useAnimatePieArc.d.ts +15 -0
- package/esm/hooks/animation/useAnimatePieArc.js +70 -0
- package/esm/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
- package/esm/hooks/animation/useAnimatePieArcLabel.js +72 -0
- package/esm/hooks/index.d.ts +2 -1
- package/esm/hooks/index.js +2 -1
- package/esm/hooks/useInteractionItemProps.js +11 -0
- package/esm/index.js +1 -1
- package/esm/internals/animation/Transition.d.ts +37 -0
- package/esm/internals/animation/Transition.js +83 -0
- package/esm/internals/animation/animation.d.ts +4 -0
- package/esm/internals/animation/animation.js +4 -0
- package/esm/internals/animation/useAnimate.d.ts +19 -0
- package/esm/internals/animation/useAnimate.js +74 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +60 -26
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
- package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
- package/esm/internals/shallowEqual.d.ts +8 -0
- package/esm/internals/shallowEqual.js +31 -0
- package/esm/models/axis.d.ts +8 -0
- package/esm/themeAugmentation/overrides.d.ts +1 -1
- package/hooks/animation/index.d.ts +6 -0
- package/hooks/animation/index.js +71 -0
- package/hooks/animation/useAnimateArea.d.ts +15 -0
- package/hooks/animation/useAnimateArea.js +34 -0
- package/hooks/animation/useAnimateBar.d.ts +17 -0
- package/hooks/animation/useAnimateBar.js +62 -0
- package/hooks/animation/useAnimateBarLabel.d.ts +19 -0
- package/hooks/animation/useAnimateBarLabel.js +65 -0
- package/hooks/animation/useAnimateLine.d.ts +14 -0
- package/hooks/animation/useAnimateLine.js +33 -0
- package/hooks/animation/useAnimatePieArc.d.ts +15 -0
- package/hooks/animation/useAnimatePieArc.js +77 -0
- package/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
- package/hooks/animation/useAnimatePieArcLabel.js +79 -0
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +13 -1
- package/hooks/useInteractionItemProps.js +11 -0
- package/index.js +1 -1
- package/internals/animation/Transition.d.ts +37 -0
- package/internals/animation/Transition.js +89 -0
- package/internals/animation/animation.d.ts +4 -0
- package/internals/animation/animation.js +11 -0
- package/internals/animation/useAnimate.d.ts +19 -0
- package/internals/animation/useAnimate.js +80 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +28 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +61 -27
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
- package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
- package/internals/shallowEqual.d.ts +8 -0
- package/internals/shallowEqual.js +37 -0
- package/models/axis.d.ts +8 -0
- package/modern/BarChart/AnimatedBarElement.d.ts +38 -8
- package/modern/BarChart/AnimatedBarElement.js +5 -5
- package/modern/BarChart/BarChart.js +2 -0
- package/modern/BarChart/BarClipPath.d.ts +19 -1
- package/modern/BarChart/BarClipPath.js +84 -17
- package/modern/BarChart/BarElement.d.ts +9 -20
- package/modern/BarChart/BarElement.js +28 -23
- package/modern/BarChart/BarLabel/BarLabel.d.ts +27 -854
- package/modern/BarChart/BarLabel/BarLabel.js +32 -5
- package/modern/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
- package/modern/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
- package/modern/BarChart/BarLabel/BarLabelItem.js +18 -6
- package/modern/BarChart/BarLabel/BarLabelPlot.js +16 -46
- package/modern/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
- package/modern/BarChart/BarLabel/barLabelClasses.js +4 -3
- package/modern/BarChart/BarPlot.js +37 -61
- package/modern/BarChart/barElementClasses.d.ts +21 -0
- package/modern/BarChart/barElementClasses.js +19 -0
- package/modern/BarChart/getRadius.d.ts +1 -1
- package/modern/BarChart/index.d.ts +2 -1
- package/modern/BarChart/index.js +2 -1
- package/modern/BarChart/seriesConfig/index.js +2 -1
- package/modern/BarChart/seriesConfig/tooltip.d.ts +2 -1
- package/modern/BarChart/seriesConfig/tooltip.js +12 -0
- package/modern/BarChart/types.d.ts +2 -2
- package/modern/ChartContainer/ChartContainer.js +4 -0
- package/modern/ChartsLabel/ChartsLabelMark.js +0 -4
- package/modern/ChartsLabel/index.d.ts +1 -0
- package/modern/ChartsLabel/index.js +1 -0
- package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +4 -9
- package/modern/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
- package/modern/ChartsTooltip/ChartsTooltipTable.js +23 -9
- package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
- package/modern/ChartsTooltip/chartsTooltipClasses.js +2 -2
- package/modern/ChartsTooltip/index.d.ts +1 -0
- package/modern/ChartsTooltip/index.js +1 -0
- package/modern/ChartsTooltip/useAxesTooltip.d.ts +7 -0
- package/modern/ChartsTooltip/useAxesTooltip.js +12 -0
- package/modern/ChartsTooltip/useAxisTooltip.d.ts +24 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +72 -38
- package/modern/ChartsTooltip/useItemTooltip.js +4 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +5 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +69 -17
- package/modern/LineChart/AnimatedArea.js +5 -22
- package/modern/LineChart/AnimatedLine.d.ts +1 -4
- package/modern/LineChart/AnimatedLine.js +9 -24
- package/modern/LineChart/AppearingMask.d.ts +5 -0
- package/modern/LineChart/AppearingMask.js +23 -18
- package/modern/LineChart/CircleMarkElement.js +19 -25
- package/modern/LineChart/LineChart.js +2 -0
- package/modern/LineChart/LineHighlightPlot.js +3 -4
- package/modern/LineChart/MarkElement.js +17 -28
- package/modern/LineChart/MarkPlot.js +0 -1
- package/modern/LineChart/markElementClasses.d.ts +3 -0
- package/modern/LineChart/markElementClasses.js +4 -3
- package/modern/LineChart/seriesConfig/index.js +2 -1
- package/modern/LineChart/seriesConfig/tooltip.d.ts +2 -1
- package/modern/LineChart/seriesConfig/tooltip.js +6 -0
- package/modern/PieChart/PieArc.d.ts +19 -11
- package/modern/PieChart/PieArc.js +36 -23
- package/modern/PieChart/PieArcLabel.d.ts +22 -13
- package/modern/PieChart/PieArcLabel.js +51 -47
- package/modern/PieChart/PieArcLabelPlot.js +16 -34
- package/modern/PieChart/PieArcPlot.js +21 -34
- package/modern/PieChart/seriesConfig/tooltip.js +3 -0
- package/modern/ScatterChart/ScatterChart.js +2 -0
- package/modern/SparkLineChart/SparkLineChart.js +2 -0
- package/modern/colorPalettes/colorPalettes.js +2 -2
- package/modern/constants/index.d.ts +1 -1
- package/modern/constants/index.js +1 -1
- package/modern/context/AnimationProvider/AnimationProvider.js +3 -6
- package/modern/hooks/animation/index.d.ts +6 -0
- package/modern/hooks/animation/index.js +6 -0
- package/modern/hooks/animation/useAnimateArea.d.ts +15 -0
- package/modern/hooks/animation/useAnimateArea.js +27 -0
- package/modern/hooks/animation/useAnimateBar.d.ts +17 -0
- package/modern/hooks/animation/useAnimateBar.js +56 -0
- package/modern/hooks/animation/useAnimateBarLabel.d.ts +19 -0
- package/modern/hooks/animation/useAnimateBarLabel.js +59 -0
- package/modern/hooks/animation/useAnimateLine.d.ts +14 -0
- package/modern/hooks/animation/useAnimateLine.js +26 -0
- package/modern/hooks/animation/useAnimatePieArc.d.ts +15 -0
- package/modern/hooks/animation/useAnimatePieArc.js +70 -0
- package/modern/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
- package/modern/hooks/animation/useAnimatePieArcLabel.js +72 -0
- package/modern/hooks/index.d.ts +2 -1
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/useInteractionItemProps.js +11 -0
- package/modern/index.js +1 -1
- package/modern/internals/animation/Transition.d.ts +37 -0
- package/modern/internals/animation/Transition.js +83 -0
- package/modern/internals/animation/animation.d.ts +4 -0
- package/modern/internals/animation/animation.js +4 -0
- package/modern/internals/animation/useAnimate.d.ts +19 -0
- package/modern/internals/animation/useAnimate.js +74 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +60 -26
- package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
- package/modern/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
- package/modern/internals/shallowEqual.d.ts +8 -0
- package/modern/internals/shallowEqual.js +31 -0
- package/modern/models/axis.d.ts +8 -0
- package/modern/themeAugmentation/overrides.d.ts +1 -1
- package/package.json +8 -9
- package/themeAugmentation/overrides.d.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/PieChart/dataTransform/transition.d.ts +0 -4
- package/PieChart/dataTransform/transition.js +0 -145
- package/esm/PieChart/dataTransform/transition.d.ts +0 -4
- package/esm/PieChart/dataTransform/transition.js +0 -137
- package/modern/PieChart/dataTransform/transition.d.ts +0 -4
- package/modern/PieChart/dataTransform/transition.js +0 -137
|
@@ -12,12 +12,12 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
|
-
var _web = require("@react-spring/web");
|
|
16
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
+
var _useAnimateBarLabel = require("../../hooks/animation/useAnimateBarLabel");
|
|
17
17
|
var _barLabelClasses = require("./barLabelClasses");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
|
|
20
|
-
const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)(
|
|
19
|
+
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin"];
|
|
20
|
+
const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)('text', {
|
|
21
21
|
name: 'MuiBarLabel',
|
|
22
22
|
slot: 'Root',
|
|
23
23
|
overridesResolver: (_, styles) => [{
|
|
@@ -45,7 +45,8 @@ function BarLabel(inProps) {
|
|
|
45
45
|
name: 'MuiBarLabel'
|
|
46
46
|
});
|
|
47
47
|
const otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
48
|
-
|
|
48
|
+
const animatedProps = (0, _useAnimateBarLabel.useAnimateBarLabel)(props);
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BarLabelComponent, (0, _extends2.default)({}, otherProps, animatedProps));
|
|
49
50
|
}
|
|
50
51
|
process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
51
52
|
// ----------------------------- Warning --------------------------------
|
|
@@ -54,7 +55,33 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
|
54
55
|
// ----------------------------------------------------------------------
|
|
55
56
|
classes: _propTypes.default.object,
|
|
56
57
|
dataIndex: _propTypes.default.number.isRequired,
|
|
58
|
+
/**
|
|
59
|
+
* Height of the bar this label belongs to.
|
|
60
|
+
*/
|
|
61
|
+
height: _propTypes.default.number.isRequired,
|
|
57
62
|
isFaded: _propTypes.default.bool.isRequired,
|
|
58
63
|
isHighlighted: _propTypes.default.bool.isRequired,
|
|
59
|
-
|
|
64
|
+
layout: _propTypes.default.oneOf(['horizontal', 'vertical']).isRequired,
|
|
65
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
66
|
+
skipAnimation: _propTypes.default.bool.isRequired,
|
|
67
|
+
/**
|
|
68
|
+
* Width of the bar this label belongs to.
|
|
69
|
+
*/
|
|
70
|
+
width: _propTypes.default.number.isRequired,
|
|
71
|
+
/**
|
|
72
|
+
* Position in the x-axis of the bar this label belongs to.
|
|
73
|
+
*/
|
|
74
|
+
x: _propTypes.default.number.isRequired,
|
|
75
|
+
/**
|
|
76
|
+
* The x-coordinate of the stack this bar label belongs to.
|
|
77
|
+
*/
|
|
78
|
+
xOrigin: _propTypes.default.number.isRequired,
|
|
79
|
+
/**
|
|
80
|
+
* Position in the y-axis of the bar this label belongs to.
|
|
81
|
+
*/
|
|
82
|
+
y: _propTypes.default.number.isRequired,
|
|
83
|
+
/**
|
|
84
|
+
* The y-coordinate of the stack this bar label belongs to.
|
|
85
|
+
*/
|
|
86
|
+
yOrigin: _propTypes.default.number.isRequired
|
|
60
87
|
} : void 0;
|
|
@@ -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.
|
|
@@ -16,7 +16,7 @@ var _getBarLabel = require("./getBarLabel");
|
|
|
16
16
|
var _BarLabel = require("./BarLabel");
|
|
17
17
|
var _useItemHighlighted = require("../../hooks/useItemHighlighted");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["seriesId", "classes", "color", "
|
|
19
|
+
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout"],
|
|
20
20
|
_excluded2 = ["ownerState"];
|
|
21
21
|
/**
|
|
22
22
|
* @ignore - internal component.
|
|
@@ -26,14 +26,19 @@ function BarLabelItem(props) {
|
|
|
26
26
|
seriesId,
|
|
27
27
|
classes: innerClasses,
|
|
28
28
|
color,
|
|
29
|
-
style,
|
|
30
29
|
dataIndex,
|
|
31
30
|
barLabel,
|
|
32
31
|
slots,
|
|
33
32
|
slotProps,
|
|
34
|
-
|
|
33
|
+
xOrigin,
|
|
34
|
+
yOrigin,
|
|
35
|
+
x,
|
|
36
|
+
y,
|
|
35
37
|
width,
|
|
36
|
-
|
|
38
|
+
height,
|
|
39
|
+
value,
|
|
40
|
+
skipAnimation,
|
|
41
|
+
layout
|
|
37
42
|
} = props,
|
|
38
43
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
39
44
|
const {
|
|
@@ -49,7 +54,9 @@ function BarLabelItem(props) {
|
|
|
49
54
|
color,
|
|
50
55
|
isFaded,
|
|
51
56
|
isHighlighted,
|
|
52
|
-
dataIndex
|
|
57
|
+
dataIndex,
|
|
58
|
+
skipAnimation,
|
|
59
|
+
layout
|
|
53
60
|
};
|
|
54
61
|
const classes = (0, _barLabelClasses.useUtilityClasses)(ownerState);
|
|
55
62
|
const Component = slots?.barLabel ?? _BarLabel.BarLabel;
|
|
@@ -57,7 +64,12 @@ function BarLabelItem(props) {
|
|
|
57
64
|
elementType: Component,
|
|
58
65
|
externalSlotProps: slotProps?.barLabel,
|
|
59
66
|
additionalProps: (0, _extends2.default)({}, other, {
|
|
60
|
-
|
|
67
|
+
xOrigin,
|
|
68
|
+
yOrigin,
|
|
69
|
+
x,
|
|
70
|
+
y,
|
|
71
|
+
width,
|
|
72
|
+
height,
|
|
61
73
|
className: classes.root
|
|
62
74
|
}),
|
|
63
75
|
ownerState
|
|
@@ -6,43 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.BarLabelPlot = BarLabelPlot;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _web = require("@react-spring/web");
|
|
13
12
|
var _BarLabelItem = require("./BarLabelItem");
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
const _excluded = ["bars", "skipAnimation"];
|
|
16
|
-
const leaveStyle = ({
|
|
17
|
-
layout,
|
|
18
|
-
yOrigin,
|
|
19
|
-
x,
|
|
20
|
-
width,
|
|
21
|
-
y,
|
|
22
|
-
xOrigin,
|
|
23
|
-
height
|
|
24
|
-
}) => (0, _extends2.default)({}, layout === 'vertical' ? {
|
|
25
|
-
y: yOrigin,
|
|
26
|
-
x: x + width / 2,
|
|
27
|
-
height: 0,
|
|
28
|
-
width
|
|
29
|
-
} : {
|
|
30
|
-
y: y + height / 2,
|
|
31
|
-
x: xOrigin,
|
|
32
|
-
height,
|
|
33
|
-
width: 0
|
|
34
|
-
});
|
|
35
|
-
const enterStyle = ({
|
|
36
|
-
x,
|
|
37
|
-
width,
|
|
38
|
-
y,
|
|
39
|
-
height
|
|
40
|
-
}) => ({
|
|
41
|
-
x: x + width / 2,
|
|
42
|
-
y: y + height / 2,
|
|
43
|
-
height,
|
|
44
|
-
width
|
|
45
|
-
});
|
|
46
15
|
/**
|
|
47
16
|
* @ignore - internal component.
|
|
48
17
|
*/
|
|
@@ -52,31 +21,32 @@ function BarLabelPlot(props) {
|
|
|
52
21
|
skipAnimation
|
|
53
22
|
} = props,
|
|
54
23
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
55
|
-
const barLabelTransition = (0, _web.useTransition)(bars, {
|
|
56
|
-
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
57
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
58
|
-
leave: null,
|
|
59
|
-
enter: enterStyle,
|
|
60
|
-
update: enterStyle,
|
|
61
|
-
immediate: skipAnimation
|
|
62
|
-
});
|
|
63
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
64
|
-
children:
|
|
25
|
+
children: bars.map(({
|
|
26
|
+
xOrigin,
|
|
27
|
+
yOrigin,
|
|
28
|
+
x,
|
|
29
|
+
y,
|
|
65
30
|
seriesId,
|
|
66
31
|
dataIndex,
|
|
67
32
|
color,
|
|
68
33
|
value,
|
|
69
34
|
width,
|
|
70
|
-
height
|
|
35
|
+
height,
|
|
36
|
+
layout
|
|
71
37
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelItem.BarLabelItem, (0, _extends2.default)({
|
|
72
38
|
seriesId: seriesId,
|
|
73
39
|
dataIndex: dataIndex,
|
|
74
40
|
value: value,
|
|
75
41
|
color: color,
|
|
42
|
+
xOrigin: xOrigin,
|
|
43
|
+
yOrigin: yOrigin,
|
|
44
|
+
x: x,
|
|
45
|
+
y: y,
|
|
76
46
|
width: width,
|
|
77
|
-
height: height
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})))
|
|
47
|
+
height: height,
|
|
48
|
+
skipAnimation: skipAnimation ?? false,
|
|
49
|
+
layout: layout ?? 'vertical'
|
|
50
|
+
}, other), `${seriesId}-${dataIndex}`))
|
|
81
51
|
});
|
|
82
52
|
}
|
|
@@ -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>;
|
|
@@ -13,16 +13,17 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
13
13
|
function getBarLabelUtilityClass(slot) {
|
|
14
14
|
return (0, _generateUtilityClass.default)('MuiBarLabel', slot);
|
|
15
15
|
}
|
|
16
|
-
const barLabelClasses = exports.barLabelClasses = (0, _generateUtilityClasses.default)('MuiBarLabel', ['root', 'highlighted', 'faded']);
|
|
16
|
+
const barLabelClasses = exports.barLabelClasses = (0, _generateUtilityClasses.default)('MuiBarLabel', ['root', 'highlighted', 'faded', 'animate']);
|
|
17
17
|
const useUtilityClasses = ownerState => {
|
|
18
18
|
const {
|
|
19
19
|
classes,
|
|
20
20
|
seriesId,
|
|
21
21
|
isFaded,
|
|
22
|
-
isHighlighted
|
|
22
|
+
isHighlighted,
|
|
23
|
+
skipAnimation
|
|
23
24
|
} = ownerState;
|
|
24
25
|
const slots = {
|
|
25
|
-
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
26
|
+
root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
|
|
26
27
|
};
|
|
27
28
|
return (0, _composeClasses.default)(slots, getBarLabelUtilityClass, classes);
|
|
28
29
|
};
|
package/BarChart/BarPlot.js
CHANGED
|
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.BarPlot = BarPlot;
|
|
10
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var _web = require("@react-spring/web");
|
|
15
14
|
var _styles = require("@mui/material/styles");
|
|
15
|
+
var _barElementClasses = require("./barElementClasses");
|
|
16
16
|
var _BarElement = require("./BarElement");
|
|
17
17
|
var _getColor = _interopRequireDefault(require("./seriesConfig/getColor"));
|
|
18
18
|
var _hooks = require("../hooks");
|
|
@@ -119,8 +119,8 @@ const useAggregatedData = () => {
|
|
|
119
119
|
layout,
|
|
120
120
|
x: verticalLayout ? xScale(baseValue) + barOffset : minValueCoord,
|
|
121
121
|
y: verticalLayout ? minValueCoord : yScale(baseValue) + barOffset,
|
|
122
|
-
xOrigin: xScale(0),
|
|
123
|
-
yOrigin: yScale(0),
|
|
122
|
+
xOrigin: xScale(0) ?? 0,
|
|
123
|
+
yOrigin: yScale(0) ?? 0,
|
|
124
124
|
height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
|
|
125
125
|
width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
|
|
126
126
|
color: colorGetter(dataIndex),
|
|
@@ -160,42 +160,12 @@ const useAggregatedData = () => {
|
|
|
160
160
|
masksData: Object.values(masks)
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
|
-
const leaveStyle = ({
|
|
164
|
-
layout,
|
|
165
|
-
yOrigin,
|
|
166
|
-
x,
|
|
167
|
-
width,
|
|
168
|
-
y,
|
|
169
|
-
xOrigin,
|
|
170
|
-
height
|
|
171
|
-
}) => (0, _extends2.default)({}, layout === 'vertical' ? {
|
|
172
|
-
y: yOrigin,
|
|
173
|
-
x,
|
|
174
|
-
height: 0,
|
|
175
|
-
width
|
|
176
|
-
} : {
|
|
177
|
-
y,
|
|
178
|
-
x: xOrigin,
|
|
179
|
-
height,
|
|
180
|
-
width: 0
|
|
181
|
-
});
|
|
182
|
-
const enterStyle = ({
|
|
183
|
-
x,
|
|
184
|
-
width,
|
|
185
|
-
y,
|
|
186
|
-
height
|
|
187
|
-
}) => ({
|
|
188
|
-
y,
|
|
189
|
-
x,
|
|
190
|
-
height,
|
|
191
|
-
width
|
|
192
|
-
});
|
|
193
163
|
const BarPlotRoot = (0, _styles.styled)('g', {
|
|
194
164
|
name: 'MuiBarPlot',
|
|
195
165
|
slot: 'Root',
|
|
196
166
|
overridesResolver: (_, styles) => styles.root
|
|
197
167
|
})({
|
|
198
|
-
[`& .${
|
|
168
|
+
[`& .${_barElementClasses.barElementClasses.root}`]: {
|
|
199
169
|
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
|
|
200
170
|
}
|
|
201
171
|
});
|
|
@@ -226,25 +196,13 @@ function BarPlot(props) {
|
|
|
226
196
|
const isZoomInteracting = (0, _useInternalIsZoomInteracting.useInternalIsZoomInteracting)();
|
|
227
197
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(isZoomInteracting || inSkipAnimation);
|
|
228
198
|
const withoutBorderRadius = !borderRadius || borderRadius <= 0;
|
|
229
|
-
const transition = (0, _web.useTransition)(completedData, {
|
|
230
|
-
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
231
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
232
|
-
leave: leaveStyle,
|
|
233
|
-
enter: enterStyle,
|
|
234
|
-
update: enterStyle,
|
|
235
|
-
immediate: skipAnimation
|
|
236
|
-
});
|
|
237
|
-
const maskTransition = (0, _web.useTransition)(withoutBorderRadius ? [] : masksData, {
|
|
238
|
-
keys: v => v.id,
|
|
239
|
-
from: skipAnimation ? undefined : leaveStyle,
|
|
240
|
-
leave: leaveStyle,
|
|
241
|
-
enter: enterStyle,
|
|
242
|
-
update: enterStyle,
|
|
243
|
-
immediate: skipAnimation
|
|
244
|
-
});
|
|
245
199
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(BarPlotRoot, {
|
|
246
|
-
children: [!withoutBorderRadius &&
|
|
200
|
+
children: [!withoutBorderRadius && masksData.map(({
|
|
247
201
|
id,
|
|
202
|
+
x,
|
|
203
|
+
y,
|
|
204
|
+
width,
|
|
205
|
+
height,
|
|
248
206
|
hasPositive,
|
|
249
207
|
hasNegative,
|
|
250
208
|
layout
|
|
@@ -255,18 +213,37 @@ function BarPlot(props) {
|
|
|
255
213
|
hasNegative: hasNegative,
|
|
256
214
|
hasPositive: hasPositive,
|
|
257
215
|
layout: layout,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
216
|
+
x: x,
|
|
217
|
+
y: y,
|
|
218
|
+
width: width,
|
|
219
|
+
height: height,
|
|
220
|
+
skipAnimation: skipAnimation ?? false
|
|
221
|
+
}, id);
|
|
222
|
+
}), completedData.map(({
|
|
261
223
|
seriesId,
|
|
262
224
|
dataIndex,
|
|
263
225
|
color,
|
|
264
|
-
maskId
|
|
226
|
+
maskId,
|
|
227
|
+
layout,
|
|
228
|
+
x,
|
|
229
|
+
xOrigin,
|
|
230
|
+
y,
|
|
231
|
+
yOrigin,
|
|
232
|
+
width,
|
|
233
|
+
height
|
|
265
234
|
}) => {
|
|
266
235
|
const barElement = /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarElement.BarElement, (0, _extends2.default)({
|
|
267
236
|
id: seriesId,
|
|
268
237
|
dataIndex: dataIndex,
|
|
269
|
-
color: color
|
|
238
|
+
color: color,
|
|
239
|
+
skipAnimation: skipAnimation ?? false,
|
|
240
|
+
layout: layout ?? 'vertical',
|
|
241
|
+
x: x,
|
|
242
|
+
xOrigin: xOrigin,
|
|
243
|
+
y: y,
|
|
244
|
+
yOrigin: yOrigin,
|
|
245
|
+
width: width,
|
|
246
|
+
height: height
|
|
270
247
|
}, other, {
|
|
271
248
|
onClick: onItemClick && (event => {
|
|
272
249
|
onItemClick(event, {
|
|
@@ -274,16 +251,15 @@ function BarPlot(props) {
|
|
|
274
251
|
seriesId,
|
|
275
252
|
dataIndex
|
|
276
253
|
});
|
|
277
|
-
})
|
|
278
|
-
|
|
279
|
-
}));
|
|
254
|
+
})
|
|
255
|
+
}), `${seriesId}-${dataIndex}`);
|
|
280
256
|
if (withoutBorderRadius) {
|
|
281
257
|
return barElement;
|
|
282
258
|
}
|
|
283
259
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
284
260
|
clipPath: `url(#${maskId})`,
|
|
285
261
|
children: barElement
|
|
286
|
-
});
|
|
262
|
+
}, `${seriesId}-${dataIndex}`);
|
|
287
263
|
}), barLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelPlot.BarLabelPlot, (0, _extends2.default)({
|
|
288
264
|
bars: completedData,
|
|
289
265
|
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,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.barElementClasses = void 0;
|
|
8
|
+
exports.getBarElementUtilityClass = getBarElementUtilityClass;
|
|
9
|
+
exports.useUtilityClasses = void 0;
|
|
10
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
11
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
12
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
13
|
+
function getBarElementUtilityClass(slot) {
|
|
14
|
+
return (0, _generateUtilityClass.default)('MuiBarElement', slot);
|
|
15
|
+
}
|
|
16
|
+
const barElementClasses = exports.barElementClasses = (0, _generateUtilityClasses.default)('MuiBarElement', ['root', 'highlighted', 'faded']);
|
|
17
|
+
const useUtilityClasses = ownerState => {
|
|
18
|
+
const {
|
|
19
|
+
classes,
|
|
20
|
+
id,
|
|
21
|
+
isHighlighted,
|
|
22
|
+
isFaded
|
|
23
|
+
} = ownerState;
|
|
24
|
+
const slots = {
|
|
25
|
+
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
26
|
+
};
|
|
27
|
+
return (0, _composeClasses.default)(slots, getBarElementUtilityClass, classes);
|
|
28
|
+
};
|
|
29
|
+
exports.useUtilityClasses = useUtilityClasses;
|
package/BarChart/getRadius.d.ts
CHANGED
package/BarChart/index.d.ts
CHANGED
package/BarChart/index.js
CHANGED
|
@@ -46,4 +46,15 @@ Object.keys(_BarLabel).forEach(function (key) {
|
|
|
46
46
|
return _BarLabel[key];
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
+
});
|
|
50
|
+
var _barElementClasses = require("./barElementClasses");
|
|
51
|
+
Object.keys(_barElementClasses).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _barElementClasses[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _barElementClasses[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
49
60
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
@@ -9,13 +10,14 @@ var _extremums = require("./extremums");
|
|
|
9
10
|
var _seriesProcessor = _interopRequireDefault(require("./seriesProcessor"));
|
|
10
11
|
var _legend = _interopRequireDefault(require("./legend"));
|
|
11
12
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
12
|
-
var _tooltip =
|
|
13
|
+
var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
13
14
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
15
|
const seriesConfig = exports.seriesConfig = {
|
|
15
16
|
seriesProcessor: _seriesProcessor.default,
|
|
16
17
|
colorProcessor: _getColor.default,
|
|
17
18
|
legendGetter: _legend.default,
|
|
18
19
|
tooltipGetter: _tooltip.default,
|
|
20
|
+
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
19
21
|
xExtremumGetter: _extremums.getExtremumX,
|
|
20
22
|
yExtremumGetter: _extremums.getExtremumY,
|
|
21
23
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { TooltipGetter } from '../../internals/plugins/models';
|
|
1
|
+
import type { AxisTooltipGetter, TooltipGetter } from '../../internals/plugins/models';
|
|
2
2
|
declare const tooltipGetter: TooltipGetter<'bar'>;
|
|
3
|
+
export declare const axisTooltipGetter: AxisTooltipGetter<'bar', 'x' | 'y'>;
|
|
3
4
|
export default tooltipGetter;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.axisTooltipGetter = void 0;
|
|
7
7
|
var _getLabel = require("../../internals/getLabel");
|
|
8
8
|
const tooltipGetter = params => {
|
|
9
9
|
const {
|
|
@@ -16,6 +16,9 @@ const tooltipGetter = params => {
|
|
|
16
16
|
}
|
|
17
17
|
const label = (0, _getLabel.getLabel)(series.label, 'tooltip');
|
|
18
18
|
const value = series.data[identifier.dataIndex];
|
|
19
|
+
if (value == null) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
19
22
|
const formattedValue = series.valueFormatter(value, {
|
|
20
23
|
dataIndex: identifier.dataIndex
|
|
21
24
|
});
|
|
@@ -28,4 +31,14 @@ const tooltipGetter = params => {
|
|
|
28
31
|
markType: series.labelMarkType
|
|
29
32
|
};
|
|
30
33
|
};
|
|
34
|
+
const axisTooltipGetter = series => {
|
|
35
|
+
return Object.values(series).map(s => s.layout === 'horizontal' ? {
|
|
36
|
+
direction: 'y',
|
|
37
|
+
axisId: s.yAxisId
|
|
38
|
+
} : {
|
|
39
|
+
direction: 'x',
|
|
40
|
+
axisId: s.xAxisId
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.axisTooltipGetter = axisTooltipGetter;
|
|
31
44
|
var _default = exports.default = tooltipGetter;
|
package/BarChart/types.d.ts
CHANGED