@mui/x-charts 9.8.0 → 9.10.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/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/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 +230 -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/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.mts +1 -1
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.ts +1 -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/ChartsDataProvider/useChartsDataProviderProps.d.mts +1 -1
- package/ChartsDataProvider/useChartsDataProviderProps.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/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/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/ChartsRadialDataProvider/useChartsRadialDataProviderProps.d.mts +1 -1
- package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.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/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/ChartsReferenceLine.d.mts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.mts +2 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +2 -2
- package/ChartsReferenceLine/ChartsYReferenceLine.d.mts +2 -2
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +2 -2
- package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -1
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -1
- package/ChartsRotationAxis/chartsRotationAxisClasses.d.mts +1 -1
- package/ChartsRotationAxis/chartsRotationAxisClasses.d.ts +1 -1
- package/ChartsText/ChartsText.d.mts +1 -1
- package/ChartsText/ChartsText.d.ts +1 -1
- package/ChartsTooltip/ChartTooltip.types.d.mts +2 -1
- package/ChartsTooltip/ChartTooltip.types.d.ts +2 -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 +5 -2
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +5 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +1 -5
- package/ChartsTooltip/ChartsTooltipContainer.mjs +2 -6
- 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/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/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/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/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/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 +4 -4
- package/LineChart/AreaPlot.d.ts +4 -4
- package/LineChart/AreaPlot.js +4 -5
- package/LineChart/AreaPlot.mjs +4 -5
- 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 +4 -4
- package/LineChart/LinePlot.d.ts +4 -4
- package/LineChart/LinePlot.js +7 -7
- package/LineChart/LinePlot.mjs +7 -7
- package/LineChart/MarkElement.d.mts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkPlot.d.mts +6 -5
- package/LineChart/MarkPlot.d.ts +6 -5
- 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/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/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/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 +3 -2
- package/PieChart/PieArcLabelPlot.d.ts +3 -2
- package/PieChart/PieArcPlot.d.mts +3 -2
- package/PieChart/PieArcPlot.d.ts +3 -2
- package/PieChart/PiePlot.d.mts +1 -1
- package/PieChart/PiePlot.d.ts +1 -1
- package/PieChart/pieClasses.d.mts +1 -1
- package/PieChart/pieClasses.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/RadarAxis/RadarAxis.utils.d.mts +5 -5
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +5 -5
- 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/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/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/RadarChart/useRadarChartProps.d.mts +1 -1
- package/RadarChart/useRadarChartProps.d.ts +1 -1
- 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/ScatterChart.d.mts +2 -1
- package/ScatterChart/ScatterChart.d.ts +2 -1
- package/ScatterChart/ScatterMarker.d.mts +1 -1
- package/ScatterChart/ScatterMarker.d.ts +1 -1
- package/ScatterChart/ScatterMarker.types.d.mts +2 -1
- package/ScatterChart/ScatterMarker.types.d.ts +2 -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/scatterClasses.d.mts +1 -1
- package/ScatterChart/scatterClasses.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/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/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/colorScale.d.mts +1 -1
- package/internals/colorScale.d.ts +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/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.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/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/identifierCleaner.d.mts +1 -1
- package/internals/identifierCleaner.d.ts +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/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 +4 -4
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +4 -4
- 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/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/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/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/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 +4 -9
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +4 -9
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -53
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +2 -53
- 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/models/axis.d.mts +5 -4
- package/models/axis.d.ts +5 -4
- package/models/seriesType/config.d.mts +8 -4
- package/models/seriesType/config.d.ts +8 -4
- 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 +4 -4
- 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
|
@@ -11,7 +11,7 @@ var _getColor = _interopRequireDefault(require("./getColor"));
|
|
|
11
11
|
var _legend = _interopRequireDefault(require("./legend"));
|
|
12
12
|
var _tooltip = _interopRequireDefault(require("./tooltip"));
|
|
13
13
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
|
-
var _tooltipPosition =
|
|
14
|
+
var _tooltipPosition = require("./tooltipPosition");
|
|
15
15
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
16
16
|
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
17
17
|
var _identifierCleaner = require("../../internals/identifierCleaner");
|
|
@@ -22,7 +22,7 @@ const scatterSeriesConfig = exports.scatterSeriesConfig = {
|
|
|
22
22
|
colorProcessor: _getColor.default,
|
|
23
23
|
legendGetter: _legend.default,
|
|
24
24
|
tooltipGetter: _tooltip.default,
|
|
25
|
-
|
|
25
|
+
selectorTooltipItemPosition: _tooltipPosition.selectorTooltipItemPosition,
|
|
26
26
|
xExtremumGetter: _extremums.getExtremumX,
|
|
27
27
|
yExtremumGetter: _extremums.getExtremumY,
|
|
28
28
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
@@ -4,7 +4,7 @@ import getColor from "./getColor.mjs";
|
|
|
4
4
|
import legendGetter from "./legend.mjs";
|
|
5
5
|
import tooltipGetter from "./tooltip.mjs";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.mjs";
|
|
7
|
-
import
|
|
7
|
+
import { selectorTooltipItemPosition } from "./tooltipPosition.mjs";
|
|
8
8
|
import keyboardFocusHandler from "./keyboardFocusHandler.mjs";
|
|
9
9
|
import { identifierSerializerSeriesIdDataIndex } from "../../internals/identifierSerializer.mjs";
|
|
10
10
|
import { identifierCleanerSeriesIdDataIndex } from "../../internals/identifierCleaner.mjs";
|
|
@@ -15,7 +15,7 @@ export const scatterSeriesConfig = {
|
|
|
15
15
|
colorProcessor: getColor,
|
|
16
16
|
legendGetter,
|
|
17
17
|
tooltipGetter,
|
|
18
|
-
|
|
18
|
+
selectorTooltipItemPosition,
|
|
19
19
|
xExtremumGetter: getExtremumX,
|
|
20
20
|
yExtremumGetter: getExtremumY,
|
|
21
21
|
getSeriesWithDefaultValues,
|
|
@@ -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<'scatter'>;
|
|
@@ -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<'scatter'>;
|
|
@@ -3,21 +3,22 @@
|
|
|
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 !== 'scatter' || identifier.dataIndex === undefined) {
|
|
14
13
|
return null;
|
|
15
14
|
}
|
|
16
15
|
const itemSeries = series.scatter?.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
24
|
const xValue = itemSeries.data?.[identifier.dataIndex].x;
|
|
@@ -26,8 +27,7 @@ const tooltipItemPositionGetter = params => {
|
|
|
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,17 +1,18 @@
|
|
|
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 !== 'scatter' || identifier.dataIndex === undefined) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
10
9
|
const itemSeries = series.scatter?.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
18
|
const xValue = itemSeries.data?.[identifier.dataIndex].x;
|
|
@@ -20,8 +21,7 @@ const tooltipItemPositionGetter = params => {
|
|
|
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
|
+
});
|
|
@@ -4,5 +4,5 @@ import type { DefaultizedScatterSeriesType, ScatterValueType } from "../models/i
|
|
|
4
4
|
export declare function useScatterPlotData(series: DefaultizedScatterSeriesType, xScale: D3Scale, yScale: D3Scale, isPointInside: (x: number, y: number) => boolean): (ScatterValueType & {
|
|
5
5
|
dataIndex: number;
|
|
6
6
|
seriesId: SeriesId;
|
|
7
|
-
type:
|
|
7
|
+
type: 'scatter';
|
|
8
8
|
})[];
|
|
@@ -4,5 +4,5 @@ import type { DefaultizedScatterSeriesType, ScatterValueType } from "../models/i
|
|
|
4
4
|
export declare function useScatterPlotData(series: DefaultizedScatterSeriesType, xScale: D3Scale, yScale: D3Scale, isPointInside: (x: number, y: number) => boolean): (ScatterValueType & {
|
|
5
5
|
dataIndex: number;
|
|
6
6
|
seriesId: SeriesId;
|
|
7
|
-
type:
|
|
7
|
+
type: 'scatter';
|
|
8
8
|
})[];
|
|
@@ -125,5 +125,5 @@ export interface SparkLineChartProps<PlotType extends 'line' | 'bar' = 'line' |
|
|
|
125
125
|
*
|
|
126
126
|
* - [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/)
|
|
127
127
|
*/
|
|
128
|
-
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps<"
|
|
128
|
+
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps<"bar" | "line"> & React.RefAttributes<HTMLDivElement>>;
|
|
129
129
|
export { SparkLineChart };
|
|
@@ -125,5 +125,5 @@ export interface SparkLineChartProps<PlotType extends 'line' | 'bar' = 'line' |
|
|
|
125
125
|
*
|
|
126
126
|
* - [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/)
|
|
127
127
|
*/
|
|
128
|
-
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps<"
|
|
128
|
+
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps<"bar" | "line"> & React.RefAttributes<HTMLDivElement>>;
|
|
129
129
|
export { SparkLineChart };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
+
import type { WithDataAttributes } from '@mui/utils/types';
|
|
2
3
|
import type { ToolbarPropsOverrides } from "../models/chartsSlotsComponentsProps.mjs";
|
|
3
4
|
export interface ChartsToolbarProps {}
|
|
4
5
|
export interface ChartsToolbarSlots {
|
|
@@ -12,5 +13,5 @@ export interface ChartsToolbarSlotProps {
|
|
|
12
13
|
/**
|
|
13
14
|
* Props for the toolbar component.
|
|
14
15
|
*/
|
|
15
|
-
toolbar?: Partial<ChartsToolbarProps> & ToolbarPropsOverrides
|
|
16
|
+
toolbar?: WithDataAttributes<Partial<ChartsToolbarProps> & ToolbarPropsOverrides>;
|
|
16
17
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
+
import type { WithDataAttributes } from '@mui/utils/types';
|
|
2
3
|
import type { ToolbarPropsOverrides } from "../models/chartsSlotsComponentsProps.js";
|
|
3
4
|
export interface ChartsToolbarProps {}
|
|
4
5
|
export interface ChartsToolbarSlots {
|
|
@@ -12,5 +13,5 @@ export interface ChartsToolbarSlotProps {
|
|
|
12
13
|
/**
|
|
13
14
|
* Props for the toolbar component.
|
|
14
15
|
*/
|
|
15
|
-
toolbar?: Partial<ChartsToolbarProps> & ToolbarPropsOverrides
|
|
16
|
+
toolbar?: WithDataAttributes<Partial<ChartsToolbarProps> & ToolbarPropsOverrides>;
|
|
16
17
|
}
|
|
@@ -3,5 +3,5 @@ import type { ChartsProviderProps } from "./ChartsProvider.types.mjs";
|
|
|
3
3
|
import type { ChartAnyPluginSignature } from "../../internals/plugins/models/index.mjs";
|
|
4
4
|
import type { ChartSeriesType } from "../../models/seriesType/config.mjs";
|
|
5
5
|
import type { ChartCorePluginSignatures } from "../../internals/plugins/corePlugins/index.mjs";
|
|
6
|
-
declare function ChartsProvider<SeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = ChartCorePluginSignatures<SeriesType>>(props: React.PropsWithChildren<ChartsProviderProps<SeriesType, TSignatures>>):
|
|
6
|
+
declare function ChartsProvider<SeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = ChartCorePluginSignatures<SeriesType>>(props: React.PropsWithChildren<ChartsProviderProps<SeriesType, TSignatures>>): React.JSX.Element;
|
|
7
7
|
export { ChartsProvider };
|
|
@@ -3,5 +3,5 @@ import type { ChartsProviderProps } from "./ChartsProvider.types.js";
|
|
|
3
3
|
import type { ChartAnyPluginSignature } from "../../internals/plugins/models/index.js";
|
|
4
4
|
import type { ChartSeriesType } from "../../models/seriesType/config.js";
|
|
5
5
|
import type { ChartCorePluginSignatures } from "../../internals/plugins/corePlugins/index.js";
|
|
6
|
-
declare function ChartsProvider<SeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = ChartCorePluginSignatures<SeriesType>>(props: React.PropsWithChildren<ChartsProviderProps<SeriesType, TSignatures>>):
|
|
6
|
+
declare function ChartsProvider<SeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = ChartCorePluginSignatures<SeriesType>>(props: React.PropsWithChildren<ChartsProviderProps<SeriesType, TSignatures>>): React.JSX.Element;
|
|
7
7
|
export { ChartsProvider };
|
|
@@ -16,5 +16,5 @@ interface ChartsSlotsProviderProps {
|
|
|
16
16
|
slotProps?: Partial<ChartsSlotProps>;
|
|
17
17
|
defaultSlots: ChartsSlots;
|
|
18
18
|
}
|
|
19
|
-
export declare function ChartsSlotsProvider(props: React.PropsWithChildren<ChartsSlotsProviderProps>):
|
|
19
|
+
export declare function ChartsSlotsProvider(props: React.PropsWithChildren<ChartsSlotsProviderProps>): React.JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -16,5 +16,5 @@ interface ChartsSlotsProviderProps {
|
|
|
16
16
|
slotProps?: Partial<ChartsSlotProps>;
|
|
17
17
|
defaultSlots: ChartsSlots;
|
|
18
18
|
}
|
|
19
|
-
export declare function ChartsSlotsProvider(props: React.PropsWithChildren<ChartsSlotsProviderProps>):
|
|
19
|
+
export declare function ChartsSlotsProvider(props: React.PropsWithChildren<ChartsSlotsProviderProps>): React.JSX.Element;
|
|
20
20
|
export {};
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -2,4 +2,4 @@ import type { ScaleOrdinal } from '@mui/x-charts-vendor/d3-scale';
|
|
|
2
2
|
import type { ContinuousColorConfig, PiecewiseColorConfig, OrdinalColorConfig } from "../models/colorMapping.mjs";
|
|
3
3
|
export declare function getSequentialColorScale<Value extends number | Date>(config: ContinuousColorConfig<Value> | PiecewiseColorConfig<Value>): import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<Value, string, string | null>;
|
|
4
4
|
export declare function getOrdinalColorScale<Value extends number | Date | string>(config: OrdinalColorConfig<Value>): ScaleOrdinal<Value, string, null | string> | ScaleOrdinal<number, string, null | string>;
|
|
5
|
-
export declare function getColorScale(config: ContinuousColorConfig | PiecewiseColorConfig | OrdinalColorConfig): ScaleOrdinal<
|
|
5
|
+
export declare function getColorScale(config: ContinuousColorConfig | PiecewiseColorConfig | OrdinalColorConfig): ScaleOrdinal<number, string, string | null> | ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string, string | null>;
|
|
@@ -2,4 +2,4 @@ import type { ScaleOrdinal } from '@mui/x-charts-vendor/d3-scale';
|
|
|
2
2
|
import type { ContinuousColorConfig, PiecewiseColorConfig, OrdinalColorConfig } from "../models/colorMapping.js";
|
|
3
3
|
export declare function getSequentialColorScale<Value extends number | Date>(config: ContinuousColorConfig<Value> | PiecewiseColorConfig<Value>): import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<Value, string, string | null>;
|
|
4
4
|
export declare function getOrdinalColorScale<Value extends number | Date | string>(config: OrdinalColorConfig<Value>): ScaleOrdinal<Value, string, null | string> | ScaleOrdinal<number, string, null | string>;
|
|
5
|
-
export declare function getColorScale(config: ContinuousColorConfig | PiecewiseColorConfig | OrdinalColorConfig): ScaleOrdinal<
|
|
5
|
+
export declare function getColorScale(config: ContinuousColorConfig | PiecewiseColorConfig | OrdinalColorConfig): ScaleOrdinal<number, string, string | null> | ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string, string | null>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* This component provides an accessibility proxy for charts.
|
|
3
4
|
* It uses two divs to let screen readers announce the focused content when it changes.
|
|
4
5
|
*/
|
|
5
|
-
export declare function ChartsAccessibilityProxy():
|
|
6
|
+
export declare function ChartsAccessibilityProxy(): React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* This component provides an accessibility proxy for charts.
|
|
3
4
|
* It uses two divs to let screen readers announce the focused content when it changes.
|
|
4
5
|
*/
|
|
5
|
-
export declare function ChartsAccessibilityProxy():
|
|
6
|
+
export declare function ChartsAccessibilityProxy(): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function ChartsAxesGradients(): React.JSX.Element | null;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function ChartsAxesGradients(): React.JSX.Element | null;
|
|
@@ -14,5 +14,5 @@ type ChartsContinuousGradientProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
gradientUnits?: 'objectBoundingBox' | 'userSpaceOnUse';
|
|
16
16
|
};
|
|
17
|
-
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react
|
|
17
|
+
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react").JSX.Element | null;
|
|
18
18
|
export {};
|
|
@@ -14,5 +14,5 @@ type ChartsContinuousGradientProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
gradientUnits?: 'objectBoundingBox' | 'userSpaceOnUse';
|
|
16
16
|
};
|
|
17
|
-
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react
|
|
17
|
+
export default function ChartsContinuousGradient(props: ChartsContinuousGradientProps): import("react").JSX.Element | null;
|
|
18
18
|
export {};
|
|
@@ -8,5 +8,5 @@ type ChartsContinuousGradientObjectBoundProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Generates gradients to be used in tooltips and legends.
|
|
10
10
|
*/
|
|
11
|
-
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react
|
|
11
|
+
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -8,5 +8,5 @@ type ChartsContinuousGradientObjectBoundProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Generates gradients to be used in tooltips and legends.
|
|
10
10
|
*/
|
|
11
|
-
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react
|
|
11
|
+
export default function ChartsContinuousGradientObjectBound(props: ChartsContinuousGradientObjectBoundProps): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PiecewiseColorConfig } from "../../../models/colorMapping.mjs";
|
|
2
3
|
type ChartsPiecewiseGradientProps = {
|
|
3
4
|
isReversed?: boolean;
|
|
@@ -7,5 +8,5 @@ type ChartsPiecewiseGradientProps = {
|
|
|
7
8
|
scale: (value: any) => number | undefined;
|
|
8
9
|
colorMap: PiecewiseColorConfig;
|
|
9
10
|
};
|
|
10
|
-
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps):
|
|
11
|
+
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps): React.JSX.Element | null;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { PiecewiseColorConfig } from "../../../models/colorMapping.js";
|
|
2
3
|
type ChartsPiecewiseGradientProps = {
|
|
3
4
|
isReversed?: boolean;
|
|
@@ -7,5 +8,5 @@ type ChartsPiecewiseGradientProps = {
|
|
|
7
8
|
scale: (value: any) => number | undefined;
|
|
8
9
|
colorMap: PiecewiseColorConfig;
|
|
9
10
|
};
|
|
10
|
-
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps):
|
|
11
|
+
export default function ChartsPiecewiseGradient(props: ChartsPiecewiseGradientProps): React.JSX.Element | null;
|
|
11
12
|
export {};
|
|
@@ -3,7 +3,7 @@ declare class CartesianSeriesTypes {
|
|
|
3
3
|
types: Set<CartesianChartSeriesType>;
|
|
4
4
|
constructor();
|
|
5
5
|
addType(value: CartesianChartSeriesType): void;
|
|
6
|
-
getTypes(): Set<"
|
|
6
|
+
getTypes(): Set<"bar" | "line" | "scatter">;
|
|
7
7
|
}
|
|
8
8
|
declare class PolarSeriesTypes {
|
|
9
9
|
types: Set<PolarChartSeriesType>;
|
|
@@ -3,7 +3,7 @@ declare class CartesianSeriesTypes {
|
|
|
3
3
|
types: Set<CartesianChartSeriesType>;
|
|
4
4
|
constructor();
|
|
5
5
|
addType(value: CartesianChartSeriesType): void;
|
|
6
|
-
getTypes(): Set<"
|
|
6
|
+
getTypes(): Set<"bar" | "line" | "scatter">;
|
|
7
7
|
}
|
|
8
8
|
declare class PolarSeriesTypes {
|
|
9
9
|
types: Set<PolarChartSeriesType>;
|
|
@@ -42,7 +42,7 @@ import * as React from 'react';
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const consumeSlots: <Props extends {}, Ref extends {}, RenderFunction = React.ForwardRefExoticComponent<Props & React.RefAttributes<Ref>>>(name: string, slotPropName: string, options: {
|
|
44
44
|
propagateSlots?: boolean;
|
|
45
|
-
defaultProps?: Omit<Partial<Props>,
|
|
45
|
+
defaultProps?: Omit<Partial<Props>, 'slots' | 'slotProps'> | ((props: Props) => Omit<Partial<Props>, 'slots' | 'slotProps'>);
|
|
46
46
|
omitProps?: Array<keyof Props>;
|
|
47
47
|
classesResolver?: (props: Props, theme: any) => Record<string, string>;
|
|
48
48
|
}, InComponent: RenderFunction) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<Ref>>;
|
|
@@ -42,7 +42,7 @@ import * as React from 'react';
|
|
|
42
42
|
*/
|
|
43
43
|
export declare const consumeSlots: <Props extends {}, Ref extends {}, RenderFunction = React.ForwardRefExoticComponent<Props & React.RefAttributes<Ref>>>(name: string, slotPropName: string, options: {
|
|
44
44
|
propagateSlots?: boolean;
|
|
45
|
-
defaultProps?: Omit<Partial<Props>,
|
|
45
|
+
defaultProps?: Omit<Partial<Props>, 'slots' | 'slotProps'> | ((props: Props) => Omit<Partial<Props>, 'slots' | 'slotProps'>);
|
|
46
46
|
omitProps?: Array<keyof Props>;
|
|
47
47
|
classesResolver?: (props: Props, theme: any) => Record<string, string>;
|
|
48
48
|
}, InComponent: RenderFunction) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<Ref>>;
|
|
@@ -45,6 +45,6 @@ import * as React from 'react';
|
|
|
45
45
|
* @param InComponent The component to render if the slot is not provided.
|
|
46
46
|
*/
|
|
47
47
|
export declare const consumeThemeProps: <Props extends {}, Ref extends {}, RenderFunction = (props: Props, ref: React.Ref<Ref>) => React.ElementType>(name: string, options: {
|
|
48
|
-
defaultProps?: Omit<Partial<Props>,
|
|
48
|
+
defaultProps?: Omit<Partial<Props>, 'slots' | 'slotProps'> | (<T extends Props>(props: T) => Omit<Partial<T>, 'slots' | 'slotProps'>);
|
|
49
49
|
classesResolver?: (props: Props, theme: any) => Record<string, string>;
|
|
50
50
|
}, InComponent: RenderFunction) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<Ref>>;
|
|
@@ -45,6 +45,6 @@ import * as React from 'react';
|
|
|
45
45
|
* @param InComponent The component to render if the slot is not provided.
|
|
46
46
|
*/
|
|
47
47
|
export declare const consumeThemeProps: <Props extends {}, Ref extends {}, RenderFunction = (props: Props, ref: React.Ref<Ref>) => React.ElementType>(name: string, options: {
|
|
48
|
-
defaultProps?: Omit<Partial<Props>,
|
|
48
|
+
defaultProps?: Omit<Partial<Props>, 'slots' | 'slotProps'> | (<T extends Props>(props: T) => Omit<Partial<T>, 'slots' | 'slotProps'>);
|
|
49
49
|
classesResolver?: (props: Props, theme: any) => Record<string, string>;
|
|
50
50
|
}, InComponent: RenderFunction) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<Ref>>;
|
|
@@ -3,7 +3,7 @@ import type { ChartSeriesType } from "../models/seriesType/config.mjs";
|
|
|
3
3
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
4
4
|
*/
|
|
5
5
|
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: {
|
|
6
|
-
type: Exclude<ChartSeriesType,
|
|
6
|
+
type: Exclude<ChartSeriesType, 'sankey' | 'heatmap'>;
|
|
7
7
|
seriesId: import("../index.mjs").SeriesId;
|
|
8
8
|
dataIndex?: number;
|
|
9
9
|
} | null, state: {
|
|
@@ -3,7 +3,7 @@ import type { ChartSeriesType } from "../models/seriesType/config.js";
|
|
|
3
3
|
* Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
|
|
4
4
|
*/
|
|
5
5
|
export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: {
|
|
6
|
-
type: Exclude<ChartSeriesType,
|
|
6
|
+
type: Exclude<ChartSeriesType, 'sankey' | 'heatmap'>;
|
|
7
7
|
seriesId: import("../index.js").SeriesId;
|
|
8
8
|
dataIndex?: number;
|
|
9
9
|
} | null, state: {
|
|
@@ -11,4 +11,17 @@ export declare function createGetBarDimensions(params: {
|
|
|
11
11
|
y: number;
|
|
12
12
|
height: number;
|
|
13
13
|
width: number;
|
|
14
|
-
} | null;
|
|
14
|
+
} | null;
|
|
15
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
16
|
+
export declare function createGetBucketBarDimensions(params: {
|
|
17
|
+
verticalLayout: boolean;
|
|
18
|
+
xAxisConfig: ComputedAxis<ScaleName, any, ChartsXAxisProps>;
|
|
19
|
+
yAxisConfig: ComputedAxis<ScaleName, any, ChartsYAxisProps>;
|
|
20
|
+
series: ChartSeriesDefaultized<'bar'>;
|
|
21
|
+
numberOfGroups: number;
|
|
22
|
+
}): (startIndex: number, endIndex: number, min: number, max: number, groupIndex: number) => {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
height: number;
|
|
26
|
+
width: number;
|
|
27
|
+
};
|
|
@@ -11,4 +11,17 @@ export declare function createGetBarDimensions(params: {
|
|
|
11
11
|
y: number;
|
|
12
12
|
height: number;
|
|
13
13
|
width: number;
|
|
14
|
-
} | null;
|
|
14
|
+
} | null;
|
|
15
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
16
|
+
export declare function createGetBucketBarDimensions(params: {
|
|
17
|
+
verticalLayout: boolean;
|
|
18
|
+
xAxisConfig: ComputedAxis<ScaleName, any, ChartsXAxisProps>;
|
|
19
|
+
yAxisConfig: ComputedAxis<ScaleName, any, ChartsYAxisProps>;
|
|
20
|
+
series: ChartSeriesDefaultized<'bar'>;
|
|
21
|
+
numberOfGroups: number;
|
|
22
|
+
}): (startIndex: number, endIndex: number, min: number, max: number, groupIndex: number) => {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
height: number;
|
|
26
|
+
width: number;
|
|
27
|
+
};
|
|
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createGetBarDimensions = createGetBarDimensions;
|
|
7
|
+
exports.createGetBucketBarDimensions = createGetBucketBarDimensions;
|
|
7
8
|
var _findMinMax = require("./findMinMax");
|
|
8
9
|
var _getBandSize = require("./getBandSize");
|
|
10
|
+
/** Minimum on-screen gap (px) kept between merged (sampled) bars so they stay distinguishable. */
|
|
11
|
+
const MIN_SAMPLED_BAR_GAP_PX = 2;
|
|
9
12
|
function shouldInvertStartCoordinate(verticalLayout, baseValue, reverse) {
|
|
10
13
|
const isVerticalAndPositive = verticalLayout && baseValue > 0;
|
|
11
14
|
const isHorizontalAndNegative = !verticalLayout && baseValue < 0;
|
|
@@ -58,4 +61,46 @@ function createGetBarDimensions(params) {
|
|
|
58
61
|
width: verticalLayout ? barWidth : barSize
|
|
59
62
|
};
|
|
60
63
|
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
67
|
+
function createGetBucketBarDimensions(params) {
|
|
68
|
+
const {
|
|
69
|
+
verticalLayout,
|
|
70
|
+
xAxisConfig,
|
|
71
|
+
yAxisConfig,
|
|
72
|
+
series,
|
|
73
|
+
numberOfGroups
|
|
74
|
+
} = params;
|
|
75
|
+
const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
|
|
76
|
+
const baseScale = baseScaleConfig.scale;
|
|
77
|
+
const bandwidth = baseScale.bandwidth();
|
|
78
|
+
const step = baseScale.step();
|
|
79
|
+
const valueScale = verticalLayout ? yAxisConfig.scale : xAxisConfig.scale;
|
|
80
|
+
return function getBucketBarDimensions(startIndex, endIndex, min, max, groupIndex) {
|
|
81
|
+
const spanStart = baseScale(baseScaleConfig.data[startIndex]);
|
|
82
|
+
const bucketCount = endIndex - startIndex + 1;
|
|
83
|
+
const bucketStride = bucketCount * step;
|
|
84
|
+
|
|
85
|
+
// Keep the gap between buckets proportional to the bucket (same ratio as an unsampled chart),
|
|
86
|
+
// but never thinner than MIN_SAMPLED_BAR_GAP_PX so it stays visible at every level and zoom.
|
|
87
|
+
const gap = Math.min(bucketStride / 2, Math.max(bucketCount * (step - bandwidth), MIN_SAMPLED_BAR_GAP_PX));
|
|
88
|
+
const {
|
|
89
|
+
barWidth,
|
|
90
|
+
offset
|
|
91
|
+
} = (0, _getBandSize.getBandSize)(bucketStride - gap, numberOfGroups, baseScaleConfig.barGapRatio);
|
|
92
|
+
const barOffset = groupIndex * (barWidth + offset);
|
|
93
|
+
const valueCoordinates = [valueScale(min), valueScale(max)];
|
|
94
|
+
const [minValueCoord, maxValueCoord] = (0, _findMinMax.findMinMax)(valueCoordinates).map(v => Math.round(v));
|
|
95
|
+
let barSize = maxValueCoord - minValueCoord;
|
|
96
|
+
if (!series.hidden && barSize > 0) {
|
|
97
|
+
barSize = Math.max(series.minBarSize, barSize);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
x: verticalLayout ? spanStart + barOffset : minValueCoord,
|
|
101
|
+
y: verticalLayout ? minValueCoord : spanStart + barOffset,
|
|
102
|
+
height: verticalLayout ? barSize : barWidth,
|
|
103
|
+
width: verticalLayout ? barWidth : barSize
|
|
104
|
+
};
|
|
105
|
+
};
|
|
61
106
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { findMinMax } from "./findMinMax.mjs";
|
|
2
2
|
import { getBandSize } from "./getBandSize.mjs";
|
|
3
|
+
|
|
4
|
+
/** Minimum on-screen gap (px) kept between merged (sampled) bars so they stay distinguishable. */
|
|
5
|
+
const MIN_SAMPLED_BAR_GAP_PX = 2;
|
|
3
6
|
function shouldInvertStartCoordinate(verticalLayout, baseValue, reverse) {
|
|
4
7
|
const isVerticalAndPositive = verticalLayout && baseValue > 0;
|
|
5
8
|
const isHorizontalAndNegative = !verticalLayout && baseValue < 0;
|
|
@@ -52,4 +55,46 @@ export function createGetBarDimensions(params) {
|
|
|
52
55
|
width: verticalLayout ? barWidth : barSize
|
|
53
56
|
};
|
|
54
57
|
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Like {@link createGetBarDimensions}, but for a sampled bucket spanning several categories. */
|
|
61
|
+
export function createGetBucketBarDimensions(params) {
|
|
62
|
+
const {
|
|
63
|
+
verticalLayout,
|
|
64
|
+
xAxisConfig,
|
|
65
|
+
yAxisConfig,
|
|
66
|
+
series,
|
|
67
|
+
numberOfGroups
|
|
68
|
+
} = params;
|
|
69
|
+
const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
|
|
70
|
+
const baseScale = baseScaleConfig.scale;
|
|
71
|
+
const bandwidth = baseScale.bandwidth();
|
|
72
|
+
const step = baseScale.step();
|
|
73
|
+
const valueScale = verticalLayout ? yAxisConfig.scale : xAxisConfig.scale;
|
|
74
|
+
return function getBucketBarDimensions(startIndex, endIndex, min, max, groupIndex) {
|
|
75
|
+
const spanStart = baseScale(baseScaleConfig.data[startIndex]);
|
|
76
|
+
const bucketCount = endIndex - startIndex + 1;
|
|
77
|
+
const bucketStride = bucketCount * step;
|
|
78
|
+
|
|
79
|
+
// Keep the gap between buckets proportional to the bucket (same ratio as an unsampled chart),
|
|
80
|
+
// but never thinner than MIN_SAMPLED_BAR_GAP_PX so it stays visible at every level and zoom.
|
|
81
|
+
const gap = Math.min(bucketStride / 2, Math.max(bucketCount * (step - bandwidth), MIN_SAMPLED_BAR_GAP_PX));
|
|
82
|
+
const {
|
|
83
|
+
barWidth,
|
|
84
|
+
offset
|
|
85
|
+
} = getBandSize(bucketStride - gap, numberOfGroups, baseScaleConfig.barGapRatio);
|
|
86
|
+
const barOffset = groupIndex * (barWidth + offset);
|
|
87
|
+
const valueCoordinates = [valueScale(min), valueScale(max)];
|
|
88
|
+
const [minValueCoord, maxValueCoord] = findMinMax(valueCoordinates).map(v => Math.round(v));
|
|
89
|
+
let barSize = maxValueCoord - minValueCoord;
|
|
90
|
+
if (!series.hidden && barSize > 0) {
|
|
91
|
+
barSize = Math.max(series.minBarSize, barSize);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
x: verticalLayout ? spanStart + barOffset : minValueCoord,
|
|
95
|
+
y: verticalLayout ? minValueCoord : spanStart + barOffset,
|
|
96
|
+
height: verticalLayout ? barSize : barWidth,
|
|
97
|
+
width: verticalLayout ? barWidth : barSize
|
|
98
|
+
};
|
|
99
|
+
};
|
|
55
100
|
}
|
package/internals/geometry.js
CHANGED
|
@@ -18,7 +18,7 @@ const ANGLE_APPROX = 5; // Angle (in deg) for which we approximate the rectangle
|
|
|
18
18
|
*/
|
|
19
19
|
function getMinXTranslation(width, height, angle = 0) {
|
|
20
20
|
if (process.env.NODE_ENV !== 'production') {
|
|
21
|
-
if (angle > 90
|
|
21
|
+
if (angle > 90 || angle < -90) {
|
|
22
22
|
(0, _warning.warnOnce)([`MUI X Charts: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`]);
|
|
23
23
|
}
|
|
24
24
|
}
|
package/internals/geometry.mjs
CHANGED
|
@@ -12,7 +12,7 @@ const ANGLE_APPROX = 5; // Angle (in deg) for which we approximate the rectangle
|
|
|
12
12
|
*/
|
|
13
13
|
export function getMinXTranslation(width, height, angle = 0) {
|
|
14
14
|
if (process.env.NODE_ENV !== 'production') {
|
|
15
|
-
if (angle > 90
|
|
15
|
+
if (angle > 90 || angle < -90) {
|
|
16
16
|
warnOnce([`MUI X Charts: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`]);
|
|
17
17
|
}
|
|
18
18
|
}
|