@mui/x-charts 9.9.0 → 9.10.1
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/barClasses.d.mts +1 -1
- package/BarChart/barClasses.d.ts +1 -1
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +10 -10
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +10 -10
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +3 -1
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.mjs +3 -1
- package/CHANGELOG.md +217 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +1 -1
- package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/getSampledBandHighlight.js +15 -3
- package/ChartsAxisHighlight/getSampledBandHighlight.mjs +15 -3
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +1 -1
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.mts +1 -1
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.ts +1 -1
- package/ChartsDataProvider/useChartsDataProviderProps.d.mts +1 -1
- package/ChartsDataProvider/useChartsDataProviderProps.d.ts +1 -1
- package/ChartsLabel/labelGradientClasses.d.mts +1 -1
- package/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.d.mts +1 -1
- package/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/ChartsLegend/chartsLegend.types.d.mts +2 -1
- package/ChartsLegend/chartsLegend.types.d.ts +2 -1
- package/ChartsLegend/chartsLegendClasses.d.mts +1 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/continuousColorLegendClasses.d.mts +1 -1
- package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/ChartsLegend/piecewiseColorLegendClasses.d.mts +1 -1
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.d.mts +1 -1
- package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.d.ts +1 -1
- package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.mts +1 -1
- package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.ts +1 -1
- package/ChartsRadiusAxis/createGetLabelTextAnchors.d.mts +6 -6
- package/ChartsRadiusAxis/createGetLabelTextAnchors.d.ts +6 -6
- package/ChartsReferenceLine/ChartsXReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsRotationAxis/chartsRotationAxisClasses.d.mts +1 -1
- package/ChartsRotationAxis/chartsRotationAxisClasses.d.ts +1 -1
- package/ChartsTooltip/ChartTooltip.types.d.mts +2 -1
- package/ChartsTooltip/ChartTooltip.types.d.ts +2 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.mts +4 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +4 -1
- package/ChartsTooltip/ChartsTooltipTable.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.mts +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/ChartsTooltip/useItemTooltip.d.mts +1 -1
- package/ChartsTooltip/useItemTooltip.d.ts +1 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +2573 -2573
- package/ChartsXAxis/useAxisTicksProps.d.ts +2573 -2573
- package/ChartsXAxis/utilities.d.mts +1 -1
- package/ChartsXAxis/utilities.d.ts +1 -1
- package/ChartsYAxis/useAxisTicksProps.d.mts +2573 -2573
- package/ChartsYAxis/useAxisTicksProps.d.ts +2573 -2573
- package/ChartsYAxis/utilities.d.mts +1 -1
- package/ChartsYAxis/utilities.d.ts +1 -1
- package/LineChart/AreaPlot.d.mts +3 -3
- package/LineChart/AreaPlot.d.ts +3 -3
- package/LineChart/AreaPlot.js +4 -5
- package/LineChart/AreaPlot.mjs +4 -5
- package/LineChart/LinePlot.d.mts +3 -3
- package/LineChart/LinePlot.d.ts +3 -3
- package/LineChart/LinePlot.js +4 -5
- package/LineChart/LinePlot.mjs +4 -5
- package/LineChart/MarkPlot.d.mts +5 -4
- package/LineChart/MarkPlot.d.ts +5 -4
- package/LineChart/MarkPlot.js +1 -1
- package/LineChart/MarkPlot.mjs +1 -1
- package/LineChart/lineClasses.d.mts +1 -1
- package/LineChart/lineClasses.d.ts +1 -1
- package/LineChart/seriesConfig/keyboardFocusHandler.js +3 -1
- package/LineChart/seriesConfig/keyboardFocusHandler.mjs +3 -1
- package/LineChart/useLineItemClickHandler.d.mts +12 -0
- package/LineChart/useLineItemClickHandler.d.ts +12 -0
- package/LineChart/useLineItemClickHandler.js +54 -0
- package/LineChart/useLineItemClickHandler.mjs +48 -0
- package/PieChart/PieArcLabelPlot.d.mts +2 -1
- package/PieChart/PieArcLabelPlot.d.ts +2 -1
- package/PieChart/PieArcPlot.d.mts +2 -1
- package/PieChart/PieArcPlot.d.ts +2 -1
- package/PieChart/pieClasses.d.mts +1 -1
- package/PieChart/pieClasses.d.ts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +4 -4
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +4 -4
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.d.mts +1 -1
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.d.ts +1 -1
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.mts +12 -12
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +12 -12
- package/RadarChart/radarClasses.d.mts +1 -1
- package/RadarChart/radarClasses.d.ts +1 -1
- package/RadarChart/seriesConfig/keyboardFocusHandler.js +3 -1
- package/RadarChart/seriesConfig/keyboardFocusHandler.mjs +3 -1
- package/RadarChart/useRadarChartProps.d.mts +1 -1
- package/RadarChart/useRadarChartProps.d.ts +1 -1
- package/ScatterChart/ScatterChart.d.mts +2 -1
- package/ScatterChart/ScatterChart.d.ts +2 -1
- package/ScatterChart/ScatterMarker.types.d.mts +2 -1
- package/ScatterChart/ScatterMarker.types.d.ts +2 -1
- package/ScatterChart/scatterClasses.d.mts +1 -1
- package/ScatterChart/scatterClasses.d.ts +1 -1
- package/ScatterChart/useScatterPlotData.d.mts +1 -1
- package/ScatterChart/useScatterPlotData.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.d.mts +1 -1
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/Toolbar/Toolbar.types.d.mts +2 -1
- package/Toolbar/Toolbar.types.d.ts +2 -1
- package/hooks/animation/useAnimatePieArc.js +2 -1
- package/hooks/animation/useAnimatePieArc.mjs +2 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/colorScale.d.mts +1 -1
- package/internals/colorScale.d.ts +1 -1
- package/internals/commonNextFocusItem.d.mts +2 -2
- package/internals/commonNextFocusItem.d.ts +2 -2
- package/internals/commonNextFocusItem.js +4 -4
- package/internals/commonNextFocusItem.mjs +4 -4
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -0
- package/internals/configInit.d.mts +1 -1
- package/internals/configInit.d.ts +1 -1
- package/internals/consumeSlots.d.mts +1 -1
- package/internals/consumeSlots.d.ts +1 -1
- package/internals/consumeThemeProps.d.mts +1 -1
- package/internals/consumeThemeProps.d.ts +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.mts +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.ts +1 -1
- package/internals/createGetBarDimensions.js +10 -5
- package/internals/createGetBarDimensions.mjs +10 -5
- package/internals/getGraphemeCount.d.mts +2 -2
- package/internals/getGraphemeCount.d.ts +2 -2
- package/internals/getGroupingConfig.d.mts +1 -1
- package/internals/getGroupingConfig.d.ts +1 -1
- package/internals/getSampledBucketRegion.d.mts +12 -0
- package/internals/getSampledBucketRegion.d.ts +12 -0
- package/internals/getSampledBucketRegion.js +23 -0
- package/internals/getSampledBucketRegion.mjs +17 -0
- package/internals/identifierCleaner.d.mts +1 -1
- package/internals/identifierCleaner.d.ts +1 -1
- package/internals/invertScale.d.mts +1 -1
- package/internals/invertScale.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- 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 +70 -70
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +70 -70
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +78 -78
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +78 -78
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.mts +7 -7
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +7 -7
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.mts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs +3 -0
- 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/useChartTooltip/useChartTooltip.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +1 -1
- package/internals/seriesSelectorOfType.d.mts +6 -6
- package/internals/seriesSelectorOfType.d.ts +6 -6
- package/internals/sizeScale.d.mts +1 -1
- package/internals/sizeScale.d.ts +1 -1
- package/internals/sliceUntil.d.mts +2 -2
- package/internals/sliceUntil.d.ts +2 -2
- package/internals/snapEndAngleToFullCircle.d.mts +20 -0
- package/internals/snapEndAngleToFullCircle.d.ts +20 -0
- package/internals/snapEndAngleToFullCircle.js +47 -0
- package/internals/snapEndAngleToFullCircle.mjs +41 -0
- package/models/axis.d.mts +5 -4
- package/models/axis.d.ts +5 -4
- package/models/seriesType/config.d.mts +2 -2
- package/models/seriesType/config.d.ts +2 -2
- package/models/seriesType/index.d.mts +1 -1
- package/models/seriesType/index.d.ts +1 -1
- package/models/seriesType/line.d.mts +14 -1
- package/models/seriesType/line.d.ts +14 -1
- package/package.json +3 -3
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js
CHANGED
|
@@ -8,6 +8,9 @@ exports.findVisibleDataIndex = findVisibleDataIndex;
|
|
|
8
8
|
* Walk forward (or backward) from `startIndex` and return the first dataIndex
|
|
9
9
|
* whose data point is visible. Returns `null` if every traversed index is hidden.
|
|
10
10
|
*
|
|
11
|
+
* Shared-axis types (line, bar) opt out of `useCurrentSeriesMaxLength`, so `dataLength`
|
|
12
|
+
* can exceed the focused series length to focus an index with no value.
|
|
13
|
+
*
|
|
11
14
|
* Series-level hidden flags are filtered upstream (see `getNonEmptySeriesArray`),
|
|
12
15
|
* so only per-data-point hidden flags are relevant here. Today only Pie sets a
|
|
13
16
|
* `hidden` flag on individual data items; for other series types the data
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Walk forward (or backward) from `startIndex` and return the first dataIndex
|
|
3
3
|
* whose data point is visible. Returns `null` if every traversed index is hidden.
|
|
4
4
|
*
|
|
5
|
+
* Shared-axis types (line, bar) opt out of `useCurrentSeriesMaxLength`, so `dataLength`
|
|
6
|
+
* can exceed the focused series length to focus an index with no value.
|
|
7
|
+
*
|
|
5
8
|
* Series-level hidden flags are filtered upstream (see `getNonEmptySeriesArray`),
|
|
6
9
|
* so only per-data-point hidden flags are relevant here. Today only Pie sets a
|
|
7
10
|
* `hidden` flag on individual data items; for other series types the data
|
|
@@ -2,4 +2,4 @@ import type { ChartsRadialAxisProps, ScaleName, PolarAxisConfig } from "../../..
|
|
|
2
2
|
import type { PolarChartSeriesType } from "../../../../models/seriesType/config.mjs";
|
|
3
3
|
import type { ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
4
4
|
import type { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.mjs";
|
|
5
|
-
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any, ChartsRadialAxisProps>, axisDirection:
|
|
5
|
+
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any, ChartsRadialAxisProps>, axisDirection: 'rotation' | 'radius', seriesConfig: ChartSeriesConfig<SeriesType>, axisIndex: number, formattedSeries: ProcessedSeries<SeriesType>) => number[];
|
|
@@ -2,4 +2,4 @@ import type { ChartsRadialAxisProps, ScaleName, PolarAxisConfig } from "../../..
|
|
|
2
2
|
import type { PolarChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
3
3
|
import type { ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
4
4
|
import type { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
5
|
-
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any, ChartsRadialAxisProps>, axisDirection:
|
|
5
|
+
export declare const getAxisExtremum: <SeriesType extends PolarChartSeriesType>(axis: PolarAxisConfig<ScaleName, any, ChartsRadialAxisProps>, axisDirection: 'rotation' | 'radius', seriesConfig: ChartSeriesConfig<SeriesType>, axisIndex: number, formattedSeries: ProcessedSeries<SeriesType>) => number[];
|
|
@@ -2,4 +2,4 @@ import type { PolarChartSeriesType } from "../../../../models/seriesType/config.
|
|
|
2
2
|
import type { ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
3
3
|
import type { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.mjs";
|
|
4
4
|
import type { AxisId } from "../../../../models/axis.mjs";
|
|
5
|
-
export declare const getAxisTriggerTooltip: <SeriesType extends PolarChartSeriesType>(axisDirection:
|
|
5
|
+
export declare const getAxisTriggerTooltip: <SeriesType extends PolarChartSeriesType>(axisDirection: 'radius' | 'rotation', seriesConfig: ChartSeriesConfig<SeriesType>, formattedSeries: ProcessedSeries<SeriesType>, defaultAxisId: AxisId) => Set<AxisId>;
|
|
@@ -2,4 +2,4 @@ import type { PolarChartSeriesType } from "../../../../models/seriesType/config.
|
|
|
2
2
|
import type { ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
3
3
|
import type { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
4
4
|
import type { AxisId } from "../../../../models/axis.js";
|
|
5
|
-
export declare const getAxisTriggerTooltip: <SeriesType extends PolarChartSeriesType>(axisDirection:
|
|
5
|
+
export declare const getAxisTriggerTooltip: <SeriesType extends PolarChartSeriesType>(axisDirection: 'radius' | 'rotation', seriesConfig: ChartSeriesConfig<SeriesType>, formattedSeries: ProcessedSeries<SeriesType>, defaultAxisId: AxisId) => Set<AxisId>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SeriesItemIdentifierWithType } from "../../../../models/index.mjs";
|
|
2
2
|
export declare const selectorChartsTooltipPointerItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartTooltip.types.mjs").UseChartTooltipState<keyof import("../../../index.mjs").ChartsSeriesConfig>> & {
|
|
3
3
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
4
|
-
}) => import("../../../index.mjs").
|
|
4
|
+
}) => import("../../../index.mjs").BarItemIdentifier | import("../../../index.mjs").LineItemIdentifier | import("../../../../index.mjs").PieItemIdentifier | import("../../../../index.mjs").RadarItemIdentifier | import("../../../../index.mjs").ScatterItemIdentifier | null;
|
|
5
5
|
export declare const selectorChartsTooltipPointerItemIsDefined: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartTooltip.types.mjs").UseChartTooltipState<keyof import("../../../index.mjs").ChartsSeriesConfig>> & {
|
|
6
6
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
7
7
|
}) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SeriesItemIdentifierWithType } from "../../../../models/index.js";
|
|
2
2
|
export declare const selectorChartsTooltipPointerItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartTooltip.types.js").UseChartTooltipState<keyof import("../../../index.js").ChartsSeriesConfig>> & {
|
|
3
3
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
4
|
-
}) => import("../../../index.js").
|
|
4
|
+
}) => import("../../../index.js").BarItemIdentifier | import("../../../index.js").LineItemIdentifier | import("../../../../index.js").PieItemIdentifier | import("../../../../index.js").RadarItemIdentifier | import("../../../../index.js").ScatterItemIdentifier | null;
|
|
5
5
|
export declare const selectorChartsTooltipPointerItemIsDefined: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartTooltip.types.js").UseChartTooltipState<keyof import("../../../index.js").ChartsSeriesConfig>> & {
|
|
6
6
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
7
7
|
}) => boolean;
|
|
@@ -40,6 +40,6 @@ export declare const selectorProgressiveSeriesRevealedBatches: (args_0: import("
|
|
|
40
40
|
}, seriesId: string) => number;
|
|
41
41
|
export declare const selectorShouldUseProgressiveRenderer: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
42
42
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
43
|
-
}, seriesIds: readonly string[], renderer:
|
|
43
|
+
}, seriesIds: readonly string[], renderer: "svg-progressive" | RendererType | undefined) => boolean;
|
|
44
44
|
/** Order-sensitive equality between two registered series-id sets. */
|
|
45
45
|
export declare function sameSeriesIds(a: readonly SeriesId[] | undefined, b: readonly SeriesId[]): boolean;
|
|
@@ -40,6 +40,6 @@ export declare const selectorProgressiveSeriesRevealedBatches: (args_0: import("
|
|
|
40
40
|
}, seriesId: string) => number;
|
|
41
41
|
export declare const selectorShouldUseProgressiveRenderer: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
42
42
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
43
|
-
}, seriesIds: readonly string[], renderer:
|
|
43
|
+
}, seriesIds: readonly string[], renderer: "svg-progressive" | RendererType | undefined) => boolean;
|
|
44
44
|
/** Order-sensitive equality between two registered series-id sets. */
|
|
45
45
|
export declare function sameSeriesIds(a: readonly SeriesId[] | undefined, b: readonly SeriesId[]): boolean;
|
|
@@ -3,18 +3,18 @@ import type { SeriesId } from "../models/seriesType/common.mjs";
|
|
|
3
3
|
import type { ProcessedSeries } from "./plugins/corePlugins/useChartSeries/index.mjs";
|
|
4
4
|
export declare const selectorAllSeriesOfType: (args_0: import("./plugins/corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("./plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("./plugins/corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("./plugins/corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("./index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("./index.mjs").ChartStateCacheKey;
|
|
6
|
-
}, seriesType: keyof ChartsSeriesConfig) =>
|
|
7
|
-
series: Record<string, import("../index.mjs").DefaultizedScatterSeriesType>;
|
|
8
|
-
seriesOrder: SeriesId[];
|
|
9
|
-
} | {
|
|
6
|
+
}, seriesType: keyof ChartsSeriesConfig) => {
|
|
10
7
|
series: Record<string, import("../index.mjs").DefaultizedPieSeriesType>;
|
|
11
8
|
seriesOrder: SeriesId[];
|
|
12
9
|
} | {
|
|
13
10
|
series: Record<string, import("../index.mjs").DefaultizedRadarSeriesType>;
|
|
14
11
|
seriesOrder: SeriesId[];
|
|
15
|
-
} |
|
|
12
|
+
} | {
|
|
13
|
+
series: Record<string, import("../index.mjs").DefaultizedScatterSeriesType>;
|
|
14
|
+
seriesOrder: SeriesId[];
|
|
15
|
+
} | import("./index.mjs").SeriesProcessorResult<"bar"> | import("./index.mjs").SeriesProcessorResult<"line"> | undefined;
|
|
16
16
|
export declare const selectorSeriesOfType: (args_0: import("./plugins/corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("./plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("./plugins/corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("./plugins/corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("./index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
17
17
|
cacheKey: import("./index.mjs").ChartStateCacheKey;
|
|
18
|
-
}, seriesType: keyof ChartsSeriesConfig, ids: string | string[] | undefined) => import("../index.mjs").
|
|
18
|
+
}, seriesType: keyof ChartsSeriesConfig, ids: string | string[] | undefined) => (import("../index.mjs").DefaultizedBarSeriesType | import("../index.mjs").DefaultizedLineSeriesType | import("../index.mjs").DefaultizedPieSeriesType | import("../index.mjs").DefaultizedRadarSeriesType | import("../index.mjs").DefaultizedScatterSeriesType | undefined)[] | import("../index.mjs").DefaultizedBarSeriesType | import("../index.mjs").DefaultizedLineSeriesType | import("../index.mjs").DefaultizedPieSeriesType | import("../index.mjs").DefaultizedRadarSeriesType | import("../index.mjs").DefaultizedScatterSeriesType | undefined;
|
|
19
19
|
export declare const useAllSeriesOfType: <T extends keyof ChartsSeriesConfig>(seriesType: T) => ProcessedSeries[T];
|
|
20
20
|
export declare const useSeriesOfType: <T extends keyof ChartsSeriesConfig>(seriesType: T, seriesId?: SeriesId | SeriesId[]) => ChartSeriesDefaultized<T> | ChartSeriesDefaultized<T>[] | undefined;
|
|
@@ -3,18 +3,18 @@ import type { SeriesId } from "../models/seriesType/common.js";
|
|
|
3
3
|
import type { ProcessedSeries } from "./plugins/corePlugins/useChartSeries/index.js";
|
|
4
4
|
export declare const selectorAllSeriesOfType: (args_0: import("./plugins/corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("./plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./plugins/corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./plugins/corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("./index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("./index.js").ChartStateCacheKey;
|
|
6
|
-
}, seriesType: keyof ChartsSeriesConfig) =>
|
|
7
|
-
series: Record<string, import("../index.js").DefaultizedScatterSeriesType>;
|
|
8
|
-
seriesOrder: SeriesId[];
|
|
9
|
-
} | {
|
|
6
|
+
}, seriesType: keyof ChartsSeriesConfig) => {
|
|
10
7
|
series: Record<string, import("../index.js").DefaultizedPieSeriesType>;
|
|
11
8
|
seriesOrder: SeriesId[];
|
|
12
9
|
} | {
|
|
13
10
|
series: Record<string, import("../index.js").DefaultizedRadarSeriesType>;
|
|
14
11
|
seriesOrder: SeriesId[];
|
|
15
|
-
} |
|
|
12
|
+
} | {
|
|
13
|
+
series: Record<string, import("../index.js").DefaultizedScatterSeriesType>;
|
|
14
|
+
seriesOrder: SeriesId[];
|
|
15
|
+
} | import("./index.js").SeriesProcessorResult<"bar"> | import("./index.js").SeriesProcessorResult<"line"> | undefined;
|
|
16
16
|
export declare const selectorSeriesOfType: (args_0: import("./plugins/corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("./plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("./plugins/corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./plugins/corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof ChartsSeriesConfig> & import("./plugins/corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("./index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
17
17
|
cacheKey: import("./index.js").ChartStateCacheKey;
|
|
18
|
-
}, seriesType: keyof ChartsSeriesConfig, ids: string | string[] | undefined) => import("../index.js").
|
|
18
|
+
}, seriesType: keyof ChartsSeriesConfig, ids: string | string[] | undefined) => (import("../index.js").DefaultizedBarSeriesType | import("../index.js").DefaultizedLineSeriesType | import("../index.js").DefaultizedPieSeriesType | import("../index.js").DefaultizedRadarSeriesType | import("../index.js").DefaultizedScatterSeriesType | undefined)[] | import("../index.js").DefaultizedBarSeriesType | import("../index.js").DefaultizedLineSeriesType | import("../index.js").DefaultizedPieSeriesType | import("../index.js").DefaultizedRadarSeriesType | import("../index.js").DefaultizedScatterSeriesType | undefined;
|
|
19
19
|
export declare const useAllSeriesOfType: <T extends keyof ChartsSeriesConfig>(seriesType: T) => ProcessedSeries[T];
|
|
20
20
|
export declare const useSeriesOfType: <T extends keyof ChartsSeriesConfig>(seriesType: T, seriesId?: SeriesId | SeriesId[]) => ChartSeriesDefaultized<T> | ChartSeriesDefaultized<T>[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScaleOrdinal, ScaleThreshold, ScaleSequential } from '@mui/x-charts-vendor/d3-scale';
|
|
2
2
|
import type { ContinuousSizeConfig, PiecewiseSizeConfig, OrdinalSizeConfig } from "../models/sizeMapping.mjs";
|
|
3
|
-
export declare function getSequentialSizeScale<Value extends number | Date>(config: ContinuousSizeConfig<Value> | PiecewiseSizeConfig<Value>):
|
|
3
|
+
export declare function getSequentialSizeScale<Value extends number | Date>(config: ContinuousSizeConfig<Value> | PiecewiseSizeConfig<Value>): ScaleSequential<number, never> | ScaleThreshold<Value, number, never>;
|
|
4
4
|
export declare function getOrdinalSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
5
5
|
export declare function getSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
6
6
|
export declare function getSizeScale(config: ContinuousSizeConfig | PiecewiseSizeConfig): ScaleThreshold<number | Date, number | null> | ScaleSequential<number, number | null>;
|
package/internals/sizeScale.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScaleOrdinal, ScaleThreshold, ScaleSequential } from '@mui/x-charts-vendor/d3-scale';
|
|
2
2
|
import type { ContinuousSizeConfig, PiecewiseSizeConfig, OrdinalSizeConfig } from "../models/sizeMapping.js";
|
|
3
|
-
export declare function getSequentialSizeScale<Value extends number | Date>(config: ContinuousSizeConfig<Value> | PiecewiseSizeConfig<Value>):
|
|
3
|
+
export declare function getSequentialSizeScale<Value extends number | Date>(config: ContinuousSizeConfig<Value> | PiecewiseSizeConfig<Value>): ScaleSequential<number, never> | ScaleThreshold<Value, number, never>;
|
|
4
4
|
export declare function getOrdinalSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
5
5
|
export declare function getSizeScale(config: OrdinalSizeConfig): ScaleOrdinal<number | Date | string, number, number | null>;
|
|
6
6
|
export declare function getSizeScale(config: ContinuousSizeConfig | PiecewiseSizeConfig): ScaleThreshold<number | Date, number | null> | ScaleSequential<number, number | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare function
|
|
1
|
+
declare function sliceUntilFallback(text: string, endIndex: number): string;
|
|
2
2
|
/** Creates a slice of {@link text} from the start until the {@link endIndex}th grapheme (basically character). */
|
|
3
|
-
export declare const sliceUntil: typeof
|
|
3
|
+
export declare const sliceUntil: typeof sliceUntilFallback;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare function
|
|
1
|
+
declare function sliceUntilFallback(text: string, endIndex: number): string;
|
|
2
2
|
/** Creates a slice of {@link text} from the start until the {@link endIndex}th grapheme (basically character). */
|
|
3
|
-
export declare const sliceUntil: typeof
|
|
3
|
+
export declare const sliceUntil: typeof sliceUntilFallback;
|
|
4
4
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snaps the end angle of an arc to create a full circle when the arc spans almost, but not
|
|
3
|
+
* exactly, the full circle.
|
|
4
|
+
*
|
|
5
|
+
* When an arc spans almost the full circle (e.g., when the remaining slices of a pie are
|
|
6
|
+
* extremely small compared to the largest one), its start and end points are so close that they
|
|
7
|
+
* can round to the same path coordinates. SVG omits arcs whose end point equals their start
|
|
8
|
+
* point, which makes the quasi-full-circle arc invisible.
|
|
9
|
+
* See https://github.com/mui/mui-x/issues/14167
|
|
10
|
+
*
|
|
11
|
+
* The end angle is only snapped when the gap left by the arc is smaller than the precision of
|
|
12
|
+
* the serialized path, so the snapping is visually lossless.
|
|
13
|
+
*
|
|
14
|
+
* @param startAngle The start angle of the arc, in radians.
|
|
15
|
+
* @param endAngle The end angle of the arc, in radians.
|
|
16
|
+
* @param outerRadius The outer radius of the arc.
|
|
17
|
+
* @param padAngle The pad angle of the arc, in radians.
|
|
18
|
+
* @returns The end angle, snapped to `startAngle ± 2 * Math.PI` when applicable.
|
|
19
|
+
*/
|
|
20
|
+
export declare function snapEndAngleToFullCircle(startAngle: number, endAngle: number, outerRadius: number, padAngle?: number): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snaps the end angle of an arc to create a full circle when the arc spans almost, but not
|
|
3
|
+
* exactly, the full circle.
|
|
4
|
+
*
|
|
5
|
+
* When an arc spans almost the full circle (e.g., when the remaining slices of a pie are
|
|
6
|
+
* extremely small compared to the largest one), its start and end points are so close that they
|
|
7
|
+
* can round to the same path coordinates. SVG omits arcs whose end point equals their start
|
|
8
|
+
* point, which makes the quasi-full-circle arc invisible.
|
|
9
|
+
* See https://github.com/mui/mui-x/issues/14167
|
|
10
|
+
*
|
|
11
|
+
* The end angle is only snapped when the gap left by the arc is smaller than the precision of
|
|
12
|
+
* the serialized path, so the snapping is visually lossless.
|
|
13
|
+
*
|
|
14
|
+
* @param startAngle The start angle of the arc, in radians.
|
|
15
|
+
* @param endAngle The end angle of the arc, in radians.
|
|
16
|
+
* @param outerRadius The outer radius of the arc.
|
|
17
|
+
* @param padAngle The pad angle of the arc, in radians.
|
|
18
|
+
* @returns The end angle, snapped to `startAngle ± 2 * Math.PI` when applicable.
|
|
19
|
+
*/
|
|
20
|
+
export declare function snapEndAngleToFullCircle(startAngle: number, endAngle: number, outerRadius: number, padAngle?: number): number;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.snapEndAngleToFullCircle = snapEndAngleToFullCircle;
|
|
7
|
+
const TAU = 2 * Math.PI;
|
|
8
|
+
|
|
9
|
+
/* `d3-shape` serializes paths with a precision of 3 digits, i.e., a resolution of 1e-3. */
|
|
10
|
+
const PATH_PRECISION = 1e-3;
|
|
11
|
+
/* If the distance between the start and end points of an arc is at least twice the path
|
|
12
|
+
* precision, at least one of their coordinates is guaranteed to round to a different value. */
|
|
13
|
+
const MIN_DISTINCT_CHORD_LENGTH = 2 * PATH_PRECISION;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Snaps the end angle of an arc to create a full circle when the arc spans almost, but not
|
|
17
|
+
* exactly, the full circle.
|
|
18
|
+
*
|
|
19
|
+
* When an arc spans almost the full circle (e.g., when the remaining slices of a pie are
|
|
20
|
+
* extremely small compared to the largest one), its start and end points are so close that they
|
|
21
|
+
* can round to the same path coordinates. SVG omits arcs whose end point equals their start
|
|
22
|
+
* point, which makes the quasi-full-circle arc invisible.
|
|
23
|
+
* See https://github.com/mui/mui-x/issues/14167
|
|
24
|
+
*
|
|
25
|
+
* The end angle is only snapped when the gap left by the arc is smaller than the precision of
|
|
26
|
+
* the serialized path, so the snapping is visually lossless.
|
|
27
|
+
*
|
|
28
|
+
* @param startAngle The start angle of the arc, in radians.
|
|
29
|
+
* @param endAngle The end angle of the arc, in radians.
|
|
30
|
+
* @param outerRadius The outer radius of the arc.
|
|
31
|
+
* @param padAngle The pad angle of the arc, in radians.
|
|
32
|
+
* @returns The end angle, snapped to `startAngle ± 2 * Math.PI` when applicable.
|
|
33
|
+
*/
|
|
34
|
+
function snapEndAngleToFullCircle(startAngle, endAngle, outerRadius, padAngle = 0) {
|
|
35
|
+
const sweep = Math.abs(endAngle - startAngle);
|
|
36
|
+
if (sweep === 0 || sweep >= TAU) {
|
|
37
|
+
return endAngle;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Chord between the start and end points of the arc, once the padding is applied.
|
|
41
|
+
// For such small angles, the chord length is approximately `radius * angle`.
|
|
42
|
+
const gapChordLength = (TAU - sweep + Math.abs(padAngle)) * outerRadius;
|
|
43
|
+
if (gapChordLength >= MIN_DISTINCT_CHORD_LENGTH) {
|
|
44
|
+
return endAngle;
|
|
45
|
+
}
|
|
46
|
+
return startAngle + Math.sign(endAngle - startAngle) * TAU;
|
|
47
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const TAU = 2 * Math.PI;
|
|
2
|
+
|
|
3
|
+
/* `d3-shape` serializes paths with a precision of 3 digits, i.e., a resolution of 1e-3. */
|
|
4
|
+
const PATH_PRECISION = 1e-3;
|
|
5
|
+
/* If the distance between the start and end points of an arc is at least twice the path
|
|
6
|
+
* precision, at least one of their coordinates is guaranteed to round to a different value. */
|
|
7
|
+
const MIN_DISTINCT_CHORD_LENGTH = 2 * PATH_PRECISION;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Snaps the end angle of an arc to create a full circle when the arc spans almost, but not
|
|
11
|
+
* exactly, the full circle.
|
|
12
|
+
*
|
|
13
|
+
* When an arc spans almost the full circle (e.g., when the remaining slices of a pie are
|
|
14
|
+
* extremely small compared to the largest one), its start and end points are so close that they
|
|
15
|
+
* can round to the same path coordinates. SVG omits arcs whose end point equals their start
|
|
16
|
+
* point, which makes the quasi-full-circle arc invisible.
|
|
17
|
+
* See https://github.com/mui/mui-x/issues/14167
|
|
18
|
+
*
|
|
19
|
+
* The end angle is only snapped when the gap left by the arc is smaller than the precision of
|
|
20
|
+
* the serialized path, so the snapping is visually lossless.
|
|
21
|
+
*
|
|
22
|
+
* @param startAngle The start angle of the arc, in radians.
|
|
23
|
+
* @param endAngle The end angle of the arc, in radians.
|
|
24
|
+
* @param outerRadius The outer radius of the arc.
|
|
25
|
+
* @param padAngle The pad angle of the arc, in radians.
|
|
26
|
+
* @returns The end angle, snapped to `startAngle ± 2 * Math.PI` when applicable.
|
|
27
|
+
*/
|
|
28
|
+
export function snapEndAngleToFullCircle(startAngle, endAngle, outerRadius, padAngle = 0) {
|
|
29
|
+
const sweep = Math.abs(endAngle - startAngle);
|
|
30
|
+
if (sweep === 0 || sweep >= TAU) {
|
|
31
|
+
return endAngle;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Chord between the start and end points of the arc, once the padding is applied.
|
|
35
|
+
// For such small angles, the chord length is approximately `radius * angle`.
|
|
36
|
+
const gapChordLength = (TAU - sweep + Math.abs(padAngle)) * outerRadius;
|
|
37
|
+
if (gapChordLength >= MIN_DISTINCT_CHORD_LENGTH) {
|
|
38
|
+
return endAngle;
|
|
39
|
+
}
|
|
40
|
+
return startAngle + Math.sign(endAngle - startAngle) * TAU;
|
|
41
|
+
}
|
package/models/axis.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import type * as React from 'react';
|
|
|
2
2
|
import type { ScaleBand, ScaleLinear, ScaleLogarithmic, ScaleOrdinal, ScalePoint, ScalePower, ScaleSequential, ScaleThreshold, ScaleTime, ScaleSymLog, NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
3
3
|
import type { SxProps } from '@mui/system/styleFunctionSx';
|
|
4
4
|
import type { HasProperty, MakeOptional, MakeRequired } from '@mui/x-internals/types';
|
|
5
|
+
import type { WithDataAttributes } from '@mui/utils/types';
|
|
5
6
|
import type { DatasetElementType } from "./seriesType/config.mjs";
|
|
6
7
|
import type { DefaultizedZoomOptions } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
|
|
7
8
|
import type { ChartsAxisClasses } from "../ChartsAxis/axisClasses.mjs";
|
|
@@ -57,10 +58,10 @@ export interface ChartsAxisSlots {
|
|
|
57
58
|
yAxis?: React.JSXElementConstructor<ChartsYAxisProps & YAxisPropsOverrides>;
|
|
58
59
|
}
|
|
59
60
|
export interface ChartsAxisSlotProps {
|
|
60
|
-
axisLine?: Partial<React.SVGAttributes<SVGPathElement>> & AxisLinePropsOverrides
|
|
61
|
-
axisTick?: Partial<React.SVGAttributes<SVGPathElement>> & AxisTickPropsOverrides
|
|
62
|
-
axisTickLabel?: Partial<ChartsTextProps> & AxisTickLabelPropsOverrides
|
|
63
|
-
axisLabel?: Partial<ChartsTextProps> & AxisLabelPropsOverrides
|
|
61
|
+
axisLine?: WithDataAttributes<Partial<React.SVGAttributes<SVGPathElement>> & AxisLinePropsOverrides>;
|
|
62
|
+
axisTick?: WithDataAttributes<Partial<React.SVGAttributes<SVGPathElement>> & AxisTickPropsOverrides>;
|
|
63
|
+
axisTickLabel?: WithDataAttributes<Partial<ChartsTextProps> & AxisTickLabelPropsOverrides>;
|
|
64
|
+
axisLabel?: WithDataAttributes<Partial<ChartsTextProps> & AxisLabelPropsOverrides>;
|
|
64
65
|
xAxis?: Partial<ChartsXAxisProps> & XAxisPropsOverrides;
|
|
65
66
|
yAxis?: Partial<ChartsYAxisProps> & YAxisPropsOverrides;
|
|
66
67
|
}
|
package/models/axis.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type * as React from 'react';
|
|
|
2
2
|
import type { ScaleBand, ScaleLinear, ScaleLogarithmic, ScaleOrdinal, ScalePoint, ScalePower, ScaleSequential, ScaleThreshold, ScaleTime, ScaleSymLog, NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
3
3
|
import type { SxProps } from '@mui/system/styleFunctionSx';
|
|
4
4
|
import type { HasProperty, MakeOptional, MakeRequired } from '@mui/x-internals/types';
|
|
5
|
+
import type { WithDataAttributes } from '@mui/utils/types';
|
|
5
6
|
import type { DatasetElementType } from "./seriesType/config.js";
|
|
6
7
|
import type { DefaultizedZoomOptions } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
7
8
|
import type { ChartsAxisClasses } from "../ChartsAxis/axisClasses.js";
|
|
@@ -57,10 +58,10 @@ export interface ChartsAxisSlots {
|
|
|
57
58
|
yAxis?: React.JSXElementConstructor<ChartsYAxisProps & YAxisPropsOverrides>;
|
|
58
59
|
}
|
|
59
60
|
export interface ChartsAxisSlotProps {
|
|
60
|
-
axisLine?: Partial<React.SVGAttributes<SVGPathElement>> & AxisLinePropsOverrides
|
|
61
|
-
axisTick?: Partial<React.SVGAttributes<SVGPathElement>> & AxisTickPropsOverrides
|
|
62
|
-
axisTickLabel?: Partial<ChartsTextProps> & AxisTickLabelPropsOverrides
|
|
63
|
-
axisLabel?: Partial<ChartsTextProps> & AxisLabelPropsOverrides
|
|
61
|
+
axisLine?: WithDataAttributes<Partial<React.SVGAttributes<SVGPathElement>> & AxisLinePropsOverrides>;
|
|
62
|
+
axisTick?: WithDataAttributes<Partial<React.SVGAttributes<SVGPathElement>> & AxisTickPropsOverrides>;
|
|
63
|
+
axisTickLabel?: WithDataAttributes<Partial<ChartsTextProps> & AxisTickLabelPropsOverrides>;
|
|
64
|
+
axisLabel?: WithDataAttributes<Partial<ChartsTextProps> & AxisLabelPropsOverrides>;
|
|
64
65
|
xAxis?: Partial<ChartsXAxisProps> & XAxisPropsOverrides;
|
|
65
66
|
yAxis?: Partial<ChartsYAxisProps> & YAxisPropsOverrides;
|
|
66
67
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefaultizedProps, MakeOptional, MakeRequired } from '@mui/x-internals/types';
|
|
2
2
|
import type { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from "./scatter.mjs";
|
|
3
|
-
import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.mjs";
|
|
3
|
+
import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier, LineItemClickIdentifier } from "./line.mjs";
|
|
4
4
|
import type { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.mjs";
|
|
5
5
|
import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, PieSeriesLayout } from "./pie.mjs";
|
|
6
6
|
import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.mjs";
|
|
@@ -60,7 +60,7 @@ export interface ChartsSeriesConfig {
|
|
|
60
60
|
seriesLayout: {};
|
|
61
61
|
seriesProp: LineSeriesType;
|
|
62
62
|
itemIdentifier: LineItemIdentifier;
|
|
63
|
-
itemIdentifierWithData:
|
|
63
|
+
itemIdentifierWithData: LineItemClickIdentifier;
|
|
64
64
|
valueType: number | null;
|
|
65
65
|
canBeStacked: true;
|
|
66
66
|
axisType: 'cartesian';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefaultizedProps, MakeOptional, MakeRequired } from '@mui/x-internals/types';
|
|
2
2
|
import type { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from "./scatter.js";
|
|
3
|
-
import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.js";
|
|
3
|
+
import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier, LineItemClickIdentifier } from "./line.js";
|
|
4
4
|
import type { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.js";
|
|
5
5
|
import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, PieSeriesLayout } from "./pie.js";
|
|
6
6
|
import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.js";
|
|
@@ -60,7 +60,7 @@ export interface ChartsSeriesConfig {
|
|
|
60
60
|
seriesLayout: {};
|
|
61
61
|
seriesProp: LineSeriesType;
|
|
62
62
|
itemIdentifier: LineItemIdentifier;
|
|
63
|
-
itemIdentifierWithData:
|
|
63
|
+
itemIdentifierWithData: LineItemClickIdentifier;
|
|
64
64
|
valueType: number | null;
|
|
65
65
|
canBeStacked: true;
|
|
66
66
|
axisType: 'cartesian';
|
|
@@ -13,7 +13,7 @@ export type HighlightItemIdentifierWithType<SeriesType extends ChartSeriesType>
|
|
|
13
13
|
export type FocusedItemIdentifier<SeriesType extends ChartSeriesType = ChartSeriesType> = SeriesType extends 'line' | 'radar' | 'radialLine' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'dataIndex'> : SeriesType extends 'heatmap' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'xIndex' | 'yIndex'> : ChartsSeriesConfig[SeriesType]['itemIdentifier'];
|
|
14
14
|
export { type SeriesId } from "./common.mjs";
|
|
15
15
|
export type { CartesianChartSeriesType, StackableChartSeriesType } from "./config.mjs";
|
|
16
|
-
export type { ShowMarkParams, MarkShape, LineSeriesType, LineItemIdentifier, DefaultizedLineSeriesType } from "./line.mjs";
|
|
16
|
+
export type { ShowMarkParams, MarkShape, LineSeriesType, LineItemIdentifier, LineItemClickIdentifier, DefaultizedLineSeriesType } from "./line.mjs";
|
|
17
17
|
export type { BarValueType, BarSeriesType, BarItemIdentifier, DefaultizedBarSeriesType } from "./bar.mjs";
|
|
18
18
|
export * from "./scatter.mjs";
|
|
19
19
|
export * from "./pie.mjs";
|
|
@@ -13,7 +13,7 @@ export type HighlightItemIdentifierWithType<SeriesType extends ChartSeriesType>
|
|
|
13
13
|
export type FocusedItemIdentifier<SeriesType extends ChartSeriesType = ChartSeriesType> = SeriesType extends 'line' | 'radar' | 'radialLine' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'dataIndex'> : SeriesType extends 'heatmap' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'xIndex' | 'yIndex'> : ChartsSeriesConfig[SeriesType]['itemIdentifier'];
|
|
14
14
|
export { type SeriesId } from "./common.js";
|
|
15
15
|
export type { CartesianChartSeriesType, StackableChartSeriesType } from "./config.js";
|
|
16
|
-
export type { ShowMarkParams, MarkShape, LineSeriesType, LineItemIdentifier, DefaultizedLineSeriesType } from "./line.js";
|
|
16
|
+
export type { ShowMarkParams, MarkShape, LineSeriesType, LineItemIdentifier, LineItemClickIdentifier, DefaultizedLineSeriesType } from "./line.js";
|
|
17
17
|
export type { BarValueType, BarSeriesType, BarItemIdentifier, DefaultizedBarSeriesType } from "./bar.js";
|
|
18
18
|
export * from "./scatter.js";
|
|
19
19
|
export * from "./pie.js";
|
|
@@ -118,10 +118,23 @@ export type LineItemIdentifier = {
|
|
|
118
118
|
type: 'line';
|
|
119
119
|
seriesId: SeriesId;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* The index of the data point closest to the pointer along the x-axis.
|
|
122
|
+
* `dataIndex` can be `undefined` if the pointer position cannot be associated with a data point.
|
|
122
123
|
*/
|
|
123
124
|
dataIndex?: number;
|
|
124
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* An object that identifies a single line together with the data point the interaction targets.
|
|
128
|
+
* Used for item interactions that always resolve a data point, like `onItemClick`.
|
|
129
|
+
*/
|
|
130
|
+
export type LineItemClickIdentifier = {
|
|
131
|
+
type: 'line';
|
|
132
|
+
seriesId: SeriesId;
|
|
133
|
+
/**
|
|
134
|
+
* The index of the data point closest to the pointer along the x-axis.
|
|
135
|
+
*/
|
|
136
|
+
dataIndex: number;
|
|
137
|
+
};
|
|
125
138
|
export interface DefaultizedLineSeriesType extends DefaultizedProps<LineSeriesType, CommonDefaultizedProps | 'color'> {
|
|
126
139
|
hidden: boolean;
|
|
127
140
|
}
|
|
@@ -118,10 +118,23 @@ export type LineItemIdentifier = {
|
|
|
118
118
|
type: 'line';
|
|
119
119
|
seriesId: SeriesId;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* The index of the data point closest to the pointer along the x-axis.
|
|
122
|
+
* `dataIndex` can be `undefined` if the pointer position cannot be associated with a data point.
|
|
122
123
|
*/
|
|
123
124
|
dataIndex?: number;
|
|
124
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* An object that identifies a single line together with the data point the interaction targets.
|
|
128
|
+
* Used for item interactions that always resolve a data point, like `onItemClick`.
|
|
129
|
+
*/
|
|
130
|
+
export type LineItemClickIdentifier = {
|
|
131
|
+
type: 'line';
|
|
132
|
+
seriesId: SeriesId;
|
|
133
|
+
/**
|
|
134
|
+
* The index of the data point closest to the pointer along the x-axis.
|
|
135
|
+
*/
|
|
136
|
+
dataIndex: number;
|
|
137
|
+
};
|
|
125
138
|
export interface DefaultizedLineSeriesType extends DefaultizedProps<LineSeriesType, CommonDefaultizedProps | 'color'> {
|
|
126
139
|
hidden: boolean;
|
|
127
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.1",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of MUI X Charts components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"prop-types": "^15.8.1",
|
|
35
35
|
"reselect": "^5.2.0",
|
|
36
36
|
"use-sync-external-store": "^1.6.0",
|
|
37
|
-
"@mui/x-
|
|
38
|
-
"@mui/x-
|
|
37
|
+
"@mui/x-internals": "^9.10.1",
|
|
38
|
+
"@mui/x-internal-gestures": "^9.10.0",
|
|
39
39
|
"@mui/x-charts-vendor": "^9.4.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|