@mui/x-charts 9.8.0 → 9.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/AnimatedBarElement.d.mts +1 -1
- package/BarChart/AnimatedBarElement.d.ts +1 -1
- package/BarChart/BarClipPath.d.mts +1 -1
- package/BarChart/BarClipPath.d.ts +1 -1
- package/BarChart/BarElement.d.mts +1 -1
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.mts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelPlot.d.mts +2 -1
- package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -1
- package/BarChart/BatchBarPlot/BarGroup.d.mts +1 -1
- package/BarChart/BatchBarPlot/BarGroup.d.ts +1 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -1
- package/BarChart/FocusedBar.d.mts +1 -1
- package/BarChart/FocusedBar.d.ts +1 -1
- package/BarChart/IndividualBarPlot.d.mts +2 -1
- package/BarChart/IndividualBarPlot.d.ts +2 -1
- package/BarChart/seriesConfig/bar/tooltipPosition.d.mts +2 -3
- package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +2 -3
- package/BarChart/seriesConfig/bar/tooltipPosition.js +19 -15
- package/BarChart/seriesConfig/bar/tooltipPosition.mjs +18 -14
- package/BarChart/seriesConfig/index.js +2 -2
- package/BarChart/seriesConfig/index.mjs +2 -2
- package/BarChart/useBarPlotData.d.mts +5 -1
- package/BarChart/useBarPlotData.d.ts +5 -1
- package/BarChart/useBarPlotData.js +102 -25
- package/BarChart/useBarPlotData.mjs +102 -26
- package/CHANGELOG.md +119 -0
- package/ChartsAxis/ChartsAxis.d.mts +2 -1
- package/ChartsAxis/ChartsAxis.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +22 -5
- package/ChartsAxisHighlight/ChartsXAxisHighlight.mjs +23 -6
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.mts +2 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +2 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +22 -5
- package/ChartsAxisHighlight/ChartsYAxisHighlight.mjs +23 -6
- package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +27 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +27 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.js +35 -0
- package/ChartsAxisHighlight/getSampledBandHighlight.mjs +29 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +1 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +2 -1
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +2 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +2 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +2 -1
- package/ChartsClipPath/ChartsClipPath.d.mts +1 -1
- package/ChartsClipPath/ChartsClipPath.d.ts +1 -1
- package/ChartsDataProvider/ChartsDataProvider.d.mts +1 -1
- package/ChartsDataProvider/ChartsDataProvider.d.ts +1 -1
- package/ChartsGrid/ChartsGrid.d.mts +1 -1
- package/ChartsGrid/ChartsGrid.d.ts +1 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.mts +2 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -1
- package/ChartsGrid/ChartsVerticalGrid.d.mts +2 -1
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.mts +1 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -1
- package/ChartsOverlay/ChartsOverlay.d.mts +1 -1
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +2 -1
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +2 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
- package/ChartsRadialGrid/ChartsRadialGrid.d.mts +1 -1
- package/ChartsRadialGrid/ChartsRadialGrid.d.ts +1 -1
- package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +2 -1
- package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +2 -1
- package/ChartsRadialGrid/ChartsRotationGrid.d.mts +2 -1
- package/ChartsRadialGrid/ChartsRotationGrid.d.ts +2 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -1
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- 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/ChartsRotationAxis.d.mts +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -1
- package/ChartsText/ChartsText.d.mts +1 -1
- package/ChartsText/ChartsText.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.mts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.d.mts +2 -1
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +2 -1
- package/ChartsTooltip/ChartsTooltip.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.mts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +1 -5
- package/ChartsTooltip/ChartsTooltipContainer.mjs +2 -6
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.mts +2 -1
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +2 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.mts +2 -1
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +2 -1
- package/ChartsXAxis/ChartsXAxis.d.mts +1 -1
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxisImpl.d.mts +2 -1
- package/ChartsXAxis/ChartsXAxisImpl.d.ts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.mts +2 -1
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +2 -1
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.mts +2 -1
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +2 -1
- package/ChartsYAxis/ChartsYAxis.d.mts +1 -1
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxisImpl.d.mts +2 -1
- package/ChartsYAxis/ChartsYAxisImpl.d.ts +2 -1
- package/Gauge/GaugeProvider.d.mts +1 -1
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/Gauge/GaugeReferenceArc.d.mts +1 -1
- package/Gauge/GaugeReferenceArc.d.ts +1 -1
- package/Gauge/GaugeValueArc.d.mts +1 -1
- package/Gauge/GaugeValueArc.d.ts +1 -1
- package/Gauge/GaugeValueText.d.mts +1 -1
- package/Gauge/GaugeValueText.d.ts +1 -1
- package/LineChart/AnimatedArea.d.mts +1 -1
- package/LineChart/AnimatedArea.d.ts +1 -1
- package/LineChart/AppearingMask.d.mts +1 -1
- package/LineChart/AppearingMask.d.ts +1 -1
- package/LineChart/AreaElement.d.mts +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.d.mts +1 -1
- package/LineChart/AreaPlot.d.ts +1 -1
- package/LineChart/CircleMarkElement.d.mts +1 -1
- package/LineChart/CircleMarkElement.d.ts +1 -1
- package/LineChart/FocusedLineMark.d.mts +1 -1
- package/LineChart/FocusedLineMark.d.ts +1 -1
- package/LineChart/LineElement.d.mts +1 -1
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightElement.d.mts +1 -1
- package/LineChart/LineHighlightElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.mts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LinePlot.d.mts +1 -1
- package/LineChart/LinePlot.d.ts +1 -1
- package/LineChart/LinePlot.js +3 -2
- package/LineChart/LinePlot.mjs +3 -2
- package/LineChart/MarkElement.d.mts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkPlot.d.mts +1 -1
- package/LineChart/MarkPlot.d.ts +1 -1
- package/LineChart/seriesConfig/index.js +2 -2
- package/LineChart/seriesConfig/index.mjs +2 -2
- package/LineChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/LineChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/LineChart/seriesConfig/tooltipPosition.js +14 -14
- package/LineChart/seriesConfig/tooltipPosition.mjs +13 -13
- package/LineChart/useLinePlotData.d.mts +13 -1
- package/LineChart/useLinePlotData.d.ts +13 -1
- package/LineChart/useLinePlotData.js +90 -33
- package/LineChart/useLinePlotData.mjs +92 -34
- package/PieChart/FocusedPieArc.d.mts +1 -1
- package/PieChart/FocusedPieArc.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.d.mts +1 -1
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.d.mts +1 -1
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PiePlot.d.mts +1 -1
- package/PieChart/PiePlot.d.ts +1 -1
- package/PieChart/seriesConfig/index.js +2 -2
- package/PieChart/seriesConfig/index.mjs +2 -2
- package/PieChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/PieChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/PieChart/seriesConfig/tooltipPosition.js +7 -11
- package/PieChart/seriesConfig/tooltipPosition.mjs +6 -10
- package/RadarChart/FocusedRadarMark.d.mts +1 -1
- package/RadarChart/FocusedRadarMark.d.ts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.d.mts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.mts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.mts +2 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +2 -1
- package/RadarChart/RadarGrid/CircularRadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.d.mts +2 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +2 -1
- package/RadarChart/RadarGrid/RadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/RadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/SharpRadarGrid.d.mts +2 -1
- package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +2 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.d.mts +2 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +2 -1
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.mts +2 -1
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +2 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.mts +1 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -1
- package/RadarChart/seriesConfig/index.js +2 -2
- package/RadarChart/seriesConfig/index.mjs +2 -2
- package/RadarChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/RadarChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/RadarChart/seriesConfig/tooltipPosition.js +9 -16
- package/RadarChart/seriesConfig/tooltipPosition.mjs +8 -15
- package/ScatterChart/BatchScatter.d.mts +2 -1
- package/ScatterChart/BatchScatter.d.ts +2 -1
- package/ScatterChart/FocusedScatterMark.d.mts +1 -1
- package/ScatterChart/FocusedScatterMark.d.ts +1 -1
- package/ScatterChart/HighlightedScatterMark.d.mts +1 -1
- package/ScatterChart/HighlightedScatterMark.d.ts +1 -1
- package/ScatterChart/Scatter.d.mts +1 -1
- package/ScatterChart/Scatter.d.ts +1 -1
- package/ScatterChart/ScatterMarker.d.mts +1 -1
- package/ScatterChart/ScatterMarker.d.ts +1 -1
- package/ScatterChart/ScatterPlot.d.mts +1 -1
- package/ScatterChart/ScatterPlot.d.ts +1 -1
- package/ScatterChart/async/ScatterAsync.d.mts +2 -1
- package/ScatterChart/async/ScatterAsync.d.ts +2 -1
- package/ScatterChart/async/ScatterAsyncBatch.d.mts +1 -1
- package/ScatterChart/async/ScatterAsyncBatch.d.ts +1 -1
- package/ScatterChart/seriesConfig/index.js +2 -2
- package/ScatterChart/seriesConfig/index.mjs +2 -2
- package/ScatterChart/seriesConfig/tooltipPosition.d.mts +2 -3
- package/ScatterChart/seriesConfig/tooltipPosition.d.ts +2 -3
- package/ScatterChart/seriesConfig/tooltipPosition.js +13 -13
- package/ScatterChart/seriesConfig/tooltipPosition.mjs +12 -12
- package/context/ChartsProvider/ChartsProvider.d.mts +1 -1
- package/context/ChartsProvider/ChartsProvider.d.ts +1 -1
- package/context/ChartsSlotsContext.d.mts +1 -1
- package/context/ChartsSlotsContext.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.mts +2 -1
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.mts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.mts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.mts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.mts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +2 -1
- package/internals/createGetBarDimensions.d.mts +14 -1
- package/internals/createGetBarDimensions.d.ts +14 -1
- package/internals/createGetBarDimensions.js +45 -0
- package/internals/createGetBarDimensions.mjs +45 -0
- package/internals/geometry.js +1 -1
- package/internals/geometry.mjs +1 -1
- package/internals/index.d.mts +1 -2
- package/internals/index.d.ts +1 -2
- package/internals/index.js +12 -8
- package/internals/index.mjs +1 -2
- 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/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +4 -4
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +11 -6
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +11 -6
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.mts +18 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.mts +26 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.ts +26 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs +81 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.mts +93 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.ts +93 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.mts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +3 -8
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +3 -8
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -53
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +2 -53
- package/models/seriesType/config.d.mts +6 -2
- package/models/seriesType/config.d.ts +6 -2
- package/package.json +5 -5
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +0 -45
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +0 -45
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +0 -48
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +0 -48
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +0 -124
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +0 -117
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +0 -73
- package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +0 -73
- /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.js → tooltipItemPositionSelector.types.js} +0 -0
- /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.mjs → tooltipItemPositionSelector.types.mjs} +0 -0
- /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.js → useChartCartesianAxis/sampling.types.js} +0 -0
- /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.mjs → useChartCartesianAxis/sampling.types.mjs} +0 -0
package/LineChart/LinePlot.mjs
CHANGED
|
@@ -66,7 +66,8 @@ function LinePlot(props) {
|
|
|
66
66
|
seriesId,
|
|
67
67
|
color,
|
|
68
68
|
gradientId,
|
|
69
|
-
hidden
|
|
69
|
+
hidden,
|
|
70
|
+
isSampled
|
|
70
71
|
}) => {
|
|
71
72
|
return /*#__PURE__*/_jsx(LineElement, {
|
|
72
73
|
seriesId: seriesId,
|
|
@@ -74,7 +75,7 @@ function LinePlot(props) {
|
|
|
74
75
|
color: color,
|
|
75
76
|
gradientId: gradientId,
|
|
76
77
|
hidden: hidden,
|
|
77
|
-
skipAnimation: skipAnimation,
|
|
78
|
+
skipAnimation: skipAnimation || isSampled,
|
|
78
79
|
slots: slots,
|
|
79
80
|
slotProps: slotProps,
|
|
80
81
|
onClick: onItemClick && (event => onItemClick(event, {
|
|
@@ -48,7 +48,7 @@ export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighli
|
|
|
48
48
|
*
|
|
49
49
|
* - [MarkElement API](https://mui.com/x/api/charts/mark-element/)
|
|
50
50
|
*/
|
|
51
|
-
declare function MarkElement(props: MarkElementProps):
|
|
51
|
+
declare function MarkElement(props: MarkElementProps): React.JSX.Element;
|
|
52
52
|
declare namespace MarkElement {
|
|
53
53
|
var propTypes: any;
|
|
54
54
|
}
|
|
@@ -48,7 +48,7 @@ export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighli
|
|
|
48
48
|
*
|
|
49
49
|
* - [MarkElement API](https://mui.com/x/api/charts/mark-element/)
|
|
50
50
|
*/
|
|
51
|
-
declare function MarkElement(props: MarkElementProps):
|
|
51
|
+
declare function MarkElement(props: MarkElementProps): React.JSX.Element;
|
|
52
52
|
declare namespace MarkElement {
|
|
53
53
|
var propTypes: any;
|
|
54
54
|
}
|
package/LineChart/MarkPlot.d.mts
CHANGED
|
@@ -36,7 +36,7 @@ export interface MarkPlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<
|
|
|
36
36
|
*
|
|
37
37
|
* - [MarkPlot API](https://mui.com/x/api/charts/mark-plot/)
|
|
38
38
|
*/
|
|
39
|
-
declare function MarkPlot(props: MarkPlotProps):
|
|
39
|
+
declare function MarkPlot(props: MarkPlotProps): React.JSX.Element;
|
|
40
40
|
declare namespace MarkPlot {
|
|
41
41
|
var propTypes: any;
|
|
42
42
|
}
|
package/LineChart/MarkPlot.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface MarkPlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<
|
|
|
36
36
|
*
|
|
37
37
|
* - [MarkPlot API](https://mui.com/x/api/charts/mark-plot/)
|
|
38
38
|
*/
|
|
39
|
-
declare function MarkPlot(props: MarkPlotProps):
|
|
39
|
+
declare function MarkPlot(props: MarkPlotProps): React.JSX.Element;
|
|
40
40
|
declare namespace MarkPlot {
|
|
41
41
|
var propTypes: any;
|
|
42
42
|
}
|
|
@@ -12,7 +12,7 @@ var _getColor = _interopRequireDefault(require("./getColor"));
|
|
|
12
12
|
var _legend = _interopRequireDefault(require("./legend"));
|
|
13
13
|
var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
14
14
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
15
|
-
var _tooltipPosition =
|
|
15
|
+
var _tooltipPosition = require("./tooltipPosition");
|
|
16
16
|
var _getItemAtPosition = _interopRequireDefault(require("./getItemAtPosition"));
|
|
17
17
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
18
18
|
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
@@ -24,7 +24,7 @@ const lineSeriesConfig = exports.lineSeriesConfig = {
|
|
|
24
24
|
seriesProcessor: _seriesProcessor.default,
|
|
25
25
|
legendGetter: _legend.default,
|
|
26
26
|
tooltipGetter: _tooltip.default,
|
|
27
|
-
|
|
27
|
+
selectorTooltipItemPosition: _tooltipPosition.selectorTooltipItemPosition,
|
|
28
28
|
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
29
29
|
xExtremumGetter: _extremums.getExtremumX,
|
|
30
30
|
yExtremumGetter: _extremums.getExtremumY,
|
|
@@ -4,7 +4,7 @@ import getColor from "./getColor.mjs";
|
|
|
4
4
|
import legendGetter from "./legend.mjs";
|
|
5
5
|
import tooltipGetter, { axisTooltipGetter } from "./tooltip.mjs";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.mjs";
|
|
7
|
-
import
|
|
7
|
+
import { selectorTooltipItemPosition } from "./tooltipPosition.mjs";
|
|
8
8
|
import getItemAtPosition from "./getItemAtPosition.mjs";
|
|
9
9
|
import keyboardFocusHandler from "./keyboardFocusHandler.mjs";
|
|
10
10
|
import { identifierSerializerSeriesIdDataIndex } from "../../internals/identifierSerializer.mjs";
|
|
@@ -16,7 +16,7 @@ export const lineSeriesConfig = {
|
|
|
16
16
|
seriesProcessor,
|
|
17
17
|
legendGetter,
|
|
18
18
|
tooltipGetter,
|
|
19
|
-
|
|
19
|
+
selectorTooltipItemPosition,
|
|
20
20
|
axisTooltipGetter,
|
|
21
21
|
xExtremumGetter: getExtremumX,
|
|
22
22
|
yExtremumGetter: getExtremumY,
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default tooltipItemPositionGetter;
|
|
1
|
+
import type { TooltipItemPositionSelector } from "../../internals/plugins/corePlugins/useChartSeriesConfig/index.mjs";
|
|
2
|
+
export declare const selectorTooltipItemPosition: TooltipItemPositionSelector<'line'>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default tooltipItemPositionGetter;
|
|
1
|
+
import type { TooltipItemPositionSelector } from "../../internals/plugins/corePlugins/useChartSeriesConfig/index.js";
|
|
2
|
+
export declare const selectorTooltipItemPosition: TooltipItemPositionSelector<'line'>;
|
|
@@ -3,31 +3,31 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!identifier || identifier.dataIndex === undefined) {
|
|
6
|
+
exports.selectorTooltipItemPosition = void 0;
|
|
7
|
+
var _store = require("@mui/x-internals/store");
|
|
8
|
+
var _useChartTooltip = require("../../internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors");
|
|
9
|
+
var _useChartSeries = require("../../internals/plugins/corePlugins/useChartSeries");
|
|
10
|
+
var _useChartCartesianAxisRendering = require("../../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors");
|
|
11
|
+
const selectorTooltipItemPosition = exports.selectorTooltipItemPosition = (0, _store.createSelectorMemoized)(_useChartTooltip.selectorChartsTooltipItem, _useChartSeries.selectorChartSeriesProcessed, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartCartesianAxisRendering.selectorChartYAxis, function selectorTooltipItemPosition(identifier, series, xAxes, yAxes) {
|
|
12
|
+
if (!identifier || identifier.type !== 'line' || identifier.dataIndex === undefined) {
|
|
14
13
|
return null;
|
|
15
14
|
}
|
|
16
15
|
const itemSeries = series.line?.series[identifier.seriesId];
|
|
17
16
|
if (itemSeries == null) {
|
|
18
17
|
return null;
|
|
19
18
|
}
|
|
20
|
-
|
|
19
|
+
const xAxis = xAxes.axis[itemSeries.xAxisId ?? xAxes.axisIds[0]];
|
|
20
|
+
const yAxis = yAxes.axis[itemSeries.yAxisId ?? yAxes.axisIds[0]];
|
|
21
|
+
if (xAxis === undefined || yAxis === undefined) {
|
|
21
22
|
return null;
|
|
22
23
|
}
|
|
23
|
-
const xValue =
|
|
24
|
+
const xValue = xAxis.data?.[identifier.dataIndex];
|
|
24
25
|
const yValue = itemSeries.data[identifier.dataIndex] == null ? null : itemSeries.visibleStackedData[identifier.dataIndex][1];
|
|
25
26
|
if (xValue == null || yValue == null) {
|
|
26
27
|
return null;
|
|
27
28
|
}
|
|
28
29
|
return {
|
|
29
|
-
x:
|
|
30
|
-
y:
|
|
30
|
+
x: xAxis.scale(xValue),
|
|
31
|
+
y: yAxis.scale(yValue)
|
|
31
32
|
};
|
|
32
|
-
};
|
|
33
|
-
var _default = exports.default = tooltipItemPositionGetter;
|
|
33
|
+
});
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (!identifier || identifier.dataIndex === undefined) {
|
|
1
|
+
import { createSelectorMemoized } from '@mui/x-internals/store';
|
|
2
|
+
import { selectorChartsTooltipItem } from "../../internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs";
|
|
3
|
+
import { selectorChartSeriesProcessed } from "../../internals/plugins/corePlugins/useChartSeries/index.mjs";
|
|
4
|
+
import { selectorChartXAxis, selectorChartYAxis } from "../../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";
|
|
5
|
+
export const selectorTooltipItemPosition = createSelectorMemoized(selectorChartsTooltipItem, selectorChartSeriesProcessed, selectorChartXAxis, selectorChartYAxis, function selectorTooltipItemPosition(identifier, series, xAxes, yAxes) {
|
|
6
|
+
if (!identifier || identifier.type !== 'line' || identifier.dataIndex === undefined) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
10
9
|
const itemSeries = series.line?.series[identifier.seriesId];
|
|
11
10
|
if (itemSeries == null) {
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
|
-
|
|
13
|
+
const xAxis = xAxes.axis[itemSeries.xAxisId ?? xAxes.axisIds[0]];
|
|
14
|
+
const yAxis = yAxes.axis[itemSeries.yAxisId ?? yAxes.axisIds[0]];
|
|
15
|
+
if (xAxis === undefined || yAxis === undefined) {
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
|
-
const xValue =
|
|
18
|
+
const xValue = xAxis.data?.[identifier.dataIndex];
|
|
18
19
|
const yValue = itemSeries.data[identifier.dataIndex] == null ? null : itemSeries.visibleStackedData[identifier.dataIndex][1];
|
|
19
20
|
if (xValue == null || yValue == null) {
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
return {
|
|
23
|
-
x:
|
|
24
|
-
y:
|
|
24
|
+
x: xAxis.scale(xValue),
|
|
25
|
+
y: yAxis.scale(yValue)
|
|
25
26
|
};
|
|
26
|
-
};
|
|
27
|
-
export default tooltipItemPositionGetter;
|
|
27
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComputedAxisConfig } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
|
|
2
|
+
import type { ZoomMap } from "../internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.mjs";
|
|
2
3
|
import type { ChartsXAxisProps, ChartsYAxisProps } from "../models/index.mjs";
|
|
3
4
|
import type { SeriesId } from "../models/seriesType/common.mjs";
|
|
4
5
|
interface LinePlotDataPoint {
|
|
@@ -7,6 +8,17 @@ interface LinePlotDataPoint {
|
|
|
7
8
|
color: string;
|
|
8
9
|
gradientId?: string;
|
|
9
10
|
hidden: boolean;
|
|
11
|
+
/** Skip the path animation: morphing between different sampled point counts looks wrong. */
|
|
12
|
+
isSampled: boolean;
|
|
10
13
|
}
|
|
11
|
-
export declare function useLinePlotData(xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps
|
|
14
|
+
export declare function useLinePlotData(xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps>,
|
|
15
|
+
/**
|
|
16
|
+
* Overrides the zoom span and pixel size used for sampling. The zoom-slider preview passes its
|
|
17
|
+
* full-range zoom and own width so its density stays stable while the main chart zooms, instead
|
|
18
|
+
* of reading the active zoom from the store.
|
|
19
|
+
*/
|
|
20
|
+
samplingOverride?: {
|
|
21
|
+
zoomMap: ZoomMap;
|
|
22
|
+
availableSize: number;
|
|
23
|
+
}): LinePlotDataPoint[];
|
|
12
24
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComputedAxisConfig } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
2
|
+
import type { ZoomMap } from "../internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js";
|
|
2
3
|
import type { ChartsXAxisProps, ChartsYAxisProps } from "../models/index.js";
|
|
3
4
|
import type { SeriesId } from "../models/seriesType/common.js";
|
|
4
5
|
interface LinePlotDataPoint {
|
|
@@ -7,6 +8,17 @@ interface LinePlotDataPoint {
|
|
|
7
8
|
color: string;
|
|
8
9
|
gradientId?: string;
|
|
9
10
|
hidden: boolean;
|
|
11
|
+
/** Skip the path animation: morphing between different sampled point counts looks wrong. */
|
|
12
|
+
isSampled: boolean;
|
|
10
13
|
}
|
|
11
|
-
export declare function useLinePlotData(xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps
|
|
14
|
+
export declare function useLinePlotData(xAxes: ComputedAxisConfig<ChartsXAxisProps>, yAxes: ComputedAxisConfig<ChartsYAxisProps>,
|
|
15
|
+
/**
|
|
16
|
+
* Overrides the zoom span and pixel size used for sampling. The zoom-slider preview passes its
|
|
17
|
+
* full-range zoom and own width so its density stays stable while the main chart zooms, instead
|
|
18
|
+
* of reading the active zoom from the store.
|
|
19
|
+
*/
|
|
20
|
+
samplingOverride?: {
|
|
21
|
+
zoomMap: ZoomMap;
|
|
22
|
+
availableSize: number;
|
|
23
|
+
}): LinePlotDataPoint[];
|
|
12
24
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
'use client';
|
|
2
3
|
|
|
3
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10,14 +11,43 @@ var _warning = require("@mui/x-internals/warning");
|
|
|
10
11
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
11
12
|
var _useChartGradientId = require("../hooks/useChartGradientId");
|
|
12
13
|
var _scaleGuards = require("../internals/scaleGuards");
|
|
14
|
+
var _sampling = require("../internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors");
|
|
15
|
+
var _useChartCartesianAxisRendering = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors");
|
|
16
|
+
var _useChartSeriesConfig = require("../internals/plugins/corePlugins/useChartSeriesConfig");
|
|
17
|
+
var _useStore = require("../internals/store/useStore");
|
|
13
18
|
var _getCurve = require("../internals/getCurve");
|
|
14
19
|
var _hooks = require("../hooks");
|
|
15
20
|
var _constants = require("../constants");
|
|
16
|
-
function useLinePlotData(xAxes, yAxes
|
|
21
|
+
function useLinePlotData(xAxes, yAxes,
|
|
22
|
+
/**
|
|
23
|
+
* Overrides the zoom span and pixel size used for sampling. The zoom-slider preview passes its
|
|
24
|
+
* full-range zoom and own width so its density stays stable while the main chart zooms, instead
|
|
25
|
+
* of reading the active zoom from the store.
|
|
26
|
+
*/
|
|
27
|
+
samplingOverride) {
|
|
17
28
|
const seriesData = (0, _hooks.useLineSeriesContext)();
|
|
18
29
|
const defaultXAxisId = (0, _hooks.useXAxes)().xAxisIds[0];
|
|
19
30
|
const defaultYAxisId = (0, _hooks.useYAxes)().yAxisIds[0];
|
|
20
31
|
const getGradientId = (0, _useChartGradientId.useChartGradientIdBuilder)();
|
|
32
|
+
const drawingArea = (0, _hooks.useDrawingArea)();
|
|
33
|
+
const store = (0, _useStore.useStore)();
|
|
34
|
+
const samplingState = store.use(_sampling.selectorChartSamplingState);
|
|
35
|
+
const sampledSeries = store.use(_sampling.selectorChartSamplingPyramids);
|
|
36
|
+
const activeZoomMap = store.use(_useChartCartesianAxisRendering.selectorChartZoomMap);
|
|
37
|
+
const zoomOptions = store.use(_useChartCartesianAxisRendering.selectorChartZoomOptionsLookup);
|
|
38
|
+
const sampler = store.use(_useChartSeriesConfig.selectorChartSeriesConfig).line?.sampler;
|
|
39
|
+
const zoomMap = samplingOverride?.zoomMap ?? activeZoomMap;
|
|
40
|
+
const samplingSize = samplingOverride?.availableSize ?? drawingArea.width;
|
|
41
|
+
|
|
42
|
+
// Skip the line animation while sampling is on, plus the first render after it turns off: the
|
|
43
|
+
// point count changes, so the path would morph.
|
|
44
|
+
const lineMethod = samplingState?.methods.line;
|
|
45
|
+
const samplingEnabled = lineMethod != null && lineMethod !== 'none';
|
|
46
|
+
const wasSamplingEnabled = React.useRef(samplingEnabled);
|
|
47
|
+
const skipSamplingAnimation = samplingEnabled || wasSamplingEnabled.current;
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
wasSamplingEnabled.current = samplingEnabled;
|
|
50
|
+
}, [samplingEnabled]);
|
|
21
51
|
|
|
22
52
|
// This memo prevents odd line chart behavior when hydrating.
|
|
23
53
|
const allData = React.useMemo(() => {
|
|
@@ -61,39 +91,65 @@ function useLinePlotData(xAxes, yAxes) {
|
|
|
61
91
|
}
|
|
62
92
|
}
|
|
63
93
|
const shouldExpand = curve?.includes('step') && !strictStepCurve && (0, _scaleGuards.isOrdinalScale)(xScale);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
|
|
95
|
+
// Only the plain (non-step) path is sampled; step expansion falls back to the full render.
|
|
96
|
+
const built = sampledSeries[seriesId];
|
|
97
|
+
const zoom = zoomMap?.get(xAxisId) ?? (built ? (0, _sampling.getFullRangeZoom)(xAxisId) : undefined);
|
|
98
|
+
let sampledBuckets = null;
|
|
99
|
+
if (samplingEnabled && built && zoom && !shouldExpand && xData) {
|
|
100
|
+
// Pro owns the sampling math; community flattens the buckets into a polyline.
|
|
101
|
+
sampledBuckets = sampler?.sample?.({
|
|
102
|
+
built,
|
|
103
|
+
zoom,
|
|
104
|
+
availableSize: samplingSize,
|
|
105
|
+
minSpan: zoomOptions[xAxisId]?.minSpan ?? 0,
|
|
106
|
+
algorithm: lineMethod,
|
|
107
|
+
getValues: () => Float64Array.from(visibleStackedData, point => point[1])
|
|
108
|
+
}) ?? null;
|
|
109
|
+
}
|
|
110
|
+
let formattedData;
|
|
111
|
+
if (sampledBuckets) {
|
|
112
|
+
// Buckets already hold the indices to render; flatten them.
|
|
113
|
+
formattedData = sampledBuckets.flatMap(bucket => Array.from(bucket.indices, index => ({
|
|
114
|
+
x: xData[index],
|
|
115
|
+
y: visibleStackedData[index],
|
|
116
|
+
nullData: data[index] == null
|
|
117
|
+
})));
|
|
118
|
+
} else {
|
|
119
|
+
formattedData = xData?.flatMap((x, index) => {
|
|
120
|
+
const nullData = data[index] == null;
|
|
121
|
+
if (shouldExpand) {
|
|
122
|
+
const rep = [{
|
|
123
|
+
x,
|
|
84
124
|
y: visibleStackedData[index],
|
|
85
125
|
nullData,
|
|
86
|
-
isExtension:
|
|
87
|
-
}
|
|
126
|
+
isExtension: false
|
|
127
|
+
}];
|
|
128
|
+
if (!nullData && (index === 0 || data[index - 1] == null)) {
|
|
129
|
+
rep.unshift({
|
|
130
|
+
x: (xScale(x) ?? 0) - (xScale.step() - xScale.bandwidth()) / 2,
|
|
131
|
+
y: visibleStackedData[index],
|
|
132
|
+
nullData,
|
|
133
|
+
isExtension: true
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (!nullData && (index === data.length - 1 || data[index + 1] == null)) {
|
|
137
|
+
rep.push({
|
|
138
|
+
x: (xScale(x) ?? 0) + (xScale.step() + xScale.bandwidth()) / 2,
|
|
139
|
+
y: visibleStackedData[index],
|
|
140
|
+
nullData,
|
|
141
|
+
isExtension: true
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return rep;
|
|
88
145
|
}
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}) ?? [];
|
|
146
|
+
return {
|
|
147
|
+
x,
|
|
148
|
+
y: visibleStackedData[index],
|
|
149
|
+
nullData
|
|
150
|
+
};
|
|
151
|
+
}) ?? [];
|
|
152
|
+
}
|
|
97
153
|
const d3Data = connectNulls ? formattedData.filter(d => !d.nullData) : formattedData;
|
|
98
154
|
const hidden = series[seriesId].hidden;
|
|
99
155
|
const linePath = (0, _d3Shape.line)().x(d => d.isExtension ? d.x : xPosition(d.x)).defined(d => connectNulls || !d.nullData || !!d.isExtension).y(d => {
|
|
@@ -108,11 +164,12 @@ function useLinePlotData(xAxes, yAxes) {
|
|
|
108
164
|
gradientId,
|
|
109
165
|
d,
|
|
110
166
|
seriesId,
|
|
111
|
-
hidden: series[seriesId].hidden
|
|
167
|
+
hidden: series[seriesId].hidden,
|
|
168
|
+
isSampled: skipSamplingAnimation
|
|
112
169
|
});
|
|
113
170
|
}
|
|
114
171
|
}
|
|
115
172
|
return linePlotData;
|
|
116
|
-
}, [seriesData, defaultXAxisId, defaultYAxisId, xAxes, yAxes, getGradientId]);
|
|
173
|
+
}, [seriesData, defaultXAxisId, defaultYAxisId, xAxes, yAxes, getGradientId, samplingEnabled, lineMethod, sampledSeries, zoomMap, samplingSize, zoomOptions, sampler, skipSamplingAnimation]);
|
|
117
174
|
return allData;
|
|
118
175
|
}
|
|
@@ -1,16 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
3
5
|
import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
|
|
4
6
|
import { useChartGradientIdBuilder } from "../hooks/useChartGradientId.mjs";
|
|
5
7
|
import { isOrdinalScale } from "../internals/scaleGuards.mjs";
|
|
8
|
+
import { selectorChartSamplingState, selectorChartSamplingPyramids, getFullRangeZoom } from "../internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs";
|
|
9
|
+
import { selectorChartZoomMap, selectorChartZoomOptionsLookup } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";
|
|
10
|
+
import { selectorChartSeriesConfig } from "../internals/plugins/corePlugins/useChartSeriesConfig/index.mjs";
|
|
11
|
+
import { useStore } from "../internals/store/useStore.mjs";
|
|
6
12
|
import { getCurveFactory } from "../internals/getCurve.mjs";
|
|
7
|
-
import { getValueToPositionMapper, useLineSeriesContext, useXAxes, useYAxes } from "../hooks/index.mjs";
|
|
13
|
+
import { getValueToPositionMapper, useDrawingArea, useLineSeriesContext, useXAxes, useYAxes } from "../hooks/index.mjs";
|
|
8
14
|
import { DEFAULT_X_AXIS_KEY } from "../constants/index.mjs";
|
|
9
|
-
export function useLinePlotData(xAxes, yAxes
|
|
15
|
+
export function useLinePlotData(xAxes, yAxes,
|
|
16
|
+
/**
|
|
17
|
+
* Overrides the zoom span and pixel size used for sampling. The zoom-slider preview passes its
|
|
18
|
+
* full-range zoom and own width so its density stays stable while the main chart zooms, instead
|
|
19
|
+
* of reading the active zoom from the store.
|
|
20
|
+
*/
|
|
21
|
+
samplingOverride) {
|
|
10
22
|
const seriesData = useLineSeriesContext();
|
|
11
23
|
const defaultXAxisId = useXAxes().xAxisIds[0];
|
|
12
24
|
const defaultYAxisId = useYAxes().yAxisIds[0];
|
|
13
25
|
const getGradientId = useChartGradientIdBuilder();
|
|
26
|
+
const drawingArea = useDrawingArea();
|
|
27
|
+
const store = useStore();
|
|
28
|
+
const samplingState = store.use(selectorChartSamplingState);
|
|
29
|
+
const sampledSeries = store.use(selectorChartSamplingPyramids);
|
|
30
|
+
const activeZoomMap = store.use(selectorChartZoomMap);
|
|
31
|
+
const zoomOptions = store.use(selectorChartZoomOptionsLookup);
|
|
32
|
+
const sampler = store.use(selectorChartSeriesConfig).line?.sampler;
|
|
33
|
+
const zoomMap = samplingOverride?.zoomMap ?? activeZoomMap;
|
|
34
|
+
const samplingSize = samplingOverride?.availableSize ?? drawingArea.width;
|
|
35
|
+
|
|
36
|
+
// Skip the line animation while sampling is on, plus the first render after it turns off: the
|
|
37
|
+
// point count changes, so the path would morph.
|
|
38
|
+
const lineMethod = samplingState?.methods.line;
|
|
39
|
+
const samplingEnabled = lineMethod != null && lineMethod !== 'none';
|
|
40
|
+
const wasSamplingEnabled = React.useRef(samplingEnabled);
|
|
41
|
+
const skipSamplingAnimation = samplingEnabled || wasSamplingEnabled.current;
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
wasSamplingEnabled.current = samplingEnabled;
|
|
44
|
+
}, [samplingEnabled]);
|
|
14
45
|
|
|
15
46
|
// This memo prevents odd line chart behavior when hydrating.
|
|
16
47
|
const allData = React.useMemo(() => {
|
|
@@ -54,39 +85,65 @@ export function useLinePlotData(xAxes, yAxes) {
|
|
|
54
85
|
}
|
|
55
86
|
}
|
|
56
87
|
const shouldExpand = curve?.includes('step') && !strictStepCurve && isOrdinalScale(xScale);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
|
|
89
|
+
// Only the plain (non-step) path is sampled; step expansion falls back to the full render.
|
|
90
|
+
const built = sampledSeries[seriesId];
|
|
91
|
+
const zoom = zoomMap?.get(xAxisId) ?? (built ? getFullRangeZoom(xAxisId) : undefined);
|
|
92
|
+
let sampledBuckets = null;
|
|
93
|
+
if (samplingEnabled && built && zoom && !shouldExpand && xData) {
|
|
94
|
+
// Pro owns the sampling math; community flattens the buckets into a polyline.
|
|
95
|
+
sampledBuckets = sampler?.sample?.({
|
|
96
|
+
built,
|
|
97
|
+
zoom,
|
|
98
|
+
availableSize: samplingSize,
|
|
99
|
+
minSpan: zoomOptions[xAxisId]?.minSpan ?? 0,
|
|
100
|
+
algorithm: lineMethod,
|
|
101
|
+
getValues: () => Float64Array.from(visibleStackedData, point => point[1])
|
|
102
|
+
}) ?? null;
|
|
103
|
+
}
|
|
104
|
+
let formattedData;
|
|
105
|
+
if (sampledBuckets) {
|
|
106
|
+
// Buckets already hold the indices to render; flatten them.
|
|
107
|
+
formattedData = sampledBuckets.flatMap(bucket => Array.from(bucket.indices, index => ({
|
|
108
|
+
x: xData[index],
|
|
109
|
+
y: visibleStackedData[index],
|
|
110
|
+
nullData: data[index] == null
|
|
111
|
+
})));
|
|
112
|
+
} else {
|
|
113
|
+
formattedData = xData?.flatMap((x, index) => {
|
|
114
|
+
const nullData = data[index] == null;
|
|
115
|
+
if (shouldExpand) {
|
|
116
|
+
const rep = [{
|
|
117
|
+
x,
|
|
77
118
|
y: visibleStackedData[index],
|
|
78
119
|
nullData,
|
|
79
|
-
isExtension:
|
|
80
|
-
}
|
|
120
|
+
isExtension: false
|
|
121
|
+
}];
|
|
122
|
+
if (!nullData && (index === 0 || data[index - 1] == null)) {
|
|
123
|
+
rep.unshift({
|
|
124
|
+
x: (xScale(x) ?? 0) - (xScale.step() - xScale.bandwidth()) / 2,
|
|
125
|
+
y: visibleStackedData[index],
|
|
126
|
+
nullData,
|
|
127
|
+
isExtension: true
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (!nullData && (index === data.length - 1 || data[index + 1] == null)) {
|
|
131
|
+
rep.push({
|
|
132
|
+
x: (xScale(x) ?? 0) + (xScale.step() + xScale.bandwidth()) / 2,
|
|
133
|
+
y: visibleStackedData[index],
|
|
134
|
+
nullData,
|
|
135
|
+
isExtension: true
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return rep;
|
|
81
139
|
}
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}) ?? [];
|
|
140
|
+
return {
|
|
141
|
+
x,
|
|
142
|
+
y: visibleStackedData[index],
|
|
143
|
+
nullData
|
|
144
|
+
};
|
|
145
|
+
}) ?? [];
|
|
146
|
+
}
|
|
90
147
|
const d3Data = connectNulls ? formattedData.filter(d => !d.nullData) : formattedData;
|
|
91
148
|
const hidden = series[seriesId].hidden;
|
|
92
149
|
const linePath = d3Line().x(d => d.isExtension ? d.x : xPosition(d.x)).defined(d => connectNulls || !d.nullData || !!d.isExtension).y(d => {
|
|
@@ -101,11 +158,12 @@ export function useLinePlotData(xAxes, yAxes) {
|
|
|
101
158
|
gradientId,
|
|
102
159
|
d,
|
|
103
160
|
seriesId,
|
|
104
|
-
hidden: series[seriesId].hidden
|
|
161
|
+
hidden: series[seriesId].hidden,
|
|
162
|
+
isSampled: skipSamplingAnimation
|
|
105
163
|
});
|
|
106
164
|
}
|
|
107
165
|
}
|
|
108
166
|
return linePlotData;
|
|
109
|
-
}, [seriesData, defaultXAxisId, defaultYAxisId, xAxes, yAxes, getGradientId]);
|
|
167
|
+
}, [seriesData, defaultXAxisId, defaultYAxisId, xAxes, yAxes, getGradientId, samplingEnabled, lineMethod, sampledSeries, zoomMap, samplingSize, zoomOptions, sampler, skipSamplingAnimation]);
|
|
110
168
|
return allData;
|
|
111
169
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PieArcProps } from "./PieArc.mjs";
|
|
2
|
-
declare function FocusedPieArc(props: Partial<Omit<PieArcProps, 'startAngle' | 'endAngle' | 'seriesId' | 'dataIndex' | 'isFaded' | 'isHighlighted' | 'isFocused'>>): import("react
|
|
2
|
+
declare function FocusedPieArc(props: Partial<Omit<PieArcProps, 'startAngle' | 'endAngle' | 'seriesId' | 'dataIndex' | 'isFaded' | 'isHighlighted' | 'isFocused'>>): import("react").JSX.Element | null;
|
|
3
3
|
declare namespace FocusedPieArc {
|
|
4
4
|
var propTypes: any;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PieArcProps } from "./PieArc.js";
|
|
2
|
-
declare function FocusedPieArc(props: Partial<Omit<PieArcProps, 'startAngle' | 'endAngle' | 'seriesId' | 'dataIndex' | 'isFaded' | 'isHighlighted' | 'isFocused'>>): import("react
|
|
2
|
+
declare function FocusedPieArc(props: Partial<Omit<PieArcProps, 'startAngle' | 'endAngle' | 'seriesId' | 'dataIndex' | 'isFaded' | 'isHighlighted' | 'isFocused'>>): import("react").JSX.Element | null;
|
|
3
3
|
declare namespace FocusedPieArc {
|
|
4
4
|
var propTypes: any;
|
|
5
5
|
}
|
|
@@ -34,7 +34,7 @@ export interface PieArcLabelPlotProps extends Pick<DefaultizedPieSeriesType, 'da
|
|
|
34
34
|
*/
|
|
35
35
|
skipAnimation?: boolean;
|
|
36
36
|
}
|
|
37
|
-
declare function PieArcLabelPlot(props: PieArcLabelPlotProps):
|
|
37
|
+
declare function PieArcLabelPlot(props: PieArcLabelPlotProps): React.JSX.Element | null;
|
|
38
38
|
declare namespace PieArcLabelPlot {
|
|
39
39
|
var propTypes: any;
|
|
40
40
|
}
|
|
@@ -34,7 +34,7 @@ export interface PieArcLabelPlotProps extends Pick<DefaultizedPieSeriesType, 'da
|
|
|
34
34
|
*/
|
|
35
35
|
skipAnimation?: boolean;
|
|
36
36
|
}
|
|
37
|
-
declare function PieArcLabelPlot(props: PieArcLabelPlotProps):
|
|
37
|
+
declare function PieArcLabelPlot(props: PieArcLabelPlotProps): React.JSX.Element | null;
|
|
38
38
|
declare namespace PieArcLabelPlot {
|
|
39
39
|
var propTypes: any;
|
|
40
40
|
}
|
|
@@ -41,7 +41,7 @@ export interface PieArcPlotProps extends Pick<DefaultizedPieSeriesType, 'data' |
|
|
|
41
41
|
*/
|
|
42
42
|
skipAnimation?: boolean;
|
|
43
43
|
}
|
|
44
|
-
declare function PieArcPlot(props: PieArcPlotProps):
|
|
44
|
+
declare function PieArcPlot(props: PieArcPlotProps): React.JSX.Element | null;
|
|
45
45
|
declare namespace PieArcPlot {
|
|
46
46
|
var propTypes: any;
|
|
47
47
|
}
|
package/PieChart/PieArcPlot.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface PieArcPlotProps extends Pick<DefaultizedPieSeriesType, 'data' |
|
|
|
41
41
|
*/
|
|
42
42
|
skipAnimation?: boolean;
|
|
43
43
|
}
|
|
44
|
-
declare function PieArcPlot(props: PieArcPlotProps):
|
|
44
|
+
declare function PieArcPlot(props: PieArcPlotProps): React.JSX.Element | null;
|
|
45
45
|
declare namespace PieArcPlot {
|
|
46
46
|
var propTypes: any;
|
|
47
47
|
}
|