@mui/x-charts 8.0.0-beta.1 → 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/BarChart/useBarChartProps.d.ts +2 -1
- package/BarChart/useBarChartProps.js +20 -13
- package/CHANGELOG.md +235 -0
- package/ChartContainer/ChartContainer.js +4 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
- 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/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
- package/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
- package/ChartsTooltip/ChartsTooltip.js +2 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +4 -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 +72 -38
- 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 +17 -23
- package/LineChart/LineChart.js +2 -0
- package/LineChart/LineHighlightPlot.js +3 -4
- 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/LineChart/useLineChartProps.d.ts +2 -1
- package/LineChart/useLineChartProps.js +7 -4
- 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/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
- package/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
- package/RadarChart/RadarGrid/RadarGrid.js +5 -1
- package/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
- package/RadarChart/RadarGrid/useRadarGridData.js +3 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/ScatterChart/ScatterChart.js +2 -0
- package/ScatterChart/useScatterChartProps.d.ts +2 -1
- package/ScatterChart/useScatterChartProps.js +6 -3
- 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/BarChart/useBarChartProps.d.ts +2 -1
- package/esm/BarChart/useBarChartProps.js +19 -13
- package/esm/ChartContainer/ChartContainer.js +4 -0
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
- 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/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +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 +5 -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/LineChart/useLineChartProps.d.ts +2 -1
- package/esm/LineChart/useLineChartProps.js +6 -4
- 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/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
- package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
- package/esm/RadarChart/RadarGrid/RadarGrid.js +5 -1
- package/esm/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
- package/esm/RadarChart/RadarGrid/useRadarGridData.js +3 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/esm/ScatterChart/ScatterChart.js +2 -0
- package/esm/ScatterChart/useScatterChartProps.d.ts +2 -1
- package/esm/ScatterChart/useScatterChartProps.js +5 -3
- 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/useAxis.d.ts +5 -5
- package/esm/hooks/useInteractionItemProps.js +11 -0
- package/esm/hooks/useScale.d.ts +2 -2
- package/esm/hooks/useScale.js +2 -2
- 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/getAxisValue.d.ts +8 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +28 -22
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +9 -42
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +75 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +4 -10
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +8 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +18 -13
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +22 -0
- 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/useAxis.d.ts +5 -5
- package/hooks/useInteractionItemProps.js +11 -0
- package/hooks/useScale.d.ts +2 -2
- package/hooks/useScale.js +2 -2
- 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/getAxisValue.d.ts +8 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +29 -22
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +7 -40
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +81 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +5 -11
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +17 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +19 -13
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +28 -0
- 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/BarChart/useBarChartProps.d.ts +2 -1
- package/modern/BarChart/useBarChartProps.js +19 -13
- package/modern/ChartContainer/ChartContainer.js +4 -0
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
- 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/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +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 +5 -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/LineChart/useLineChartProps.d.ts +2 -1
- package/modern/LineChart/useLineChartProps.js +6 -4
- 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/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
- package/modern/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
- package/modern/RadarChart/RadarGrid/RadarGrid.js +5 -1
- package/modern/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
- package/modern/RadarChart/RadarGrid/useRadarGridData.js +3 -0
- package/modern/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/modern/ScatterChart/ScatterChart.js +2 -0
- package/modern/ScatterChart/useScatterChartProps.d.ts +2 -1
- package/modern/ScatterChart/useScatterChartProps.js +5 -3
- 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/useAxis.d.ts +5 -5
- package/modern/hooks/useInteractionItemProps.js +11 -0
- package/modern/hooks/useScale.d.ts +2 -2
- package/modern/hooks/useScale.js +2 -2
- 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/getAxisValue.d.ts +8 -6
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +28 -22
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +9 -42
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +75 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +4 -10
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +8 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +18 -13
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +22 -0
- 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
|
@@ -65,7 +65,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
65
65
|
* The components used for each slot inside the Popper.
|
|
66
66
|
* Either a string to use a HTML element or a component.
|
|
67
67
|
*
|
|
68
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in
|
|
68
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
69
69
|
* @default {}
|
|
70
70
|
*/
|
|
71
71
|
components: _propTypes.default.shape({
|
|
@@ -74,7 +74,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
74
74
|
/**
|
|
75
75
|
* The props used for each slot inside the Popper.
|
|
76
76
|
*
|
|
77
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in
|
|
77
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
78
78
|
* @default {}
|
|
79
79
|
*/
|
|
80
80
|
componentsProps: _propTypes.default.shape({
|
|
@@ -20,8 +20,8 @@ var _useSvgRef = require("../hooks/useSvgRef");
|
|
|
20
20
|
var _utils = require("./utils");
|
|
21
21
|
var _useSelector = require("../internals/store/useSelector");
|
|
22
22
|
var _useStore = require("../internals/store/useStore");
|
|
23
|
-
var _hooks = require("../hooks");
|
|
24
23
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
24
|
+
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
26
|
const _excluded = ["trigger", "classes", "children"];
|
|
27
27
|
const ChartsTooltipRoot = (0, _styles.styled)(_Popper.default, {
|
|
@@ -34,7 +34,6 @@ const ChartsTooltipRoot = (0, _styles.styled)(_Popper.default, {
|
|
|
34
34
|
pointerEvents: 'none',
|
|
35
35
|
zIndex: theme.zIndex.modal
|
|
36
36
|
}));
|
|
37
|
-
const axisHasData = axis => axis?.data !== undefined && axis.data.length !== 0;
|
|
38
37
|
|
|
39
38
|
/**
|
|
40
39
|
* Demos:
|
|
@@ -58,16 +57,13 @@ function ChartsTooltipContainer(inProps) {
|
|
|
58
57
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
59
58
|
const svgRef = (0, _useSvgRef.useSvgRef)();
|
|
60
59
|
const pointerType = (0, _utils.usePointerType)();
|
|
61
|
-
const xAxis = (0, _hooks.useXAxis)();
|
|
62
60
|
const popperRef = React.useRef(null);
|
|
63
61
|
const positionRef = (0, _useLazyRef.default)(() => ({
|
|
64
62
|
x: 0,
|
|
65
63
|
y: 0
|
|
66
64
|
}));
|
|
67
65
|
const store = (0, _useStore.useStore)();
|
|
68
|
-
const isOpen = (0, _useSelector.useSelector)(store,
|
|
69
|
-
// eslint-disable-next-line no-nested-ternary
|
|
70
|
-
trigger === 'axis' ? axisHasData(xAxis) ? _useChartInteraction.selectorChartsInteractionXAxisIsDefined : _useChartInteraction.selectorChartsInteractionYAxisIsDefined : _useChartInteraction.selectorChartsInteractionItemIsDefined);
|
|
66
|
+
const isOpen = (0, _useSelector.useSelector)(store, trigger === 'axis' ? _useChartCartesianAxis.selectorChartsInteractionAxisTooltip : _useChartInteraction.selectorChartsInteractionItemIsDefined);
|
|
71
67
|
const popperOpen = pointerType !== null && isOpen; // tooltipHasData;
|
|
72
68
|
|
|
73
69
|
React.useEffect(() => {
|
|
@@ -161,7 +157,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltipContainer.propTypes = {
|
|
|
161
157
|
* The components used for each slot inside the Popper.
|
|
162
158
|
* Either a string to use a HTML element or a component.
|
|
163
159
|
*
|
|
164
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in
|
|
160
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
165
161
|
* @default {}
|
|
166
162
|
*/
|
|
167
163
|
components: _propTypes.default.shape({
|
|
@@ -170,7 +166,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltipContainer.propTypes = {
|
|
|
170
166
|
/**
|
|
171
167
|
* The props used for each slot inside the Popper.
|
|
172
168
|
*
|
|
173
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in
|
|
169
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
174
170
|
* @default {}
|
|
175
171
|
*/
|
|
176
172
|
componentsProps: _propTypes.default.shape({
|
|
@@ -13,4 +13,6 @@ export declare const ChartsTooltipRow: import("@emotion/styled").StyledComponent
|
|
|
13
13
|
/**
|
|
14
14
|
* @ignore - internal component.
|
|
15
15
|
*/
|
|
16
|
-
export declare const ChartsTooltipCell: import("@emotion/styled").StyledComponent<import("@mui/
|
|
16
|
+
export declare const ChartsTooltipCell: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "p" | "style" | "typography" | "zIndex" | "classes" | "border" | "boxShadow" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "className" | "children" | "sx" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variant" | "variantMapping">, "p" | "slot" | "style" | "title" | "ref" | "typography" | "zIndex" | "classes" | "border" | "boxShadow" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "sx" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
17
|
+
component?: React.ElementType;
|
|
18
|
+
}, {}, {}>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.ChartsTooltipTable = exports.ChartsTooltipRow = exports.ChartsTooltipPaper = exports.ChartsTooltipCell = void 0;
|
|
7
8
|
var _styles = require("@mui/material/styles");
|
|
9
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
8
10
|
var _chartsTooltipClasses = require("./chartsTooltipClasses");
|
|
9
11
|
/**
|
|
10
12
|
* @ignore - internal component.
|
|
@@ -33,8 +35,14 @@ const ChartsTooltipTable = exports.ChartsTooltipTable = (0, _styles.styled)('tab
|
|
|
33
35
|
theme
|
|
34
36
|
}) => ({
|
|
35
37
|
borderSpacing: 0,
|
|
36
|
-
'&
|
|
37
|
-
borderBottom: `solid ${(theme.vars || theme).palette.divider} 1px
|
|
38
|
+
'& caption': {
|
|
39
|
+
borderBottom: `solid ${(theme.vars || theme).palette.divider} 1px`,
|
|
40
|
+
padding: theme.spacing(0.5, 1.5),
|
|
41
|
+
textAlign: 'start',
|
|
42
|
+
whiteSpace: 'nowrap',
|
|
43
|
+
'& span': {
|
|
44
|
+
marginRight: theme.spacing(1.5)
|
|
45
|
+
}
|
|
38
46
|
}
|
|
39
47
|
}));
|
|
40
48
|
|
|
@@ -59,20 +67,27 @@ const ChartsTooltipRow = exports.ChartsTooltipRow = (0, _styles.styled)('tr', {
|
|
|
59
67
|
/**
|
|
60
68
|
* @ignore - internal component.
|
|
61
69
|
*/
|
|
62
|
-
const ChartsTooltipCell = exports.ChartsTooltipCell = (0, _styles.styled)(
|
|
70
|
+
const ChartsTooltipCell = exports.ChartsTooltipCell = (0, _styles.styled)(_Typography.default, {
|
|
63
71
|
name: 'MuiChartsTooltip',
|
|
64
|
-
slot: 'Cell'
|
|
65
|
-
overridesResolver: (props, styles) => styles.cell
|
|
72
|
+
slot: 'Cell'
|
|
66
73
|
})(({
|
|
67
74
|
theme
|
|
68
75
|
}) => ({
|
|
69
76
|
verticalAlign: 'middle',
|
|
70
77
|
color: (theme.vars || theme).palette.text.secondary,
|
|
71
|
-
|
|
78
|
+
textAlign: 'start',
|
|
79
|
+
[`&.${_chartsTooltipClasses.chartsTooltipClasses.cell}`]: {
|
|
72
80
|
paddingLeft: theme.spacing(1),
|
|
73
|
-
paddingRight: theme.spacing(1
|
|
81
|
+
paddingRight: theme.spacing(1)
|
|
82
|
+
},
|
|
83
|
+
[`&.${_chartsTooltipClasses.chartsTooltipClasses.labelCell}`]: {
|
|
74
84
|
fontWeight: theme.typography.fontWeightRegular
|
|
75
85
|
},
|
|
86
|
+
[`& .${_chartsTooltipClasses.chartsTooltipClasses.markContainer}`]: {
|
|
87
|
+
display: 'inline-block',
|
|
88
|
+
width: `calc(20px + ${theme.spacing(1.5)})`,
|
|
89
|
+
verticalAlign: 'middle'
|
|
90
|
+
},
|
|
76
91
|
[`&.${_chartsTooltipClasses.chartsTooltipClasses.valueCell}, &.${_chartsTooltipClasses.chartsTooltipClasses.axisValueCell}`]: {
|
|
77
92
|
color: (theme.vars || theme).palette.text.primary,
|
|
78
93
|
fontWeight: theme.typography.fontWeightMedium
|
|
@@ -81,10 +96,10 @@ const ChartsTooltipCell = exports.ChartsTooltipCell = (0, _styles.styled)('td',
|
|
|
81
96
|
paddingLeft: theme.spacing(1.5),
|
|
82
97
|
paddingRight: theme.spacing(1.5)
|
|
83
98
|
},
|
|
84
|
-
'td:first-of-type&': {
|
|
99
|
+
'td:first-of-type&, th:first-of-type&': {
|
|
85
100
|
paddingLeft: theme.spacing(1.5)
|
|
86
101
|
},
|
|
87
|
-
'td:last-of-type&': {
|
|
102
|
+
'td:last-of-type&, th:last-of-type&': {
|
|
88
103
|
paddingRight: theme.spacing(1.5)
|
|
89
104
|
}
|
|
90
105
|
}));
|
|
@@ -11,8 +11,8 @@ export interface ChartsTooltipClasses {
|
|
|
11
11
|
cell: string;
|
|
12
12
|
/** Styles applied to the mark element. */
|
|
13
13
|
mark: string;
|
|
14
|
-
/** Styles applied to the
|
|
15
|
-
|
|
14
|
+
/** Styles applied to the markContainer element. */
|
|
15
|
+
markContainer: string;
|
|
16
16
|
/** Styles applied to the labelCell element. */
|
|
17
17
|
labelCell: string;
|
|
18
18
|
/** Styles applied to the valueCell element. */
|
|
@@ -20,7 +20,7 @@ export interface ChartsTooltipClasses {
|
|
|
20
20
|
/** Styles applied to the axisValueCell element. Only available for axis tooltip. */
|
|
21
21
|
axisValueCell: string;
|
|
22
22
|
}
|
|
23
|
-
export type ChartsTooltipClassKey = keyof Omit<ChartsTooltipClasses, '
|
|
23
|
+
export type ChartsTooltipClassKey = keyof Omit<ChartsTooltipClasses, 'markContainer' | 'labelCell' | 'valueCell'>;
|
|
24
24
|
export declare function getChartsTooltipUtilityClass(slot: string): string;
|
|
25
25
|
export declare const chartsTooltipClasses: ChartsTooltipClasses;
|
|
26
|
-
export declare const useUtilityClasses: (classes?: Partial<ChartsTooltipClasses>) => Record<"root" | "mark" | "table" | "cell" | "row" | "
|
|
26
|
+
export declare const useUtilityClasses: (classes?: Partial<ChartsTooltipClasses>) => Record<"root" | "mark" | "table" | "cell" | "row" | "markContainer" | "labelCell" | "valueCell" | "paper" | "axisValueCell", string>;
|
|
@@ -13,7 +13,7 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
13
13
|
function getChartsTooltipUtilityClass(slot) {
|
|
14
14
|
return (0, _generateUtilityClass.default)('MuiChartsTooltip', slot);
|
|
15
15
|
}
|
|
16
|
-
const chartsTooltipClasses = exports.chartsTooltipClasses = (0, _generateUtilityClasses.default)('MuiChartsTooltip', ['root', 'paper', 'table', 'row', 'cell', 'mark', '
|
|
16
|
+
const chartsTooltipClasses = exports.chartsTooltipClasses = (0, _generateUtilityClasses.default)('MuiChartsTooltip', ['root', 'paper', 'table', 'row', 'cell', 'mark', 'markContainer', 'labelCell', 'valueCell', 'axisValueCell']);
|
|
17
17
|
const useUtilityClasses = classes => {
|
|
18
18
|
const slots = {
|
|
19
19
|
root: ['root'],
|
|
@@ -22,7 +22,7 @@ const useUtilityClasses = classes => {
|
|
|
22
22
|
row: ['row'],
|
|
23
23
|
cell: ['cell'],
|
|
24
24
|
mark: ['mark'],
|
|
25
|
-
|
|
25
|
+
markContainer: ['markContainer'],
|
|
26
26
|
labelCell: ['labelCell'],
|
|
27
27
|
valueCell: ['valueCell'],
|
|
28
28
|
axisValueCell: ['axisValueCell']
|
package/ChartsTooltip/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export * from "./ChartsItemTooltipContent.js";
|
|
|
7
7
|
export * from "./ChartsTooltipTable.js";
|
|
8
8
|
export * from "./useItemTooltip.js";
|
|
9
9
|
export * from "./useAxisTooltip.js";
|
|
10
|
+
export * from "./useAxesTooltip.js";
|
|
10
11
|
export { useMouseTracker } from "./utils.js";
|
|
11
12
|
export * from "./ChartTooltip.types.js";
|
package/ChartsTooltip/index.js
CHANGED
|
@@ -111,6 +111,18 @@ Object.keys(_useAxisTooltip).forEach(function (key) {
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
|
+
var _useAxesTooltip = require("./useAxesTooltip");
|
|
115
|
+
Object.keys(_useAxesTooltip).forEach(function (key) {
|
|
116
|
+
if (key === "default" || key === "__esModule") return;
|
|
117
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
118
|
+
if (key in exports && exports[key] === _useAxesTooltip[key]) return;
|
|
119
|
+
Object.defineProperty(exports, key, {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
get: function () {
|
|
122
|
+
return _useAxesTooltip[key];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
114
126
|
var _utils = require("./utils");
|
|
115
127
|
var _ChartTooltip = require("./ChartTooltip.types");
|
|
116
128
|
Object.keys(_ChartTooltip).forEach(function (key) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseAxisTooltipParams, UseAxisTooltipReturnValue } from "./useAxisTooltip.js";
|
|
2
|
+
type UseAxesTooltipParams = Omit<UseAxisTooltipParams, 'multipleAxes'>;
|
|
3
|
+
/**
|
|
4
|
+
* Returns the axes to display in the tooltip and the series item related to them.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAxesTooltip(params?: UseAxesTooltipParams): UseAxisTooltipReturnValue[] | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useAxesTooltip = useAxesTooltip;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _useAxisTooltip = require("./useAxisTooltip");
|
|
11
|
+
/**
|
|
12
|
+
* Returns the axes to display in the tooltip and the series item related to them.
|
|
13
|
+
*/
|
|
14
|
+
function useAxesTooltip(params) {
|
|
15
|
+
return (0, _useAxisTooltip.useAxisTooltip)((0, _extends2.default)({}, params, {
|
|
16
|
+
multipleAxes: true
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { SeriesId } from "../models/seriesType/common.js";
|
|
2
|
+
import { AxisId } from "../models/axis.js";
|
|
2
3
|
import { CartesianChartSeriesType, ChartsSeriesConfig } from "../models/seriesType/config.js";
|
|
3
4
|
import { ChartsLabelMarkProps } from "../ChartsLabel/index.js";
|
|
4
5
|
export interface UseAxisTooltipReturnValue<SeriesT extends CartesianChartSeriesType = CartesianChartSeriesType, AxisValueT extends string | number | Date = string | number | Date> {
|
|
5
6
|
axisDirection: 'x' | 'y';
|
|
6
|
-
|
|
7
|
-
seriesItems: SeriesItem<SeriesT>[];
|
|
7
|
+
axisId: AxisId;
|
|
8
8
|
axisValue: AxisValueT;
|
|
9
9
|
axisFormattedValue: string;
|
|
10
|
+
dataIndex: number;
|
|
11
|
+
seriesItems: SeriesItem<SeriesT>[];
|
|
12
|
+
}
|
|
13
|
+
export interface UseAxisTooltipParams {
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, the hook returns an array with an object per active axis.
|
|
16
|
+
*/
|
|
17
|
+
multipleAxes?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The axis directions to consider.
|
|
20
|
+
* If not defined, all directions are considered
|
|
21
|
+
*/
|
|
22
|
+
directions?: ('x' | 'y')[];
|
|
10
23
|
}
|
|
11
24
|
interface SeriesItem<T extends CartesianChartSeriesType> {
|
|
12
25
|
seriesId: SeriesId;
|
|
@@ -16,5 +29,13 @@ interface SeriesItem<T extends CartesianChartSeriesType> {
|
|
|
16
29
|
formattedLabel: string | null;
|
|
17
30
|
markType: ChartsLabelMarkProps['type'];
|
|
18
31
|
}
|
|
19
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `useAxesTooltip` instead.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useAxisTooltip(params: UseAxisTooltipParams & {
|
|
36
|
+
multipleAxes: true;
|
|
37
|
+
}): UseAxisTooltipReturnValue[] | null;
|
|
38
|
+
export declare function useAxisTooltip(params?: UseAxisTooltipParams & {
|
|
39
|
+
multipleAxes?: false;
|
|
40
|
+
}): UseAxisTooltipReturnValue | null;
|
|
20
41
|
export {};
|
|
@@ -14,13 +14,38 @@ var _isCartesian = require("../internals/isCartesian");
|
|
|
14
14
|
var _utils = require("./utils");
|
|
15
15
|
var _useAxis = require("../hooks/useAxis");
|
|
16
16
|
var _useZAxis = require("../hooks/useZAxis");
|
|
17
|
-
var
|
|
18
|
-
function
|
|
17
|
+
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
18
|
+
function defaultAxisTooltipConfig(axis, dataIndex, axisDirection) {
|
|
19
|
+
const axisValue = axis.data?.[dataIndex] ?? null;
|
|
20
|
+
const axisFormatter = axis.valueFormatter ?? (v => axis.scaleType === 'utc' ? (0, _utils.utcFormatter)(v) : v.toLocaleString());
|
|
21
|
+
const axisFormattedValue = axisFormatter(axisValue, {
|
|
22
|
+
location: 'tooltip',
|
|
23
|
+
scale: axis.scale
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
axisDirection,
|
|
27
|
+
axisId: axis.id,
|
|
28
|
+
dataIndex,
|
|
29
|
+
axisValue,
|
|
30
|
+
axisFormattedValue,
|
|
31
|
+
seriesItems: []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use `useAxesTooltip` instead.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
function useAxisTooltip(params = {}) {
|
|
40
|
+
const {
|
|
41
|
+
multipleAxes,
|
|
42
|
+
directions
|
|
43
|
+
} = params;
|
|
19
44
|
const defaultXAxis = (0, _useAxis.useXAxis)();
|
|
20
45
|
const defaultYAxis = (0, _useAxis.useYAxis)();
|
|
21
|
-
const xAxisHasData = defaultXAxis.data !== undefined && defaultXAxis.data.length !== 0;
|
|
22
46
|
const store = (0, _useStore.useStore)();
|
|
23
|
-
const
|
|
47
|
+
const tooltipXAxes = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionTooltipXAxes);
|
|
48
|
+
const tooltipYAxes = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionTooltipYAxes);
|
|
24
49
|
const series = (0, _useSeries.useSeries)();
|
|
25
50
|
const {
|
|
26
51
|
xAxis
|
|
@@ -33,61 +58,70 @@ function useAxisTooltip() {
|
|
|
33
58
|
zAxisIds
|
|
34
59
|
} = (0, _useZAxis.useZAxes)();
|
|
35
60
|
const colorProcessors = (0, _useColorProcessor.useColorProcessor)();
|
|
36
|
-
if (
|
|
61
|
+
if (tooltipXAxes.length === 0 && tooltipYAxes.length === 0) {
|
|
37
62
|
return null;
|
|
38
63
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
64
|
+
const tooltipAxes = [];
|
|
65
|
+
if (directions === undefined || directions.includes('x')) {
|
|
66
|
+
tooltipXAxes.forEach(({
|
|
67
|
+
axisId,
|
|
68
|
+
dataIndex
|
|
69
|
+
}) => {
|
|
70
|
+
if (!multipleAxes && tooltipAxes.length > 1) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
tooltipAxes.push(defaultAxisTooltipConfig(xAxis[axisId], dataIndex, 'x'));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (directions === undefined || directions.includes('y')) {
|
|
77
|
+
tooltipYAxes.forEach(({
|
|
78
|
+
axisId,
|
|
79
|
+
dataIndex
|
|
80
|
+
}) => {
|
|
81
|
+
if (!multipleAxes && tooltipAxes.length > 1) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
tooltipAxes.push(defaultAxisTooltipConfig(yAxis[axisId], dataIndex, 'y'));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
Object.keys(series).filter(_isCartesian.isCartesianSeriesType).flatMap(seriesType => {
|
|
46
88
|
const seriesOfType = series[seriesType];
|
|
47
89
|
if (!seriesOfType) {
|
|
48
90
|
return [];
|
|
49
91
|
}
|
|
50
|
-
return seriesOfType.seriesOrder.
|
|
92
|
+
return seriesOfType.seriesOrder.forEach(seriesId => {
|
|
51
93
|
const seriesToAdd = seriesOfType.series[seriesId];
|
|
52
|
-
const providedXAxisId = seriesToAdd.xAxisId;
|
|
53
|
-
const providedYAxisId = seriesToAdd.yAxisId;
|
|
54
|
-
const
|
|
55
|
-
|
|
94
|
+
const providedXAxisId = seriesToAdd.xAxisId ?? defaultXAxis.id;
|
|
95
|
+
const providedYAxisId = seriesToAdd.yAxisId ?? defaultYAxis.id;
|
|
96
|
+
const tooltipItemIndex = tooltipAxes.findIndex(({
|
|
97
|
+
axisDirection,
|
|
98
|
+
axisId
|
|
99
|
+
}) => axisDirection === 'x' && axisId === providedXAxisId || axisDirection === 'y' && axisId === providedYAxisId);
|
|
56
100
|
// Test if the series uses the default axis
|
|
57
|
-
if (
|
|
58
|
-
const xAxisId = providedXAxisId ?? defaultXAxis.id;
|
|
59
|
-
const yAxisId = providedYAxisId ?? defaultYAxis.id;
|
|
101
|
+
if (tooltipItemIndex >= 0) {
|
|
60
102
|
const zAxisId = 'zAxisId' in seriesToAdd ? seriesToAdd.zAxisId : zAxisIds[0];
|
|
61
|
-
const
|
|
103
|
+
const {
|
|
104
|
+
dataIndex
|
|
105
|
+
} = tooltipAxes[tooltipItemIndex];
|
|
106
|
+
const color = colorProcessors[seriesType]?.(seriesToAdd, xAxis[providedXAxisId], yAxis[providedYAxisId], zAxisId ? zAxis[zAxisId] : undefined)(dataIndex) ?? '';
|
|
62
107
|
const value = seriesToAdd.data[dataIndex] ?? null;
|
|
63
108
|
const formattedValue = seriesToAdd.valueFormatter(value, {
|
|
64
109
|
dataIndex
|
|
65
110
|
});
|
|
66
111
|
const formattedLabel = (0, _getLabel.getLabel)(seriesToAdd.label, 'tooltip') ?? null;
|
|
67
|
-
|
|
112
|
+
tooltipAxes[tooltipItemIndex].seriesItems.push({
|
|
68
113
|
seriesId,
|
|
69
114
|
color,
|
|
70
115
|
value,
|
|
71
116
|
formattedValue,
|
|
72
117
|
formattedLabel,
|
|
73
118
|
markType: seriesToAdd.labelMarkType
|
|
74
|
-
};
|
|
119
|
+
});
|
|
75
120
|
}
|
|
76
|
-
return undefined;
|
|
77
121
|
});
|
|
78
|
-
}).filter(function truthy(item) {
|
|
79
|
-
return Boolean(item);
|
|
80
|
-
});
|
|
81
|
-
const axisFormatter = usedAxis.valueFormatter ?? (v => usedAxis.scaleType === 'utc' ? (0, _utils.utcFormatter)(v) : v.toLocaleString());
|
|
82
|
-
const axisFormattedValue = axisFormatter(axisValue, {
|
|
83
|
-
location: 'tooltip',
|
|
84
|
-
scale: usedAxis.scale
|
|
85
122
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
axisValue,
|
|
91
|
-
axisFormattedValue
|
|
92
|
-
};
|
|
123
|
+
if (!multipleAxes) {
|
|
124
|
+
return tooltipAxes.length === 0 ? tooltipAxes[0] : null;
|
|
125
|
+
}
|
|
126
|
+
return tooltipAxes;
|
|
93
127
|
}
|
|
@@ -35,7 +35,10 @@ function useItemTooltip() {
|
|
|
35
35
|
if (!identifier || identifier.dataIndex === undefined) {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
|
-
const itemSeries = series[identifier.type]
|
|
38
|
+
const itemSeries = series[identifier.type]?.series[identifier.seriesId];
|
|
39
|
+
if (!itemSeries) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
39
42
|
const getColor = seriesConfig[itemSeries.type].colorProcessor?.(itemSeries, xAxisId && xAxis[xAxisId], yAxisId && yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
|
|
40
43
|
return seriesConfig[itemSeries.type].tooltipGetter({
|
|
41
44
|
series: itemSeries,
|
|
@@ -118,7 +118,7 @@ function getVisibleLabels(xTicks, {
|
|
|
118
118
|
return true;
|
|
119
119
|
}));
|
|
120
120
|
}
|
|
121
|
-
function shortenLabels(visibleLabels, drawingArea, maxHeight, tickLabelStyle) {
|
|
121
|
+
function shortenLabels(visibleLabels, drawingArea, maxHeight, isRtl, tickLabelStyle) {
|
|
122
122
|
const shortenedLabels = new Map();
|
|
123
123
|
const angle = (0, _clampAngle.clampAngle)(tickLabelStyle?.angle ?? 0);
|
|
124
124
|
|
|
@@ -139,6 +139,9 @@ function shortenLabels(visibleLabels, drawingArea, maxHeight, tickLabelStyle) {
|
|
|
139
139
|
if (angle > 90 && angle < 270) {
|
|
140
140
|
[leftBoundFactor, rightBoundFactor] = [rightBoundFactor, leftBoundFactor];
|
|
141
141
|
}
|
|
142
|
+
if (isRtl) {
|
|
143
|
+
[leftBoundFactor, rightBoundFactor] = [rightBoundFactor, leftBoundFactor];
|
|
144
|
+
}
|
|
142
145
|
for (const item of visibleLabels) {
|
|
143
146
|
if (item.formattedValue) {
|
|
144
147
|
// That maximum width of the tick depends on its proximity to the axis bounds.
|
|
@@ -300,7 +303,7 @@ function ChartsXAxis(inProps) {
|
|
|
300
303
|
|
|
301
304
|
/* If there's an axis title, the tick labels have less space to render */
|
|
302
305
|
const tickLabelsMaxHeight = Math.max(0, axisHeight - (label ? labelHeight + AXIS_LABEL_TICK_LABEL_GAP : 0) - tickSize - TICK_LABEL_GAP);
|
|
303
|
-
const tickLabels = isHydrated ? shortenLabels(visibleLabels, drawingArea, tickLabelsMaxHeight, axisTickLabelProps.style) : new Map(Array.from(visibleLabels).map(item => [item, item.formattedValue]));
|
|
306
|
+
const tickLabels = isHydrated ? shortenLabels(visibleLabels, drawingArea, tickLabelsMaxHeight, isRtl, axisTickLabelProps.style) : new Map(Array.from(visibleLabels).map(item => [item, item.formattedValue]));
|
|
304
307
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(XAxisRoot, {
|
|
305
308
|
transform: `translate(0, ${position === 'bottom' ? top + height + offset : top - offset})`,
|
|
306
309
|
className: classes.root,
|