@mui/x-charts 8.11.3 → 8.13.0
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/BarChart.d.ts +2 -2
- package/BarChart/BarChart.js +1 -0
- package/BarChart/BarChart.plugins.d.ts +3 -2
- package/BarChart/BarChart.plugins.js +2 -1
- package/BarChart/BarElement.js +10 -2
- package/BarChart/index.d.ts +1 -0
- package/BarChart/index.js +12 -0
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/CHANGELOG.md +296 -6
- package/ChartContainer/ChartContainer.js +4 -2
- package/ChartContainer/useChartContainerProps.js +4 -2
- package/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/ChartsLegend/PiecewiseColorLegend.js +1 -0
- package/ChartsSurface/ChartsSurface.js +23 -3
- package/ChartsWrapper/ChartsWrapper.d.ts +2 -1
- package/ChartsWrapper/ChartsWrapper.js +49 -46
- package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
- package/LineChart/FocusedMark.d.ts +2 -0
- package/LineChart/FocusedMark.js +44 -0
- package/LineChart/LineChart.d.ts +2 -2
- package/LineChart/LineChart.js +3 -1
- package/LineChart/LineChart.plugins.d.ts +3 -2
- package/LineChart/LineChart.plugins.js +2 -1
- package/LineChart/index.d.ts +1 -0
- package/LineChart/index.js +12 -0
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/PieChart/PieArc.d.ts +4 -0
- package/PieChart/PieArc.js +16 -11
- package/PieChart/PieArcPlot.js +28 -3
- package/PieChart/PieChart.js +1 -0
- package/PieChart/PieChart.plugins.d.ts +2 -1
- package/PieChart/PieChart.plugins.js +2 -1
- package/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/PieChart/dataTransform/useTransformData.js +9 -1
- package/PieChart/index.d.ts +1 -0
- package/PieChart/index.js +12 -0
- package/RadarChart/RadarChart.plugins.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
- package/RadarChart/index.d.ts +2 -1
- package/RadarChart/index.js +12 -0
- package/RadarChart/useRadarChartProps.d.ts +2 -2
- package/ScatterChart/BatchScatter.d.ts +32 -0
- package/ScatterChart/BatchScatter.js +171 -0
- package/ScatterChart/Scatter.js +13 -5
- package/ScatterChart/ScatterChart.d.ts +4 -4
- package/ScatterChart/ScatterChart.js +13 -2
- package/ScatterChart/ScatterChart.plugins.d.ts +4 -3
- package/ScatterChart/ScatterChart.plugins.js +3 -2
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +14 -2
- package/ScatterChart/index.d.ts +1 -0
- package/ScatterChart/index.js +12 -0
- package/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/ScatterChart/useScatterChartProps.js +8 -5
- package/SparkLineChart/SparkLineChart.js +10 -5
- package/Toolbar/Toolbar.js +1 -2
- package/colorPalettes/types.d.ts +1 -1
- package/context/ChartApi.d.ts +6 -6
- package/esm/BarChart/BarChart.d.ts +2 -2
- package/esm/BarChart/BarChart.js +1 -0
- package/esm/BarChart/BarChart.plugins.d.ts +3 -2
- package/esm/BarChart/BarChart.plugins.js +2 -1
- package/esm/BarChart/BarElement.js +10 -2
- package/esm/BarChart/index.d.ts +1 -0
- package/esm/BarChart/index.js +1 -0
- package/esm/BarChart/useBarChartProps.d.ts +2 -2
- package/esm/ChartContainer/ChartContainer.js +4 -2
- package/esm/ChartContainer/useChartContainerProps.js +4 -2
- package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.js +1 -0
- package/esm/ChartsSurface/ChartsSurface.js +23 -3
- package/esm/ChartsWrapper/ChartsWrapper.d.ts +2 -1
- package/esm/ChartsWrapper/ChartsWrapper.js +49 -46
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/LineChart/FocusedMark.d.ts +2 -0
- package/esm/LineChart/FocusedMark.js +38 -0
- package/esm/LineChart/LineChart.d.ts +2 -2
- package/esm/LineChart/LineChart.js +3 -1
- package/esm/LineChart/LineChart.plugins.d.ts +3 -2
- package/esm/LineChart/LineChart.plugins.js +2 -1
- package/esm/LineChart/index.d.ts +1 -0
- package/esm/LineChart/index.js +1 -0
- package/esm/LineChart/useLineChartProps.d.ts +2 -2
- package/esm/PieChart/PieArc.d.ts +4 -0
- package/esm/PieChart/PieArc.js +17 -12
- package/esm/PieChart/PieArcPlot.js +30 -5
- package/esm/PieChart/PieChart.js +1 -0
- package/esm/PieChart/PieChart.plugins.d.ts +2 -1
- package/esm/PieChart/PieChart.plugins.js +2 -1
- package/esm/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/esm/PieChart/dataTransform/useTransformData.js +9 -1
- package/esm/PieChart/index.d.ts +1 -0
- package/esm/PieChart/index.js +1 -0
- package/esm/RadarChart/RadarChart.plugins.d.ts +1 -1
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
- package/esm/RadarChart/index.d.ts +2 -1
- package/esm/RadarChart/index.js +2 -1
- package/esm/RadarChart/useRadarChartProps.d.ts +2 -2
- package/esm/ScatterChart/BatchScatter.d.ts +32 -0
- package/esm/ScatterChart/BatchScatter.js +165 -0
- package/esm/ScatterChart/Scatter.js +13 -5
- package/esm/ScatterChart/ScatterChart.d.ts +4 -4
- package/esm/ScatterChart/ScatterChart.js +13 -2
- package/esm/ScatterChart/ScatterChart.plugins.d.ts +4 -3
- package/esm/ScatterChart/ScatterChart.plugins.js +3 -2
- package/esm/ScatterChart/ScatterPlot.d.ts +10 -0
- package/esm/ScatterChart/ScatterPlot.js +14 -2
- package/esm/ScatterChart/index.d.ts +1 -0
- package/esm/ScatterChart/index.js +1 -0
- package/esm/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/esm/ScatterChart/useScatterChartProps.js +8 -5
- package/esm/SparkLineChart/SparkLineChart.js +10 -5
- package/esm/Toolbar/Toolbar.js +1 -2
- package/esm/colorPalettes/types.d.ts +1 -1
- package/esm/context/ChartApi.d.ts +6 -6
- package/esm/hooks/useAxis.d.ts +5 -5
- package/esm/hooks/useDrawingArea.d.ts +20 -2
- package/esm/hooks/useFocusedItem.d.ts +15 -0
- package/esm/hooks/useFocusedItem.js +20 -0
- package/esm/hooks/useIsItemFocused.d.ts +12 -0
- package/esm/hooks/useIsItemFocused.js +15 -0
- package/esm/hooks/useIsItemFocusedGetter.d.ts +8 -0
- package/esm/hooks/useIsItemFocusedGetter.js +14 -0
- package/esm/hooks/useScale.js +6 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/internals/animation/Transition.js +1 -3
- package/esm/internals/index.d.ts +3 -2
- package/esm/internals/index.js +3 -2
- package/esm/internals/plugins/allPlugins.d.ts +5 -4
- package/esm/internals/plugins/allPlugins.js +3 -2
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +60 -32
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +66 -72
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +121 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +49 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +41 -21
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +9 -7
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +3 -0
- package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
- package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +32 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +6 -4
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +2 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +88 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +170 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +33 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
- package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/esm/internals/scaleGuards.d.ts +7 -0
- package/esm/internals/scaleGuards.js +6 -0
- package/esm/internals/ticks.d.ts +3 -5
- package/esm/internals/ticks.js +6 -5
- package/esm/locales/elGR.d.ts +96 -0
- package/esm/locales/elGR.js +100 -0
- package/esm/locales/enUS.d.ts +96 -0
- package/esm/locales/enUS.js +99 -1
- package/esm/locales/frFR.d.ts +96 -0
- package/esm/locales/frFR.js +100 -2
- package/esm/locales/ptBR.d.ts +96 -0
- package/esm/locales/ptBR.js +100 -0
- package/esm/locales/ptPT.d.ts +96 -0
- package/esm/locales/ptPT.js +100 -0
- package/esm/locales/svSE.d.ts +97 -1
- package/esm/locales/svSE.js +100 -0
- package/esm/locales/utils/chartsLocaleTextApi.d.ts +384 -0
- package/esm/locales/utils/getChartsLocalization.d.ts +96 -0
- package/esm/plugins/index.d.ts +6 -0
- package/esm/plugins/index.js +12 -0
- package/hooks/useAxis.d.ts +5 -5
- package/hooks/useDrawingArea.d.ts +20 -2
- package/hooks/useFocusedItem.d.ts +15 -0
- package/hooks/useFocusedItem.js +26 -0
- package/hooks/useIsItemFocused.d.ts +12 -0
- package/hooks/useIsItemFocused.js +20 -0
- package/hooks/useIsItemFocusedGetter.d.ts +8 -0
- package/hooks/useIsItemFocusedGetter.js +18 -0
- package/hooks/useScale.js +6 -0
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/internals/animation/Transition.js +0 -2
- package/internals/index.d.ts +3 -2
- package/internals/index.js +20 -8
- package/internals/plugins/allPlugins.d.ts +5 -4
- package/internals/plugins/allPlugins.js +3 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +59 -31
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -69
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +131 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +49 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +42 -22
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
- package/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
- package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +11 -9
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +9 -0
- package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +41 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +6 -1
- package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +9 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +6 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +3 -2
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +96 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +178 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +39 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
- package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/internals/scaleGuards.d.ts +7 -0
- package/internals/scaleGuards.js +8 -0
- package/internals/ticks.d.ts +3 -5
- package/internals/ticks.js +7 -5
- package/locales/elGR.d.ts +96 -0
- package/locales/elGR.js +100 -0
- package/locales/enUS.d.ts +96 -0
- package/locales/enUS.js +99 -1
- package/locales/frFR.d.ts +96 -0
- package/locales/frFR.js +100 -2
- package/locales/ptBR.d.ts +96 -0
- package/locales/ptBR.js +100 -0
- package/locales/ptPT.d.ts +96 -0
- package/locales/ptPT.js +100 -0
- package/locales/svSE.d.ts +97 -1
- package/locales/svSE.js +100 -0
- package/locales/utils/chartsLocaleTextApi.d.ts +384 -0
- package/locales/utils/getChartsLocalization.d.ts +96 -0
- package/package.json +5 -5
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +47 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -22
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -2
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -29
- package/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -27
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -9
- /package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
- /package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
package/colorPalettes/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type ChartsColorPaletteCallback = (mode: 'light' | 'dark') => string[];
|
|
2
|
-
export type ChartsColorPalette = string[] | ChartsColorPaletteCallback;
|
|
2
|
+
export type ChartsColorPalette = readonly string[] | ChartsColorPaletteCallback;
|
|
3
3
|
export type ChartsColorCallback = (mode: 'light' | 'dark') => string;
|
|
4
4
|
export type ChartsColor = string | ChartsColorCallback;
|
package/context/ChartApi.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
import type { BarChartPluginSignatures } from "../BarChart/BarChart.plugins.js";
|
|
3
|
+
import type { ScatterChartPluginSignatures } from "../ScatterChart/ScatterChart.plugins.js";
|
|
4
|
+
import type { LineChartPluginSignatures } from "../LineChart/LineChart.plugins.js";
|
|
5
5
|
import type { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
6
|
import type { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
|
|
7
7
|
import type { ChartPublicAPI } from "../internals/plugins/models/index.js";
|
|
8
8
|
export type PluginsPerSeriesType = {
|
|
9
|
-
line:
|
|
10
|
-
scatter:
|
|
11
|
-
bar:
|
|
9
|
+
line: LineChartPluginSignatures;
|
|
10
|
+
scatter: ScatterChartPluginSignatures;
|
|
11
|
+
bar: BarChartPluginSignatures;
|
|
12
12
|
pie: PieChartPluginSignatures;
|
|
13
13
|
composition: DefaultPluginSignatures;
|
|
14
14
|
};
|
|
@@ -12,11 +12,11 @@ import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
|
12
12
|
import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
|
|
13
13
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
14
14
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
|
|
15
|
-
import {
|
|
15
|
+
import { BarChartPluginSignatures } from "./BarChart.plugins.js";
|
|
16
16
|
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
17
17
|
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
18
18
|
export type BarSeries = MakeOptional<BarSeriesType, 'type'>;
|
|
19
|
-
export interface BarChartProps extends Omit<ChartContainerProps<'bar',
|
|
19
|
+
export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
20
20
|
/**
|
|
21
21
|
* The series to display in the bar chart.
|
|
22
22
|
* An array of [[BarSeries]] objects.
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -2,6 +2,7 @@ import { UseChartZAxisSignature } from "../internals/plugins/featurePlugins/useC
|
|
|
2
2
|
import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
3
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
+
import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
5
6
|
import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
6
|
-
export type
|
|
7
|
-
export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<
|
|
7
|
+
export type BarChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
|
|
8
|
+
export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPluginSignatures>;
|
|
@@ -2,4 +2,5 @@ import { useChartZAxis } from "../internals/plugins/featurePlugins/useChartZAxis
|
|
|
2
2
|
import { useChartCartesianAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
3
|
import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
-
|
|
5
|
+
import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
6
|
+
export const BAR_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation];
|
|
@@ -10,6 +10,7 @@ import { useUtilityClasses } from "./barElementClasses.js";
|
|
|
10
10
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
11
11
|
import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
|
|
12
12
|
import { AnimatedBarElement } from "./AnimatedBarElement.js";
|
|
13
|
+
import { useIsItemFocused } from "../hooks/useIsItemFocused.js";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
function BarElement(props) {
|
|
15
16
|
const {
|
|
@@ -43,13 +44,19 @@ function BarElement(props) {
|
|
|
43
44
|
seriesId: id,
|
|
44
45
|
dataIndex
|
|
45
46
|
});
|
|
47
|
+
const isFocused = useIsItemFocused({
|
|
48
|
+
seriesType: 'bar',
|
|
49
|
+
seriesId: id,
|
|
50
|
+
dataIndex
|
|
51
|
+
});
|
|
46
52
|
const ownerState = {
|
|
47
53
|
id,
|
|
48
54
|
dataIndex,
|
|
49
55
|
classes: innerClasses,
|
|
50
56
|
color,
|
|
51
57
|
isFaded,
|
|
52
|
-
isHighlighted
|
|
58
|
+
isHighlighted,
|
|
59
|
+
isFocused
|
|
53
60
|
};
|
|
54
61
|
const classes = useUtilityClasses(ownerState);
|
|
55
62
|
const Bar = slots?.bar ?? AnimatedBarElement;
|
|
@@ -73,7 +80,8 @@ function BarElement(props) {
|
|
|
73
80
|
stroke: 'none',
|
|
74
81
|
fill: color,
|
|
75
82
|
skipAnimation,
|
|
76
|
-
layout
|
|
83
|
+
layout,
|
|
84
|
+
'data-focused': isFocused || undefined
|
|
77
85
|
}),
|
|
78
86
|
className: classes.root,
|
|
79
87
|
ownerState
|
package/esm/BarChart/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./BarPlot.js";
|
|
|
3
3
|
export * from "./BarElement.js";
|
|
4
4
|
export * from "./BarLabel/index.js";
|
|
5
5
|
export * from "./barElementClasses.js";
|
|
6
|
+
export * from "./BarChart.plugins.js";
|
|
6
7
|
export { type BarProps } from "./AnimatedBarElement.js";
|
|
7
8
|
export { barClasses, getBarUtilityClass } from "./barClasses.js";
|
|
8
9
|
export type { BarClassKey, BarClasses } from "./barClasses.js";
|
package/esm/BarChart/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
|
9
9
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
10
10
|
import { ChartsLegendSlotExtension } from "../ChartsLegend/index.js";
|
|
11
11
|
import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { BarChartPluginSignatures } from "./BarChart.plugins.js";
|
|
13
13
|
/**
|
|
14
14
|
* A helper function that extracts BarChartProps from the input props
|
|
15
15
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -19,7 +19,7 @@ import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const useBarChartProps: (props: BarChartProps) => {
|
|
21
21
|
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
22
|
-
chartContainerProps: ChartContainerProps<"bar",
|
|
22
|
+
chartContainerProps: ChartContainerProps<"bar", BarChartPluginSignatures>;
|
|
23
23
|
barPlotProps: BarPlotProps;
|
|
24
24
|
gridProps: ChartsGridProps;
|
|
25
25
|
clipPathProps: ChartsClipPathProps;
|
|
@@ -76,6 +76,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
76
76
|
* If true, the voronoi interaction are ignored.
|
|
77
77
|
*/
|
|
78
78
|
disableVoronoi: PropTypes.bool,
|
|
79
|
+
enableKeyboardNavigation: PropTypes.bool,
|
|
79
80
|
/**
|
|
80
81
|
* Options to enable features planned for the next major.
|
|
81
82
|
*/
|
|
@@ -658,10 +659,11 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
658
659
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
659
660
|
title: PropTypes.string,
|
|
660
661
|
/**
|
|
661
|
-
* Defines the
|
|
662
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
663
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
662
664
|
* If `undefined`, the radius is assumed to be infinite.
|
|
663
665
|
*/
|
|
664
|
-
voronoiMaxRadius: PropTypes.number,
|
|
666
|
+
voronoiMaxRadius: PropTypes.oneOfType([PropTypes.oneOf(['item']), PropTypes.number]),
|
|
665
667
|
/**
|
|
666
668
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
667
669
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures"];
|
|
5
|
+
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures", "enableKeyboardNavigation"];
|
|
6
6
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
7
7
|
export const useChartContainerProps = (props, ref) => {
|
|
8
8
|
const _ref = props,
|
|
@@ -37,7 +37,8 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
37
37
|
localeText,
|
|
38
38
|
slots,
|
|
39
39
|
slotProps,
|
|
40
|
-
experimentalFeatures
|
|
40
|
+
experimentalFeatures,
|
|
41
|
+
enableKeyboardNavigation
|
|
41
42
|
} = _ref,
|
|
42
43
|
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
44
|
const chartsSurfaceProps = _extends({
|
|
@@ -71,6 +72,7 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
71
72
|
localeText,
|
|
72
73
|
seriesConfig,
|
|
73
74
|
experimentalFeatures,
|
|
75
|
+
enableKeyboardNavigation,
|
|
74
76
|
plugins: plugins ?? DEFAULT_PLUGINS,
|
|
75
77
|
slots,
|
|
76
78
|
slotProps
|
|
@@ -66,6 +66,7 @@ const RootElement = styled('ul', {
|
|
|
66
66
|
paddingInlineStart: 0,
|
|
67
67
|
marginBlock: theme.spacing(1),
|
|
68
68
|
marginInline: theme.spacing(1),
|
|
69
|
+
gridArea: 'legend',
|
|
69
70
|
[`&.${continuousColorLegendClasses.horizontal}`]: {
|
|
70
71
|
gridTemplateRows: 'min-content min-content',
|
|
71
72
|
gridTemplateColumns: 'min-content auto min-content',
|
|
@@ -12,12 +12,14 @@ import { useSvgRef } from "../hooks/useSvgRef.js";
|
|
|
12
12
|
import { useSelector } from "../internals/store/useSelector.js";
|
|
13
13
|
import { useStore } from "../internals/store/useStore.js";
|
|
14
14
|
import { selectorChartContainerSize, selectorChartPropsSize } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js";
|
|
15
|
+
import { selectorChartsHasFocusedItem, selectorChartsIsKeyboardNavigationEnabled } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
const ChartsSurfaceStyles = styled('svg', {
|
|
17
18
|
name: 'MuiChartsSurface',
|
|
18
19
|
slot: 'Root'
|
|
19
20
|
})(({
|
|
20
|
-
ownerState
|
|
21
|
+
ownerState,
|
|
22
|
+
theme
|
|
21
23
|
}) => ({
|
|
22
24
|
width: ownerState.width ?? '100%',
|
|
23
25
|
height: ownerState.height ?? '100%',
|
|
@@ -31,7 +33,21 @@ const ChartsSurfaceStyles = styled('svg', {
|
|
|
31
33
|
// For example, prevent page scroll & zoom.
|
|
32
34
|
touchAction: 'pan-y',
|
|
33
35
|
userSelect: 'none',
|
|
34
|
-
gridArea: 'chart'
|
|
36
|
+
gridArea: 'chart',
|
|
37
|
+
'&:focus': {
|
|
38
|
+
outline: 'none' // By default don't show focus on the SVG container
|
|
39
|
+
},
|
|
40
|
+
'&:focus-visible': {
|
|
41
|
+
// Show focus outline on the SVG container only when using keyboard navigation
|
|
42
|
+
outline: `${(theme.vars ?? theme).palette.text.primary} solid 2px`,
|
|
43
|
+
'&[data-has-focused-item=true]': {
|
|
44
|
+
// But not if the chart has a focused children item
|
|
45
|
+
outline: 'none'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
'& [data-focused=true]': {
|
|
49
|
+
outline: `${(theme.vars ?? theme).palette.text.primary} solid 2px`
|
|
50
|
+
}
|
|
35
51
|
}));
|
|
36
52
|
|
|
37
53
|
/**
|
|
@@ -58,6 +74,8 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
58
74
|
width: propsWidth,
|
|
59
75
|
height: propsHeight
|
|
60
76
|
} = useSelector(store, selectorChartPropsSize);
|
|
77
|
+
const isKeyboardNavigationEnabled = useSelector(store, selectorChartsIsKeyboardNavigationEnabled);
|
|
78
|
+
const hasFocusedItem = useSelector(store, selectorChartsHasFocusedItem);
|
|
61
79
|
const svgRef = useSvgRef();
|
|
62
80
|
const handleRef = useForkRef(svgRef, ref);
|
|
63
81
|
const themeProps = useThemeProps({
|
|
@@ -78,7 +96,9 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
78
96
|
height: propsHeight
|
|
79
97
|
},
|
|
80
98
|
viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
|
|
81
|
-
className: className
|
|
99
|
+
className: className,
|
|
100
|
+
tabIndex: isKeyboardNavigationEnabled ? 0 : undefined,
|
|
101
|
+
"data-has-focused-item": hasFocusedItem || undefined
|
|
82
102
|
}, other, {
|
|
83
103
|
ref: handleRef,
|
|
84
104
|
children: [title && /*#__PURE__*/_jsx("title", {
|
|
@@ -15,8 +15,9 @@ export interface ChartsWrapperProps {
|
|
|
15
15
|
legendDirection?: Direction;
|
|
16
16
|
/**
|
|
17
17
|
* If `true`, the legend is not rendered.
|
|
18
|
+
* @default false
|
|
18
19
|
*/
|
|
19
|
-
hideLegend
|
|
20
|
+
hideLegend?: boolean;
|
|
20
21
|
/**
|
|
21
22
|
* If `true`, the chart wrapper set `height: 100%`.
|
|
22
23
|
* @default `false` if the `height` prop is set. And `true` otherwise.
|
|
@@ -26,10 +26,6 @@ const getAlignItems = position => {
|
|
|
26
26
|
}
|
|
27
27
|
return 'center';
|
|
28
28
|
};
|
|
29
|
-
const addToolbar = template => {
|
|
30
|
-
return `"toolbar"
|
|
31
|
-
${template}`;
|
|
32
|
-
};
|
|
33
29
|
const getGridTemplateAreas = (hideLegend, direction, position) => {
|
|
34
30
|
if (hideLegend) {
|
|
35
31
|
return `"chart"`;
|
|
@@ -47,26 +43,25 @@ const getGridTemplateAreas = (hideLegend, direction, position) => {
|
|
|
47
43
|
return `"legend"
|
|
48
44
|
"chart"`;
|
|
49
45
|
};
|
|
50
|
-
const getTemplateColumns = (hideLegend, direction,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
return `${width ? 'auto' : '1fr'} auto`;
|
|
46
|
+
const getTemplateColumns = (hideLegend = false, direction = 'horizontal', horizontalPosition = 'end', width = undefined) => {
|
|
47
|
+
const drawingAreaColumn = width ? 'auto' : '1fr';
|
|
48
|
+
if (direction === 'horizontal') {
|
|
49
|
+
return drawingAreaColumn;
|
|
50
|
+
}
|
|
51
|
+
if (hideLegend) {
|
|
52
|
+
return drawingAreaColumn;
|
|
59
53
|
}
|
|
60
|
-
return '
|
|
54
|
+
return horizontalPosition === 'start' ? `auto ${drawingAreaColumn}` : `${drawingAreaColumn} auto`;
|
|
61
55
|
};
|
|
62
|
-
const getTemplateRows = (hideLegend, direction) => {
|
|
56
|
+
const getTemplateRows = (hideLegend = false, direction = 'horizontal', verticalPosition = 'top') => {
|
|
57
|
+
const drawingAreaRow = '1fr';
|
|
63
58
|
if (direction === 'vertical') {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return
|
|
59
|
+
return drawingAreaRow;
|
|
60
|
+
}
|
|
61
|
+
if (hideLegend) {
|
|
62
|
+
return drawingAreaRow;
|
|
68
63
|
}
|
|
69
|
-
return 'auto
|
|
64
|
+
return verticalPosition === 'bottom' ? `${drawingAreaRow} auto` : `auto ${drawingAreaRow}`;
|
|
70
65
|
};
|
|
71
66
|
const Root = styled('div', {
|
|
72
67
|
name: 'MuiChartsWrapper',
|
|
@@ -75,32 +70,39 @@ const Root = styled('div', {
|
|
|
75
70
|
})(({
|
|
76
71
|
ownerState,
|
|
77
72
|
width
|
|
78
|
-
}) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
}) => {
|
|
74
|
+
const gridTemplateColumns = getTemplateColumns(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.horizontal, width);
|
|
75
|
+
const gridTemplateRows = getTemplateRows(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.vertical);
|
|
76
|
+
const gridTemplateAreas = getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition);
|
|
77
|
+
return {
|
|
78
|
+
variants: [{
|
|
79
|
+
props: {
|
|
80
|
+
extendVertically: true
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
height: '100%'
|
|
84
|
+
}
|
|
85
|
+
}],
|
|
86
|
+
flex: 1,
|
|
87
|
+
display: 'grid',
|
|
88
|
+
gridTemplateColumns,
|
|
89
|
+
gridTemplateRows,
|
|
90
|
+
gridTemplateAreas,
|
|
91
|
+
[`&:has(.${chartsToolbarClasses.root})`]: {
|
|
92
|
+
// Add a row for toolbar if there is one.
|
|
93
|
+
gridTemplateRows: `auto ${gridTemplateRows}`,
|
|
94
|
+
gridTemplateAreas: `"${gridTemplateColumns.split(' ').map(() => 'toolbar').join(' ')}"
|
|
95
|
+
${gridTemplateAreas}`
|
|
82
96
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
gridTemplateAreas: addToolbar(getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition))
|
|
93
|
-
},
|
|
94
|
-
[`&:not(:has(.${chartsToolbarClasses.root}))`]: {
|
|
95
|
-
gridTemplateAreas: getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition)
|
|
96
|
-
},
|
|
97
|
-
justifyContent: 'center',
|
|
98
|
-
justifyItems: getJustifyItems(ownerState.legendPosition),
|
|
99
|
-
alignItems: getAlignItems(ownerState.legendPosition),
|
|
100
|
-
[`& > .${chartsToolbarClasses.root}`]: {
|
|
101
|
-
justifySelf: 'center'
|
|
102
|
-
}
|
|
103
|
-
}));
|
|
97
|
+
[`& .${chartsToolbarClasses.root}`]: {
|
|
98
|
+
gridArea: 'toolbar',
|
|
99
|
+
justifySelf: 'center'
|
|
100
|
+
},
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
justifyItems: getJustifyItems(ownerState.legendPosition),
|
|
103
|
+
alignItems: getAlignItems(ownerState.legendPosition)
|
|
104
|
+
};
|
|
105
|
+
});
|
|
104
106
|
|
|
105
107
|
/**
|
|
106
108
|
* Wrapper for the charts components.
|
|
@@ -140,8 +142,9 @@ process.env.NODE_ENV !== "production" ? ChartsWrapper.propTypes = {
|
|
|
140
142
|
extendVertically: PropTypes.bool,
|
|
141
143
|
/**
|
|
142
144
|
* If `true`, the legend is not rendered.
|
|
145
|
+
* @default false
|
|
143
146
|
*/
|
|
144
|
-
hideLegend: PropTypes.bool
|
|
147
|
+
hideLegend: PropTypes.bool,
|
|
145
148
|
/**
|
|
146
149
|
* The direction of the legend.
|
|
147
150
|
* @default 'horizontal'
|
|
@@ -3685,9 +3685,11 @@ export declare function useAxisTicksProps(inProps: ChartsXAxisProps): {
|
|
|
3685
3685
|
x?: number | string | undefined | undefined;
|
|
3686
3686
|
y?: number | string | undefined | undefined;
|
|
3687
3687
|
radius?: number | string | undefined | undefined;
|
|
3688
|
+
href?: string | undefined | undefined;
|
|
3688
3689
|
media?: string | undefined | undefined;
|
|
3689
|
-
method?: string | undefined | undefined;
|
|
3690
3690
|
target?: string | undefined | undefined;
|
|
3691
|
+
from?: number | string | undefined | undefined;
|
|
3692
|
+
method?: string | undefined | undefined;
|
|
3691
3693
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
3692
3694
|
accentHeight?: number | string | undefined | undefined;
|
|
3693
3695
|
accumulate?: "none" | "sum" | undefined | undefined;
|
|
@@ -3731,7 +3733,6 @@ export declare function useAxisTicksProps(inProps: ChartsXAxisProps): {
|
|
|
3731
3733
|
focusable?: "auto" | (boolean | "true" | "false") | undefined;
|
|
3732
3734
|
format?: number | string | undefined | undefined;
|
|
3733
3735
|
fr?: number | string | undefined | undefined;
|
|
3734
|
-
from?: number | string | undefined | undefined;
|
|
3735
3736
|
fx?: number | string | undefined | undefined;
|
|
3736
3737
|
fy?: number | string | undefined | undefined;
|
|
3737
3738
|
g1?: number | string | undefined | undefined;
|
|
@@ -3744,7 +3745,6 @@ export declare function useAxisTicksProps(inProps: ChartsXAxisProps): {
|
|
|
3744
3745
|
hanging?: number | string | undefined | undefined;
|
|
3745
3746
|
horizAdvX?: number | string | undefined | undefined;
|
|
3746
3747
|
horizOriginX?: number | string | undefined | undefined;
|
|
3747
|
-
href?: string | undefined | undefined;
|
|
3748
3748
|
ideographic?: number | string | undefined | undefined;
|
|
3749
3749
|
in2?: number | string | undefined | undefined;
|
|
3750
3750
|
in?: string | undefined | undefined;
|
|
@@ -3604,9 +3604,11 @@ export declare function useAxisTicksProps(inProps: ChartsYAxisProps): {
|
|
|
3604
3604
|
x?: number | string | undefined | undefined;
|
|
3605
3605
|
y?: number | string | undefined | undefined;
|
|
3606
3606
|
radius?: number | string | undefined | undefined;
|
|
3607
|
+
href?: string | undefined | undefined;
|
|
3607
3608
|
media?: string | undefined | undefined;
|
|
3608
|
-
method?: string | undefined | undefined;
|
|
3609
3609
|
target?: string | undefined | undefined;
|
|
3610
|
+
from?: number | string | undefined | undefined;
|
|
3611
|
+
method?: string | undefined | undefined;
|
|
3610
3612
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
3611
3613
|
accentHeight?: number | string | undefined | undefined;
|
|
3612
3614
|
accumulate?: "none" | "sum" | undefined | undefined;
|
|
@@ -3650,7 +3652,6 @@ export declare function useAxisTicksProps(inProps: ChartsYAxisProps): {
|
|
|
3650
3652
|
focusable?: "auto" | (boolean | "true" | "false") | undefined;
|
|
3651
3653
|
format?: number | string | undefined | undefined;
|
|
3652
3654
|
fr?: number | string | undefined | undefined;
|
|
3653
|
-
from?: number | string | undefined | undefined;
|
|
3654
3655
|
fx?: number | string | undefined | undefined;
|
|
3655
3656
|
fy?: number | string | undefined | undefined;
|
|
3656
3657
|
g1?: number | string | undefined | undefined;
|
|
@@ -3663,7 +3664,6 @@ export declare function useAxisTicksProps(inProps: ChartsYAxisProps): {
|
|
|
3663
3664
|
hanging?: number | string | undefined | undefined;
|
|
3664
3665
|
horizAdvX?: number | string | undefined | undefined;
|
|
3665
3666
|
horizOriginX?: number | string | undefined | undefined;
|
|
3666
|
-
href?: string | undefined | undefined;
|
|
3667
3667
|
ideographic?: number | string | undefined | undefined;
|
|
3668
3668
|
in2?: number | string | undefined | undefined;
|
|
3669
3669
|
in?: string | undefined | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useTheme } from '@mui/material/styles';
|
|
5
|
+
import { useFocusedItem } from "../hooks/useFocusedItem.js";
|
|
6
|
+
import { useLineSeriesContext, useXAxes, useYAxes } from "../hooks/index.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const RADIUS = 6;
|
|
9
|
+
export function FocusedMark() {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const focusedItem = useFocusedItem();
|
|
12
|
+
const lineSeries = useLineSeriesContext();
|
|
13
|
+
const {
|
|
14
|
+
xAxis,
|
|
15
|
+
xAxisIds
|
|
16
|
+
} = useXAxes();
|
|
17
|
+
const {
|
|
18
|
+
yAxis,
|
|
19
|
+
yAxisIds
|
|
20
|
+
} = useYAxes();
|
|
21
|
+
if (focusedItem === null || focusedItem.seriesType !== 'line' || !lineSeries) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const series = lineSeries?.series[focusedItem.seriesId];
|
|
25
|
+
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
26
|
+
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
27
|
+
return /*#__PURE__*/_jsx("rect", {
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
30
|
+
strokeWidth: 2,
|
|
31
|
+
x: xAxis[xAxisId].scale(xAxis[xAxisId].data[focusedItem.dataIndex]) - RADIUS,
|
|
32
|
+
y: yAxis[yAxisId].scale(series.stackedData[focusedItem.dataIndex][1]) - RADIUS,
|
|
33
|
+
width: 2 * RADIUS,
|
|
34
|
+
height: 2 * RADIUS,
|
|
35
|
+
rx: 3,
|
|
36
|
+
ry: 3
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -14,12 +14,12 @@ import { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
|
|
|
14
14
|
import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from "./LineHighlightPlot.js";
|
|
15
15
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
16
16
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/index.js";
|
|
17
|
-
import {
|
|
17
|
+
import { LineChartPluginSignatures } from "./LineChart.plugins.js";
|
|
18
18
|
import { ChartsToolbarSlots, ChartsToolbarSlotProps } from "../Toolbar/index.js";
|
|
19
19
|
export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
20
20
|
export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
21
21
|
export type LineSeries = MakeOptional<LineSeriesType, 'type'>;
|
|
22
|
-
export interface LineChartProps extends Omit<ChartContainerProps<'line',
|
|
22
|
+
export interface LineChartProps extends Omit<ChartContainerProps<'line', LineChartPluginSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
23
23
|
/**
|
|
24
24
|
* The series to display in the line chart.
|
|
25
25
|
* An array of [[LineSeries]] objects.
|
|
@@ -20,6 +20,7 @@ import { useChartContainerProps } from "../ChartContainer/useChartContainerProps
|
|
|
20
20
|
import { ChartDataProvider } from "../ChartDataProvider/index.js";
|
|
21
21
|
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
22
22
|
import { ChartsWrapper } from "../ChartsWrapper/index.js";
|
|
23
|
+
import { FocusedMark } from "./FocusedMark.js";
|
|
23
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
25
|
/**
|
|
25
26
|
* Demos:
|
|
@@ -63,7 +64,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(inProps, ref)
|
|
|
63
64
|
children: [props.showToolbar && Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
64
65
|
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
65
66
|
children: [/*#__PURE__*/_jsx(AreaPlot, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlot, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
66
|
-
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
|
|
67
|
+
})), /*#__PURE__*/_jsx(FocusedMark, {}), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
|
|
67
68
|
"data-drawing-container": true,
|
|
68
69
|
children: /*#__PURE__*/_jsx(MarkPlot, _extends({}, markPlotProps))
|
|
69
70
|
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
@@ -111,6 +112,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
111
112
|
* If `true`, render the line highlight item.
|
|
112
113
|
*/
|
|
113
114
|
disableLineItemHighlight: PropTypes.bool,
|
|
115
|
+
enableKeyboardNavigation: PropTypes.bool,
|
|
114
116
|
/**
|
|
115
117
|
* Options to enable features planned for the next major.
|
|
116
118
|
*/
|
|
@@ -2,6 +2,7 @@ import { UseChartZAxisSignature } from "../internals/plugins/featurePlugins/useC
|
|
|
2
2
|
import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
3
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
+
import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
5
6
|
import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
6
|
-
export type
|
|
7
|
-
export declare const LINE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<
|
|
7
|
+
export type LineChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
|
|
8
|
+
export declare const LINE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<LineChartPluginSignatures>;
|
|
@@ -2,4 +2,5 @@ import { useChartZAxis } from "../internals/plugins/featurePlugins/useChartZAxis
|
|
|
2
2
|
import { useChartCartesianAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
3
|
import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
-
|
|
5
|
+
import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
6
|
+
export const LINE_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation];
|
package/esm/LineChart/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export * from "./LineElement.js";
|
|
|
9
9
|
export * from "./AnimatedLine.js";
|
|
10
10
|
export * from "./MarkElement.js";
|
|
11
11
|
export * from "./LineHighlightElement.js";
|
|
12
|
+
export * from "./LineChart.plugins.js";
|
|
12
13
|
export type { MarkElementClasses, MarkElementClassKey } from "./markElementClasses.js";
|
|
13
14
|
export { getMarkElementUtilityClass, markElementClasses } from "./markElementClasses.js";
|
package/esm/LineChart/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export * from "./LineElement.js";
|
|
|
9
9
|
export * from "./AnimatedLine.js";
|
|
10
10
|
export * from "./MarkElement.js";
|
|
11
11
|
export * from "./LineHighlightElement.js";
|
|
12
|
+
export * from "./LineChart.plugins.js";
|
|
12
13
|
export { getMarkElementUtilityClass, markElementClasses } from "./markElementClasses.js";
|
|
@@ -12,7 +12,7 @@ import { LineHighlightPlotProps } from "./LineHighlightPlot.js";
|
|
|
12
12
|
import { LinePlotProps } from "./LinePlot.js";
|
|
13
13
|
import { MarkPlotProps } from "./MarkPlot.js";
|
|
14
14
|
import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
15
|
-
import {
|
|
15
|
+
import { LineChartPluginSignatures } from "./LineChart.plugins.js";
|
|
16
16
|
/**
|
|
17
17
|
* A helper function that extracts LineChartProps from the input props
|
|
18
18
|
* and returns an object with props for the children components of LineChart.
|
|
@@ -22,7 +22,7 @@ import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const useLineChartProps: (props: LineChartProps) => {
|
|
24
24
|
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
25
|
-
chartContainerProps: ChartContainerProps<"line",
|
|
25
|
+
chartContainerProps: ChartContainerProps<"line", LineChartPluginSignatures>;
|
|
26
26
|
gridProps: ChartsGridProps;
|
|
27
27
|
clipPathProps: ChartsClipPathProps;
|
|
28
28
|
clipPathGroupProps: {
|
package/esm/PieChart/PieArc.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface PieArcClasses {
|
|
|
12
12
|
* Needs to be suffixed with the series ID: `.${pieArcClasses.series}-${seriesId}`.
|
|
13
13
|
*/
|
|
14
14
|
series: string;
|
|
15
|
+
/** Styles applied to the focus indicator element. */
|
|
16
|
+
focusIndicator: string;
|
|
15
17
|
}
|
|
16
18
|
export type PieArcClassKey = keyof PieArcClasses;
|
|
17
19
|
interface PieArcOwnerState {
|
|
@@ -20,6 +22,8 @@ interface PieArcOwnerState {
|
|
|
20
22
|
color: string;
|
|
21
23
|
isFaded: boolean;
|
|
22
24
|
isHighlighted: boolean;
|
|
25
|
+
isFocused: boolean;
|
|
26
|
+
stroke?: string;
|
|
23
27
|
classes?: Partial<PieArcClasses>;
|
|
24
28
|
}
|
|
25
29
|
export declare function getPieArcUtilityClass(slot: string): string;
|