@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
|
@@ -34,10 +34,6 @@ const getAlignItems = position => {
|
|
|
34
34
|
}
|
|
35
35
|
return 'center';
|
|
36
36
|
};
|
|
37
|
-
const addToolbar = template => {
|
|
38
|
-
return `"toolbar"
|
|
39
|
-
${template}`;
|
|
40
|
-
};
|
|
41
37
|
const getGridTemplateAreas = (hideLegend, direction, position) => {
|
|
42
38
|
if (hideLegend) {
|
|
43
39
|
return `"chart"`;
|
|
@@ -55,26 +51,25 @@ const getGridTemplateAreas = (hideLegend, direction, position) => {
|
|
|
55
51
|
return `"legend"
|
|
56
52
|
"chart"`;
|
|
57
53
|
};
|
|
58
|
-
const getTemplateColumns = (hideLegend, direction,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
return `${width ? 'auto' : '1fr'} auto`;
|
|
54
|
+
const getTemplateColumns = (hideLegend = false, direction = 'horizontal', horizontalPosition = 'end', width = undefined) => {
|
|
55
|
+
const drawingAreaColumn = width ? 'auto' : '1fr';
|
|
56
|
+
if (direction === 'horizontal') {
|
|
57
|
+
return drawingAreaColumn;
|
|
58
|
+
}
|
|
59
|
+
if (hideLegend) {
|
|
60
|
+
return drawingAreaColumn;
|
|
67
61
|
}
|
|
68
|
-
return '
|
|
62
|
+
return horizontalPosition === 'start' ? `auto ${drawingAreaColumn}` : `${drawingAreaColumn} auto`;
|
|
69
63
|
};
|
|
70
|
-
const getTemplateRows = (hideLegend, direction) => {
|
|
64
|
+
const getTemplateRows = (hideLegend = false, direction = 'horizontal', verticalPosition = 'top') => {
|
|
65
|
+
const drawingAreaRow = '1fr';
|
|
71
66
|
if (direction === 'vertical') {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return
|
|
67
|
+
return drawingAreaRow;
|
|
68
|
+
}
|
|
69
|
+
if (hideLegend) {
|
|
70
|
+
return drawingAreaRow;
|
|
76
71
|
}
|
|
77
|
-
return 'auto
|
|
72
|
+
return verticalPosition === 'bottom' ? `${drawingAreaRow} auto` : `auto ${drawingAreaRow}`;
|
|
78
73
|
};
|
|
79
74
|
const Root = (0, _styles.styled)('div', {
|
|
80
75
|
name: 'MuiChartsWrapper',
|
|
@@ -83,32 +78,39 @@ const Root = (0, _styles.styled)('div', {
|
|
|
83
78
|
})(({
|
|
84
79
|
ownerState,
|
|
85
80
|
width
|
|
86
|
-
}) =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
}) => {
|
|
82
|
+
const gridTemplateColumns = getTemplateColumns(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.horizontal, width);
|
|
83
|
+
const gridTemplateRows = getTemplateRows(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition?.vertical);
|
|
84
|
+
const gridTemplateAreas = getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition);
|
|
85
|
+
return {
|
|
86
|
+
variants: [{
|
|
87
|
+
props: {
|
|
88
|
+
extendVertically: true
|
|
89
|
+
},
|
|
90
|
+
style: {
|
|
91
|
+
height: '100%'
|
|
92
|
+
}
|
|
93
|
+
}],
|
|
94
|
+
flex: 1,
|
|
95
|
+
display: 'grid',
|
|
96
|
+
gridTemplateColumns,
|
|
97
|
+
gridTemplateRows,
|
|
98
|
+
gridTemplateAreas,
|
|
99
|
+
[`&:has(.${_Toolbar.chartsToolbarClasses.root})`]: {
|
|
100
|
+
// Add a row for toolbar if there is one.
|
|
101
|
+
gridTemplateRows: `auto ${gridTemplateRows}`,
|
|
102
|
+
gridTemplateAreas: `"${gridTemplateColumns.split(' ').map(() => 'toolbar').join(' ')}"
|
|
103
|
+
${gridTemplateAreas}`
|
|
90
104
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
gridTemplateAreas: addToolbar(getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition))
|
|
101
|
-
},
|
|
102
|
-
[`&:not(:has(.${_Toolbar.chartsToolbarClasses.root}))`]: {
|
|
103
|
-
gridTemplateAreas: getGridTemplateAreas(ownerState.hideLegend, ownerState.legendDirection, ownerState.legendPosition)
|
|
104
|
-
},
|
|
105
|
-
justifyContent: 'center',
|
|
106
|
-
justifyItems: getJustifyItems(ownerState.legendPosition),
|
|
107
|
-
alignItems: getAlignItems(ownerState.legendPosition),
|
|
108
|
-
[`& > .${_Toolbar.chartsToolbarClasses.root}`]: {
|
|
109
|
-
justifySelf: 'center'
|
|
110
|
-
}
|
|
111
|
-
}));
|
|
105
|
+
[`& .${_Toolbar.chartsToolbarClasses.root}`]: {
|
|
106
|
+
gridArea: 'toolbar',
|
|
107
|
+
justifySelf: 'center'
|
|
108
|
+
},
|
|
109
|
+
justifyContent: 'center',
|
|
110
|
+
justifyItems: getJustifyItems(ownerState.legendPosition),
|
|
111
|
+
alignItems: getAlignItems(ownerState.legendPosition)
|
|
112
|
+
};
|
|
113
|
+
});
|
|
112
114
|
|
|
113
115
|
/**
|
|
114
116
|
* Wrapper for the charts components.
|
|
@@ -148,8 +150,9 @@ process.env.NODE_ENV !== "production" ? ChartsWrapper.propTypes = {
|
|
|
148
150
|
extendVertically: _propTypes.default.bool,
|
|
149
151
|
/**
|
|
150
152
|
* If `true`, the legend is not rendered.
|
|
153
|
+
* @default false
|
|
151
154
|
*/
|
|
152
|
-
hideLegend: _propTypes.default.bool
|
|
155
|
+
hideLegend: _propTypes.default.bool,
|
|
153
156
|
/**
|
|
154
157
|
* The direction of the legend.
|
|
155
158
|
* @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,44 @@
|
|
|
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.FocusedMark = FocusedMark;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
11
|
+
var _useFocusedItem = require("../hooks/useFocusedItem");
|
|
12
|
+
var _hooks = require("../hooks");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const RADIUS = 6;
|
|
15
|
+
function FocusedMark() {
|
|
16
|
+
const theme = (0, _styles.useTheme)();
|
|
17
|
+
const focusedItem = (0, _useFocusedItem.useFocusedItem)();
|
|
18
|
+
const lineSeries = (0, _hooks.useLineSeriesContext)();
|
|
19
|
+
const {
|
|
20
|
+
xAxis,
|
|
21
|
+
xAxisIds
|
|
22
|
+
} = (0, _hooks.useXAxes)();
|
|
23
|
+
const {
|
|
24
|
+
yAxis,
|
|
25
|
+
yAxisIds
|
|
26
|
+
} = (0, _hooks.useYAxes)();
|
|
27
|
+
if (focusedItem === null || focusedItem.seriesType !== 'line' || !lineSeries) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const series = lineSeries?.series[focusedItem.seriesId];
|
|
31
|
+
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
32
|
+
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
|
34
|
+
fill: "none",
|
|
35
|
+
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
36
|
+
strokeWidth: 2,
|
|
37
|
+
x: xAxis[xAxisId].scale(xAxis[xAxisId].data[focusedItem.dataIndex]) - RADIUS,
|
|
38
|
+
y: yAxis[yAxisId].scale(series.stackedData[focusedItem.dataIndex][1]) - RADIUS,
|
|
39
|
+
width: 2 * RADIUS,
|
|
40
|
+
height: 2 * RADIUS,
|
|
41
|
+
rx: 3,
|
|
42
|
+
ry: 3
|
|
43
|
+
});
|
|
44
|
+
}
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -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.
|
package/LineChart/LineChart.js
CHANGED
|
@@ -27,6 +27,7 @@ var _useChartContainerProps = require("../ChartContainer/useChartContainerProps"
|
|
|
27
27
|
var _ChartDataProvider = require("../ChartDataProvider");
|
|
28
28
|
var _ChartsSurface = require("../ChartsSurface");
|
|
29
29
|
var _ChartsWrapper = require("../ChartsWrapper");
|
|
30
|
+
var _FocusedMark = require("./FocusedMark");
|
|
30
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
32
|
/**
|
|
32
33
|
* Demos:
|
|
@@ -70,7 +71,7 @@ const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function Lin
|
|
|
70
71
|
children: [props.showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
71
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
72
73
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AreaPlot.AreaPlot, (0, _extends2.default)({}, areaPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinePlot.LinePlot, (0, _extends2.default)({}, linePlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
|
|
73
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
74
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedMark.FocusedMark, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
74
75
|
"data-drawing-container": true,
|
|
75
76
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MarkPlot.MarkPlot, (0, _extends2.default)({}, markPlotProps))
|
|
76
77
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineHighlightPlot.LineHighlightPlot, (0, _extends2.default)({}, lineHighlightPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
|
@@ -118,6 +119,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
118
119
|
* If `true`, render the line highlight item.
|
|
119
120
|
*/
|
|
120
121
|
disableLineItemHighlight: _propTypes.default.bool,
|
|
122
|
+
enableKeyboardNavigation: _propTypes.default.bool,
|
|
121
123
|
/**
|
|
122
124
|
* Options to enable features planned for the next major.
|
|
123
125
|
*/
|
|
@@ -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>;
|
|
@@ -8,4 +8,5 @@ var _useChartZAxis = require("../internals/plugins/featurePlugins/useChartZAxis"
|
|
|
8
8
|
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
9
9
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
10
10
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
11
|
-
|
|
11
|
+
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
12
|
+
const LINE_CHART_PLUGINS = exports.LINE_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
package/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/LineChart/index.js
CHANGED
|
@@ -151,4 +151,16 @@ Object.keys(_LineHighlightElement).forEach(function (key) {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
});
|
|
154
|
+
var _LineChart2 = require("./LineChart.plugins");
|
|
155
|
+
Object.keys(_LineChart2).forEach(function (key) {
|
|
156
|
+
if (key === "default" || key === "__esModule") return;
|
|
157
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
158
|
+
if (key in exports && exports[key] === _LineChart2[key]) return;
|
|
159
|
+
Object.defineProperty(exports, key, {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function () {
|
|
162
|
+
return _LineChart2[key];
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
});
|
|
154
166
|
var _markElementClasses = require("./markElementClasses");
|
|
@@ -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/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;
|
package/PieChart/PieArc.js
CHANGED
|
@@ -13,6 +13,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
13
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
14
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
16
17
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
17
18
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
18
19
|
var _styles = require("@mui/material/styles");
|
|
@@ -21,11 +22,11 @@ var _hooks = require("../hooks");
|
|
|
21
22
|
var _animation = require("../internals/animation/animation");
|
|
22
23
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
const _excluded = ["classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation"];
|
|
25
|
+
const _excluded = ["className", "classes", "color", "dataIndex", "id", "isFaded", "isHighlighted", "isFocused", "onClick", "cornerRadius", "startAngle", "endAngle", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "stroke"];
|
|
25
26
|
function getPieArcUtilityClass(slot) {
|
|
26
27
|
return (0, _generateUtilityClass.default)('MuiPieArc', slot);
|
|
27
28
|
}
|
|
28
|
-
const pieArcClasses = exports.pieArcClasses = (0, _generateUtilityClasses.default)('MuiPieArc', ['root', 'highlighted', 'faded', 'series']);
|
|
29
|
+
const pieArcClasses = exports.pieArcClasses = (0, _generateUtilityClasses.default)('MuiPieArc', ['root', 'highlighted', 'faded', 'series', 'focusIndicator']);
|
|
29
30
|
const useUtilityClasses = ownerState => {
|
|
30
31
|
const {
|
|
31
32
|
classes,
|
|
@@ -43,23 +44,21 @@ const PieArcRoot = (0, _styles.styled)('path', {
|
|
|
43
44
|
name: 'MuiPieArc',
|
|
44
45
|
slot: 'Root',
|
|
45
46
|
overridesResolver: (_, styles) => styles.arc // FIXME: Inconsistent naming with slot
|
|
46
|
-
})(
|
|
47
|
-
theme
|
|
48
|
-
}) => ({
|
|
49
|
-
// Got to move stroke to an element prop instead of style.
|
|
50
|
-
stroke: (theme.vars || theme).palette.background.paper,
|
|
47
|
+
})({
|
|
51
48
|
transitionProperty: 'opacity, fill, filter',
|
|
52
49
|
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
53
50
|
transitionTimingFunction: _animation.ANIMATION_TIMING_FUNCTION
|
|
54
|
-
})
|
|
51
|
+
});
|
|
55
52
|
const PieArc = exports.PieArc = /*#__PURE__*/React.forwardRef(function PieArc(props, ref) {
|
|
56
53
|
const {
|
|
54
|
+
className,
|
|
57
55
|
classes: innerClasses,
|
|
58
56
|
color,
|
|
59
57
|
dataIndex,
|
|
60
58
|
id,
|
|
61
59
|
isFaded,
|
|
62
60
|
isHighlighted,
|
|
61
|
+
isFocused,
|
|
63
62
|
onClick,
|
|
64
63
|
cornerRadius,
|
|
65
64
|
startAngle,
|
|
@@ -67,16 +66,20 @@ const PieArc = exports.PieArc = /*#__PURE__*/React.forwardRef(function PieArc(pr
|
|
|
67
66
|
innerRadius,
|
|
68
67
|
outerRadius,
|
|
69
68
|
paddingAngle,
|
|
70
|
-
skipAnimation
|
|
69
|
+
skipAnimation,
|
|
70
|
+
stroke: strokeProp
|
|
71
71
|
} = props,
|
|
72
72
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
73
|
+
const theme = (0, _styles.useTheme)();
|
|
74
|
+
const stroke = strokeProp ?? (theme.vars || theme).palette.background.paper;
|
|
73
75
|
const ownerState = {
|
|
74
76
|
id,
|
|
75
77
|
dataIndex,
|
|
76
78
|
classes: innerClasses,
|
|
77
79
|
color,
|
|
78
80
|
isFaded,
|
|
79
|
-
isHighlighted
|
|
81
|
+
isHighlighted,
|
|
82
|
+
isFocused
|
|
80
83
|
};
|
|
81
84
|
const classes = useUtilityClasses(ownerState);
|
|
82
85
|
const interactionProps = (0, _useInteractionItemProps.useInteractionItemProps)({
|
|
@@ -98,10 +101,11 @@ const PieArc = exports.PieArc = /*#__PURE__*/React.forwardRef(function PieArc(pr
|
|
|
98
101
|
onClick: onClick,
|
|
99
102
|
cursor: onClick ? 'pointer' : 'unset',
|
|
100
103
|
ownerState: ownerState,
|
|
101
|
-
className: classes.root,
|
|
104
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
102
105
|
fill: ownerState.color,
|
|
103
106
|
opacity: ownerState.isFaded ? 0.3 : 1,
|
|
104
107
|
filter: ownerState.isHighlighted ? 'brightness(120%)' : 'none',
|
|
108
|
+
stroke: stroke,
|
|
105
109
|
strokeWidth: 1,
|
|
106
110
|
strokeLinejoin: "round",
|
|
107
111
|
"data-highlighted": ownerState.isHighlighted || undefined,
|
|
@@ -121,6 +125,7 @@ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
|
121
125
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
122
126
|
innerRadius: _propTypes.default.number.isRequired,
|
|
123
127
|
isFaded: _propTypes.default.bool.isRequired,
|
|
128
|
+
isFocused: _propTypes.default.bool.isRequired,
|
|
124
129
|
isHighlighted: _propTypes.default.bool.isRequired,
|
|
125
130
|
outerRadius: _propTypes.default.number.isRequired,
|
|
126
131
|
paddingAngle: _propTypes.default.number.isRequired,
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -11,6 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _styles = require("@mui/material/styles");
|
|
15
|
+
var _useFocusedItem = require("../hooks/useFocusedItem");
|
|
14
16
|
var _PieArc = require("./PieArc");
|
|
15
17
|
var _useTransformData = require("./dataTransform/useTransformData");
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -33,6 +35,7 @@ function PieArcPlot(props) {
|
|
|
33
35
|
skipAnimation
|
|
34
36
|
} = props,
|
|
35
37
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
|
+
const theme = (0, _styles.useTheme)();
|
|
36
39
|
const transformedData = (0, _useTransformData.useTransformData)({
|
|
37
40
|
innerRadius,
|
|
38
41
|
outerRadius,
|
|
@@ -43,12 +46,16 @@ function PieArcPlot(props) {
|
|
|
43
46
|
faded,
|
|
44
47
|
data
|
|
45
48
|
});
|
|
49
|
+
const {
|
|
50
|
+
dataIndex: focusedIndex = -1
|
|
51
|
+
} = (0, _useFocusedItem.useFocusedItem)() ?? {};
|
|
52
|
+
const focusedItem = focusedIndex !== -1 ? transformedData[focusedIndex] : null;
|
|
46
53
|
if (data.length === 0) {
|
|
47
54
|
return null;
|
|
48
55
|
}
|
|
49
56
|
const Arc = slots?.pieArc ?? _PieArc.PieArc;
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
51
|
-
children: transformedData.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Arc, (0, _extends2.default)({
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, other, {
|
|
58
|
+
children: [transformedData.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Arc, (0, _extends2.default)({
|
|
52
59
|
startAngle: item.startAngle,
|
|
53
60
|
endAngle: item.endAngle,
|
|
54
61
|
paddingAngle: item.paddingAngle,
|
|
@@ -61,6 +68,7 @@ function PieArcPlot(props) {
|
|
|
61
68
|
dataIndex: index,
|
|
62
69
|
isFaded: item.isFaded,
|
|
63
70
|
isHighlighted: item.isHighlighted,
|
|
71
|
+
isFocused: item.isFocused,
|
|
64
72
|
onClick: onItemClick && (event => {
|
|
65
73
|
onItemClick(event, {
|
|
66
74
|
type: 'pie',
|
|
@@ -68,7 +76,24 @@ function PieArcPlot(props) {
|
|
|
68
76
|
dataIndex: index
|
|
69
77
|
}, item);
|
|
70
78
|
})
|
|
71
|
-
}, slotProps?.pieArc), item.dataIndex))
|
|
79
|
+
}, slotProps?.pieArc), item.dataIndex)), focusedItem && /*#__PURE__*/(0, _jsxRuntime.jsx)(Arc, {
|
|
80
|
+
startAngle: focusedItem.startAngle,
|
|
81
|
+
endAngle: focusedItem.endAngle,
|
|
82
|
+
paddingAngle: focusedItem.paddingAngle,
|
|
83
|
+
innerRadius: focusedItem.innerRadius,
|
|
84
|
+
color: focusedItem.color,
|
|
85
|
+
outerRadius: focusedItem.outerRadius,
|
|
86
|
+
cornerRadius: focusedItem.cornerRadius,
|
|
87
|
+
skipAnimation: true,
|
|
88
|
+
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
89
|
+
id: id,
|
|
90
|
+
className: _PieArc.pieArcClasses.focusIndicator,
|
|
91
|
+
dataIndex: focusedIndex,
|
|
92
|
+
isFaded: false,
|
|
93
|
+
isHighlighted: false,
|
|
94
|
+
isFocused: false,
|
|
95
|
+
strokeWidth: 3
|
|
96
|
+
})]
|
|
72
97
|
}));
|
|
73
98
|
}
|
|
74
99
|
process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
|
package/PieChart/PieChart.js
CHANGED
|
@@ -127,6 +127,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
127
127
|
*/
|
|
128
128
|
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
129
129
|
desc: _propTypes.default.string,
|
|
130
|
+
enableKeyboardNavigation: _propTypes.default.bool,
|
|
130
131
|
/**
|
|
131
132
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
132
133
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
2
2
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
3
|
+
import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
3
4
|
import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
4
|
-
export type PieChartPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature];
|
|
5
|
+
export type PieChartPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
|
|
5
6
|
export declare const PIE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<PieChartPluginSignatures>;
|
|
@@ -6,4 +6,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.PIE_CHART_PLUGINS = void 0;
|
|
7
7
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
8
8
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
9
|
-
|
|
9
|
+
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
10
|
+
const PIE_CHART_PLUGINS = exports.PIE_CHART_PLUGINS = [_useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -12,5 +12,6 @@ export interface ValueWithHighlight extends DefaultizedPieValueType, AnimatedObj
|
|
|
12
12
|
dataIndex: number;
|
|
13
13
|
isFaded: boolean;
|
|
14
14
|
isHighlighted: boolean;
|
|
15
|
+
isFocused: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare function useTransformData(series: Pick<DefaultizedPieSeriesType, 'cornerRadius' | 'paddingAngle' | 'id' | 'highlighted' | 'faded' | 'data'> & ComputedPieRadius): ValueWithHighlight[];
|
|
@@ -10,6 +10,7 @@ exports.useTransformData = useTransformData;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
|
|
13
|
+
var _useIsItemFocusedGetter = require("../../hooks/useIsItemFocusedGetter");
|
|
13
14
|
var _angleConversion = require("../../internals/angleConversion");
|
|
14
15
|
function useTransformData(series) {
|
|
15
16
|
const {
|
|
@@ -27,6 +28,7 @@ function useTransformData(series) {
|
|
|
27
28
|
isFaded: isItemFaded,
|
|
28
29
|
isHighlighted: isItemHighlighted
|
|
29
30
|
} = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
|
|
31
|
+
const isItemFocused = (0, _useIsItemFocusedGetter.useIsItemFocusedGetter)();
|
|
30
32
|
const dataWithHighlight = React.useMemo(() => data.map((item, itemIndex) => {
|
|
31
33
|
const currentItem = {
|
|
32
34
|
seriesId,
|
|
@@ -34,6 +36,11 @@ function useTransformData(series) {
|
|
|
34
36
|
};
|
|
35
37
|
const isHighlighted = isItemHighlighted(currentItem);
|
|
36
38
|
const isFaded = !isHighlighted && isItemFaded(currentItem);
|
|
39
|
+
const isFocused = isItemFocused({
|
|
40
|
+
seriesType: 'pie',
|
|
41
|
+
seriesId,
|
|
42
|
+
dataIndex: itemIndex
|
|
43
|
+
});
|
|
37
44
|
const attributesOverride = (0, _extends2.default)({
|
|
38
45
|
additionalRadius: 0
|
|
39
46
|
}, isFaded && faded || isHighlighted && highlighted || {});
|
|
@@ -46,12 +53,13 @@ function useTransformData(series) {
|
|
|
46
53
|
dataIndex: itemIndex,
|
|
47
54
|
isFaded,
|
|
48
55
|
isHighlighted,
|
|
56
|
+
isFocused,
|
|
49
57
|
paddingAngle,
|
|
50
58
|
innerRadius,
|
|
51
59
|
outerRadius,
|
|
52
60
|
cornerRadius,
|
|
53
61
|
arcLabelRadius
|
|
54
62
|
});
|
|
55
|
-
}), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded, highlighted, isItemFaded, isItemHighlighted, seriesId]);
|
|
63
|
+
}), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded, highlighted, isItemFaded, isItemHighlighted, isItemFocused, seriesId]);
|
|
56
64
|
return dataWithHighlight;
|
|
57
65
|
}
|
package/PieChart/index.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export * from "./PieArcLabelPlot.js";
|
|
|
5
5
|
export * from "./PieArc.js";
|
|
6
6
|
export * from "./PieArcLabel.js";
|
|
7
7
|
export * from "./getPieCoordinates.js";
|
|
8
|
+
export * from "./PieChart.plugins.js";
|
|
8
9
|
export { pieClasses } from "./pieClasses.js";
|
|
9
10
|
export type { PieClasses, PieClassKey } from "./pieClasses.js";
|
package/PieChart/index.js
CHANGED
|
@@ -96,4 +96,16 @@ Object.keys(_getPieCoordinates).forEach(function (key) {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
|
+
var _PieChart2 = require("./PieChart.plugins");
|
|
100
|
+
Object.keys(_PieChart2).forEach(function (key) {
|
|
101
|
+
if (key === "default" || key === "__esModule") return;
|
|
102
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
103
|
+
if (key in exports && exports[key] === _PieChart2[key]) return;
|
|
104
|
+
Object.defineProperty(exports, key, {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function () {
|
|
107
|
+
return _PieChart2[key];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
99
111
|
var _pieClasses = require("./pieClasses");
|
|
@@ -2,4 +2,4 @@ import { UseChartPolarAxisSignature } from "../internals/plugins/featurePlugins/
|
|
|
2
2
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
3
3
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
4
|
export declare const RADAR_PLUGINS: readonly [import("../internals/index.js").ChartPlugin<UseChartPolarAxisSignature<any>>, import("../internals/index.js").ChartPlugin<UseChartInteractionSignature>, import("../internals/index.js").ChartPlugin<UseChartHighlightSignature>];
|
|
5
|
-
export type
|
|
5
|
+
export type RadarChartPluginSignatures = [UseChartPolarAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature];
|