@mui/x-charts 9.0.0-alpha.2 → 9.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/AnimatedBarElement.d.mts +1 -1
- package/BarChart/AnimatedBarElement.d.ts +1 -1
- package/BarChart/BarChart.js +5 -2
- package/BarChart/BarChart.mjs +5 -2
- package/BarChart/BarElement.d.mts +1 -1
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarElement.js +8 -7
- package/BarChart/BarElement.mjs +8 -7
- package/BarChart/BarLabel/BarLabel.js +4 -0
- package/BarChart/BarLabel/BarLabel.mjs +4 -0
- package/BarChart/BarLabel/BarLabel.types.d.mts +2 -2
- package/BarChart/BarLabel/BarLabel.types.d.ts +2 -2
- package/BarChart/BarLabel/BarLabelItem.js +8 -7
- package/BarChart/BarLabel/BarLabelItem.mjs +8 -7
- package/BarChart/BarLabel/barLabelClasses.d.mts +15 -0
- package/BarChart/BarLabel/barLabelClasses.d.ts +15 -0
- package/BarChart/BarLabel/barLabelClasses.js +19 -0
- package/BarChart/BarLabel/barLabelClasses.mjs +20 -0
- package/BarChart/BarPlot.js +1 -2
- package/BarChart/BarPlot.mjs +2 -3
- package/BarChart/barClasses.d.mts +21 -1
- package/BarChart/barClasses.d.ts +21 -1
- package/BarChart/barClasses.js +9 -3
- package/BarChart/barClasses.mjs +9 -3
- package/BarChart/barElementClasses.d.mts +17 -10
- package/BarChart/barElementClasses.d.ts +17 -10
- package/BarChart/barElementClasses.js +19 -0
- package/BarChart/barElementClasses.mjs +20 -0
- package/BarChart/index.d.mts +1 -1
- package/BarChart/index.d.ts +1 -1
- package/BarChart/index.js +1 -8
- package/BarChart/index.mjs +1 -1
- package/CHANGELOG.md +123 -1
- package/ChartContainer/ChartContainer.d.mts +1 -1
- package/ChartContainer/ChartContainer.d.ts +1 -1
- package/ChartContainer/useChartContainerProps.d.mts +2 -2
- package/ChartContainer/useChartContainerProps.d.ts +2 -2
- package/ChartDataProvider/ChartDataProvider.d.mts +1 -1
- package/ChartDataProvider/ChartDataProvider.d.ts +1 -1
- package/ChartDataProvider/useChartDataProviderProps.d.mts +2 -2
- package/ChartDataProvider/useChartDataProviderProps.d.ts +2 -2
- package/ChartsContainer/ChartsContainer.d.mts +1 -1
- package/ChartsContainer/ChartsContainer.d.ts +1 -1
- package/ChartsContainer/ChartsContainer.js +5 -2
- package/ChartsContainer/ChartsContainer.mjs +5 -2
- package/ChartsContainer/useChartsContainerProps.d.mts +3 -3
- package/ChartsContainer/useChartsContainerProps.d.ts +3 -3
- package/ChartsContainer/useChartsContainerProps.js +3 -3
- package/ChartsContainer/useChartsContainerProps.mjs +3 -3
- package/ChartsDataProvider/ChartsDataProvider.d.mts +2 -2
- package/ChartsDataProvider/ChartsDataProvider.d.ts +2 -2
- package/ChartsDataProvider/useChartsDataProviderProps.d.mts +2 -2
- package/ChartsDataProvider/useChartsDataProviderProps.d.ts +2 -2
- package/ChartsLabel/ChartsLabelMark.d.mts +8 -1
- package/ChartsLabel/ChartsLabelMark.d.ts +8 -1
- package/ChartsLabel/ChartsLabelMark.js +29 -3
- package/ChartsLabel/ChartsLabelMark.mjs +29 -3
- package/ChartsLabel/labelMarkClasses.d.mts +2 -0
- package/ChartsLabel/labelMarkClasses.d.ts +2 -0
- package/ChartsLabel/labelMarkClasses.js +1 -1
- package/ChartsLabel/labelMarkClasses.mjs +1 -1
- package/ChartsLegend/ChartsLegend.js +4 -2
- package/ChartsLegend/ChartsLegend.mjs +4 -2
- package/ChartsLegend/legendContext.types.d.mts +1 -0
- package/ChartsLegend/legendContext.types.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +3 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.mjs +3 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +6 -2
- package/ChartsTooltip/ChartsItemTooltipContent.mjs +6 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +7 -5
- package/ChartsTooltip/ChartsTooltipContainer.mjs +6 -4
- package/ChartsTooltip/ChartsTooltipTable.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/useAxesTooltip.d.mts +1 -0
- package/ChartsTooltip/useAxesTooltip.d.ts +1 -0
- package/ChartsTooltip/useAxesTooltip.js +6 -4
- package/ChartsTooltip/useAxesTooltip.mjs +6 -4
- package/ChartsTooltip/useItemTooltip.d.mts +5 -3
- package/ChartsTooltip/useItemTooltip.d.ts +5 -3
- package/ChartsXAxis/useAxisTicksProps.d.mts +286 -286
- package/ChartsXAxis/useAxisTicksProps.d.ts +286 -286
- package/ChartsYAxis/useAxisTicksProps.d.mts +286 -286
- package/ChartsYAxis/useAxisTicksProps.d.ts +286 -286
- package/LineChart/AreaElement.d.mts +12 -0
- package/LineChart/AreaElement.d.ts +12 -0
- package/LineChart/AreaElement.js +28 -9
- package/LineChart/AreaElement.mjs +30 -9
- package/LineChart/AreaPlot.js +10 -4
- package/LineChart/AreaPlot.mjs +11 -5
- package/LineChart/CircleMarkElement.js +9 -2
- package/LineChart/CircleMarkElement.mjs +10 -3
- package/LineChart/LineChart.js +5 -2
- package/LineChart/LineChart.mjs +5 -2
- package/LineChart/LineElement.d.mts +12 -0
- package/LineChart/LineElement.d.ts +12 -0
- package/LineChart/LineElement.js +28 -9
- package/LineChart/LineElement.mjs +30 -9
- package/LineChart/LineHighlightElement.d.mts +12 -0
- package/LineChart/LineHighlightElement.d.ts +12 -0
- package/LineChart/LineHighlightElement.js +22 -3
- package/LineChart/LineHighlightElement.mjs +24 -3
- package/LineChart/LinePlot.js +11 -5
- package/LineChart/LinePlot.mjs +12 -6
- package/LineChart/MarkElement.js +9 -2
- package/LineChart/MarkElement.mjs +10 -3
- package/LineChart/MarkPlot.js +19 -9
- package/LineChart/MarkPlot.mjs +20 -10
- package/LineChart/index.d.mts +3 -1
- package/LineChart/index.d.ts +3 -1
- package/LineChart/index.js +10 -2
- package/LineChart/index.mjs +2 -1
- package/LineChart/lineClasses.d.mts +34 -0
- package/LineChart/lineClasses.d.ts +34 -0
- package/LineChart/lineClasses.js +32 -0
- package/LineChart/lineClasses.mjs +23 -0
- package/LineChart/markElementClasses.d.mts +17 -8
- package/LineChart/markElementClasses.d.ts +17 -8
- package/LineChart/markElementClasses.js +19 -0
- package/LineChart/markElementClasses.mjs +20 -0
- package/LineChart/seriesConfig/legend.js +1 -0
- package/LineChart/seriesConfig/legend.mjs +1 -0
- package/LineChart/seriesConfig/seriesProcessor.js +1 -1
- package/LineChart/seriesConfig/seriesProcessor.mjs +1 -1
- package/LineChart/seriesConfig/tooltip.js +2 -1
- package/LineChart/seriesConfig/tooltip.mjs +2 -1
- package/PieChart/FocusedPieArc.js +8 -6
- package/PieChart/FocusedPieArc.mjs +8 -6
- package/PieChart/PieArc.d.mts +14 -11
- package/PieChart/PieArc.d.ts +14 -11
- package/PieChart/PieArc.js +22 -4
- package/PieChart/PieArc.mjs +24 -4
- package/PieChart/PieArcLabel.d.mts +16 -2
- package/PieChart/PieArcLabel.d.ts +16 -2
- package/PieChart/PieArcLabel.js +26 -5
- package/PieChart/PieArcLabel.mjs +28 -5
- package/PieChart/PieArcLabelPlot.js +6 -1
- package/PieChart/PieArcLabelPlot.mjs +6 -1
- package/PieChart/PieArcPlot.js +6 -1
- package/PieChart/PieArcPlot.mjs +6 -1
- package/PieChart/PieChart.js +5 -2
- package/PieChart/PieChart.mjs +5 -2
- package/PieChart/PiePlot.d.mts +1 -0
- package/PieChart/PiePlot.d.ts +1 -0
- package/PieChart/PiePlot.js +4 -1
- package/PieChart/PiePlot.mjs +4 -1
- package/PieChart/dataTransform/useTransformData.js +6 -8
- package/PieChart/dataTransform/useTransformData.mjs +6 -8
- package/PieChart/pieClasses.d.mts +22 -1
- package/PieChart/pieClasses.d.ts +22 -1
- package/PieChart/pieClasses.js +10 -3
- package/PieChart/pieClasses.mjs +10 -3
- package/RadarChart/RadarChart.js +5 -2
- package/RadarChart/RadarChart.mjs +5 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +3 -3
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +3 -3
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +7 -14
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +7 -14
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +7 -14
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +7 -14
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +4 -9
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +4 -9
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.mts +1 -1
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +1 -1
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -16
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.mjs +8 -16
- package/RadarChart/seriesConfig/tooltip.js +13 -8
- package/RadarChart/seriesConfig/tooltip.mjs +13 -8
- package/RadarChart/useRadarChartProps.js +3 -3
- package/RadarChart/useRadarChartProps.mjs +3 -3
- package/ScatterChart/BatchScatter.d.mts +2 -1
- package/ScatterChart/BatchScatter.d.ts +2 -1
- package/ScatterChart/BatchScatter.js +5 -3
- package/ScatterChart/BatchScatter.mjs +4 -3
- package/ScatterChart/FocusedScatterMark.d.mts +4 -1
- package/ScatterChart/FocusedScatterMark.d.ts +4 -1
- package/ScatterChart/FocusedScatterMark.js +12 -2
- package/ScatterChart/FocusedScatterMark.mjs +11 -1
- package/ScatterChart/Scatter.d.mts +1 -1
- package/ScatterChart/Scatter.d.ts +1 -1
- package/ScatterChart/Scatter.js +11 -9
- package/ScatterChart/Scatter.mjs +11 -9
- package/ScatterChart/ScatterChart.js +5 -2
- package/ScatterChart/ScatterChart.mjs +5 -2
- package/ScatterChart/ScatterPlot.d.mts +2 -1
- package/ScatterChart/ScatterPlot.d.ts +2 -1
- package/ScatterChart/ScatterPlot.js +16 -2
- package/ScatterChart/ScatterPlot.mjs +16 -2
- package/ScatterChart/index.d.mts +2 -2
- package/ScatterChart/index.d.ts +2 -2
- package/ScatterChart/scatterClasses.d.mts +14 -2
- package/ScatterChart/scatterClasses.d.ts +14 -2
- package/ScatterChart/scatterClasses.js +9 -3
- package/ScatterChart/scatterClasses.mjs +9 -3
- package/SparkLineChart/SparkLineChart.js +5 -2
- package/SparkLineChart/SparkLineChart.mjs +5 -2
- package/context/ChartApi.d.mts +1 -1
- package/context/ChartApi.d.ts +1 -1
- package/context/ChartProvider/ChartProvider.types.d.mts +2 -2
- package/context/ChartProvider/ChartProvider.types.d.ts +2 -2
- package/context/ChartsProvider/ChartsProvider.d.mts +1 -1
- package/context/ChartsProvider/ChartsProvider.d.ts +1 -1
- package/context/ChartsProvider/ChartsProvider.types.d.mts +3 -3
- package/context/ChartsProvider/ChartsProvider.types.d.ts +3 -3
- package/hooks/index.d.mts +2 -2
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +8 -8
- package/hooks/index.mjs +2 -2
- package/hooks/useInteractionItemProps.d.mts +1 -2
- package/hooks/useInteractionItemProps.d.ts +1 -2
- package/hooks/{useItemHighlighted.d.mts → useItemHighlightState.d.mts} +5 -13
- package/hooks/{useItemHighlighted.d.ts → useItemHighlightState.d.ts} +5 -13
- package/hooks/{useItemHighlighted.js → useItemHighlightState.js} +5 -10
- package/hooks/useItemHighlightState.mjs +17 -0
- package/hooks/useItemHighlightStateGetter.d.mts +9 -0
- package/hooks/useItemHighlightStateGetter.d.ts +9 -0
- package/hooks/useItemHighlightStateGetter.js +21 -0
- package/hooks/useItemHighlightStateGetter.mjs +16 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/commonNextFocusItem.d.mts +5 -5
- package/internals/commonNextFocusItem.d.ts +5 -5
- package/internals/createCommonKeyboardFocusHandler.d.mts +2 -2
- package/internals/createCommonKeyboardFocusHandler.d.ts +2 -2
- package/internals/identifierCleaner.d.mts +8 -4
- package/internals/identifierCleaner.d.ts +8 -4
- package/internals/identifierCleaner.js +5 -1
- package/internals/identifierCleaner.mjs +5 -1
- package/internals/identifierSerializer.d.mts +10 -2
- package/internals/identifierSerializer.d.ts +10 -2
- package/internals/identifierSerializer.js +8 -0
- package/internals/identifierSerializer.mjs +8 -0
- package/internals/plugins/allPlugins.d.mts +2 -2
- package/internals/plugins/allPlugins.d.ts +2 -2
- package/internals/plugins/corePlugins/corePlugins.d.mts +1 -1
- package/internals/plugins/corePlugins/corePlugins.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.mts +6 -6
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +6 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.mts +9 -9
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +9 -9
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.d.ts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/cartesianExtremumGetter.types.d.mts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/cartesianExtremumGetter.types.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemAtPosition.types.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemAtPosition.types.d.ts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getSeriesWithDefaultValues.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierCleaner.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierCleaner.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierSerializer.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierSerializer.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/legendGetter.types.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/legendGetter.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.mts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +28 -28
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +28 -28
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesLayout.types.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesLayout.types.d.ts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesProcessor.types.d.mts +6 -6
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesProcessor.types.d.ts +6 -6
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.mts +21 -11
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +21 -11
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.d.mts +10 -10
- package/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.d.ts +10 -10
- package/internals/plugins/corePlugins/useChartSeriesConfig/utils/cleanIdentifier.d.mts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/utils/cleanIdentifier.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/utils/serializeIdentifier.d.mts +3 -3
- package/internals/plugins/corePlugins/useChartSeriesConfig/utils/serializeIdentifier.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.mts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.mts +1 -2
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +1 -2
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +0 -5
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.mjs +0 -4
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.mts +10 -29
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +10 -29
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +27 -64
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.mjs +24 -60
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +8 -10
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs +8 -10
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +1 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs +1 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.mts +8 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +8 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisTriggerTooltip.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisTriggerTooltip.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +6 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.mjs +6 -4
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.mts +10 -10
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +10 -10
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.mts +16 -16
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +16 -16
- package/internals/plugins/models/chart.d.mts +1 -1
- package/internals/plugins/models/chart.d.ts +1 -1
- package/models/seriesType/config.d.mts +18 -6
- package/models/seriesType/config.d.ts +18 -6
- package/models/seriesType/index.d.mts +8 -8
- package/models/seriesType/index.d.ts +8 -8
- package/models/seriesType/line.d.mts +2 -1
- package/models/seriesType/line.d.ts +2 -1
- package/models/seriesType/radar.d.mts +1 -1
- package/models/seriesType/radar.d.ts +1 -1
- package/package.json +3 -3
- package/themeAugmentation/components.d.mts +26 -1
- package/themeAugmentation/components.d.ts +26 -1
- package/themeAugmentation/overrides.d.mts +15 -1
- package/themeAugmentation/overrides.d.ts +15 -1
- package/hooks/useItemHighlighted.mjs +0 -22
- package/hooks/useItemHighlightedGetter.d.mts +0 -53
- package/hooks/useItemHighlightedGetter.d.ts +0 -53
- package/hooks/useItemHighlightedGetter.js +0 -26
- package/hooks/useItemHighlightedGetter.mjs +0 -21
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.BatchScatter = BatchScatter;
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
12
|
var _styles = require("@mui/material/styles");
|
|
11
13
|
var _scatterClasses = require("./scatterClasses");
|
|
12
14
|
var _ChartProvider = require("../context/ChartProvider");
|
|
@@ -113,7 +115,7 @@ function BatchScatter(props) {
|
|
|
113
115
|
yScale,
|
|
114
116
|
color,
|
|
115
117
|
colorGetter,
|
|
116
|
-
|
|
118
|
+
className
|
|
117
119
|
} = props;
|
|
118
120
|
const {
|
|
119
121
|
store
|
|
@@ -124,7 +126,7 @@ function BatchScatter(props) {
|
|
|
124
126
|
const seriesUnfadedItem = store.use(_useChartHighlight.selectorChartSeriesUnfadedItem, series.id);
|
|
125
127
|
const highlightedModifier = 1.2;
|
|
126
128
|
const markerSize = series.markerSize * (isSeriesHighlighted ? highlightedModifier : 1);
|
|
127
|
-
const classes = (0, _scatterClasses.useUtilityClasses)(
|
|
129
|
+
const classes = (0, _scatterClasses.useUtilityClasses)(props);
|
|
128
130
|
const siblings = [];
|
|
129
131
|
if (seriesHighlightedItem != null) {
|
|
130
132
|
const datum = series.data[seriesHighlightedItem];
|
|
@@ -147,7 +149,7 @@ function BatchScatter(props) {
|
|
|
147
149
|
}
|
|
148
150
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
149
151
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Group, {
|
|
150
|
-
className: classes.
|
|
152
|
+
className: (0, _clsx.default)(classes.series, className),
|
|
151
153
|
"data-series": series.id,
|
|
152
154
|
"data-faded": isSeriesFaded || undefined,
|
|
153
155
|
"data-highlighted": isSeriesHighlighted || undefined,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
4
5
|
import { styled } from '@mui/material/styles';
|
|
5
6
|
import { useUtilityClasses } from "./scatterClasses.mjs";
|
|
6
7
|
import { useChartContext } from "../context/ChartProvider/index.mjs";
|
|
@@ -107,7 +108,7 @@ export function BatchScatter(props) {
|
|
|
107
108
|
yScale,
|
|
108
109
|
color,
|
|
109
110
|
colorGetter,
|
|
110
|
-
|
|
111
|
+
className
|
|
111
112
|
} = props;
|
|
112
113
|
const {
|
|
113
114
|
store
|
|
@@ -118,7 +119,7 @@ export function BatchScatter(props) {
|
|
|
118
119
|
const seriesUnfadedItem = store.use(selectorChartSeriesUnfadedItem, series.id);
|
|
119
120
|
const highlightedModifier = 1.2;
|
|
120
121
|
const markerSize = series.markerSize * (isSeriesHighlighted ? highlightedModifier : 1);
|
|
121
|
-
const classes = useUtilityClasses(
|
|
122
|
+
const classes = useUtilityClasses(props);
|
|
122
123
|
const siblings = [];
|
|
123
124
|
if (seriesHighlightedItem != null) {
|
|
124
125
|
const datum = series.data[seriesHighlightedItem];
|
|
@@ -141,7 +142,7 @@ export function BatchScatter(props) {
|
|
|
141
142
|
}
|
|
142
143
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
143
144
|
children: [/*#__PURE__*/_jsx(Group, {
|
|
144
|
-
className: classes.
|
|
145
|
+
className: clsx(classes.series, className),
|
|
145
146
|
"data-series": series.id,
|
|
146
147
|
"data-faded": isSeriesFaded || undefined,
|
|
147
148
|
"data-highlighted": isSeriesHighlighted || undefined,
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function FocusedScatterMark(
|
|
2
|
+
export declare function FocusedScatterMark({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}: React.SVGAttributes<SVGRectElement>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function FocusedScatterMark(
|
|
2
|
+
export declare function FocusedScatterMark({
|
|
3
|
+
className,
|
|
4
|
+
...props
|
|
5
|
+
}: React.SVGAttributes<SVGRectElement>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.FocusedScatterMark = FocusedScatterMark;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
14
|
var _styles = require("@mui/material/styles");
|
|
13
15
|
var _useFocusedItem = require("../hooks/useFocusedItem");
|
|
14
16
|
var _hooks = require("../hooks");
|
|
17
|
+
var _scatterClasses = require("./scatterClasses");
|
|
15
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
|
|
19
|
+
const _excluded = ["className"];
|
|
20
|
+
function FocusedScatterMark(_ref) {
|
|
21
|
+
let {
|
|
22
|
+
className
|
|
23
|
+
} = _ref,
|
|
24
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
17
25
|
const theme = (0, _styles.useTheme)();
|
|
18
26
|
const focusedItem = (0, _useFocusedItem.useFocusedItem)();
|
|
19
27
|
const scatterSeries = (0, _hooks.useScatterSeriesContext)();
|
|
@@ -25,6 +33,7 @@ function FocusedScatterMark(props) {
|
|
|
25
33
|
yAxis,
|
|
26
34
|
yAxisIds
|
|
27
35
|
} = (0, _hooks.useYAxes)();
|
|
36
|
+
const classes = (0, _scatterClasses.useUtilityClasses)();
|
|
28
37
|
if (focusedItem === null || focusedItem.type !== 'scatter' || !scatterSeries) {
|
|
29
38
|
return null;
|
|
30
39
|
}
|
|
@@ -38,6 +47,7 @@ function FocusedScatterMark(props) {
|
|
|
38
47
|
const y = getYPosition(scatterPoint.y);
|
|
39
48
|
const size = series.markerSize + 3;
|
|
40
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", (0, _extends2.default)({
|
|
50
|
+
className: (0, _clsx.default)(classes.focusedMark, className),
|
|
41
51
|
fill: "none",
|
|
42
52
|
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
43
53
|
strokeWidth: 2,
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["className"];
|
|
4
6
|
import * as React from 'react';
|
|
7
|
+
import clsx from 'clsx';
|
|
5
8
|
import { useTheme } from '@mui/material/styles';
|
|
6
9
|
import { useFocusedItem } from "../hooks/useFocusedItem.mjs";
|
|
7
10
|
import { getValueToPositionMapper, useScatterSeriesContext, useXAxes, useYAxes } from "../hooks/index.mjs";
|
|
11
|
+
import { useUtilityClasses } from "./scatterClasses.mjs";
|
|
8
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export function FocusedScatterMark(
|
|
13
|
+
export function FocusedScatterMark(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
className
|
|
16
|
+
} = _ref,
|
|
17
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
10
18
|
const theme = useTheme();
|
|
11
19
|
const focusedItem = useFocusedItem();
|
|
12
20
|
const scatterSeries = useScatterSeriesContext();
|
|
@@ -18,6 +26,7 @@ export function FocusedScatterMark(props) {
|
|
|
18
26
|
yAxis,
|
|
19
27
|
yAxisIds
|
|
20
28
|
} = useYAxes();
|
|
29
|
+
const classes = useUtilityClasses();
|
|
21
30
|
if (focusedItem === null || focusedItem.type !== 'scatter' || !scatterSeries) {
|
|
22
31
|
return null;
|
|
23
32
|
}
|
|
@@ -31,6 +40,7 @@ export function FocusedScatterMark(props) {
|
|
|
31
40
|
const y = getYPosition(scatterPoint.y);
|
|
32
41
|
const size = series.markerSize + 3;
|
|
33
42
|
return /*#__PURE__*/_jsx("rect", _extends({
|
|
43
|
+
className: clsx(classes.focusedMark, className),
|
|
34
44
|
fill: "none",
|
|
35
45
|
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
36
46
|
strokeWidth: 2,
|
|
@@ -3,7 +3,7 @@ import { type ScatterMarkerSlotProps, type ScatterMarkerSlots } from "./ScatterM
|
|
|
3
3
|
import { type DefaultizedScatterSeriesType, type ScatterItemIdentifier } from "../models/seriesType/scatter.mjs";
|
|
4
4
|
import { type D3Scale } from "../models/axis.mjs";
|
|
5
5
|
import { type ColorGetter } from "../internals/plugins/corePlugins/useChartSeriesConfig/index.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import type { ScatterClasses } from "./scatterClasses.mjs";
|
|
7
7
|
export interface ScatterProps {
|
|
8
8
|
series: DefaultizedScatterSeriesType;
|
|
9
9
|
xScale: D3Scale;
|
|
@@ -3,7 +3,7 @@ import { type ScatterMarkerSlotProps, type ScatterMarkerSlots } from "./ScatterM
|
|
|
3
3
|
import { type DefaultizedScatterSeriesType, type ScatterItemIdentifier } from "../models/seriesType/scatter.js";
|
|
4
4
|
import { type D3Scale } from "../models/axis.js";
|
|
5
5
|
import { type ColorGetter } from "../internals/plugins/corePlugins/useChartSeriesConfig/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import type { ScatterClasses } from "./scatterClasses.js";
|
|
7
7
|
export interface ScatterProps {
|
|
8
8
|
series: DefaultizedScatterSeriesType;
|
|
9
9
|
xScale: D3Scale;
|
package/ScatterChart/Scatter.js
CHANGED
|
@@ -11,10 +11,11 @@ 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 _clsx = _interopRequireDefault(require("clsx"));
|
|
14
15
|
var _useSlotProps2 = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
15
16
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
16
17
|
var _useStore = require("../internals/store/useStore");
|
|
17
|
-
var
|
|
18
|
+
var _useItemHighlightStateGetter = require("../hooks/useItemHighlightStateGetter");
|
|
18
19
|
var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
|
|
19
20
|
var _ScatterMarker = require("./ScatterMarker");
|
|
20
21
|
var _scatterClasses = require("./scatterClasses");
|
|
@@ -49,10 +50,7 @@ function Scatter(props) {
|
|
|
49
50
|
const store = (0, _useStore.useStore)();
|
|
50
51
|
const isVoronoiEnabled = store.use(_useChartClosestPoint.selectorChartsIsVoronoiEnabled);
|
|
51
52
|
const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
|
|
52
|
-
const
|
|
53
|
-
isFaded,
|
|
54
|
-
isHighlighted
|
|
55
|
-
} = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
|
|
53
|
+
const getHighlightState = (0, _useItemHighlightStateGetter.useItemHighlightStateGetter)();
|
|
56
54
|
const scatterPlotData = (0, _useScatterPlotData.useScatterPlotData)(series, xScale, yScale, instance.isPointInside);
|
|
57
55
|
const Marker = slots?.marker ?? _ScatterMarker.ScatterMarker;
|
|
58
56
|
const _useSlotProps = (0, _useSlotProps2.default)({
|
|
@@ -65,14 +63,18 @@ function Scatter(props) {
|
|
|
65
63
|
ownerState: {}
|
|
66
64
|
}),
|
|
67
65
|
markerProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded);
|
|
68
|
-
const classes = (0, _scatterClasses.useUtilityClasses)(
|
|
66
|
+
const classes = (0, _scatterClasses.useUtilityClasses)({
|
|
67
|
+
classes: inClasses
|
|
68
|
+
});
|
|
69
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
70
70
|
"data-series": series.id,
|
|
71
|
-
className: classes.
|
|
71
|
+
className: classes.series,
|
|
72
72
|
children: scatterPlotData.map(dataPoint => {
|
|
73
|
-
const
|
|
74
|
-
const
|
|
73
|
+
const highlightState = getHighlightState(dataPoint);
|
|
74
|
+
const isItemHighlighted = highlightState === 'highlighted';
|
|
75
|
+
const isItemFaded = highlightState === 'faded';
|
|
75
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Marker, (0, _extends2.default)({
|
|
77
|
+
className: (0, _clsx.default)(classes.marker, markerProps.className),
|
|
76
78
|
dataIndex: dataPoint.dataIndex,
|
|
77
79
|
color: colorGetter(dataPoint.dataIndex),
|
|
78
80
|
isHighlighted: isItemHighlighted,
|
package/ScatterChart/Scatter.mjs
CHANGED
|
@@ -5,10 +5,11 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["ownerState"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
10
|
import { getInteractionItemProps } from "../hooks/useInteractionItemProps.mjs";
|
|
10
11
|
import { useStore } from "../internals/store/useStore.mjs";
|
|
11
|
-
import {
|
|
12
|
+
import { useItemHighlightStateGetter } from "../hooks/useItemHighlightStateGetter.mjs";
|
|
12
13
|
import { selectorChartsIsVoronoiEnabled } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.mjs";
|
|
13
14
|
import { ScatterMarker } from "./ScatterMarker.mjs";
|
|
14
15
|
import { useUtilityClasses } from "./scatterClasses.mjs";
|
|
@@ -42,10 +43,7 @@ function Scatter(props) {
|
|
|
42
43
|
const store = useStore();
|
|
43
44
|
const isVoronoiEnabled = store.use(selectorChartsIsVoronoiEnabled);
|
|
44
45
|
const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
|
|
45
|
-
const
|
|
46
|
-
isFaded,
|
|
47
|
-
isHighlighted
|
|
48
|
-
} = useItemHighlightedGetter();
|
|
46
|
+
const getHighlightState = useItemHighlightStateGetter();
|
|
49
47
|
const scatterPlotData = useScatterPlotData(series, xScale, yScale, instance.isPointInside);
|
|
50
48
|
const Marker = slots?.marker ?? ScatterMarker;
|
|
51
49
|
const _useSlotProps = useSlotProps({
|
|
@@ -58,14 +56,18 @@ function Scatter(props) {
|
|
|
58
56
|
ownerState: {}
|
|
59
57
|
}),
|
|
60
58
|
markerProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded);
|
|
61
|
-
const classes = useUtilityClasses(
|
|
59
|
+
const classes = useUtilityClasses({
|
|
60
|
+
classes: inClasses
|
|
61
|
+
});
|
|
62
62
|
return /*#__PURE__*/_jsx("g", {
|
|
63
63
|
"data-series": series.id,
|
|
64
|
-
className: classes.
|
|
64
|
+
className: classes.series,
|
|
65
65
|
children: scatterPlotData.map(dataPoint => {
|
|
66
|
-
const
|
|
67
|
-
const
|
|
66
|
+
const highlightState = getHighlightState(dataPoint);
|
|
67
|
+
const isItemHighlighted = highlightState === 'highlighted';
|
|
68
|
+
const isItemFaded = highlightState === 'faded';
|
|
68
69
|
return /*#__PURE__*/_jsx(Marker, _extends({
|
|
70
|
+
className: clsx(classes.marker, markerProps.className),
|
|
69
71
|
dataIndex: dataPoint.dataIndex,
|
|
70
72
|
color: colorGetter(dataPoint.dataIndex),
|
|
71
73
|
isHighlighted: isItemHighlighted,
|
|
@@ -120,12 +120,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
120
120
|
* @default false
|
|
121
121
|
*/
|
|
122
122
|
disableAxisListener: _propTypes.default.bool,
|
|
123
|
+
/**
|
|
124
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
125
|
+
*/
|
|
126
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
123
127
|
/**
|
|
124
128
|
* If true, the interaction will not use the Voronoi cell and fall back to hover events.
|
|
125
129
|
* @default false
|
|
126
130
|
*/
|
|
127
131
|
disableVoronoi: _propTypes.default.bool,
|
|
128
|
-
enableKeyboardNavigation: _propTypes.default.bool,
|
|
129
132
|
/**
|
|
130
133
|
* Option to display a cartesian grid in the background.
|
|
131
134
|
*/
|
|
@@ -273,7 +276,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
273
276
|
/**
|
|
274
277
|
* The callback fired when the tooltip item changes.
|
|
275
278
|
*
|
|
276
|
-
* @param {SeriesItemIdentifier<
|
|
279
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
277
280
|
*/
|
|
278
281
|
onTooltipItemChange: _propTypes.default.func,
|
|
279
282
|
/**
|
|
@@ -113,12 +113,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
113
113
|
* @default false
|
|
114
114
|
*/
|
|
115
115
|
disableAxisListener: PropTypes.bool,
|
|
116
|
+
/**
|
|
117
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
118
|
+
*/
|
|
119
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
116
120
|
/**
|
|
117
121
|
* If true, the interaction will not use the Voronoi cell and fall back to hover events.
|
|
118
122
|
* @default false
|
|
119
123
|
*/
|
|
120
124
|
disableVoronoi: PropTypes.bool,
|
|
121
|
-
enableKeyboardNavigation: PropTypes.bool,
|
|
122
125
|
/**
|
|
123
126
|
* Option to display a cartesian grid in the background.
|
|
124
127
|
*/
|
|
@@ -266,7 +269,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
266
269
|
/**
|
|
267
270
|
* The callback fired when the tooltip item changes.
|
|
268
271
|
*
|
|
269
|
-
* @param {SeriesItemIdentifier<
|
|
272
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
270
273
|
*/
|
|
271
274
|
onTooltipItemChange: PropTypes.func,
|
|
272
275
|
/**
|
|
@@ -7,7 +7,8 @@ export interface ScatterPlotSlotProps extends ScatterSlotProps {
|
|
|
7
7
|
scatter?: Partial<ScatterProps>;
|
|
8
8
|
}
|
|
9
9
|
export type RendererType = 'svg-single' | 'svg-batch';
|
|
10
|
-
export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick'> {
|
|
10
|
+
export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick' | 'classes'> {
|
|
11
|
+
className?: string;
|
|
11
12
|
/**
|
|
12
13
|
* Overridable component slots.
|
|
13
14
|
* @default {}
|
|
@@ -7,7 +7,8 @@ export interface ScatterPlotSlotProps extends ScatterSlotProps {
|
|
|
7
7
|
scatter?: Partial<ScatterProps>;
|
|
8
8
|
}
|
|
9
9
|
export type RendererType = 'svg-single' | 'svg-batch';
|
|
10
|
-
export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick'> {
|
|
10
|
+
export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick' | 'classes'> {
|
|
11
|
+
className?: string;
|
|
11
12
|
/**
|
|
12
13
|
* Overridable component slots.
|
|
13
14
|
* @default {}
|
|
@@ -10,13 +10,21 @@ exports.ScatterPlot = ScatterPlot;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
+
var _styles = require("@mui/material/styles");
|
|
13
15
|
var _Scatter = require("./Scatter");
|
|
14
16
|
var _useScatterSeries = require("../hooks/useScatterSeries");
|
|
15
17
|
var _hooks = require("../hooks");
|
|
16
18
|
var _useZAxis = require("../hooks/useZAxis");
|
|
17
19
|
var _seriesConfig = require("./seriesConfig");
|
|
18
20
|
var _BatchScatter = require("./BatchScatter");
|
|
21
|
+
var _scatterClasses = require("./scatterClasses");
|
|
19
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
const ScatterPlotRoot = (0, _styles.styled)('g', {
|
|
24
|
+
name: 'MuiScatterPlot',
|
|
25
|
+
slot: 'Root'
|
|
26
|
+
})();
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* Demos:
|
|
22
30
|
*
|
|
@@ -32,7 +40,9 @@ function ScatterPlot(props) {
|
|
|
32
40
|
slots,
|
|
33
41
|
slotProps,
|
|
34
42
|
onItemClick,
|
|
35
|
-
renderer
|
|
43
|
+
renderer,
|
|
44
|
+
className,
|
|
45
|
+
classes: inClasses
|
|
36
46
|
} = props;
|
|
37
47
|
const seriesData = (0, _useScatterSeries.useScatterSeriesContext)();
|
|
38
48
|
const {
|
|
@@ -47,6 +57,9 @@ function ScatterPlot(props) {
|
|
|
47
57
|
zAxis,
|
|
48
58
|
zAxisIds
|
|
49
59
|
} = (0, _useZAxis.useZAxes)();
|
|
60
|
+
const classes = (0, _scatterClasses.useUtilityClasses)({
|
|
61
|
+
classes: inClasses
|
|
62
|
+
});
|
|
50
63
|
if (seriesData === undefined) {
|
|
51
64
|
return null;
|
|
52
65
|
}
|
|
@@ -59,7 +72,8 @@ function ScatterPlot(props) {
|
|
|
59
72
|
const defaultZAxisId = zAxisIds[0];
|
|
60
73
|
const DefaultScatterItems = renderer === 'svg-batch' ? _BatchScatter.BatchScatter : _Scatter.Scatter;
|
|
61
74
|
const ScatterItems = slots?.scatter ?? DefaultScatterItems;
|
|
62
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScatterPlotRoot, {
|
|
76
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
63
77
|
children: seriesOrder.map(seriesId => {
|
|
64
78
|
const {
|
|
65
79
|
id,
|
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { styled } from '@mui/material/styles';
|
|
6
8
|
import { Scatter } from "./Scatter.mjs";
|
|
7
9
|
import { useScatterSeriesContext } from "../hooks/useScatterSeries.mjs";
|
|
8
10
|
import { useXAxes, useYAxes } from "../hooks/index.mjs";
|
|
9
11
|
import { useZAxes } from "../hooks/useZAxis.mjs";
|
|
10
12
|
import { scatterSeriesConfig } from "./seriesConfig/index.mjs";
|
|
11
13
|
import { BatchScatter } from "./BatchScatter.mjs";
|
|
14
|
+
import { useUtilityClasses } from "./scatterClasses.mjs";
|
|
12
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
const ScatterPlotRoot = styled('g', {
|
|
17
|
+
name: 'MuiScatterPlot',
|
|
18
|
+
slot: 'Root'
|
|
19
|
+
})();
|
|
20
|
+
|
|
13
21
|
/**
|
|
14
22
|
* Demos:
|
|
15
23
|
*
|
|
@@ -25,7 +33,9 @@ function ScatterPlot(props) {
|
|
|
25
33
|
slots,
|
|
26
34
|
slotProps,
|
|
27
35
|
onItemClick,
|
|
28
|
-
renderer
|
|
36
|
+
renderer,
|
|
37
|
+
className,
|
|
38
|
+
classes: inClasses
|
|
29
39
|
} = props;
|
|
30
40
|
const seriesData = useScatterSeriesContext();
|
|
31
41
|
const {
|
|
@@ -40,6 +50,9 @@ function ScatterPlot(props) {
|
|
|
40
50
|
zAxis,
|
|
41
51
|
zAxisIds
|
|
42
52
|
} = useZAxes();
|
|
53
|
+
const classes = useUtilityClasses({
|
|
54
|
+
classes: inClasses
|
|
55
|
+
});
|
|
43
56
|
if (seriesData === undefined) {
|
|
44
57
|
return null;
|
|
45
58
|
}
|
|
@@ -52,7 +65,8 @@ function ScatterPlot(props) {
|
|
|
52
65
|
const defaultZAxisId = zAxisIds[0];
|
|
53
66
|
const DefaultScatterItems = renderer === 'svg-batch' ? BatchScatter : Scatter;
|
|
54
67
|
const ScatterItems = slots?.scatter ?? DefaultScatterItems;
|
|
55
|
-
return /*#__PURE__*/_jsx(
|
|
68
|
+
return /*#__PURE__*/_jsx(ScatterPlotRoot, {
|
|
69
|
+
className: clsx(classes.root, className),
|
|
56
70
|
children: seriesOrder.map(seriesId => {
|
|
57
71
|
const {
|
|
58
72
|
id,
|
package/ScatterChart/index.d.mts
CHANGED
|
@@ -5,5 +5,5 @@ export * from "./ScatterMarker.types.mjs";
|
|
|
5
5
|
export * from "./ScatterMarker.mjs";
|
|
6
6
|
export * from "./FocusedScatterMark.mjs";
|
|
7
7
|
export * from "./ScatterChart.plugins.mjs";
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
8
|
+
export { scatterClasses } from "./scatterClasses.mjs";
|
|
9
|
+
export type { ScatterClassKey, ScatterClasses } from "./scatterClasses.mjs";
|
package/ScatterChart/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export * from "./ScatterMarker.types.js";
|
|
|
5
5
|
export * from "./ScatterMarker.js";
|
|
6
6
|
export * from "./FocusedScatterMark.js";
|
|
7
7
|
export * from "./ScatterChart.plugins.js";
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
8
|
+
export { scatterClasses } from "./scatterClasses.js";
|
|
9
|
+
export type { ScatterClassKey, ScatterClasses } from "./scatterClasses.js";
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
export interface ScatterClasses {
|
|
2
|
-
/** Styles applied to the
|
|
2
|
+
/** Styles applied to the scatter plot element. */
|
|
3
3
|
root: string;
|
|
4
|
+
/** Styles applied to the group surrounding a series' scatter elements. */
|
|
5
|
+
series: string;
|
|
6
|
+
/**
|
|
7
|
+
* Styles applied to an individual scatter marker element.
|
|
8
|
+
* Not applied when using the `svg-batch` renderer.
|
|
9
|
+
*/
|
|
10
|
+
marker: string;
|
|
11
|
+
/** Styles applied to the focused scatter mark element. */
|
|
12
|
+
focusedMark: string;
|
|
4
13
|
}
|
|
5
14
|
export type ScatterClassKey = keyof ScatterClasses;
|
|
6
15
|
export declare function getScatterUtilityClass(slot: string): string;
|
|
7
16
|
export declare const scatterClasses: ScatterClasses;
|
|
8
|
-
export
|
|
17
|
+
export interface UseUtilityClassesOptions {
|
|
18
|
+
classes?: Partial<ScatterClasses>;
|
|
19
|
+
}
|
|
20
|
+
export declare const useUtilityClasses: (options?: UseUtilityClassesOptions) => Record<"root" | "marker" | "series" | "focusedMark", string>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
export interface ScatterClasses {
|
|
2
|
-
/** Styles applied to the
|
|
2
|
+
/** Styles applied to the scatter plot element. */
|
|
3
3
|
root: string;
|
|
4
|
+
/** Styles applied to the group surrounding a series' scatter elements. */
|
|
5
|
+
series: string;
|
|
6
|
+
/**
|
|
7
|
+
* Styles applied to an individual scatter marker element.
|
|
8
|
+
* Not applied when using the `svg-batch` renderer.
|
|
9
|
+
*/
|
|
10
|
+
marker: string;
|
|
11
|
+
/** Styles applied to the focused scatter mark element. */
|
|
12
|
+
focusedMark: string;
|
|
4
13
|
}
|
|
5
14
|
export type ScatterClassKey = keyof ScatterClasses;
|
|
6
15
|
export declare function getScatterUtilityClass(slot: string): string;
|
|
7
16
|
export declare const scatterClasses: ScatterClasses;
|
|
8
|
-
export
|
|
17
|
+
export interface UseUtilityClassesOptions {
|
|
18
|
+
classes?: Partial<ScatterClasses>;
|
|
19
|
+
}
|
|
20
|
+
export declare const useUtilityClasses: (options?: UseUtilityClassesOptions) => Record<"root" | "marker" | "series" | "focusedMark", string>;
|
|
@@ -12,10 +12,16 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
12
12
|
function getScatterUtilityClass(slot) {
|
|
13
13
|
return (0, _generateUtilityClass.default)('MuiScatterChart', slot);
|
|
14
14
|
}
|
|
15
|
-
const scatterClasses = exports.scatterClasses = (0, _generateUtilityClasses.default)('MuiScatterChart', ['root']);
|
|
16
|
-
const useUtilityClasses =
|
|
15
|
+
const scatterClasses = exports.scatterClasses = (0, _generateUtilityClasses.default)('MuiScatterChart', ['root', 'series', 'marker', 'focusedMark']);
|
|
16
|
+
const useUtilityClasses = options => {
|
|
17
|
+
const {
|
|
18
|
+
classes
|
|
19
|
+
} = options ?? {};
|
|
17
20
|
const slots = {
|
|
18
|
-
root: ['root']
|
|
21
|
+
root: ['root'],
|
|
22
|
+
series: ['series'],
|
|
23
|
+
marker: ['marker'],
|
|
24
|
+
focusedMark: ['focusedMark']
|
|
19
25
|
};
|
|
20
26
|
return (0, _composeClasses.default)(slots, getScatterUtilityClass, classes);
|
|
21
27
|
};
|
|
@@ -4,10 +4,16 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
|
4
4
|
export function getScatterUtilityClass(slot) {
|
|
5
5
|
return generateUtilityClass('MuiScatterChart', slot);
|
|
6
6
|
}
|
|
7
|
-
export const scatterClasses = generateUtilityClasses('MuiScatterChart', ['root']);
|
|
8
|
-
export const useUtilityClasses =
|
|
7
|
+
export const scatterClasses = generateUtilityClasses('MuiScatterChart', ['root', 'series', 'marker', 'focusedMark']);
|
|
8
|
+
export const useUtilityClasses = options => {
|
|
9
|
+
const {
|
|
10
|
+
classes
|
|
11
|
+
} = options ?? {};
|
|
9
12
|
const slots = {
|
|
10
|
-
root: ['root']
|
|
13
|
+
root: ['root'],
|
|
14
|
+
series: ['series'],
|
|
15
|
+
marker: ['marker'],
|
|
16
|
+
focusedMark: ['focusedMark']
|
|
11
17
|
};
|
|
12
18
|
return composeClasses(slots, getScatterUtilityClass, classes);
|
|
13
19
|
};
|
|
@@ -239,11 +239,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
239
239
|
* @default false
|
|
240
240
|
*/
|
|
241
241
|
disableClipping: _propTypes.default.bool,
|
|
242
|
+
/**
|
|
243
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
244
|
+
*/
|
|
245
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
242
246
|
/**
|
|
243
247
|
* If true, the voronoi interaction are ignored.
|
|
244
248
|
*/
|
|
245
249
|
disableVoronoi: _propTypes.default.bool,
|
|
246
|
-
enableKeyboardNavigation: _propTypes.default.bool,
|
|
247
250
|
/**
|
|
248
251
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
249
252
|
*/
|
|
@@ -473,7 +476,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
473
476
|
/**
|
|
474
477
|
* The callback fired when the tooltip item changes.
|
|
475
478
|
*
|
|
476
|
-
* @param {SeriesItemIdentifier<
|
|
479
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
477
480
|
*/
|
|
478
481
|
onTooltipItemChange: _propTypes.default.func,
|
|
479
482
|
/**
|
|
@@ -232,11 +232,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
232
232
|
* @default false
|
|
233
233
|
*/
|
|
234
234
|
disableClipping: PropTypes.bool,
|
|
235
|
+
/**
|
|
236
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
237
|
+
*/
|
|
238
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
235
239
|
/**
|
|
236
240
|
* If true, the voronoi interaction are ignored.
|
|
237
241
|
*/
|
|
238
242
|
disableVoronoi: PropTypes.bool,
|
|
239
|
-
enableKeyboardNavigation: PropTypes.bool,
|
|
240
243
|
/**
|
|
241
244
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
242
245
|
*/
|
|
@@ -466,7 +469,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
466
469
|
/**
|
|
467
470
|
* The callback fired when the tooltip item changes.
|
|
468
471
|
*
|
|
469
|
-
* @param {SeriesItemIdentifier<
|
|
472
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
470
473
|
*/
|
|
471
474
|
onTooltipItemChange: PropTypes.func,
|
|
472
475
|
/**
|
package/context/ChartApi.d.mts
CHANGED
|
@@ -19,4 +19,4 @@ export type PluginsPerSeriesType = {
|
|
|
19
19
|
* If the chart is being created using composition, the `composition` value can be used.
|
|
20
20
|
* @example ChartApi<'composition'>
|
|
21
21
|
*/
|
|
22
|
-
export type ChartApi<
|
|
22
|
+
export type ChartApi<SeriesType extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (SeriesType extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[SeriesType] : AllPluginSignatures)> = ChartPublicAPI<TSignatures>;
|
package/context/ChartApi.d.ts
CHANGED
|
@@ -19,4 +19,4 @@ export type PluginsPerSeriesType = {
|
|
|
19
19
|
* If the chart is being created using composition, the `composition` value can be used.
|
|
20
20
|
* @example ChartApi<'composition'>
|
|
21
21
|
*/
|
|
22
|
-
export type ChartApi<
|
|
22
|
+
export type ChartApi<SeriesType extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (SeriesType extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[SeriesType] : AllPluginSignatures)> = ChartPublicAPI<TSignatures>;
|