@mui/x-charts 8.11.2 → 8.12.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 +2 -0
- package/BarChart/index.js +12 -0
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/BarChart/useBarChartProps.js +4 -3
- package/CHANGELOG.md +231 -0
- package/ChartContainer/ChartContainer.js +4 -2
- package/ChartContainer/useChartContainerProps.js +4 -2
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/ChartsLegend/ChartsLegend.js +2 -1
- package/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/ChartsLegend/PiecewiseColorLegend.d.ts +2 -2
- package/ChartsLegend/PiecewiseColorLegend.js +33 -22
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +4 -0
- package/ChartsLegend/piecewiseColorLegendClasses.js +2 -2
- package/ChartsSurface/ChartsSurface.js +22 -2
- package/ChartsWrapper/ChartsWrapper.d.ts +5 -0
- package/ChartsWrapper/ChartsWrapper.js +87 -36
- package/ChartsXAxis/ChartsGroupedXAxisTicks.js +2 -2
- package/ChartsXAxis/ChartsXAxisImpl.js +3 -3
- package/ChartsXAxis/getVisibleLabels.js +5 -1
- package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/ChartsYAxis/ChartsGroupedYAxisTicks.js +2 -2
- package/ChartsYAxis/ChartsYAxisImpl.js +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/useAreaPlotData.js +2 -2
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/LineChart/useLineChartProps.js +2 -1
- package/LineChart/useLinePlotData.js +2 -2
- package/PieChart/PieArc.d.ts +1 -0
- package/PieChart/PieArc.js +7 -3
- package/PieChart/PieArcPlot.js +1 -0
- package/PieChart/PieChart.js +2 -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/RadarAxis/useRadarAxis.js +2 -2
- 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/RadarChart/useRadarChartProps.js +2 -1
- 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 +10 -6
- package/SparkLineChart/SparkLineChart.js +10 -5
- 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 +2 -0
- package/esm/BarChart/index.js +1 -0
- package/esm/BarChart/useBarChartProps.d.ts +2 -2
- package/esm/BarChart/useBarChartProps.js +4 -3
- package/esm/ChartContainer/ChartContainer.js +4 -2
- package/esm/ChartContainer/useChartContainerProps.js +4 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/esm/ChartsLegend/ChartsLegend.js +2 -1
- package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.d.ts +2 -2
- package/esm/ChartsLegend/PiecewiseColorLegend.js +33 -22
- package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +4 -0
- package/esm/ChartsLegend/piecewiseColorLegendClasses.js +2 -2
- package/esm/ChartsSurface/ChartsSurface.js +22 -2
- package/esm/ChartsWrapper/ChartsWrapper.d.ts +5 -0
- package/esm/ChartsWrapper/ChartsWrapper.js +87 -36
- package/esm/ChartsXAxis/ChartsGroupedXAxisTicks.js +2 -2
- package/esm/ChartsXAxis/ChartsXAxisImpl.js +3 -3
- package/esm/ChartsXAxis/getVisibleLabels.js +5 -1
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/ChartsYAxis/ChartsGroupedYAxisTicks.js +2 -2
- package/esm/ChartsYAxis/ChartsYAxisImpl.js +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/useAreaPlotData.js +2 -2
- package/esm/LineChart/useLineChartProps.d.ts +2 -2
- package/esm/LineChart/useLineChartProps.js +2 -1
- package/esm/LineChart/useLinePlotData.js +2 -2
- package/esm/PieChart/PieArc.d.ts +1 -0
- package/esm/PieChart/PieArc.js +7 -3
- package/esm/PieChart/PieArcPlot.js +1 -0
- package/esm/PieChart/PieChart.js +2 -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/RadarAxis/useRadarAxis.js +2 -2
- 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/RadarChart/useRadarChartProps.js +2 -1
- 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 +10 -6
- package/esm/SparkLineChart/SparkLineChart.js +10 -5
- 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 +8 -2
- package/esm/hooks/useTicks.js +2 -2
- package/esm/hooks/useTicksGrouped.js +2 -2
- 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 +4 -3
- package/esm/internals/index.js +4 -3
- package/esm/internals/invertScale.js +2 -2
- package/esm/internals/plugins/allPlugins.d.ts +5 -4
- package/esm/internals/plugins/allPlugins.js +3 -2
- 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/{internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts → esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.d.ts} +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +123 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -3
- 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 +46 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +32 -21
- 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/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 +210 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +7 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +2 -2
- 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 +11 -0
- package/esm/internals/scaleGuards.js +9 -0
- 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/models/axis.d.ts +3 -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 +8 -2
- package/hooks/useTicks.js +2 -2
- package/hooks/useTicksGrouped.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/internals/animation/Transition.js +0 -2
- package/internals/index.d.ts +4 -3
- package/internals/index.js +24 -12
- package/internals/invertScale.js +2 -2
- package/internals/plugins/allPlugins.d.ts +5 -4
- package/internals/plugins/allPlugins.js +3 -2
- 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/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts → internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.d.ts} +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +134 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -3
- 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 +47 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +33 -22
- 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/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 +218 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +2 -2
- 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 +11 -0
- package/internals/scaleGuards.js +17 -0
- 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/models/axis.d.ts +3 -0
- package/package.json +4 -4
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +47 -0
- package/esm/internals/isBandScale.d.ts +0 -5
- package/esm/internals/isBandScale.js +0 -3
- 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/isBandScale.d.ts +0 -5
- package/internals/isBandScale.js +0 -9
- 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
|
@@ -28,6 +28,7 @@ const RootElement = (0, _styles.styled)('ul', {
|
|
|
28
28
|
theme,
|
|
29
29
|
ownerState
|
|
30
30
|
}) => {
|
|
31
|
+
const classes = _piecewiseColorLegendClasses.piecewiseColorLegendClasses;
|
|
31
32
|
return (0, _extends2.default)({}, theme.typography.caption, {
|
|
32
33
|
color: (theme.vars || theme).palette.text.primary,
|
|
33
34
|
lineHeight: '100%',
|
|
@@ -39,8 +40,9 @@ const RootElement = (0, _styles.styled)('ul', {
|
|
|
39
40
|
paddingInlineStart: 0,
|
|
40
41
|
marginBlock: theme.spacing(1),
|
|
41
42
|
marginInline: theme.spacing(1),
|
|
42
|
-
width: '
|
|
43
|
-
|
|
43
|
+
width: 'fit-content',
|
|
44
|
+
gridArea: 'legend',
|
|
45
|
+
[`button.${classes.item}`]: {
|
|
44
46
|
// Reset button styles
|
|
45
47
|
background: 'none',
|
|
46
48
|
border: 'none',
|
|
@@ -52,55 +54,62 @@ const RootElement = (0, _styles.styled)('ul', {
|
|
|
52
54
|
letterSpacing: 'inherit',
|
|
53
55
|
color: 'inherit'
|
|
54
56
|
},
|
|
55
|
-
[`.${
|
|
57
|
+
[`.${classes.item}`]: {
|
|
56
58
|
display: 'flex',
|
|
57
59
|
gap: theme.spacing(0.5)
|
|
58
60
|
},
|
|
59
|
-
[`li :not(.${
|
|
61
|
+
[`li :not(.${classes.minLabel}, .${classes.maxLabel}) .${classes?.mark}`]: {
|
|
60
62
|
alignSelf: 'center'
|
|
61
63
|
},
|
|
62
|
-
[`&.${
|
|
64
|
+
[`&.${classes.start}`]: {
|
|
63
65
|
alignItems: 'end'
|
|
64
66
|
},
|
|
65
|
-
[`&.${
|
|
67
|
+
[`&.${classes.end}`]: {
|
|
66
68
|
alignItems: 'start'
|
|
67
69
|
},
|
|
68
|
-
[`&.${
|
|
70
|
+
[`&.${classes.horizontal}`]: {
|
|
69
71
|
alignItems: 'center',
|
|
70
|
-
[`.${
|
|
72
|
+
[`.${classes.item}`]: {
|
|
71
73
|
flexDirection: 'column'
|
|
72
74
|
},
|
|
73
|
-
[`&.${
|
|
75
|
+
[`&.${classes.inlineStart}, &.${classes.inlineEnd}`]: {
|
|
76
|
+
gap: theme.spacing(1.5),
|
|
77
|
+
flexWrap: 'wrap',
|
|
78
|
+
[`.${classes.item}`]: {
|
|
79
|
+
flexDirection: 'row'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[`&.${classes.start}`]: {
|
|
74
83
|
alignItems: 'end'
|
|
75
84
|
},
|
|
76
|
-
[`&.${
|
|
85
|
+
[`&.${classes.end}`]: {
|
|
77
86
|
alignItems: 'start'
|
|
78
87
|
},
|
|
79
|
-
[`.${
|
|
88
|
+
[`.${classes.minLabel}`]: {
|
|
80
89
|
alignItems: 'end'
|
|
81
90
|
},
|
|
82
|
-
[`&.${
|
|
83
|
-
[`.${
|
|
91
|
+
[`&.${classes.extremes}`]: {
|
|
92
|
+
[`.${classes.minLabel}, .${classes.maxLabel}`]: {
|
|
84
93
|
alignItems: 'center',
|
|
85
94
|
display: 'flex',
|
|
86
95
|
flexDirection: 'row'
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
},
|
|
90
|
-
[`&.${
|
|
91
|
-
[`.${
|
|
99
|
+
[`&.${classes.vertical}`]: {
|
|
100
|
+
[`.${classes.item}`]: {
|
|
92
101
|
flexDirection: 'row',
|
|
93
102
|
alignItems: 'center'
|
|
94
103
|
},
|
|
95
|
-
[`&.${
|
|
104
|
+
[`&.${classes.start}, &.${classes.inlineStart}`]: {
|
|
96
105
|
alignItems: 'end'
|
|
97
106
|
},
|
|
98
|
-
[`&.${
|
|
107
|
+
[`&.${classes.end}, &.${classes.inlineEnd}`]: {
|
|
99
108
|
alignItems: 'start'
|
|
100
109
|
},
|
|
101
|
-
[`&.${
|
|
110
|
+
[`&.${classes.extremes}`]: {
|
|
102
111
|
alignItems: 'center',
|
|
103
|
-
[`.${
|
|
112
|
+
[`.${classes.minLabel}, .${classes.maxLabel}`]: {
|
|
104
113
|
alignItems: 'center',
|
|
105
114
|
display: 'flex',
|
|
106
115
|
flexDirection: 'column'
|
|
@@ -153,6 +162,8 @@ const PiecewiseColorLegend = exports.PiecewiseColorLegend = (0, _consumeThemePro
|
|
|
153
162
|
const isStart = labelPosition === 'start';
|
|
154
163
|
const isEnd = labelPosition === 'end';
|
|
155
164
|
const isExtremes = labelPosition === 'extremes';
|
|
165
|
+
const isInlineStart = labelPosition === 'inline-start';
|
|
166
|
+
const isInlineEnd = labelPosition === 'inline-end';
|
|
156
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RootElement, (0, _extends2.default)({
|
|
157
168
|
className: (0, _clsx.default)(classes?.root, className),
|
|
158
169
|
ref: ref
|
|
@@ -186,8 +197,8 @@ const PiecewiseColorLegend = exports.PiecewiseColorLegend = (0, _consumeThemePro
|
|
|
186
197
|
if (label === null || label === undefined) {
|
|
187
198
|
return null;
|
|
188
199
|
}
|
|
189
|
-
const isTextBefore = isStart || isExtremes && isFirst;
|
|
190
|
-
const isTextAfter = isEnd || isExtremes && isLast;
|
|
200
|
+
const isTextBefore = isStart || isExtremes && isFirst || isInlineStart;
|
|
201
|
+
const isTextAfter = isEnd || isExtremes && isLast || isInlineEnd;
|
|
191
202
|
const clickObject = {
|
|
192
203
|
type: 'piecewiseColor',
|
|
193
204
|
color,
|
|
@@ -255,7 +266,7 @@ process.env.NODE_ENV !== "production" ? PiecewiseColorLegend.propTypes = {
|
|
|
255
266
|
* Where to position the labels relative to the gradient.
|
|
256
267
|
* @default 'extremes'
|
|
257
268
|
*/
|
|
258
|
-
labelPosition: _propTypes.default.oneOf(['start', 'end', 'extremes']),
|
|
269
|
+
labelPosition: _propTypes.default.oneOf(['start', 'end', 'extremes', 'inline-start', 'inline-end']),
|
|
259
270
|
/**
|
|
260
271
|
* The type of the mark.
|
|
261
272
|
* @default 'square'
|
|
@@ -19,6 +19,10 @@ export interface PiecewiseColorLegendClasses {
|
|
|
19
19
|
end: string;
|
|
20
20
|
/** Styles applied to the legend with the labels on the extremes of the color marks. */
|
|
21
21
|
extremes: string;
|
|
22
|
+
/** Styles applied to the legend with the labels inlined before the color marks. */
|
|
23
|
+
inlineStart: string;
|
|
24
|
+
/** Styles applied to the legend with the labels inlined after the color marks. */
|
|
25
|
+
inlineEnd: string;
|
|
22
26
|
/** Styles applied to the marks. */
|
|
23
27
|
mark: string;
|
|
24
28
|
/** Styles applied to the series label. */
|
|
@@ -18,7 +18,7 @@ const useUtilityClasses = props => {
|
|
|
18
18
|
labelPosition
|
|
19
19
|
} = props;
|
|
20
20
|
const slots = {
|
|
21
|
-
root: ['root', direction, labelPosition],
|
|
21
|
+
root: ['root', direction, labelPosition?.replaceAll(/-(\w)/g, match => match[1].toUpperCase())],
|
|
22
22
|
minLabel: ['minLabel'],
|
|
23
23
|
maxLabel: ['maxLabel'],
|
|
24
24
|
item: ['item'],
|
|
@@ -28,4 +28,4 @@ const useUtilityClasses = props => {
|
|
|
28
28
|
return (0, _composeClasses.default)(slots, getLegendUtilityClass, classes);
|
|
29
29
|
};
|
|
30
30
|
exports.useUtilityClasses = useUtilityClasses;
|
|
31
|
-
const piecewiseColorLegendClasses = exports.piecewiseColorLegendClasses = (0, _generateUtilityClasses.default)('MuiPiecewiseColorLegendClasses', ['root', 'minLabel', 'maxLabel', 'item', 'vertical', 'horizontal', 'start', 'end', 'extremes', 'mark', 'label']);
|
|
31
|
+
const piecewiseColorLegendClasses = exports.piecewiseColorLegendClasses = (0, _generateUtilityClasses.default)('MuiPiecewiseColorLegendClasses', ['root', 'minLabel', 'maxLabel', 'item', 'vertical', 'horizontal', 'start', 'end', 'extremes', 'inlineStart', 'inlineEnd', 'mark', 'label']);
|
|
@@ -18,6 +18,7 @@ var _useSvgRef = require("../hooks/useSvgRef");
|
|
|
18
18
|
var _useSelector = require("../internals/store/useSelector");
|
|
19
19
|
var _useStore = require("../internals/store/useStore");
|
|
20
20
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
21
|
+
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
21
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
const _excluded = ["children", "className", "title", "desc"];
|
|
23
24
|
const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
@@ -37,7 +38,22 @@ const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
|
37
38
|
// This prevents default touch actions when using the svg on mobile devices.
|
|
38
39
|
// For example, prevent page scroll & zoom.
|
|
39
40
|
touchAction: 'pan-y',
|
|
40
|
-
userSelect: 'none'
|
|
41
|
+
userSelect: 'none',
|
|
42
|
+
gridArea: 'chart',
|
|
43
|
+
'&:focus': {
|
|
44
|
+
outline: 'none' // By default don't show focus on the SVG container
|
|
45
|
+
},
|
|
46
|
+
'&:focus-visible': {
|
|
47
|
+
// Show focus outline on the SVG container only when using keyboard navigation
|
|
48
|
+
outline: 'auto',
|
|
49
|
+
'&[data-has-focused-item=true]': {
|
|
50
|
+
// But not if the chart has a focused children item
|
|
51
|
+
outline: 'none'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
'& [data-focused=true]': {
|
|
55
|
+
outline: 'auto'
|
|
56
|
+
}
|
|
41
57
|
}));
|
|
42
58
|
|
|
43
59
|
/**
|
|
@@ -64,6 +80,8 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
|
|
|
64
80
|
width: propsWidth,
|
|
65
81
|
height: propsHeight
|
|
66
82
|
} = (0, _useSelector.useSelector)(store, _useChartDimensions.selectorChartPropsSize);
|
|
83
|
+
const isKeyboardNavigationEnabled = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsIsKeyboardNavigationEnabled);
|
|
84
|
+
const hasFocusedItem = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsHasFocusedItem);
|
|
67
85
|
const svgRef = (0, _useSvgRef.useSvgRef)();
|
|
68
86
|
const handleRef = (0, _useForkRef.default)(svgRef, ref);
|
|
69
87
|
const themeProps = (0, _styles.useThemeProps)({
|
|
@@ -84,7 +102,9 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
|
|
|
84
102
|
height: propsHeight
|
|
85
103
|
},
|
|
86
104
|
viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
|
|
87
|
-
className: className
|
|
105
|
+
className: className,
|
|
106
|
+
tabIndex: isKeyboardNavigationEnabled ? 0 : undefined,
|
|
107
|
+
"data-has-focused-item": hasFocusedItem || undefined
|
|
88
108
|
}, other, {
|
|
89
109
|
ref: handleRef,
|
|
90
110
|
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("title", {
|
|
@@ -13,6 +13,11 @@ export interface ChartsWrapperProps {
|
|
|
13
13
|
* @default 'horizontal'
|
|
14
14
|
*/
|
|
15
15
|
legendDirection?: Direction;
|
|
16
|
+
/**
|
|
17
|
+
* If `true`, the legend is not rendered.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
hideLegend?: boolean;
|
|
16
21
|
/**
|
|
17
22
|
* If `true`, the chart wrapper set `height: 100%`.
|
|
18
23
|
* @default `false` if the `height` prop is set. And `true` otherwise.
|
|
@@ -14,59 +14,103 @@ var _useChartRootRef = require("../hooks/useChartRootRef");
|
|
|
14
14
|
var _useStore = require("../internals/store/useStore");
|
|
15
15
|
var _useSelector = require("../internals/store/useSelector");
|
|
16
16
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions");
|
|
17
|
+
var _Toolbar = require("../Toolbar");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const
|
|
19
|
+
const getJustifyItems = position => {
|
|
20
|
+
if (position?.horizontal === 'start') {
|
|
21
|
+
return 'start';
|
|
22
|
+
}
|
|
23
|
+
if (position?.horizontal === 'end') {
|
|
24
|
+
return 'end';
|
|
25
|
+
}
|
|
26
|
+
return 'center';
|
|
27
|
+
};
|
|
28
|
+
const getAlignItems = position => {
|
|
29
|
+
if (position?.vertical === 'top') {
|
|
30
|
+
return 'flex-start';
|
|
31
|
+
}
|
|
32
|
+
if (position?.vertical === 'bottom') {
|
|
33
|
+
return 'flex-end';
|
|
34
|
+
}
|
|
35
|
+
return 'center';
|
|
36
|
+
};
|
|
37
|
+
const getGridTemplateAreas = (hideLegend, direction, position) => {
|
|
38
|
+
if (hideLegend) {
|
|
39
|
+
return `"chart"`;
|
|
40
|
+
}
|
|
19
41
|
if (direction === 'vertical') {
|
|
20
42
|
if (position?.horizontal === 'start') {
|
|
21
|
-
return
|
|
43
|
+
return `"legend chart"`;
|
|
22
44
|
}
|
|
23
|
-
return
|
|
45
|
+
return `"chart legend"`;
|
|
24
46
|
}
|
|
25
47
|
if (position?.vertical === 'bottom') {
|
|
26
|
-
return
|
|
48
|
+
return `"chart"
|
|
49
|
+
"legend"`;
|
|
50
|
+
}
|
|
51
|
+
return `"legend"
|
|
52
|
+
"chart"`;
|
|
53
|
+
};
|
|
54
|
+
const getTemplateColumns = (hideLegend = false, direction = 'horizontal', horizontalPosition = 'end', width = undefined) => {
|
|
55
|
+
const drawingAreaColumn = width ? 'auto' : '1fr';
|
|
56
|
+
if (direction === 'horizontal') {
|
|
57
|
+
return drawingAreaColumn;
|
|
27
58
|
}
|
|
28
|
-
|
|
59
|
+
if (hideLegend) {
|
|
60
|
+
return drawingAreaColumn;
|
|
61
|
+
}
|
|
62
|
+
return horizontalPosition === 'start' ? `auto ${drawingAreaColumn}` : `${drawingAreaColumn} auto`;
|
|
29
63
|
};
|
|
30
|
-
const
|
|
64
|
+
const getTemplateRows = (hideLegend = false, direction = 'horizontal', verticalPosition = 'top') => {
|
|
65
|
+
const drawingAreaRow = '1fr';
|
|
31
66
|
if (direction === 'vertical') {
|
|
32
|
-
|
|
33
|
-
return 'flex-start';
|
|
34
|
-
}
|
|
35
|
-
if (position?.vertical === 'bottom') {
|
|
36
|
-
return 'flex-end';
|
|
37
|
-
}
|
|
67
|
+
return drawingAreaRow;
|
|
38
68
|
}
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
return 'flex-start';
|
|
42
|
-
}
|
|
43
|
-
if (position?.horizontal === 'end') {
|
|
44
|
-
return 'flex-end';
|
|
45
|
-
}
|
|
69
|
+
if (hideLegend) {
|
|
70
|
+
return drawingAreaRow;
|
|
46
71
|
}
|
|
47
|
-
return '
|
|
72
|
+
return verticalPosition === 'bottom' ? `${drawingAreaRow} auto` : `auto ${drawingAreaRow}`;
|
|
48
73
|
};
|
|
49
74
|
const Root = (0, _styles.styled)('div', {
|
|
50
75
|
name: 'MuiChartsWrapper',
|
|
51
76
|
slot: 'Root',
|
|
52
|
-
shouldForwardProp: prop => (0, _createStyled.shouldForwardProp)(prop) && prop !== 'extendVertically'
|
|
77
|
+
shouldForwardProp: prop => (0, _createStyled.shouldForwardProp)(prop) && prop !== 'extendVertically' && prop !== 'width'
|
|
53
78
|
})(({
|
|
54
|
-
ownerState
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
ownerState,
|
|
80
|
+
width
|
|
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}`
|
|
64
104
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
});
|
|
70
114
|
|
|
71
115
|
/**
|
|
72
116
|
* Wrapper for the charts components.
|
|
@@ -81,6 +125,7 @@ function ChartsWrapper(props) {
|
|
|
81
125
|
const chartRootRef = (0, _useChartRootRef.useChartRootRef)();
|
|
82
126
|
const store = (0, _useStore.useStore)();
|
|
83
127
|
const {
|
|
128
|
+
width: propsWidth,
|
|
84
129
|
height: propsHeight
|
|
85
130
|
} = (0, _useSelector.useSelector)(store, _useChartDimensions.selectorChartPropsSize);
|
|
86
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
@@ -88,6 +133,7 @@ function ChartsWrapper(props) {
|
|
|
88
133
|
ownerState: props,
|
|
89
134
|
sx: sx,
|
|
90
135
|
extendVertically: extendVertically ?? propsHeight === undefined,
|
|
136
|
+
width: propsWidth,
|
|
91
137
|
children: children
|
|
92
138
|
});
|
|
93
139
|
}
|
|
@@ -102,6 +148,11 @@ process.env.NODE_ENV !== "production" ? ChartsWrapper.propTypes = {
|
|
|
102
148
|
* @default `false` if the `height` prop is set. And `true` otherwise.
|
|
103
149
|
*/
|
|
104
150
|
extendVertically: _propTypes.default.bool,
|
|
151
|
+
/**
|
|
152
|
+
* If `true`, the legend is not rendered.
|
|
153
|
+
* @default false
|
|
154
|
+
*/
|
|
155
|
+
hideLegend: _propTypes.default.bool,
|
|
105
156
|
/**
|
|
106
157
|
* The direction of the legend.
|
|
107
158
|
* @default 'horizontal'
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.ChartsGroupedXAxisTicks = ChartsGroupedXAxisTicks;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _scaleGuards = require("../internals/scaleGuards");
|
|
13
13
|
var _useChartContext = require("../context/ChartProvider/useChartContext");
|
|
14
14
|
var _utilities = require("./utilities");
|
|
15
15
|
var _useTicksGrouped = require("../hooks/useTicksGrouped");
|
|
@@ -40,7 +40,7 @@ function ChartsGroupedXAxisTicks(inProps) {
|
|
|
40
40
|
TickLabel,
|
|
41
41
|
axisTickLabelProps
|
|
42
42
|
} = (0, _useAxisTicksProps.useAxisTicksProps)(inProps);
|
|
43
|
-
if (!(0,
|
|
43
|
+
if (!(0, _scaleGuards.isOrdinalScale)(xScale)) {
|
|
44
44
|
throw new Error('MUI X Charts: ChartsGroupedXAxis only supports the `band` and `point` scale types.');
|
|
45
45
|
}
|
|
46
46
|
const {
|
|
@@ -15,7 +15,7 @@ var _styles = require("@mui/material/styles");
|
|
|
15
15
|
var _ChartsSingleXAxisTicks = require("./ChartsSingleXAxisTicks");
|
|
16
16
|
var _ChartsGroupedXAxisTicks = require("./ChartsGroupedXAxisTicks");
|
|
17
17
|
var _ChartsText = require("../ChartsText");
|
|
18
|
-
var
|
|
18
|
+
var _scaleGuards = require("../internals/scaleGuards");
|
|
19
19
|
var _isInfinity = require("../internals/isInfinity");
|
|
20
20
|
var _utilities = require("./utilities");
|
|
21
21
|
var _hooks = require("../hooks");
|
|
@@ -87,8 +87,8 @@ function ChartsXAxisImpl(_ref) {
|
|
|
87
87
|
}
|
|
88
88
|
const labelHeight = label ? (0, _domUtils.getStringSize)(label, axisLabelProps.style).height : 0;
|
|
89
89
|
const domain = xScale.domain();
|
|
90
|
-
const
|
|
91
|
-
const skipTickRendering =
|
|
90
|
+
const isScaleOrdinal = (0, _scaleGuards.isOrdinalScale)(xScale);
|
|
91
|
+
const skipTickRendering = isScaleOrdinal ? domain.length === 0 : domain.some(_isInfinity.isInfinity);
|
|
92
92
|
let children = null;
|
|
93
93
|
if (!skipTickRendering) {
|
|
94
94
|
children = 'groups' in axis && Array.isArray(axis.groups) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGroupedXAxisTicks.ChartsGroupedXAxisTicks, (0, _extends2.default)({}, inProps)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSingleXAxisTicks.ChartsSingleXAxisTicks, (0, _extends2.default)({}, inProps, {
|
|
@@ -43,8 +43,12 @@ function getVisibleLabels(xTicks, {
|
|
|
43
43
|
return new Set(xTicks.filter((item, labelIndex) => {
|
|
44
44
|
const {
|
|
45
45
|
offset,
|
|
46
|
-
labelOffset
|
|
46
|
+
labelOffset,
|
|
47
|
+
formattedValue
|
|
47
48
|
} = item;
|
|
49
|
+
if (formattedValue === '') {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
48
52
|
const textPosition = offset + labelOffset;
|
|
49
53
|
if (labelIndex > 0 && direction * textPosition < direction * (previousTextLimit + tickLabelMinGap)) {
|
|
50
54
|
return false;
|
|
@@ -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;
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.ChartsGroupedYAxisTicks = ChartsGroupedYAxisTicks;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _scaleGuards = require("../internals/scaleGuards");
|
|
13
13
|
var _useChartContext = require("../context/ChartProvider/useChartContext");
|
|
14
14
|
var _utilities = require("./utilities");
|
|
15
15
|
var _useTicksGrouped = require("../hooks/useTicksGrouped");
|
|
@@ -41,7 +41,7 @@ function ChartsGroupedYAxisTicks(inProps) {
|
|
|
41
41
|
TickLabel,
|
|
42
42
|
axisTickLabelProps
|
|
43
43
|
} = (0, _useAxisTicksProps.useAxisTicksProps)(inProps);
|
|
44
|
-
if (!(0,
|
|
44
|
+
if (!(0, _scaleGuards.isOrdinalScale)(yScale)) {
|
|
45
45
|
throw new Error('MUI X Charts: ChartsGroupedYAxis only supports the `band` and `point` scale types.');
|
|
46
46
|
}
|
|
47
47
|
const {
|
|
@@ -19,7 +19,7 @@ var _utilities = require("./utilities");
|
|
|
19
19
|
var _isInfinity = require("../internals/isInfinity");
|
|
20
20
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
21
21
|
var _useIsHydrated = require("../hooks/useIsHydrated");
|
|
22
|
-
var
|
|
22
|
+
var _scaleGuards = require("../internals/scaleGuards");
|
|
23
23
|
var _domUtils = require("../internals/domUtils");
|
|
24
24
|
var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -107,8 +107,8 @@ function ChartsYAxisImpl(_ref) {
|
|
|
107
107
|
};
|
|
108
108
|
const axisLabelHeight = label == null ? 0 : (0, _domUtils.getStringSize)(label, axisLabelProps.style).height;
|
|
109
109
|
const domain = yScale.domain();
|
|
110
|
-
const
|
|
111
|
-
const skipTickRendering =
|
|
110
|
+
const isScaleOrdinal = (0, _scaleGuards.isOrdinalScale)(yScale);
|
|
111
|
+
const skipTickRendering = isScaleOrdinal ? domain.length === 0 : domain.some(_isInfinity.isInfinity);
|
|
112
112
|
let children = null;
|
|
113
113
|
if (!skipTickRendering) {
|
|
114
114
|
children = 'groups' in axis && Array.isArray(axis.groups) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGroupedYAxisTicks.ChartsGroupedYAxisTicks, (0, _extends2.default)({}, inProps)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSingleYAxisTicks.ChartsSingleYAxisTicks, (0, _extends2.default)({}, inProps, {
|
|
@@ -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>;
|