@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
|
@@ -10,7 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
12
12
|
var _constants = require("../constants");
|
|
13
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "
|
|
13
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAxisClick", "axisHighlight", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
|
|
14
14
|
/**
|
|
15
15
|
* A helper function that extracts BarChartProps from the input props
|
|
16
16
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -29,7 +29,6 @@ const useBarChartProps = props => {
|
|
|
29
29
|
colors,
|
|
30
30
|
dataset,
|
|
31
31
|
sx,
|
|
32
|
-
tooltip,
|
|
33
32
|
onAxisClick,
|
|
34
33
|
axisHighlight,
|
|
35
34
|
grid,
|
|
@@ -80,7 +79,7 @@ const useBarChartProps = props => {
|
|
|
80
79
|
sx,
|
|
81
80
|
highlightedItem,
|
|
82
81
|
onHighlightChange,
|
|
83
|
-
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
82
|
+
disableAxisListener: slotProps?.tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
84
83
|
className,
|
|
85
84
|
skipAnimation
|
|
86
85
|
});
|
|
@@ -126,10 +125,6 @@ const useBarChartProps = props => {
|
|
|
126
125
|
slots,
|
|
127
126
|
slotProps
|
|
128
127
|
};
|
|
129
|
-
const tooltipProps = (0, _extends2.default)({}, tooltip, {
|
|
130
|
-
slots,
|
|
131
|
-
slotProps
|
|
132
|
-
});
|
|
133
128
|
return {
|
|
134
129
|
chartContainerProps,
|
|
135
130
|
barPlotProps,
|
|
@@ -141,7 +136,6 @@ const useBarChartProps = props => {
|
|
|
141
136
|
chartsAxisProps,
|
|
142
137
|
axisHighlightProps,
|
|
143
138
|
legendProps,
|
|
144
|
-
tooltipProps,
|
|
145
139
|
children
|
|
146
140
|
};
|
|
147
141
|
};
|
|
@@ -11,17 +11,43 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _ChartDataProvider = require("../context/ChartDataProvider");
|
|
14
|
-
var _ResizableContainer = require("./ResizableContainer");
|
|
15
14
|
var _useChartContainerProps = require("./useChartContainerProps");
|
|
15
|
+
var _ChartsSurface = require("../ChartsSurface");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
/**
|
|
18
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
19
|
+
*
|
|
20
|
+
* This is a combination of both the `ChartDataProvider` and `ChartsSurface` components.
|
|
21
|
+
*
|
|
22
|
+
* Demos:
|
|
23
|
+
*
|
|
24
|
+
* - [Composition](http://localhost:3001/x/react-charts/composition/)
|
|
25
|
+
*
|
|
26
|
+
* API:
|
|
27
|
+
*
|
|
28
|
+
* - [ChartContainer API](https://mui.com/x/api/charts/chart-container/)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <ChartContainer
|
|
33
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
34
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
35
|
+
* >
|
|
36
|
+
* <BarPlot />
|
|
37
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
38
|
+
* </ChartContainer>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
17
41
|
const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
18
42
|
const {
|
|
19
|
-
hasIntrinsicSize,
|
|
20
43
|
chartDataProviderProps,
|
|
21
|
-
|
|
44
|
+
children,
|
|
45
|
+
chartsSurfaceProps
|
|
22
46
|
} = (0, _useChartContainerProps.useChartContainerProps)(props, ref);
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
24
|
-
children:
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
49
|
+
children: children
|
|
50
|
+
}))
|
|
25
51
|
}));
|
|
26
52
|
});
|
|
27
53
|
process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
@@ -81,16 +107,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
81
107
|
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
82
108
|
*/
|
|
83
109
|
plugins: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
84
|
-
/**
|
|
85
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
86
|
-
* before it renders for the first time.
|
|
87
|
-
*
|
|
88
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
89
|
-
* the first render, like when used inside a grid.
|
|
90
|
-
*
|
|
91
|
-
* @default false
|
|
92
|
-
*/
|
|
93
|
-
resolveSizeBeforeRender: _propTypes.default.bool,
|
|
94
110
|
/**
|
|
95
111
|
* The array of series to display.
|
|
96
112
|
* Each type of series has its own specificity.
|
|
@@ -104,12 +120,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
104
120
|
skipAnimation: _propTypes.default.bool,
|
|
105
121
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
106
122
|
title: _propTypes.default.string,
|
|
107
|
-
viewBox: _propTypes.default.shape({
|
|
108
|
-
height: _propTypes.default.number,
|
|
109
|
-
width: _propTypes.default.number,
|
|
110
|
-
x: _propTypes.default.number,
|
|
111
|
-
y: _propTypes.default.number
|
|
112
|
-
}),
|
|
113
123
|
/**
|
|
114
124
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
115
125
|
*/
|
|
@@ -145,7 +155,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
145
155
|
hideTooltip: _propTypes.default.bool,
|
|
146
156
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
147
157
|
label: _propTypes.default.string,
|
|
148
|
-
labelFontSize: _propTypes.default.number,
|
|
149
158
|
labelStyle: _propTypes.default.object,
|
|
150
159
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
151
160
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -156,7 +165,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
156
165
|
slots: _propTypes.default.object,
|
|
157
166
|
stroke: _propTypes.default.string,
|
|
158
167
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
159
|
-
tickFontSize: _propTypes.default.number,
|
|
160
168
|
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
161
169
|
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
162
170
|
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
@@ -199,7 +207,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
199
207
|
hideTooltip: _propTypes.default.bool,
|
|
200
208
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
201
209
|
label: _propTypes.default.string,
|
|
202
|
-
labelFontSize: _propTypes.default.number,
|
|
203
210
|
labelStyle: _propTypes.default.object,
|
|
204
211
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
205
212
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
@@ -210,7 +217,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
210
217
|
slots: _propTypes.default.object,
|
|
211
218
|
stroke: _propTypes.default.string,
|
|
212
219
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
213
|
-
tickFontSize: _propTypes.default.number,
|
|
214
220
|
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
215
221
|
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
216
222
|
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
@@ -8,13 +8,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.useChartContainerProps = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
-
|
|
12
|
-
const _excluded = ["width", "height", "resolveSizeBeforeRender", "margin", "children", "series", "colors", "dataset", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "sx", "title", "viewBox", "xAxis", "yAxis", "zAxis", "skipAnimation"];
|
|
11
|
+
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "sx", "title", "xAxis", "yAxis", "zAxis", "skipAnimation"];
|
|
13
12
|
const useChartContainerProps = (props, ref) => {
|
|
14
13
|
const {
|
|
15
14
|
width,
|
|
16
15
|
height,
|
|
17
|
-
resolveSizeBeforeRender,
|
|
18
16
|
margin,
|
|
19
17
|
children,
|
|
20
18
|
series,
|
|
@@ -27,51 +25,38 @@ const useChartContainerProps = (props, ref) => {
|
|
|
27
25
|
plugins,
|
|
28
26
|
sx,
|
|
29
27
|
title,
|
|
30
|
-
viewBox,
|
|
31
28
|
xAxis,
|
|
32
29
|
yAxis,
|
|
33
30
|
zAxis,
|
|
34
31
|
skipAnimation
|
|
35
32
|
} = props,
|
|
36
33
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
37
|
-
const {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
width,
|
|
45
|
-
height
|
|
46
|
-
},
|
|
47
|
-
ref: containerRef
|
|
48
|
-
});
|
|
34
|
+
const chartsSurfaceProps = (0, _extends2.default)({
|
|
35
|
+
title,
|
|
36
|
+
desc,
|
|
37
|
+
sx,
|
|
38
|
+
disableAxisListener,
|
|
39
|
+
ref
|
|
40
|
+
}, other);
|
|
49
41
|
const chartDataProviderProps = {
|
|
50
42
|
margin,
|
|
51
|
-
children,
|
|
52
43
|
series,
|
|
53
44
|
colors,
|
|
54
45
|
dataset,
|
|
55
|
-
desc,
|
|
56
|
-
disableAxisListener,
|
|
57
46
|
highlightedItem,
|
|
58
47
|
onHighlightChange,
|
|
59
48
|
plugins,
|
|
60
|
-
sx,
|
|
61
|
-
title,
|
|
62
|
-
viewBox,
|
|
63
49
|
xAxis,
|
|
64
50
|
yAxis,
|
|
65
51
|
zAxis,
|
|
66
52
|
skipAnimation,
|
|
67
|
-
width
|
|
68
|
-
height
|
|
69
|
-
ref
|
|
53
|
+
width,
|
|
54
|
+
height
|
|
70
55
|
};
|
|
71
56
|
return {
|
|
72
|
-
hasIntrinsicSize: Boolean(dWidth && dHeight),
|
|
73
57
|
chartDataProviderProps,
|
|
74
|
-
|
|
58
|
+
chartsSurfaceProps,
|
|
59
|
+
children
|
|
75
60
|
};
|
|
76
61
|
};
|
|
77
62
|
exports.useChartContainerProps = useChartContainerProps;
|
|
@@ -1,12 +1,14 @@
|
|
|
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.axisClasses = void 0;
|
|
7
8
|
exports.getAxisUtilityClass = getAxisUtilityClass;
|
|
8
|
-
var
|
|
9
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
9
11
|
function getAxisUtilityClass(slot) {
|
|
10
|
-
return (0,
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiChartsAxis', slot);
|
|
11
13
|
}
|
|
12
|
-
const axisClasses = exports.axisClasses = (0,
|
|
14
|
+
const axisClasses = exports.axisClasses = (0, _generateUtilityClasses.default)('MuiChartsAxis', ['root', 'line', 'tickContainer', 'tick', 'tickLabel', 'label', 'directionX', 'directionY', 'top', 'bottom', 'left', 'right']);
|
|
@@ -1,66 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.ChartsAxisHighlight = ChartsAxisHighlight;
|
|
10
|
-
exports.chartsAxisHighlightClasses = exports.ChartsAxisHighlightPath = void 0;
|
|
11
|
-
exports.getAxisHighlightUtilityClass = getAxisHighlightUtilityClass;
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
10
|
var React = _interopRequireWildcard(require("react"));
|
|
14
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var _InteractionProvider = require("../context/InteractionProvider");
|
|
20
|
-
var _CartesianProvider = require("../context/CartesianProvider");
|
|
21
|
-
var _useScale = require("../hooks/useScale");
|
|
22
|
-
var _isBandScale = require("../internals/isBandScale");
|
|
13
|
+
var _chartsAxisHighlightClasses = require("./chartsAxisHighlightClasses");
|
|
14
|
+
var _ChartsYAxisHighlight = _interopRequireDefault(require("./ChartsYAxisHighlight"));
|
|
15
|
+
var _ChartsXAxisHighlight = _interopRequireDefault(require("./ChartsXAxisHighlight"));
|
|
23
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
function getAxisHighlightUtilityClass(slot) {
|
|
25
|
-
return (0, _generateUtilityClass.default)('MuiChartsAxisHighlight', slot);
|
|
26
|
-
}
|
|
27
|
-
const chartsAxisHighlightClasses = exports.chartsAxisHighlightClasses = (0, _generateUtilityClasses.default)('MuiChartsAxisHighlight', ['root']);
|
|
28
17
|
const useUtilityClasses = () => {
|
|
29
18
|
const slots = {
|
|
30
19
|
root: ['root']
|
|
31
20
|
};
|
|
32
|
-
return (0, _composeClasses.default)(slots, getAxisHighlightUtilityClass);
|
|
21
|
+
return (0, _composeClasses.default)(slots, _chartsAxisHighlightClasses.getAxisHighlightUtilityClass);
|
|
33
22
|
};
|
|
34
|
-
|
|
35
|
-
name: 'MuiChartsAxisHighlight',
|
|
36
|
-
slot: 'Root',
|
|
37
|
-
overridesResolver: (_, styles) => styles.root
|
|
38
|
-
})(({
|
|
39
|
-
theme
|
|
40
|
-
}) => ({
|
|
41
|
-
pointerEvents: 'none',
|
|
42
|
-
variants: [{
|
|
43
|
-
props: {
|
|
44
|
-
axisHighlight: 'band'
|
|
45
|
-
},
|
|
46
|
-
style: (0, _extends2.default)({
|
|
47
|
-
fill: 'white',
|
|
48
|
-
fillOpacity: 0.1
|
|
49
|
-
}, theme.applyStyles('light', {
|
|
50
|
-
fill: 'gray'
|
|
51
|
-
}))
|
|
52
|
-
}, {
|
|
53
|
-
props: {
|
|
54
|
-
axisHighlight: 'line'
|
|
55
|
-
},
|
|
56
|
-
style: (0, _extends2.default)({
|
|
57
|
-
strokeDasharray: '5 2',
|
|
58
|
-
stroke: '#ffffff'
|
|
59
|
-
}, theme.applyStyles('light', {
|
|
60
|
-
stroke: '#000000'
|
|
61
|
-
}))
|
|
62
|
-
}]
|
|
63
|
-
}));
|
|
23
|
+
|
|
64
24
|
/**
|
|
65
25
|
* Demos:
|
|
66
26
|
*
|
|
@@ -75,62 +35,14 @@ function ChartsAxisHighlight(props) {
|
|
|
75
35
|
x: xAxisHighlight,
|
|
76
36
|
y: yAxisHighlight
|
|
77
37
|
} = props;
|
|
78
|
-
const {
|
|
79
|
-
xAxisIds,
|
|
80
|
-
xAxis,
|
|
81
|
-
yAxisIds,
|
|
82
|
-
yAxis
|
|
83
|
-
} = (0, _CartesianProvider.useCartesianContext)();
|
|
84
38
|
const classes = useUtilityClasses();
|
|
85
|
-
const USED_X_AXIS_ID = xAxisIds[0];
|
|
86
|
-
const USED_Y_AXIS_ID = yAxisIds[0];
|
|
87
|
-
const xScale = xAxis[USED_X_AXIS_ID].scale;
|
|
88
|
-
const yScale = yAxis[USED_Y_AXIS_ID].scale;
|
|
89
|
-
const {
|
|
90
|
-
axis
|
|
91
|
-
} = React.useContext(_InteractionProvider.InteractionContext);
|
|
92
|
-
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
93
|
-
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
94
|
-
const axisX = axis.x;
|
|
95
|
-
const axisY = axis.y;
|
|
96
|
-
const isBandScaleX = xAxisHighlight === 'band' && axisX !== null && (0, _isBandScale.isBandScale)(xScale);
|
|
97
|
-
const isBandScaleY = yAxisHighlight === 'band' && axisY !== null && (0, _isBandScale.isBandScale)(yScale);
|
|
98
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
99
|
-
const isXError = isBandScaleX && xScale(axisX.value) === undefined;
|
|
100
|
-
const isYError = isBandScaleY && yScale(axisY.value) === undefined;
|
|
101
|
-
if (isXError || isYError) {
|
|
102
|
-
console.error([`MUI X: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
106
|
-
children: [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
axisHighlight: 'band'
|
|
113
|
-
}
|
|
114
|
-
}), isBandScaleY && yScale(axisY.value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
115
|
-
d: `M ${xScale.range()[0]} ${
|
|
116
|
-
// @ts-expect-error, yScale value is checked in the statement above
|
|
117
|
-
yScale(axisY.value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${xScale.range()[1] - xScale.range()[0]} 0 l 0 ${-yScale.step()} Z`,
|
|
118
|
-
className: classes.root,
|
|
119
|
-
ownerState: {
|
|
120
|
-
axisHighlight: 'band'
|
|
121
|
-
}
|
|
122
|
-
}), xAxisHighlight === 'line' && axis.x !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
123
|
-
d: `M ${getXPosition(axis.x.value)} ${yScale.range()[0]} L ${getXPosition(axis.x.value)} ${yScale.range()[1]}`,
|
|
124
|
-
className: classes.root,
|
|
125
|
-
ownerState: {
|
|
126
|
-
axisHighlight: 'line'
|
|
127
|
-
}
|
|
128
|
-
}), yAxisHighlight === 'line' && axis.y !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
129
|
-
d: `M ${xScale.range()[0]} ${getYPosition(axis.y.value)} L ${xScale.range()[1]} ${getYPosition(axis.y.value)}`,
|
|
130
|
-
className: classes.root,
|
|
131
|
-
ownerState: {
|
|
132
|
-
axisHighlight: 'line'
|
|
133
|
-
}
|
|
40
|
+
children: [xAxisHighlight && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxisHighlight.default, {
|
|
41
|
+
type: xAxisHighlight,
|
|
42
|
+
classes: classes
|
|
43
|
+
}), yAxisHighlight && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxisHighlight.default, {
|
|
44
|
+
type: yAxisHighlight,
|
|
45
|
+
classes: classes
|
|
134
46
|
})]
|
|
135
47
|
});
|
|
136
48
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.ChartsAxisHighlightPath = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
11
|
+
const ChartsAxisHighlightPath = exports.ChartsAxisHighlightPath = (0, _styles.styled)('path', {
|
|
12
|
+
name: 'MuiChartsAxisHighlight',
|
|
13
|
+
slot: 'Root',
|
|
14
|
+
overridesResolver: (_, styles) => styles.root
|
|
15
|
+
})(({
|
|
16
|
+
theme
|
|
17
|
+
}) => ({
|
|
18
|
+
pointerEvents: 'none',
|
|
19
|
+
variants: [{
|
|
20
|
+
props: {
|
|
21
|
+
axisHighlight: 'band'
|
|
22
|
+
},
|
|
23
|
+
style: (0, _extends2.default)({
|
|
24
|
+
fill: 'white',
|
|
25
|
+
fillOpacity: 0.1
|
|
26
|
+
}, theme.applyStyles('light', {
|
|
27
|
+
fill: 'gray'
|
|
28
|
+
}))
|
|
29
|
+
}, {
|
|
30
|
+
props: {
|
|
31
|
+
axisHighlight: 'line'
|
|
32
|
+
},
|
|
33
|
+
style: (0, _extends2.default)({
|
|
34
|
+
strokeDasharray: '5 2',
|
|
35
|
+
stroke: '#ffffff'
|
|
36
|
+
}, theme.applyStyles('light', {
|
|
37
|
+
stroke: '#000000'
|
|
38
|
+
}))
|
|
39
|
+
}]
|
|
40
|
+
}));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = ChartsXHighlight;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _useScale = require("../hooks/useScale");
|
|
11
|
+
var _isBandScale = require("../internals/isBandScale");
|
|
12
|
+
var _useSelector = require("../internals/store/useSelector");
|
|
13
|
+
var _useStore = require("../internals/store/useStore");
|
|
14
|
+
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
15
|
+
var _hooks = require("../hooks");
|
|
16
|
+
var _ChartsAxisHighlightPath = require("./ChartsAxisHighlightPath");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
/**
|
|
19
|
+
* @ignore - internal component.
|
|
20
|
+
*/function ChartsXHighlight(props) {
|
|
21
|
+
const {
|
|
22
|
+
type,
|
|
23
|
+
classes
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
top,
|
|
27
|
+
height
|
|
28
|
+
} = (0, _hooks.useDrawingArea)();
|
|
29
|
+
const xScale = (0, _useScale.useXScale)();
|
|
30
|
+
const store = (0, _useStore.useStore)();
|
|
31
|
+
const axisX = (0, _useSelector.useSelector)(store, _useChartInteraction.selectorChartsInteractionXAxis);
|
|
32
|
+
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
33
|
+
const isBandScaleX = type === 'band' && axisX !== null && (0, _isBandScale.isBandScale)(xScale);
|
|
34
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
35
|
+
const isError = isBandScaleX && xScale(axisX.value) === undefined;
|
|
36
|
+
if (isError) {
|
|
37
|
+
console.error([`MUI X: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
41
|
+
children: [isBandScaleX && xScale(axisX.value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath
|
|
42
|
+
// @ts-expect-error, xScale value is checked in the statement above
|
|
43
|
+
, {
|
|
44
|
+
d: `M ${xScale(axisX.value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
|
|
45
|
+
className: classes.root,
|
|
46
|
+
ownerState: {
|
|
47
|
+
axisHighlight: 'band'
|
|
48
|
+
}
|
|
49
|
+
}), type === 'line' && axisX !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
|
|
50
|
+
d: `M ${getXPosition(axisX.value)} ${top} L ${getXPosition(axisX.value)} ${top + height}`,
|
|
51
|
+
className: classes.root,
|
|
52
|
+
ownerState: {
|
|
53
|
+
axisHighlight: 'line'
|
|
54
|
+
}
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = ChartsYHighlight;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _useScale = require("../hooks/useScale");
|
|
11
|
+
var _isBandScale = require("../internals/isBandScale");
|
|
12
|
+
var _useSelector = require("../internals/store/useSelector");
|
|
13
|
+
var _useStore = require("../internals/store/useStore");
|
|
14
|
+
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
15
|
+
var _hooks = require("../hooks");
|
|
16
|
+
var _ChartsAxisHighlightPath = require("./ChartsAxisHighlightPath");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
/**
|
|
19
|
+
* @ignore - internal component.
|
|
20
|
+
*/function ChartsYHighlight(props) {
|
|
21
|
+
const {
|
|
22
|
+
type,
|
|
23
|
+
classes
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
left,
|
|
27
|
+
width
|
|
28
|
+
} = (0, _hooks.useDrawingArea)();
|
|
29
|
+
const yScale = (0, _useScale.useYScale)();
|
|
30
|
+
const store = (0, _useStore.useStore)();
|
|
31
|
+
const axisY = (0, _useSelector.useSelector)(store, _useChartInteraction.selectorChartsInteractionYAxis);
|
|
32
|
+
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
33
|
+
const isBandScaleY = type === 'band' && axisY !== null && (0, _isBandScale.isBandScale)(yScale);
|
|
34
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
35
|
+
const isError = isBandScaleY && yScale(axisY.value) === undefined;
|
|
36
|
+
if (isError) {
|
|
37
|
+
console.error([`MUI X: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
41
|
+
children: [isBandScaleY && yScale(axisY.value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
|
|
42
|
+
d: `M ${left} ${
|
|
43
|
+
// @ts-expect-error, yScale value is checked in the statement above
|
|
44
|
+
yScale(axisY.value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
|
|
45
|
+
className: classes.root,
|
|
46
|
+
ownerState: {
|
|
47
|
+
axisHighlight: 'band'
|
|
48
|
+
}
|
|
49
|
+
}), type === 'line' && axisY !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
|
|
50
|
+
d: `M ${left} ${getYPosition(axisY.value)} L ${left + width} ${getYPosition(axisY.value)}`,
|
|
51
|
+
className: classes.root,
|
|
52
|
+
ownerState: {
|
|
53
|
+
axisHighlight: 'line'
|
|
54
|
+
}
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.chartsAxisHighlightClasses = void 0;
|
|
8
|
+
exports.getAxisHighlightUtilityClass = getAxisHighlightUtilityClass;
|
|
9
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
11
|
+
function getAxisHighlightUtilityClass(slot) {
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiChartsAxisHighlight', slot);
|
|
13
|
+
}
|
|
14
|
+
const chartsAxisHighlightClasses = exports.chartsAxisHighlightClasses = (0, _generateUtilityClasses.default)('MuiChartsAxisHighlight', ['root']);
|
|
@@ -13,4 +13,37 @@ Object.keys(_ChartsAxisHighlight).forEach(function (key) {
|
|
|
13
13
|
return _ChartsAxisHighlight[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _chartsAxisHighlightClasses = require("./chartsAxisHighlightClasses");
|
|
18
|
+
Object.keys(_chartsAxisHighlightClasses).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _chartsAxisHighlightClasses[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _chartsAxisHighlightClasses[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _ChartsAxisHighlight2 = require("./ChartsAxisHighlight.types");
|
|
29
|
+
Object.keys(_ChartsAxisHighlight2).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _ChartsAxisHighlight2[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _ChartsAxisHighlight2[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _ChartsAxisHighlightPath = require("./ChartsAxisHighlightPath");
|
|
40
|
+
Object.keys(_ChartsAxisHighlightPath).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _ChartsAxisHighlightPath[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _ChartsAxisHighlightPath[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
16
49
|
});
|
|
@@ -16,7 +16,7 @@ var _styles = require("@mui/material/styles");
|
|
|
16
16
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
17
17
|
var _chartsGridClasses = require("./chartsGridClasses");
|
|
18
18
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
19
|
-
var
|
|
19
|
+
var _styledComponents = require("./styledComponents");
|
|
20
20
|
var _ChartsVerticalGrid = require("./ChartsVerticalGrid");
|
|
21
21
|
var _ChartsHorizontalGrid = require("./ChartsHorizontalGrid");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -60,7 +60,7 @@ function ChartsGrid(inProps) {
|
|
|
60
60
|
const classes = useUtilityClasses(props);
|
|
61
61
|
const horizontalAxis = yAxis[yAxisIds[0]];
|
|
62
62
|
const verticalAxis = xAxis[xAxisIds[0]];
|
|
63
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledComponents.GridRoot, (0, _extends2.default)({}, other, {
|
|
64
64
|
className: classes.root,
|
|
65
65
|
children: [vertical && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsVerticalGrid.ChartsGridVertical, {
|
|
66
66
|
axis: verticalAxis,
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ChartsGridHorizontal = ChartsGridHorizontal;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _useTicks = require("../hooks/useTicks");
|
|
10
|
-
var
|
|
10
|
+
var _styledComponents = require("./styledComponents");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
/**
|
|
13
13
|
* @ignore - internal component.
|
|
@@ -30,14 +30,14 @@ function ChartsGridHorizontal(props) {
|
|
|
30
30
|
});
|
|
31
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
32
32
|
children: yTicks.map(({
|
|
33
|
-
|
|
33
|
+
value,
|
|
34
34
|
offset
|
|
35
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
35
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.GridLine, {
|
|
36
36
|
y1: offset,
|
|
37
37
|
y2: offset,
|
|
38
38
|
x1: drawingArea.left,
|
|
39
39
|
x2: drawingArea.left + drawingArea.width,
|
|
40
40
|
className: classes.horizontalLine
|
|
41
|
-
}, `horizontal-${
|
|
41
|
+
}, `horizontal-${value}`))
|
|
42
42
|
});
|
|
43
43
|
}
|