@mui/x-charts 8.0.0-alpha.0 → 8.0.0-alpha.2
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 +15 -0
- package/BarChart/AnimatedBarElement.js +21 -0
- package/BarChart/BarChart.d.ts +4 -9
- package/BarChart/BarChart.js +3 -35
- package/BarChart/BarElement.d.ts +5 -1342
- package/BarChart/BarElement.js +10 -20
- package/BarChart/BarLabel/BarLabel.d.ts +298 -298
- package/BarChart/BarPlot.js +12 -2
- package/BarChart/useBarChartProps.d.ts +0 -2
- package/BarChart/useBarChartProps.js +2 -8
- package/CHANGELOG.md +651 -6
- package/ChartContainer/ChartContainer.d.ts +26 -19
- package/ChartContainer/ChartContainer.js +31 -25
- package/ChartContainer/useChartContainerProps.d.ts +5 -7
- package/ChartContainer/useChartContainerProps.js +12 -27
- package/ChartsAxis/axisClasses.js +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
- package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
- package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
- package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
- package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
- package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
- package/ChartsAxisHighlight/index.d.ts +3 -0
- package/ChartsAxisHighlight/index.js +4 -1
- package/ChartsGrid/ChartsGrid.js +1 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/ChartsLegend/LegendPerItem.d.ts +2 -2
- package/ChartsLegend/chartsLegendClasses.js +2 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/ChartsSurface/ChartsSurface.d.ts +14 -15
- package/ChartsSurface/ChartsSurface.js +68 -35
- package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
- package/ChartsTooltip/ChartTooltip.types.js +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
- package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
- package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
- package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
- package/ChartsTooltip/ChartsTooltip.js +143 -145
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
- package/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
- package/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/ChartsTooltip/index.d.ts +3 -3
- package/ChartsTooltip/index.js +2 -3
- package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
- package/ChartsTooltip/useAxisTooltip.js +19 -19
- package/ChartsTooltip/useItemTooltip.d.ts +2 -3
- package/ChartsTooltip/useItemTooltip.js +5 -4
- package/ChartsTooltip/utils.d.ts +0 -3
- package/ChartsTooltip/utils.js +0 -8
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
- package/ChartsXAxis/ChartsXAxis.js +3 -17
- package/ChartsYAxis/ChartsYAxis.js +2 -17
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/Gauge.js +0 -6
- package/Gauge/GaugeContainer.d.ts +3 -3
- package/Gauge/GaugeContainer.js +42 -76
- package/LineChart/AnimatedArea.d.ts +0 -1333
- package/LineChart/AnimatedArea.js +9 -18
- package/LineChart/AnimatedLine.d.ts +0 -1333
- package/LineChart/AnimatedLine.js +9 -20
- package/LineChart/AreaPlot.js +12 -2
- package/LineChart/CircleMarkElement.js +6 -5
- package/LineChart/LineChart.d.ts +4 -10
- package/LineChart/LineChart.js +3 -36
- package/LineChart/LineHighlightPlot.js +6 -5
- package/LineChart/LinePlot.js +12 -2
- package/LineChart/MarkElement.js +6 -5
- package/LineChart/useLineChartProps.d.ts +0 -2
- package/LineChart/useLineChartProps.js +2 -8
- package/PieChart/PieChart.d.ts +3 -9
- package/PieChart/PieChart.js +5 -41
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/README.md +2 -2
- package/ScatterChart/Scatter.js +6 -5
- package/ScatterChart/ScatterChart.d.ts +4 -10
- package/ScatterChart/ScatterChart.js +5 -36
- package/ScatterChart/useScatterChartProps.d.ts +0 -2
- package/ScatterChart/useScatterChartProps.js +1 -9
- package/SparkLineChart/SparkLineChart.d.ts +3 -4
- package/SparkLineChart/SparkLineChart.js +4 -35
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -11
- package/context/ChartDataProvider/ChartDataProvider.d.ts +36 -19
- package/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +25 -32
- package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -11
- package/context/ChartProvider/ChartContext.d.ts +6 -0
- package/context/ChartProvider/ChartContext.js +8 -0
- package/context/ChartProvider/ChartProvider.d.ts +4 -0
- package/context/ChartProvider/ChartProvider.js +19 -0
- package/context/ChartProvider/ChartProvider.types.d.ts +24 -0
- package/context/ChartProvider/ChartProvider.types.js +1 -0
- package/context/ChartProvider/index.d.ts +3 -0
- package/context/ChartProvider/index.js +3 -0
- package/context/ChartProvider/useChartContext.d.ts +3 -0
- package/context/ChartProvider/useChartContext.js +11 -0
- package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
- package/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +3 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
- package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
- package/{modern/context/DrawingProvider.js → context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/context/DrawingAreaProvider/index.d.ts +3 -0
- package/context/DrawingAreaProvider/index.js +3 -0
- package/context/InteractionSelectors.d.ts +382 -0
- package/context/InteractionSelectors.js +12 -0
- package/context/SizeProvider/Size.types.d.ts +30 -0
- package/context/SizeProvider/Size.types.js +1 -0
- package/context/SizeProvider/SizeContext.d.ts +4 -0
- package/context/SizeProvider/SizeContext.js +15 -0
- package/context/SizeProvider/SizeProvider.d.ts +11 -0
- package/context/SizeProvider/SizeProvider.js +26 -0
- package/context/SizeProvider/index.d.ts +4 -0
- package/context/SizeProvider/index.js +4 -0
- package/context/SizeProvider/useChartContainerDimensions.d.ts +9 -0
- package/{modern/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/context/SizeProvider/useSize.d.ts +5 -0
- package/context/SizeProvider/useSize.js +13 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +2 -1
- package/hooks/useAxisEvents.js +32 -19
- package/hooks/useChartId.js +5 -6
- package/hooks/useDrawingArea.d.ts +2 -2
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +22 -13
- package/hooks/useSvgRef.d.ts +1 -1
- package/hooks/useSvgRef.js +4 -8
- package/index.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
- package/internals/computeAxisValue.d.ts +2 -2
- package/internals/defaultizeColor.d.ts +1 -1
- package/internals/index.d.ts +3 -4
- package/internals/index.js +3 -4
- package/internals/plugins/allPlugins.d.ts +1 -0
- package/internals/plugins/allPlugins.js +3 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +10 -0
- package/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/internals/plugins/corePlugins/index.d.ts +2 -0
- package/internals/plugins/corePlugins/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/index.d.ts +2 -0
- package/internals/plugins/corePlugins/useChartId/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +36 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +20 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +376 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +57 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/internals/plugins/models/chart.d.ts +14 -0
- package/internals/plugins/models/chart.js +1 -0
- package/internals/plugins/models/helpers.d.ts +7 -0
- package/internals/plugins/models/helpers.js +1 -0
- package/internals/plugins/models/index.d.ts +3 -0
- package/internals/plugins/models/index.js +3 -0
- package/internals/plugins/models/plugin.d.ts +75 -0
- package/internals/plugins/models/plugin.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +13 -0
- package/internals/plugins/utils/ChartStore.js +24 -0
- package/internals/plugins/utils/selectors.d.ts +9 -0
- package/internals/plugins/utils/selectors.js +37 -0
- package/internals/store/useCharts.d.ts +14 -0
- package/internals/store/useCharts.js +72 -0
- package/internals/store/useCharts.types.d.ts +5 -0
- package/internals/store/useCharts.types.js +1 -0
- package/internals/store/useSelector.d.ts +4 -0
- package/internals/store/useSelector.js +6 -0
- package/internals/store/useStore.d.ts +3 -0
- package/internals/store/useStore.js +17 -0
- package/models/axis.d.ts +1 -13
- package/modern/BarChart/AnimatedBarElement.js +21 -0
- package/modern/BarChart/BarChart.js +3 -35
- package/modern/BarChart/BarElement.js +10 -20
- package/modern/BarChart/BarPlot.js +12 -2
- package/modern/BarChart/useBarChartProps.js +2 -8
- package/modern/ChartContainer/ChartContainer.js +31 -25
- package/modern/ChartContainer/useChartContainerProps.js +12 -27
- package/modern/ChartsAxis/axisClasses.js +2 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
- package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
- package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
- package/modern/ChartsAxisHighlight/index.js +4 -1
- package/modern/ChartsGrid/ChartsGrid.js +1 -1
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/modern/ChartsLegend/chartsLegendClasses.js +2 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/modern/ChartsSurface/ChartsSurface.js +68 -35
- package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
- package/modern/ChartsTooltip/ChartsTooltip.js +143 -145
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/modern/ChartsTooltip/index.js +2 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +19 -19
- package/modern/ChartsTooltip/useItemTooltip.js +5 -4
- package/modern/ChartsTooltip/utils.js +0 -8
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
- package/modern/ChartsXAxis/ChartsXAxis.js +3 -17
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -17
- package/modern/Gauge/Gauge.js +0 -6
- package/modern/Gauge/GaugeContainer.js +42 -76
- package/modern/LineChart/AnimatedArea.js +9 -18
- package/modern/LineChart/AnimatedLine.js +9 -20
- package/modern/LineChart/AreaPlot.js +12 -2
- package/modern/LineChart/CircleMarkElement.js +6 -5
- package/modern/LineChart/LineChart.js +3 -36
- package/modern/LineChart/LineHighlightPlot.js +6 -5
- package/modern/LineChart/LinePlot.js +12 -2
- package/modern/LineChart/MarkElement.js +6 -5
- package/modern/LineChart/useLineChartProps.js +2 -8
- package/modern/PieChart/PieChart.js +5 -41
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/ScatterChart/Scatter.js +6 -5
- package/modern/ScatterChart/ScatterChart.js +5 -36
- package/modern/ScatterChart/useScatterChartProps.js +1 -9
- package/modern/SparkLineChart/SparkLineChart.js +4 -35
- package/modern/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/modern/context/ChartProvider/ChartContext.js +8 -0
- package/modern/context/ChartProvider/ChartProvider.js +19 -0
- package/modern/context/ChartProvider/ChartProvider.types.js +1 -0
- package/modern/context/ChartProvider/index.js +3 -0
- package/modern/context/ChartProvider/useChartContext.js +11 -0
- package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
- package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/modern/context/DrawingAreaProvider/index.js +3 -0
- package/modern/context/InteractionSelectors.js +12 -0
- package/modern/context/SizeProvider/Size.types.js +1 -0
- package/modern/context/SizeProvider/SizeContext.js +15 -0
- package/modern/context/SizeProvider/SizeProvider.js +26 -0
- package/modern/context/SizeProvider/index.js +4 -0
- package/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/modern/context/SizeProvider/useSize.js +13 -0
- package/modern/context/index.js +2 -1
- package/modern/hooks/useAxisEvents.js +32 -19
- package/modern/hooks/useChartId.js +5 -6
- package/modern/hooks/useDrawingArea.js +2 -2
- package/modern/hooks/useInteractionItemProps.js +22 -13
- package/modern/hooks/useSvgRef.js +4 -8
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
- package/modern/internals/index.js +3 -4
- package/modern/internals/plugins/allPlugins.js +3 -0
- package/modern/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/modern/internals/plugins/corePlugins/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/modern/internals/plugins/models/chart.js +1 -0
- package/modern/internals/plugins/models/helpers.js +1 -0
- package/modern/internals/plugins/models/index.js +3 -0
- package/modern/internals/plugins/models/plugin.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +24 -0
- package/modern/internals/plugins/utils/selectors.js +37 -0
- package/modern/internals/store/useCharts.js +72 -0
- package/modern/internals/store/useCharts.types.js +1 -0
- package/modern/internals/store/useSelector.js +6 -0
- package/modern/internals/store/useStore.js +17 -0
- package/node/BarChart/AnimatedBarElement.js +28 -0
- package/node/BarChart/BarChart.js +3 -35
- package/node/BarChart/BarElement.js +11 -21
- package/node/BarChart/BarPlot.js +11 -1
- package/node/BarChart/useBarChartProps.js +2 -8
- package/node/ChartContainer/ChartContainer.js +31 -25
- package/node/ChartContainer/useChartContainerProps.js +12 -27
- package/node/ChartsAxis/axisClasses.js +5 -3
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.types.js +5 -0
- package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
- package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
- package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
- package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
- package/node/ChartsAxisHighlight/index.js +33 -0
- package/node/ChartsGrid/ChartsGrid.js +2 -2
- package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
- package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
- package/node/ChartsLegend/chartsLegendClasses.js +5 -3
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/node/ChartsSurface/ChartsSurface.js +68 -35
- package/node/ChartsTooltip/ChartTooltip.types.js +5 -0
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
- package/node/ChartsTooltip/ChartsTooltip.js +142 -144
- package/node/ChartsTooltip/ChartsTooltipContainer.js +286 -0
- package/node/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
- package/node/ChartsTooltip/index.js +19 -28
- package/node/ChartsTooltip/useAxisTooltip.js +19 -19
- package/node/ChartsTooltip/useItemTooltip.js +5 -4
- package/node/ChartsTooltip/utils.js +0 -9
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -37
- package/node/ChartsXAxis/ChartsXAxis.js +3 -17
- package/node/ChartsYAxis/ChartsYAxis.js +2 -17
- package/node/Gauge/Gauge.js +0 -6
- package/node/Gauge/GaugeContainer.js +42 -76
- package/node/LineChart/AnimatedArea.js +9 -19
- package/node/LineChart/AnimatedLine.js +9 -21
- package/node/LineChart/AreaPlot.js +11 -1
- package/node/LineChart/CircleMarkElement.js +6 -5
- package/node/LineChart/LineChart.js +3 -36
- package/node/LineChart/LineHighlightPlot.js +6 -5
- package/node/LineChart/LinePlot.js +11 -1
- package/node/LineChart/MarkElement.js +6 -5
- package/node/LineChart/useLineChartProps.js +2 -8
- package/node/PieChart/PieChart.js +5 -41
- package/node/PieChart/PiePlot.js +2 -2
- package/node/ScatterChart/Scatter.js +6 -5
- package/node/ScatterChart/ScatterChart.js +5 -36
- package/node/ScatterChart/useScatterChartProps.js +1 -9
- package/node/SparkLineChart/SparkLineChart.js +4 -35
- package/node/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
- package/node/context/ChartProvider/ChartContext.js +15 -0
- package/node/context/ChartProvider/ChartProvider.js +24 -0
- package/node/context/ChartProvider/ChartProvider.types.js +5 -0
- package/node/context/ChartProvider/index.js +38 -0
- package/node/context/ChartProvider/useChartContext.js +18 -0
- package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +21 -0
- package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
- package/node/context/DrawingAreaProvider/index.js +38 -0
- package/node/context/InteractionSelectors.js +18 -0
- package/node/context/SizeProvider/Size.types.js +5 -0
- package/node/context/SizeProvider/SizeContext.js +22 -0
- package/node/context/SizeProvider/SizeProvider.js +29 -0
- package/node/context/SizeProvider/index.js +49 -0
- package/node/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/node/context/SizeProvider/useSize.js +20 -0
- package/node/context/index.js +10 -2
- package/node/hooks/useAxisEvents.js +33 -19
- package/node/hooks/useChartId.js +5 -7
- package/node/hooks/useDrawingArea.js +2 -2
- package/node/hooks/useInteractionItemProps.js +23 -14
- package/node/hooks/useSvgRef.js +4 -9
- package/node/index.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +8 -6
- package/node/internals/index.js +28 -40
- package/node/internals/plugins/allPlugins.js +10 -0
- package/node/internals/plugins/corePlugins/corePlugins.js +12 -0
- package/node/internals/plugins/corePlugins/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.js +41 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +15 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.types.js +5 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.utils.js +12 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +81 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +16 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +5 -0
- package/node/internals/plugins/models/chart.js +5 -0
- package/node/internals/plugins/models/helpers.js +5 -0
- package/node/internals/plugins/models/index.js +38 -0
- package/node/internals/plugins/models/plugin.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +31 -0
- package/node/internals/plugins/utils/selectors.js +44 -0
- package/node/internals/store/useCharts.js +80 -0
- package/node/internals/store/useCharts.types.js +5 -0
- package/node/internals/store/useSelector.js +13 -0
- package/node/internals/store/useStore.js +23 -0
- package/package.json +7 -5
- package/themeAugmentation/props.d.ts +1 -2
- package/ChartContainer/ResizableContainer.d.ts +0 -9
- package/ChartContainer/ResizableContainer.js +0 -26
- package/ChartContainer/useChartContainerDimensions.d.ts +0 -6
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/context/InteractionProvider.d.ts +0 -50
- package/context/InteractionProvider.js +0 -78
- package/modern/ChartContainer/ResizableContainer.js +0 -26
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/modern/context/InteractionProvider.js +0 -78
- package/node/ChartContainer/ResizableContainer.js +0 -32
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- package/node/context/InteractionProvider.js +0 -85
- /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
- /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
/**
|
|
11
|
-
* @ignore - internal component.
|
|
12
|
-
*/
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useUtilityClasses } from "./chartsTooltipClasses.js";
|
|
7
|
+
import { useItemTooltip } from "./useItemTooltip.js";
|
|
8
|
+
import { ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow, ChartsTooltipTable } from "./ChartsTooltipTable.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
10
|
function ChartsItemTooltipContent(props) {
|
|
14
11
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
sx,
|
|
18
|
-
classes,
|
|
19
|
-
contentProps
|
|
12
|
+
classes: propClasses,
|
|
13
|
+
sx
|
|
20
14
|
} = props;
|
|
21
|
-
const
|
|
15
|
+
const tooltipData = useItemTooltip();
|
|
16
|
+
const classes = useUtilityClasses(propClasses);
|
|
17
|
+
if (!tooltipData) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
22
20
|
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
21
|
+
color,
|
|
22
|
+
label,
|
|
23
|
+
formattedValue
|
|
24
|
+
} = tooltipData;
|
|
25
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
26
|
+
sx: sx,
|
|
27
|
+
className: classes.paper,
|
|
28
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
|
|
29
|
+
className: classes.table,
|
|
30
|
+
children: /*#__PURE__*/_jsx("tbody", {
|
|
31
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
32
|
+
className: classes.row,
|
|
33
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
34
|
+
className: clsx(classes.markCell, classes.cell),
|
|
35
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
36
|
+
color: color,
|
|
37
|
+
className: classes.mark
|
|
38
|
+
})
|
|
39
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
40
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
41
|
+
children: label
|
|
42
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
43
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
44
|
+
children: formattedValue
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
49
|
});
|
|
50
|
-
return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
|
|
51
50
|
}
|
|
51
|
+
process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
|
|
52
|
+
// ----------------------------- Warning --------------------------------
|
|
53
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
55
|
+
// ----------------------------------------------------------------------
|
|
56
|
+
/**
|
|
57
|
+
* Override or extend the styles applied to the component.
|
|
58
|
+
*/
|
|
59
|
+
classes: PropTypes.object,
|
|
60
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
61
|
+
} : void 0;
|
|
52
62
|
export { ChartsItemTooltipContent };
|
|
@@ -1,72 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { TriggerOptions } from './utils';
|
|
5
|
-
import { ChartSeriesType } from '../models/seriesType/config';
|
|
6
|
-
import { ChartsItemContentProps } from './ChartsItemTooltipContent';
|
|
7
|
-
import { ChartsAxisContentProps } from './ChartsAxisTooltipContent';
|
|
8
|
-
import { ChartsTooltipClasses } from './chartsTooltipClasses';
|
|
9
|
-
export type PopperProps = BasePopperProps & {
|
|
10
|
-
/**
|
|
11
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
12
|
-
*/
|
|
13
|
-
sx?: SxProps<Theme>;
|
|
14
|
-
};
|
|
15
|
-
export interface ChartsTooltipSlots<T extends ChartSeriesType> {
|
|
16
|
-
/**
|
|
17
|
-
* Custom component for the tooltip popper.
|
|
18
|
-
* @default ChartsTooltipRoot
|
|
19
|
-
*/
|
|
20
|
-
popper?: React.ElementType<PopperProps>;
|
|
21
|
-
/**
|
|
22
|
-
* Custom component for displaying tooltip content when triggered by axis event.
|
|
23
|
-
* @default DefaultChartsAxisTooltipContent
|
|
24
|
-
*/
|
|
25
|
-
axisContent?: React.ElementType<ChartsAxisContentProps>;
|
|
26
|
-
/**
|
|
27
|
-
* Custom component for displaying tooltip content when triggered by item event.
|
|
28
|
-
* @default DefaultChartsItemTooltipContent
|
|
29
|
-
*/
|
|
30
|
-
itemContent?: React.ElementType<ChartsItemContentProps<T>>;
|
|
31
|
-
}
|
|
32
|
-
export interface ChartsTooltipSlotProps<T extends ChartSeriesType> {
|
|
33
|
-
popper?: Partial<PopperProps>;
|
|
34
|
-
axisContent?: Partial<ChartsAxisContentProps>;
|
|
35
|
-
itemContent?: Partial<ChartsItemContentProps<T>>;
|
|
36
|
-
}
|
|
37
|
-
export interface ChartsTooltipProps<T extends ChartSeriesType> {
|
|
38
|
-
/**
|
|
39
|
-
* Select the kind of tooltip to display
|
|
40
|
-
* - 'item': Shows data about the item below the mouse.
|
|
41
|
-
* - 'axis': Shows values associated with the hovered x value
|
|
42
|
-
* - 'none': Does not display tooltip
|
|
43
|
-
* @default 'axis'
|
|
44
|
-
*/
|
|
45
|
-
trigger?: TriggerOptions;
|
|
46
|
-
/**
|
|
47
|
-
* Component to override the tooltip content when trigger is set to 'item'.
|
|
48
|
-
* @deprecated Use slots.itemContent instead
|
|
49
|
-
*/
|
|
50
|
-
itemContent?: React.ElementType<ChartsItemContentProps<any>>;
|
|
51
|
-
/**
|
|
52
|
-
* Component to override the tooltip content when trigger is set to 'axis'.
|
|
53
|
-
* @deprecated Use slots.axisContent instead
|
|
54
|
-
*/
|
|
55
|
-
axisContent?: React.ElementType<ChartsAxisContentProps>;
|
|
56
|
-
/**
|
|
57
|
-
* Override or extend the styles applied to the component.
|
|
58
|
-
*/
|
|
59
|
-
classes?: Partial<ChartsTooltipClasses>;
|
|
60
|
-
/**
|
|
61
|
-
* Overridable component slots.
|
|
62
|
-
* @default {}
|
|
63
|
-
*/
|
|
64
|
-
slots?: ChartsTooltipSlots<T>;
|
|
65
|
-
/**
|
|
66
|
-
* The props used for each component slot.
|
|
67
|
-
* @default {}
|
|
68
|
-
*/
|
|
69
|
-
slotProps?: ChartsTooltipSlotProps<T>;
|
|
2
|
+
import { ChartsTooltipContainerProps } from './ChartsTooltipContainer';
|
|
3
|
+
export interface ChartsTooltipProps extends Omit<ChartsTooltipContainerProps, 'children'> {
|
|
70
4
|
}
|
|
71
5
|
/**
|
|
72
6
|
* Demos:
|
|
@@ -77,7 +11,7 @@ export interface ChartsTooltipProps<T extends ChartSeriesType> {
|
|
|
77
11
|
*
|
|
78
12
|
* - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
|
|
79
13
|
*/
|
|
80
|
-
declare function ChartsTooltip
|
|
14
|
+
declare function ChartsTooltip(props: ChartsTooltipProps): React.JSX.Element;
|
|
81
15
|
declare namespace ChartsTooltip {
|
|
82
16
|
var propTypes: any;
|
|
83
17
|
}
|
|
@@ -3,47 +3,12 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
7
|
-
import useLazyRef from '@mui/utils/useLazyRef';
|
|
8
|
-
import { styled, useThemeProps } from '@mui/material/styles';
|
|
9
|
-
import Popper from '@mui/material/Popper';
|
|
10
|
-
import NoSsr from '@mui/material/NoSsr';
|
|
11
|
-
import useSlotProps from '@mui/utils/useSlotProps';
|
|
12
|
-
import { InteractionContext } from "../context/InteractionProvider.js";
|
|
13
|
-
import { useSvgRef } from "../hooks/useSvgRef.js";
|
|
14
|
-
import { getTooltipHasData, usePointerType } from "./utils.js";
|
|
6
|
+
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
15
7
|
import { ChartsItemTooltipContent } from "./ChartsItemTooltipContent.js";
|
|
16
8
|
import { ChartsAxisTooltipContent } from "./ChartsAxisTooltipContent.js";
|
|
17
|
-
import {
|
|
9
|
+
import { ChartsTooltipContainer } from "./ChartsTooltipContainer.js";
|
|
10
|
+
import { useUtilityClasses } from "./chartsTooltipClasses.js";
|
|
18
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
const useUtilityClasses = ownerState => {
|
|
20
|
-
const {
|
|
21
|
-
classes
|
|
22
|
-
} = ownerState;
|
|
23
|
-
const slots = {
|
|
24
|
-
root: ['root'],
|
|
25
|
-
paper: ['paper'],
|
|
26
|
-
table: ['table'],
|
|
27
|
-
row: ['row'],
|
|
28
|
-
cell: ['cell'],
|
|
29
|
-
mark: ['mark'],
|
|
30
|
-
markCell: ['markCell'],
|
|
31
|
-
labelCell: ['labelCell'],
|
|
32
|
-
valueCell: ['valueCell']
|
|
33
|
-
};
|
|
34
|
-
return composeClasses(slots, getChartsTooltipUtilityClass, classes);
|
|
35
|
-
};
|
|
36
|
-
const ChartsTooltipRoot = styled(Popper, {
|
|
37
|
-
name: 'MuiChartsTooltip',
|
|
38
|
-
slot: 'Root',
|
|
39
|
-
overridesResolver: (_, styles) => styles.root
|
|
40
|
-
})(({
|
|
41
|
-
theme
|
|
42
|
-
}) => ({
|
|
43
|
-
pointerEvents: 'none',
|
|
44
|
-
zIndex: theme.zIndex.modal
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
12
|
/**
|
|
48
13
|
* Demos:
|
|
49
14
|
*
|
|
@@ -53,108 +18,20 @@ const ChartsTooltipRoot = styled(Popper, {
|
|
|
53
18
|
*
|
|
54
19
|
* - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
|
|
55
20
|
*/
|
|
56
|
-
function ChartsTooltip(
|
|
57
|
-
const props = useThemeProps({
|
|
58
|
-
props: inProps,
|
|
59
|
-
name: 'MuiChartsTooltip'
|
|
60
|
-
});
|
|
21
|
+
function ChartsTooltip(props) {
|
|
61
22
|
const {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
axisContent,
|
|
65
|
-
slots,
|
|
66
|
-
slotProps
|
|
23
|
+
classes: propClasses,
|
|
24
|
+
trigger = 'axis'
|
|
67
25
|
} = props;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
26
|
+
const classes = useUtilityClasses(propClasses);
|
|
27
|
+
return /*#__PURE__*/_jsx(ChartsTooltipContainer, _extends({}, props, {
|
|
28
|
+
classes: classes,
|
|
29
|
+
children: trigger === 'axis' ? /*#__PURE__*/_jsx(ChartsAxisTooltipContent, {
|
|
30
|
+
classes: classes
|
|
31
|
+
}) : /*#__PURE__*/_jsx(ChartsItemTooltipContent, {
|
|
32
|
+
classes: classes
|
|
33
|
+
})
|
|
74
34
|
}));
|
|
75
|
-
const {
|
|
76
|
-
item,
|
|
77
|
-
axis
|
|
78
|
-
} = React.useContext(InteractionContext);
|
|
79
|
-
const displayedData = trigger === 'item' ? item : axis;
|
|
80
|
-
const tooltipHasData = getTooltipHasData(trigger, displayedData);
|
|
81
|
-
const popperOpen = pointerType !== null && tooltipHasData;
|
|
82
|
-
const classes = useUtilityClasses({
|
|
83
|
-
classes: props.classes
|
|
84
|
-
});
|
|
85
|
-
const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
|
|
86
|
-
const popperProps = useSlotProps({
|
|
87
|
-
elementType: PopperComponent,
|
|
88
|
-
externalSlotProps: slotProps?.popper,
|
|
89
|
-
additionalProps: {
|
|
90
|
-
open: popperOpen,
|
|
91
|
-
placement: pointerType?.pointerType === 'mouse' ? 'right-start' : 'top',
|
|
92
|
-
popperRef,
|
|
93
|
-
anchorEl: {
|
|
94
|
-
getBoundingClientRect: () => ({
|
|
95
|
-
x: positionRef.current.x,
|
|
96
|
-
y: positionRef.current.y,
|
|
97
|
-
top: positionRef.current.y,
|
|
98
|
-
left: positionRef.current.x,
|
|
99
|
-
right: positionRef.current.x,
|
|
100
|
-
bottom: positionRef.current.y,
|
|
101
|
-
width: 0,
|
|
102
|
-
height: 0,
|
|
103
|
-
toJSON: () => ''
|
|
104
|
-
})
|
|
105
|
-
},
|
|
106
|
-
modifiers: [{
|
|
107
|
-
name: 'offset',
|
|
108
|
-
options: {
|
|
109
|
-
offset: [0, pointerType?.pointerType === 'touch' ? 40 - pointerType.height : 0]
|
|
110
|
-
}
|
|
111
|
-
}]
|
|
112
|
-
},
|
|
113
|
-
ownerState: {}
|
|
114
|
-
});
|
|
115
|
-
React.useEffect(() => {
|
|
116
|
-
const element = svgRef.current;
|
|
117
|
-
if (element === null) {
|
|
118
|
-
return () => {};
|
|
119
|
-
}
|
|
120
|
-
const handleMove = event => {
|
|
121
|
-
// eslint-disable-next-line react-compiler/react-compiler
|
|
122
|
-
positionRef.current = {
|
|
123
|
-
x: event.clientX,
|
|
124
|
-
y: event.clientY
|
|
125
|
-
};
|
|
126
|
-
popperRef.current?.update();
|
|
127
|
-
};
|
|
128
|
-
element.addEventListener('pointermove', handleMove);
|
|
129
|
-
return () => {
|
|
130
|
-
element.removeEventListener('pointermove', handleMove);
|
|
131
|
-
};
|
|
132
|
-
}, [svgRef, positionRef]);
|
|
133
|
-
if (trigger === 'none') {
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
return /*#__PURE__*/_jsx(NoSsr, {
|
|
137
|
-
children: popperOpen && /*#__PURE__*/_jsx(PopperComponent, _extends({}, popperProps, {
|
|
138
|
-
className: classes.root,
|
|
139
|
-
children: trigger === 'item' ? /*#__PURE__*/_jsx(ChartsItemTooltipContent, {
|
|
140
|
-
itemData: displayedData,
|
|
141
|
-
content: slots?.itemContent ?? itemContent,
|
|
142
|
-
contentProps: slotProps?.itemContent,
|
|
143
|
-
sx: {
|
|
144
|
-
mx: 2
|
|
145
|
-
},
|
|
146
|
-
classes: classes
|
|
147
|
-
}) : /*#__PURE__*/_jsx(ChartsAxisTooltipContent, {
|
|
148
|
-
axisData: displayedData,
|
|
149
|
-
content: slots?.axisContent ?? axisContent,
|
|
150
|
-
contentProps: slotProps?.axisContent,
|
|
151
|
-
sx: {
|
|
152
|
-
mx: 2
|
|
153
|
-
},
|
|
154
|
-
classes: classes
|
|
155
|
-
})
|
|
156
|
-
}))
|
|
157
|
-
});
|
|
158
35
|
}
|
|
159
36
|
process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
160
37
|
// ----------------------------- Warning --------------------------------
|
|
@@ -162,29 +39,150 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
162
39
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
163
40
|
// ----------------------------------------------------------------------
|
|
164
41
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
42
|
+
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
43
|
+
* or a function that returns either.
|
|
44
|
+
* It's used to set the position of the popper.
|
|
45
|
+
* The return value will passed as the reference object of the Popper instance.
|
|
167
46
|
*/
|
|
168
|
-
|
|
47
|
+
anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
|
|
169
48
|
/**
|
|
170
49
|
* Override or extend the styles applied to the component.
|
|
171
50
|
*/
|
|
172
51
|
classes: PropTypes.object,
|
|
173
52
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
53
|
+
* The component used for the root node.
|
|
54
|
+
* Either a string to use a HTML element or a component.
|
|
176
55
|
*/
|
|
177
|
-
|
|
56
|
+
component: PropTypes.elementType,
|
|
178
57
|
/**
|
|
179
|
-
* The
|
|
58
|
+
* The components used for each slot inside the Popper.
|
|
59
|
+
* Either a string to use a HTML element or a component.
|
|
60
|
+
* @default {}
|
|
61
|
+
*/
|
|
62
|
+
components: PropTypes.shape({
|
|
63
|
+
Root: PropTypes.elementType
|
|
64
|
+
}),
|
|
65
|
+
/**
|
|
66
|
+
* The props used for each slot inside the Popper.
|
|
67
|
+
* @default {}
|
|
68
|
+
*/
|
|
69
|
+
componentsProps: PropTypes.shape({
|
|
70
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
71
|
+
}),
|
|
72
|
+
/**
|
|
73
|
+
* An HTML element or function that returns one.
|
|
74
|
+
* The `container` will have the portal children appended to it.
|
|
75
|
+
*
|
|
76
|
+
* You can also provide a callback, which is called in a React layout effect.
|
|
77
|
+
* This lets you set the container from a ref, and also makes server-side rendering possible.
|
|
78
|
+
*
|
|
79
|
+
* By default, it uses the body of the top-level document object,
|
|
80
|
+
* so it's simply `document.body` most of the time.
|
|
81
|
+
*/
|
|
82
|
+
container: PropTypes.oneOfType([(props, propName) => {
|
|
83
|
+
if (props[propName] == null) {
|
|
84
|
+
return new Error(`Prop '${propName}' is required but wasn't specified`);
|
|
85
|
+
}
|
|
86
|
+
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
87
|
+
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}, PropTypes.func]),
|
|
91
|
+
/**
|
|
92
|
+
* The `children` will be under the DOM hierarchy of the parent component.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
disablePortal: PropTypes.bool,
|
|
96
|
+
/**
|
|
97
|
+
* Always keep the children in the DOM.
|
|
98
|
+
* This prop can be useful in SEO situation or
|
|
99
|
+
* when you want to maximize the responsiveness of the Popper.
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
keepMounted: PropTypes.bool,
|
|
103
|
+
/**
|
|
104
|
+
* Popper.js is based on a "plugin-like" architecture,
|
|
105
|
+
* most of its features are fully encapsulated "modifiers".
|
|
106
|
+
*
|
|
107
|
+
* A modifier is a function that is called each time Popper.js needs to
|
|
108
|
+
* compute the position of the popper.
|
|
109
|
+
* For this reason, modifiers should be very performant to avoid bottlenecks.
|
|
110
|
+
* To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
|
|
111
|
+
*/
|
|
112
|
+
modifiers: PropTypes.arrayOf(PropTypes.shape({
|
|
113
|
+
data: PropTypes.object,
|
|
114
|
+
effect: PropTypes.func,
|
|
115
|
+
enabled: PropTypes.bool,
|
|
116
|
+
fn: PropTypes.func,
|
|
117
|
+
name: PropTypes.any,
|
|
118
|
+
options: PropTypes.object,
|
|
119
|
+
phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
|
|
120
|
+
requires: PropTypes.arrayOf(PropTypes.string),
|
|
121
|
+
requiresIfExists: PropTypes.arrayOf(PropTypes.string)
|
|
122
|
+
})),
|
|
123
|
+
/**
|
|
124
|
+
* If `true`, the component is shown.
|
|
125
|
+
*/
|
|
126
|
+
open: PropTypes.bool,
|
|
127
|
+
/**
|
|
128
|
+
* Popper placement.
|
|
129
|
+
* @default 'bottom'
|
|
130
|
+
*/
|
|
131
|
+
placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
132
|
+
/**
|
|
133
|
+
* Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
|
|
134
|
+
* @default {}
|
|
135
|
+
*/
|
|
136
|
+
popperOptions: PropTypes.shape({
|
|
137
|
+
modifiers: PropTypes.array,
|
|
138
|
+
onFirstUpdate: PropTypes.func,
|
|
139
|
+
placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
140
|
+
strategy: PropTypes.oneOf(['absolute', 'fixed'])
|
|
141
|
+
}),
|
|
142
|
+
/**
|
|
143
|
+
* A ref that points to the used popper instance.
|
|
144
|
+
*/
|
|
145
|
+
popperRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
146
|
+
current: PropTypes.shape({
|
|
147
|
+
destroy: PropTypes.func.isRequired,
|
|
148
|
+
forceUpdate: PropTypes.func.isRequired,
|
|
149
|
+
setOptions: PropTypes.func.isRequired,
|
|
150
|
+
state: PropTypes.shape({
|
|
151
|
+
attributes: PropTypes.object.isRequired,
|
|
152
|
+
elements: PropTypes.object.isRequired,
|
|
153
|
+
modifiersData: PropTypes.object.isRequired,
|
|
154
|
+
options: PropTypes.object.isRequired,
|
|
155
|
+
orderedModifiers: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
156
|
+
placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']).isRequired,
|
|
157
|
+
rects: PropTypes.object.isRequired,
|
|
158
|
+
reset: PropTypes.bool.isRequired,
|
|
159
|
+
scrollParents: PropTypes.object.isRequired,
|
|
160
|
+
strategy: PropTypes.oneOf(['absolute', 'fixed']).isRequired,
|
|
161
|
+
styles: PropTypes.object.isRequired
|
|
162
|
+
}).isRequired,
|
|
163
|
+
update: PropTypes.func.isRequired
|
|
164
|
+
})
|
|
165
|
+
})]),
|
|
166
|
+
/**
|
|
167
|
+
* The props used for each slot inside the Popper.
|
|
180
168
|
* @default {}
|
|
181
169
|
*/
|
|
182
170
|
slotProps: PropTypes.object,
|
|
183
171
|
/**
|
|
184
|
-
*
|
|
172
|
+
* The components used for each slot inside the Popper.
|
|
173
|
+
* Either a string to use a HTML element or a component.
|
|
185
174
|
* @default {}
|
|
186
175
|
*/
|
|
187
176
|
slots: PropTypes.object,
|
|
177
|
+
/**
|
|
178
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
179
|
+
*/
|
|
180
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
181
|
+
/**
|
|
182
|
+
* Help supporting a react-transition-group/Transition component.
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
transition: PropTypes.bool,
|
|
188
186
|
/**
|
|
189
187
|
* Select the kind of tooltip to display
|
|
190
188
|
* - 'item': Shows data about the item below the mouse.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PopperProps } from '@mui/material/Popper';
|
|
3
|
+
import { TriggerOptions } from './utils';
|
|
4
|
+
import { ChartsTooltipClasses } from './chartsTooltipClasses';
|
|
5
|
+
export interface ChartsTooltipContainerProps extends Partial<PopperProps> {
|
|
6
|
+
/**
|
|
7
|
+
* Select the kind of tooltip to display
|
|
8
|
+
* - 'item': Shows data about the item below the mouse.
|
|
9
|
+
* - 'axis': Shows values associated with the hovered x value
|
|
10
|
+
* - 'none': Does not display tooltip
|
|
11
|
+
* @default 'axis'
|
|
12
|
+
*/
|
|
13
|
+
trigger?: TriggerOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Override or extend the styles applied to the component.
|
|
16
|
+
*/
|
|
17
|
+
classes?: Partial<ChartsTooltipClasses>;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Demos:
|
|
22
|
+
*
|
|
23
|
+
* - [ChartsTooltip](https://mui.com/x/react-charts/tooltip/)
|
|
24
|
+
*
|
|
25
|
+
* API:
|
|
26
|
+
*
|
|
27
|
+
* - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
|
|
28
|
+
*/
|
|
29
|
+
declare function ChartsTooltipContainer(inProps: ChartsTooltipContainerProps): React.JSX.Element | null;
|
|
30
|
+
declare namespace ChartsTooltipContainer {
|
|
31
|
+
var propTypes: any;
|
|
32
|
+
}
|
|
33
|
+
export { ChartsTooltipContainer };
|