@mui/x-charts 8.16.0 → 8.18.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.ts +1 -1
- package/BarChart/BarChart.js +1 -0
- package/BarChart/BarClipPath.d.ts +1 -1
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarElement.js +6 -8
- package/BarChart/BarLabel/BarLabel.d.ts +6 -0
- package/BarChart/BarLabel/BarLabel.js +41 -4
- package/BarChart/BarLabel/BarLabelItem.d.ts +7 -1
- package/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -3
- package/BarChart/BarLabel/BarLabelPlot.js +42 -38
- package/BarChart/BarPlot.d.ts +13 -3
- package/BarChart/BarPlot.js +8 -3
- package/BarChart/seriesConfig/{extremums.d.ts → bar/extremums.d.ts} +1 -1
- package/BarChart/seriesConfig/{extremums.js → bar/extremums.js} +1 -1
- package/BarChart/seriesConfig/bar/getColor.d.ts +3 -0
- package/BarChart/seriesConfig/{getColor.js → bar/getColor.js} +28 -5
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +3 -0
- package/BarChart/seriesConfig/bar/legend.d.ts +3 -0
- package/BarChart/seriesConfig/{legend.js → bar/legend.js} +1 -1
- package/BarChart/seriesConfig/bar/seriesProcessor.d.ts +3 -0
- package/BarChart/seriesConfig/{seriesProcessor.js → bar/seriesProcessor.js} +1 -1
- package/BarChart/seriesConfig/bar/tooltip.d.ts +4 -0
- package/BarChart/seriesConfig/{tooltip.js → bar/tooltip.js} +1 -1
- package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +3 -0
- package/BarChart/seriesConfig/{tooltipPosition.js → bar/tooltipPosition.js} +1 -1
- package/BarChart/seriesConfig/index.d.ts +1 -1
- package/BarChart/seriesConfig/index.js +9 -9
- package/BarChart/types.d.ts +2 -0
- package/BarChart/useBarPlotData.js +5 -3
- package/CHANGELOG.md +208 -1
- package/ChartDataProvider/ChartDataProvider.d.ts +1 -1
- package/ChartsAxis/ChartsAxis.d.ts +1 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -2
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -2
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -2
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +1 -2
- package/ChartsClipPath/ChartsClipPath.d.ts +1 -2
- package/ChartsClipPath/ChartsClipPath.js +0 -2
- package/ChartsGrid/ChartsGrid.d.ts +1 -2
- package/ChartsGrid/ChartsGrid.js +0 -2
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +1 -2
- package/ChartsGrid/ChartsVerticalGrid.d.ts +1 -2
- package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -2
- package/ChartsOverlay/ChartsLoadingOverlay.js +0 -2
- package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -2
- package/ChartsOverlay/ChartsNoDataOverlay.js +0 -2
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -2
- package/ChartsReferenceLine/ChartsReferenceLine.js +0 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.js +0 -2
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -2
- package/ChartsReferenceLine/ChartsYReferenceLine.js +0 -2
- package/ChartsSurface/ChartsSurface.js +8 -9
- package/ChartsSurface/chartsSurfaceClasses.d.ts +6 -0
- package/ChartsSurface/chartsSurfaceClasses.js +21 -0
- package/ChartsSurface/index.d.ts +2 -1
- package/ChartsSurface/index.js +12 -1
- package/ChartsText/ChartsText.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -2
- package/ChartsTooltip/ChartsAxisTooltipContent.js +0 -2
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +0 -2
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -2
- package/ChartsTooltip/ChartsTooltip.js +0 -2
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +13 -14
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsWrapper/ChartsWrapper.d.ts +1 -1
- package/ChartsWrapper/ChartsWrapper.js +3 -5
- package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +1 -2
- package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +1 -2
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -2
- package/ChartsXAxis/ChartsXAxis.js +0 -2
- package/ChartsXAxis/ChartsXAxisImpl.d.ts +1 -2
- package/ChartsXAxis/useAxisTicksProps.d.ts +32 -32
- package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +1 -2
- package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +1 -2
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -2
- package/ChartsYAxis/ChartsYAxis.js +0 -2
- package/ChartsYAxis/ChartsYAxisImpl.d.ts +1 -2
- package/ChartsYAxis/useAxisTicksProps.d.ts +32 -32
- package/Gauge/GaugeProvider.d.ts +1 -1
- package/Gauge/GaugeReferenceArc.d.ts +1 -1
- package/Gauge/GaugeValueArc.d.ts +1 -1
- package/Gauge/GaugeValueText.d.ts +1 -2
- package/Gauge/GaugeValueText.js +0 -2
- package/LineChart/AnimatedArea.d.ts +1 -1
- package/LineChart/AppearingMask.d.ts +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.d.ts +1 -1
- package/LineChart/CircleMarkElement.d.ts +1 -1
- package/LineChart/FocusedMark.d.ts +1 -2
- package/LineChart/FocusedMark.js +0 -2
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LinePlot.d.ts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkPlot.d.ts +1 -1
- package/LineChart/seriesConfig/getColor.js +28 -5
- package/LineChart/seriesConfig/index.d.ts +1 -1
- package/LineChart/seriesConfig/index.js +2 -2
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PiePlot.d.ts +1 -2
- package/PieChart/PiePlot.js +0 -2
- package/PieChart/seriesConfig/index.d.ts +1 -1
- package/PieChart/seriesConfig/index.js +2 -2
- package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -2
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +7 -3
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -2
- package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +1 -2
- package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +1 -2
- package/RadarChart/RadarGrid/RadarGrid.d.ts +1 -2
- package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +1 -2
- package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +1 -2
- package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +1 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +1 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +1 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -3
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +3 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -1
- package/RadarChart/seriesConfig/getColor.js +12 -1
- package/ScatterChart/BatchScatter.d.ts +1 -2
- package/ScatterChart/BatchScatter.js +4 -4
- package/ScatterChart/Scatter.d.ts +7 -2
- package/ScatterChart/Scatter.js +7 -3
- package/ScatterChart/ScatterMarker.d.ts +1 -1
- package/ScatterChart/ScatterPlot.d.ts +1 -1
- package/ScatterChart/ScatterPlot.js +1 -1
- package/ScatterChart/seriesConfig/getColor.js +36 -7
- package/ScatterChart/seriesConfig/index.d.ts +1 -1
- package/ScatterChart/seriesConfig/index.js +2 -2
- package/context/ChartProvider/ChartProvider.d.ts +1 -1
- package/context/ChartProvider/ChartProvider.js +4 -4
- package/context/ChartProvider/ChartProvider.types.d.ts +3 -3
- package/context/ChartsSlotsContext.d.ts +1 -1
- package/esm/BarChart/AnimatedBarElement.d.ts +1 -1
- package/esm/BarChart/BarChart.js +1 -0
- package/esm/BarChart/BarClipPath.d.ts +1 -1
- package/esm/BarChart/BarElement.d.ts +1 -1
- package/esm/BarChart/BarElement.js +6 -8
- package/esm/BarChart/BarLabel/BarLabel.d.ts +6 -0
- package/esm/BarChart/BarLabel/BarLabel.js +41 -4
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +7 -1
- package/esm/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -3
- package/esm/BarChart/BarLabel/BarLabelPlot.js +42 -37
- package/esm/BarChart/BarPlot.d.ts +13 -3
- package/esm/BarChart/BarPlot.js +8 -3
- package/esm/BarChart/seriesConfig/{extremums.d.ts → bar/extremums.d.ts} +1 -1
- package/esm/BarChart/seriesConfig/{extremums.js → bar/extremums.js} +1 -1
- package/esm/BarChart/seriesConfig/bar/getColor.d.ts +3 -0
- package/esm/BarChart/seriesConfig/{getColor.js → bar/getColor.js} +28 -5
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/BarChart/seriesConfig/bar/legend.d.ts +3 -0
- package/esm/BarChart/seriesConfig/{legend.js → bar/legend.js} +1 -1
- package/esm/BarChart/seriesConfig/bar/seriesProcessor.d.ts +3 -0
- package/esm/BarChart/seriesConfig/{seriesProcessor.js → bar/seriesProcessor.js} +1 -1
- package/esm/BarChart/seriesConfig/bar/tooltip.d.ts +4 -0
- package/esm/BarChart/seriesConfig/{tooltip.js → bar/tooltip.js} +1 -1
- package/esm/BarChart/seriesConfig/bar/tooltipPosition.d.ts +3 -0
- package/esm/BarChart/seriesConfig/{tooltipPosition.js → bar/tooltipPosition.js} +1 -1
- package/esm/BarChart/seriesConfig/index.d.ts +1 -1
- package/esm/BarChart/seriesConfig/index.js +8 -8
- package/esm/BarChart/types.d.ts +2 -0
- package/esm/BarChart/useBarPlotData.js +5 -3
- package/esm/ChartDataProvider/ChartDataProvider.d.ts +1 -1
- package/esm/ChartsAxis/ChartsAxis.d.ts +1 -2
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -2
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -2
- package/esm/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +1 -2
- package/esm/ChartsClipPath/ChartsClipPath.d.ts +1 -2
- package/esm/ChartsClipPath/ChartsClipPath.js +0 -1
- package/esm/ChartsGrid/ChartsGrid.d.ts +1 -2
- package/esm/ChartsGrid/ChartsGrid.js +0 -1
- package/esm/ChartsGrid/ChartsHorizontalGrid.d.ts +1 -2
- package/esm/ChartsGrid/ChartsVerticalGrid.d.ts +1 -2
- package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/esm/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
- package/esm/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -2
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +0 -1
- package/esm/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -2
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +0 -1
- package/esm/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -2
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +0 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -2
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +0 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -2
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +0 -1
- package/esm/ChartsSurface/ChartsSurface.js +9 -10
- package/esm/ChartsSurface/chartsSurfaceClasses.d.ts +6 -0
- package/esm/ChartsSurface/chartsSurfaceClasses.js +13 -0
- package/esm/ChartsSurface/index.d.ts +2 -1
- package/esm/ChartsSurface/index.js +2 -1
- package/esm/ChartsText/ChartsText.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -2
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
- package/esm/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -2
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
- package/esm/ChartsTooltip/ChartsTooltip.d.ts +1 -2
- package/esm/ChartsTooltip/ChartsTooltip.js +0 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +13 -14
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/esm/ChartsWrapper/ChartsWrapper.d.ts +1 -1
- package/esm/ChartsWrapper/ChartsWrapper.js +4 -6
- package/esm/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +1 -2
- package/esm/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +1 -2
- package/esm/ChartsXAxis/ChartsXAxis.d.ts +1 -2
- package/esm/ChartsXAxis/ChartsXAxis.js +0 -1
- package/esm/ChartsXAxis/ChartsXAxisImpl.d.ts +1 -2
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +32 -32
- package/esm/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +1 -2
- package/esm/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +1 -2
- package/esm/ChartsYAxis/ChartsYAxis.d.ts +1 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +0 -1
- package/esm/ChartsYAxis/ChartsYAxisImpl.d.ts +1 -2
- package/esm/ChartsYAxis/useAxisTicksProps.d.ts +32 -32
- package/esm/Gauge/GaugeProvider.d.ts +1 -1
- package/esm/Gauge/GaugeReferenceArc.d.ts +1 -1
- package/esm/Gauge/GaugeValueArc.d.ts +1 -1
- package/esm/Gauge/GaugeValueText.d.ts +1 -2
- package/esm/Gauge/GaugeValueText.js +0 -1
- package/esm/LineChart/AnimatedArea.d.ts +1 -1
- package/esm/LineChart/AppearingMask.d.ts +1 -1
- package/esm/LineChart/AreaElement.d.ts +1 -1
- package/esm/LineChart/AreaPlot.d.ts +1 -1
- package/esm/LineChart/CircleMarkElement.d.ts +1 -1
- package/esm/LineChart/FocusedMark.d.ts +1 -2
- package/esm/LineChart/FocusedMark.js +0 -1
- package/esm/LineChart/LineElement.d.ts +1 -1
- package/esm/LineChart/LineHighlightElement.d.ts +1 -1
- package/esm/LineChart/LineHighlightPlot.d.ts +1 -1
- package/esm/LineChart/LinePlot.d.ts +1 -1
- package/esm/LineChart/MarkElement.d.ts +1 -1
- package/esm/LineChart/MarkPlot.d.ts +1 -1
- package/esm/LineChart/seriesConfig/getColor.js +28 -5
- package/esm/LineChart/seriesConfig/index.d.ts +1 -1
- package/esm/LineChart/seriesConfig/index.js +1 -1
- package/esm/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/esm/PieChart/PieArcPlot.d.ts +1 -1
- package/esm/PieChart/PiePlot.d.ts +1 -2
- package/esm/PieChart/PiePlot.js +0 -1
- package/esm/PieChart/seriesConfig/index.d.ts +1 -1
- package/esm/PieChart/seriesConfig/index.js +1 -1
- package/esm/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
- package/esm/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
- package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -2
- package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +7 -2
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -2
- package/esm/RadarChart/RadarGrid/CircularRadarGrid.d.ts +1 -2
- package/esm/RadarChart/RadarGrid/CircularRadarStripes.d.ts +1 -2
- package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +1 -2
- package/esm/RadarChart/RadarGrid/SharpRadarGrid.d.ts +1 -2
- package/esm/RadarChart/RadarGrid/SharpRadarStripes.d.ts +1 -2
- package/esm/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +1 -2
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +1 -1
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +1 -1
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -2
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -2
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -2
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +3 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -1
- package/esm/RadarChart/seriesConfig/getColor.js +12 -1
- package/esm/ScatterChart/BatchScatter.d.ts +1 -2
- package/esm/ScatterChart/BatchScatter.js +4 -4
- package/esm/ScatterChart/Scatter.d.ts +7 -2
- package/esm/ScatterChart/Scatter.js +7 -3
- package/esm/ScatterChart/ScatterMarker.d.ts +1 -1
- package/esm/ScatterChart/ScatterPlot.d.ts +1 -1
- package/esm/ScatterChart/ScatterPlot.js +1 -1
- package/esm/ScatterChart/seriesConfig/getColor.js +36 -7
- package/esm/ScatterChart/seriesConfig/index.d.ts +1 -1
- package/esm/ScatterChart/seriesConfig/index.js +1 -1
- package/esm/context/ChartProvider/ChartProvider.d.ts +1 -1
- package/esm/context/ChartProvider/ChartProvider.js +4 -4
- package/esm/context/ChartProvider/ChartProvider.types.d.ts +3 -3
- package/esm/context/ChartsSlotsContext.d.ts +1 -1
- package/esm/hooks/animation/useAnimateBarLabel.d.ts +1 -1
- package/esm/hooks/animation/useAnimateBarLabel.js +61 -12
- package/esm/hooks/index.d.ts +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useAxis.d.ts +116 -16
- package/esm/hooks/useAxis.js +122 -18
- package/esm/hooks/useDataset.d.ts +6 -0
- package/esm/hooks/useDataset.js +13 -0
- package/esm/hooks/useInteractionItemProps.js +2 -5
- package/esm/hooks/useIsItemFocused.js +5 -3
- package/esm/hooks/useItemHighlighted.js +2 -2
- package/esm/hooks/useItemHighlightedGetter.js +0 -1
- package/esm/hooks/useScale.d.ts +25 -6
- package/esm/hooks/useScale.js +29 -8
- package/esm/index.js +1 -1
- package/esm/internals/colorScale.d.ts +1 -1
- package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -2
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -2
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +0 -1
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -2
- package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +0 -1
- package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -2
- package/esm/internals/createSeriesSelectorOfType.js +5 -3
- package/esm/internals/getSeriesColorFn.d.ts +5 -0
- package/esm/internals/getSeriesColorFn.js +3 -0
- package/esm/internals/index.d.ts +1 -1
- package/esm/internals/index.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.js +7 -15
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +2 -4
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +28 -36
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +11 -17
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +27 -21
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +1 -6
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +6 -10
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +2 -4
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +1 -3
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +10 -10
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -7
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +8 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +19 -35
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +29 -57
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +15 -15
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +21 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +11 -17
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +12 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +15 -9
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +62 -86
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +69 -45
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +14 -26
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +3 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +17 -33
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +23 -22
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +9 -15
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +2 -4
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +12 -16
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +23 -21
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +8 -7
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +29 -43
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +14 -28
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +7 -9
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -53
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +22 -36
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +3 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +11 -21
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +14 -26
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +11 -10
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +1 -3
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +3 -5
- package/esm/internals/plugins/models/plugin.d.ts +3 -2
- package/esm/internals/plugins/utils/selectors.d.ts +13 -17
- package/esm/internals/plugins/utils/selectors.js +3 -35
- package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +2 -2
- package/esm/internals/plugins/utils/useLazySelectorEffect.js +2 -2
- package/esm/internals/store/useCharts.d.ts +3 -4
- package/esm/internals/store/useCharts.js +2 -2
- package/esm/internals/store/useSelector.d.ts +2 -4
- package/esm/internals/store/useSelector.js +2 -8
- package/esm/internals/store/useStore.d.ts +3 -5
- package/esm/locales/index.d.ts +2 -1
- package/esm/locales/index.js +1 -0
- package/esm/locales/nbNO.d.ts +115 -0
- package/esm/locales/nbNO.js +113 -0
- package/esm/models/seriesType/bar.d.ts +16 -0
- package/esm/models/seriesType/common.d.ts +22 -6
- package/esm/models/seriesType/config.d.ts +7 -16
- package/hooks/animation/useAnimateBarLabel.d.ts +1 -1
- package/hooks/animation/useAnimateBarLabel.js +61 -12
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/hooks/useAxis.d.ts +116 -16
- package/hooks/useAxis.js +122 -18
- package/hooks/useDataset.d.ts +6 -0
- package/hooks/useDataset.js +18 -0
- package/hooks/useInteractionItemProps.js +2 -5
- package/hooks/useIsItemFocused.js +5 -3
- package/hooks/useItemHighlighted.js +2 -2
- package/hooks/useScale.d.ts +25 -6
- package/hooks/useScale.js +29 -8
- package/index.js +1 -1
- package/internals/colorScale.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -2
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -2
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +0 -2
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -2
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +0 -2
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -2
- package/internals/createSeriesSelectorOfType.js +6 -3
- package/internals/getSeriesColorFn.d.ts +5 -0
- package/internals/getSeriesColorFn.js +9 -0
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.js +7 -15
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +2 -4
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +28 -36
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +11 -17
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +27 -21
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +1 -6
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
- package/internals/plugins/corePlugins/useChartId/useChartId.js +6 -10
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +2 -4
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +1 -3
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +10 -10
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -7
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +9 -2
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +19 -35
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +29 -57
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +15 -15
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +22 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +11 -17
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +12 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +14 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +62 -86
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +70 -46
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +14 -26
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +17 -33
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +23 -23
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +9 -15
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +2 -4
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +12 -16
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +23 -21
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +8 -7
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +29 -43
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +14 -28
- package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +7 -9
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -53
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +22 -36
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +4 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +3 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +11 -21
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +14 -26
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +12 -10
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +1 -3
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +3 -5
- package/internals/plugins/models/plugin.d.ts +3 -2
- package/internals/plugins/utils/selectors.d.ts +13 -17
- package/internals/plugins/utils/selectors.js +3 -35
- package/internals/plugins/utils/useLazySelectorEffect.d.ts +2 -2
- package/internals/plugins/utils/useLazySelectorEffect.js +2 -2
- package/internals/store/useCharts.d.ts +3 -4
- package/internals/store/useCharts.js +2 -2
- package/internals/store/useSelector.d.ts +2 -4
- package/internals/store/useSelector.js +2 -10
- package/internals/store/useStore.d.ts +3 -5
- package/locales/index.d.ts +2 -1
- package/locales/index.js +11 -0
- package/locales/nbNO.d.ts +115 -0
- package/locales/nbNO.js +119 -0
- package/models/seriesType/bar.d.ts +16 -0
- package/models/seriesType/common.d.ts +22 -6
- package/models/seriesType/config.d.ts +7 -16
- package/package.json +5 -5
- package/BarChart/seriesConfig/getColor.d.ts +0 -3
- package/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/BarChart/seriesConfig/legend.d.ts +0 -3
- package/BarChart/seriesConfig/seriesProcessor.d.ts +0 -3
- package/BarChart/seriesConfig/tooltip.d.ts +0 -4
- package/BarChart/seriesConfig/tooltipPosition.d.ts +0 -3
- package/esm/BarChart/seriesConfig/getColor.d.ts +0 -3
- package/esm/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
- package/esm/BarChart/seriesConfig/legend.d.ts +0 -3
- package/esm/BarChart/seriesConfig/seriesProcessor.d.ts +0 -3
- package/esm/BarChart/seriesConfig/tooltip.d.ts +0 -4
- package/esm/BarChart/seriesConfig/tooltipPosition.d.ts +0 -3
- package/esm/internals/plugins/utils/ChartStore.d.ts +0 -13
- package/esm/internals/plugins/utils/ChartStore.js +0 -22
- package/internals/plugins/utils/ChartStore.d.ts +0 -13
- package/internals/plugins/utils/ChartStore.js +0 -29
- /package/BarChart/seriesConfig/{getSeriesWithDefaultValues.js → bar/getSeriesWithDefaultValues.js} +0 -0
- /package/esm/BarChart/seriesConfig/{getSeriesWithDefaultValues.js → bar/getSeriesWithDefaultValues.js} +0 -0
|
@@ -39,4 +39,4 @@ export interface BarProps extends Omit<React.SVGProps<SVGRectElement>, 'id' | 'c
|
|
|
39
39
|
*/
|
|
40
40
|
skipAnimation: boolean;
|
|
41
41
|
}
|
|
42
|
-
export declare function AnimatedBarElement(props: BarProps):
|
|
42
|
+
export declare function AnimatedBarElement(props: BarProps): import("react/jsx-runtime").JSX.Element;
|
package/BarChart/BarChart.js
CHANGED
|
@@ -90,6 +90,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
90
90
|
y: _propTypes.default.oneOf(['band', 'line', 'none'])
|
|
91
91
|
}),
|
|
92
92
|
/**
|
|
93
|
+
* @deprecated Use `barLabel` in the chart series instead.
|
|
93
94
|
* If provided, the function will be used to format the label of the bar.
|
|
94
95
|
* It can be set to 'value' to display the current value.
|
|
95
96
|
* @param {BarItem} item The item to format.
|
|
@@ -33,5 +33,5 @@ export interface BarClipPathProps {
|
|
|
33
33
|
/**
|
|
34
34
|
* @ignore - internal component.
|
|
35
35
|
*/
|
|
36
|
-
declare function BarClipPath(props: BarClipPathProps):
|
|
36
|
+
declare function BarClipPath(props: BarClipPathProps): import("react/jsx-runtime").JSX.Element | null;
|
|
37
37
|
export { BarClipPath };
|
package/BarChart/BarElement.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighligh
|
|
|
32
32
|
layout: 'horizontal' | 'vertical';
|
|
33
33
|
skipAnimation: boolean;
|
|
34
34
|
};
|
|
35
|
-
declare function BarElement(props: BarElementProps):
|
|
35
|
+
declare function BarElement(props: BarElementProps): import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
declare namespace BarElement {
|
|
37
37
|
var propTypes: any;
|
|
38
38
|
}
|
package/BarChart/BarElement.js
CHANGED
|
@@ -39,23 +39,21 @@ function BarElement(props) {
|
|
|
39
39
|
height
|
|
40
40
|
} = props,
|
|
41
41
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
42
|
-
const
|
|
42
|
+
const itemIdentifier = React.useMemo(() => ({
|
|
43
43
|
type: 'bar',
|
|
44
44
|
seriesId: id,
|
|
45
45
|
dataIndex
|
|
46
|
-
});
|
|
46
|
+
}), [id, dataIndex]);
|
|
47
|
+
const interactionProps = (0, _useInteractionItemProps.useInteractionItemProps)(itemIdentifier);
|
|
47
48
|
const {
|
|
48
49
|
isFaded,
|
|
49
50
|
isHighlighted
|
|
50
|
-
} = (0, _useItemHighlighted.useItemHighlighted)(
|
|
51
|
-
|
|
52
|
-
dataIndex
|
|
53
|
-
});
|
|
54
|
-
const isFocused = (0, _useIsItemFocused.useIsItemFocused)({
|
|
51
|
+
} = (0, _useItemHighlighted.useItemHighlighted)(itemIdentifier);
|
|
52
|
+
const isFocused = (0, _useIsItemFocused.useIsItemFocused)(React.useMemo(() => ({
|
|
55
53
|
seriesType: 'bar',
|
|
56
54
|
seriesId: id,
|
|
57
55
|
dataIndex
|
|
58
|
-
});
|
|
56
|
+
}), [id, dataIndex]));
|
|
59
57
|
const ownerState = {
|
|
60
58
|
id,
|
|
61
59
|
dataIndex,
|
|
@@ -26,6 +26,12 @@ export type BarLabelProps = Omit<React.SVGProps<SVGTextElement>, 'ref' | 'id' |
|
|
|
26
26
|
* Height of the bar this label belongs to.
|
|
27
27
|
*/
|
|
28
28
|
height: number;
|
|
29
|
+
/**
|
|
30
|
+
* The placement of the bar label.
|
|
31
|
+
* It controls whether the label is rendered in the center or outside the bar.
|
|
32
|
+
* @default 'center'
|
|
33
|
+
*/
|
|
34
|
+
placement?: 'center' | 'outside';
|
|
29
35
|
};
|
|
30
36
|
declare function BarLabel(inProps: BarLabelProps): React.JSX.Element;
|
|
31
37
|
declare namespace BarLabel {
|
|
@@ -16,7 +16,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
16
16
|
var _useAnimateBarLabel = require("../../hooks/animation/useAnimateBarLabel");
|
|
17
17
|
var _barLabelClasses = require("./barLabelClasses");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin"];
|
|
19
|
+
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin", "placement"];
|
|
20
20
|
const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)('text', {
|
|
21
21
|
name: 'MuiBarLabel',
|
|
22
22
|
slot: 'Root',
|
|
@@ -31,8 +31,6 @@ const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)('text'
|
|
|
31
31
|
stroke: 'none',
|
|
32
32
|
fill: (theme.vars || theme)?.palette?.text?.primary,
|
|
33
33
|
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
|
|
34
|
-
textAnchor: 'middle',
|
|
35
|
-
dominantBaseline: 'central',
|
|
36
34
|
pointerEvents: 'none',
|
|
37
35
|
opacity: 1,
|
|
38
36
|
[`&.${_barLabelClasses.barLabelClasses.faded}`]: {
|
|
@@ -46,7 +44,40 @@ function BarLabel(inProps) {
|
|
|
46
44
|
});
|
|
47
45
|
const otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
48
46
|
const animatedProps = (0, _useAnimateBarLabel.useAnimateBarLabel)(props);
|
|
49
|
-
|
|
47
|
+
const textAnchor = getTextAnchor(props);
|
|
48
|
+
const dominantBaseline = getDominantBaseline(props);
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BarLabelComponent, (0, _extends2.default)({
|
|
50
|
+
textAnchor: textAnchor,
|
|
51
|
+
dominantBaseline: dominantBaseline
|
|
52
|
+
}, otherProps, animatedProps));
|
|
53
|
+
}
|
|
54
|
+
function getTextAnchor({
|
|
55
|
+
placement,
|
|
56
|
+
layout,
|
|
57
|
+
xOrigin,
|
|
58
|
+
x
|
|
59
|
+
}) {
|
|
60
|
+
if (placement === 'outside') {
|
|
61
|
+
if (layout === 'horizontal') {
|
|
62
|
+
return x < xOrigin ? 'end' : 'start';
|
|
63
|
+
}
|
|
64
|
+
return 'middle';
|
|
65
|
+
}
|
|
66
|
+
return 'middle';
|
|
67
|
+
}
|
|
68
|
+
function getDominantBaseline({
|
|
69
|
+
placement,
|
|
70
|
+
layout,
|
|
71
|
+
yOrigin,
|
|
72
|
+
y
|
|
73
|
+
}) {
|
|
74
|
+
if (placement === 'outside') {
|
|
75
|
+
if (layout === 'horizontal') {
|
|
76
|
+
return 'central';
|
|
77
|
+
}
|
|
78
|
+
return y < yOrigin ? 'auto' : 'hanging';
|
|
79
|
+
}
|
|
80
|
+
return 'central';
|
|
50
81
|
}
|
|
51
82
|
process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
52
83
|
// ----------------------------- Warning --------------------------------
|
|
@@ -62,6 +93,12 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
|
62
93
|
isFaded: _propTypes.default.bool.isRequired,
|
|
63
94
|
isHighlighted: _propTypes.default.bool.isRequired,
|
|
64
95
|
layout: _propTypes.default.oneOf(['horizontal', 'vertical']).isRequired,
|
|
96
|
+
/**
|
|
97
|
+
* The placement of the bar label.
|
|
98
|
+
* It controls whether the label is rendered in the center or outside the bar.
|
|
99
|
+
* @default 'center'
|
|
100
|
+
*/
|
|
101
|
+
placement: _propTypes.default.oneOf(['center', 'outside']),
|
|
65
102
|
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
66
103
|
skipAnimation: _propTypes.default.bool.isRequired,
|
|
67
104
|
/**
|
|
@@ -67,11 +67,17 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
|
|
|
67
67
|
* @returns {string} The formatted label.
|
|
68
68
|
*/
|
|
69
69
|
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
70
|
+
/**
|
|
71
|
+
* The placement of the bar label.
|
|
72
|
+
* It controls whether the label is rendered in the center or outside the bar.
|
|
73
|
+
* @default 'center'
|
|
74
|
+
*/
|
|
75
|
+
barLabelPlacement?: BarLabelProps['placement'];
|
|
70
76
|
};
|
|
71
77
|
/**
|
|
72
78
|
* @ignore - internal component.
|
|
73
79
|
*/
|
|
74
|
-
declare function BarLabelItem(props: BarLabelItemProps):
|
|
80
|
+
declare function BarLabelItem(props: BarLabelItemProps): import("react/jsx-runtime").JSX.Element | null;
|
|
75
81
|
declare namespace BarLabelItem {
|
|
76
82
|
var propTypes: any;
|
|
77
83
|
}
|
|
@@ -16,7 +16,7 @@ var _getBarLabel = require("./getBarLabel");
|
|
|
16
16
|
var _BarLabel = require("./BarLabel");
|
|
17
17
|
var _useItemHighlighted = require("../../hooks/useItemHighlighted");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout"],
|
|
19
|
+
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout", "barLabelPlacement"],
|
|
20
20
|
_excluded2 = ["ownerState"];
|
|
21
21
|
/**
|
|
22
22
|
* @ignore - internal component.
|
|
@@ -38,7 +38,8 @@ function BarLabelItem(props) {
|
|
|
38
38
|
height,
|
|
39
39
|
value,
|
|
40
40
|
skipAnimation,
|
|
41
|
-
layout
|
|
41
|
+
layout,
|
|
42
|
+
barLabelPlacement
|
|
42
43
|
} = props,
|
|
43
44
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
44
45
|
const {
|
|
@@ -70,6 +71,7 @@ function BarLabelItem(props) {
|
|
|
70
71
|
y,
|
|
71
72
|
width,
|
|
72
73
|
height,
|
|
74
|
+
placement: barLabelPlacement,
|
|
73
75
|
className: classes.root
|
|
74
76
|
}),
|
|
75
77
|
ownerState
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { ProcessedBarSeriesData } from "../types.js";
|
|
3
2
|
import { BarLabelItemProps } from "./BarLabelItem.js";
|
|
4
3
|
type BarLabelPlotProps = {
|
|
5
|
-
|
|
4
|
+
processedSeries: ProcessedBarSeriesData;
|
|
6
5
|
skipAnimation?: boolean;
|
|
7
6
|
barLabel?: BarLabelItemProps['barLabel'];
|
|
8
7
|
};
|
|
9
8
|
/**
|
|
10
9
|
* @ignore - internal component.
|
|
11
10
|
*/
|
|
12
|
-
declare function BarLabelPlot(props: BarLabelPlotProps):
|
|
11
|
+
declare function BarLabelPlot(props: BarLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
12
|
export { BarLabelPlot };
|
|
@@ -1,60 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.BarLabelPlot = BarLabelPlot;
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
-
var React = _interopRequireWildcard(require("react"));
|
|
12
10
|
var _BarLabelItem = require("./BarLabelItem");
|
|
13
11
|
var _barClasses = require("../barClasses");
|
|
14
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
const _excluded = ["
|
|
13
|
+
const _excluded = ["processedSeries", "skipAnimation"];
|
|
16
14
|
/**
|
|
17
15
|
* @ignore - internal component.
|
|
18
16
|
*/
|
|
19
17
|
function BarLabelPlot(props) {
|
|
20
18
|
const {
|
|
21
|
-
|
|
19
|
+
processedSeries,
|
|
22
20
|
skipAnimation
|
|
23
21
|
} = props,
|
|
24
22
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
23
|
+
const {
|
|
24
|
+
seriesId,
|
|
25
|
+
data
|
|
26
|
+
} = processedSeries;
|
|
25
27
|
const classes = (0, _barClasses.useUtilityClasses)();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
const barLabel = processedSeries.barLabel ?? props.barLabel;
|
|
29
|
+
if (!barLabel) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
33
|
+
className: classes.seriesLabels,
|
|
34
|
+
"data-series": seriesId,
|
|
35
|
+
children: data.map(({
|
|
36
|
+
xOrigin,
|
|
37
|
+
yOrigin,
|
|
38
|
+
x,
|
|
39
|
+
y,
|
|
40
|
+
dataIndex,
|
|
41
|
+
color,
|
|
42
|
+
value,
|
|
43
|
+
width,
|
|
44
|
+
height,
|
|
45
|
+
layout
|
|
46
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelItem.BarLabelItem, (0, _extends2.default)({
|
|
47
|
+
seriesId: seriesId,
|
|
48
|
+
dataIndex: dataIndex,
|
|
49
|
+
value: value,
|
|
50
|
+
color: color,
|
|
51
|
+
xOrigin: xOrigin,
|
|
52
|
+
yOrigin: yOrigin,
|
|
53
|
+
x: x,
|
|
54
|
+
y: y,
|
|
55
|
+
width: width,
|
|
56
|
+
height: height,
|
|
57
|
+
skipAnimation: skipAnimation ?? false,
|
|
58
|
+
layout: layout ?? 'vertical'
|
|
59
|
+
}, other, {
|
|
60
|
+
barLabel: barLabel,
|
|
61
|
+
barLabelPlacement: processedSeries.barLabelPlacement || 'center'
|
|
62
|
+
}), dataIndex))
|
|
63
|
+
}, seriesId);
|
|
60
64
|
}
|
package/BarChart/BarPlot.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BarElementSlotProps, BarElementSlots } from "./BarElement.js";
|
|
3
3
|
import { BarItemIdentifier } from "../models/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BarLabelSlotProps, BarLabelSlots } from "./BarLabel/BarLabelItem.js";
|
|
5
|
+
import { BarItem, BarLabelContext } from "./BarLabel/index.js";
|
|
5
6
|
export interface BarPlotSlots extends BarElementSlots, BarLabelSlots {}
|
|
6
7
|
export interface BarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
|
|
7
|
-
export interface BarPlotProps
|
|
8
|
+
export interface BarPlotProps {
|
|
8
9
|
/**
|
|
9
10
|
* If `true`, animations are skipped.
|
|
10
11
|
* @default undefined
|
|
@@ -20,6 +21,15 @@ export interface BarPlotProps extends Pick<BarLabelItemProps, 'barLabel'> {
|
|
|
20
21
|
* Defines the border radius of the bar element.
|
|
21
22
|
*/
|
|
22
23
|
borderRadius?: number;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `barLabel` in the chart series instead.
|
|
26
|
+
* If provided, the function will be used to format the label of the bar.
|
|
27
|
+
* It can be set to 'value' to display the current value.
|
|
28
|
+
* @param {BarItem} item The item to format.
|
|
29
|
+
* @param {BarLabelContext} context data about the bar.
|
|
30
|
+
* @returns {string} The formatted label.
|
|
31
|
+
*/
|
|
32
|
+
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
23
33
|
/**
|
|
24
34
|
* The props used for each component slot.
|
|
25
35
|
* @default {}
|
|
@@ -42,7 +52,7 @@ export interface BarPlotProps extends Pick<BarLabelItemProps, 'barLabel'> {
|
|
|
42
52
|
*
|
|
43
53
|
* - [BarPlot API](https://mui.com/x/api/charts/bar-plot/)
|
|
44
54
|
*/
|
|
45
|
-
declare function BarPlot(props: BarPlotProps):
|
|
55
|
+
declare function BarPlot(props: BarPlotProps): import("react/jsx-runtime").JSX.Element;
|
|
46
56
|
declare namespace BarPlot {
|
|
47
57
|
var propTypes: any;
|
|
48
58
|
}
|
package/BarChart/BarPlot.js
CHANGED
|
@@ -142,11 +142,11 @@ function BarPlot(props) {
|
|
|
142
142
|
}, dataIndex);
|
|
143
143
|
})
|
|
144
144
|
}, seriesId);
|
|
145
|
-
}),
|
|
146
|
-
|
|
145
|
+
}), completedData.map(processedSeries => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelPlot.BarLabelPlot, (0, _extends2.default)({
|
|
146
|
+
processedSeries: processedSeries,
|
|
147
147
|
skipAnimation: skipAnimation,
|
|
148
148
|
barLabel: barLabel
|
|
149
|
-
}, other))]
|
|
149
|
+
}, other), processedSeries.seriesId))]
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
|
|
@@ -162,6 +162,11 @@ process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
|
|
|
162
162
|
* @returns {string} The formatted label.
|
|
163
163
|
*/
|
|
164
164
|
barLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['value']), _propTypes.default.func]),
|
|
165
|
+
/**
|
|
166
|
+
* The placement of the bar label.
|
|
167
|
+
* It controls whether the label is rendered inside or outside the bar.
|
|
168
|
+
*/
|
|
169
|
+
barLabelPlacement: _propTypes.default.oneOf(['outside', 'inside']),
|
|
165
170
|
/**
|
|
166
171
|
* Defines the border radius of the bar element.
|
|
167
172
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CartesianExtremumGetter } from "
|
|
1
|
+
import { CartesianExtremumGetter } from "../../../internals/plugins/models/seriesConfig/index.js";
|
|
2
2
|
export declare const getExtremumX: CartesianExtremumGetter<'bar'>;
|
|
3
3
|
export declare const getExtremumY: CartesianExtremumGetter<'bar'>;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getExtremumY = exports.getExtremumX = void 0;
|
|
7
|
-
var _findMinMax = require("
|
|
7
|
+
var _findMinMax = require("../../../internals/findMinMax");
|
|
8
8
|
const createResult = (data, direction) => {
|
|
9
9
|
if (direction === 'x') {
|
|
10
10
|
return {
|
|
@@ -4,20 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _getSeriesColorFn = require("../../../internals/getSeriesColorFn");
|
|
7
8
|
const getColor = (series, xAxis, yAxis) => {
|
|
8
9
|
const verticalLayout = series.layout === 'vertical';
|
|
9
10
|
const bandColorScale = verticalLayout ? xAxis?.colorScale : yAxis?.colorScale;
|
|
10
11
|
const valueColorScale = verticalLayout ? yAxis?.colorScale : xAxis?.colorScale;
|
|
11
12
|
const bandValues = verticalLayout ? xAxis?.data : yAxis?.data;
|
|
13
|
+
const getSeriesColor = (0, _getSeriesColorFn.getSeriesColorFn)(series);
|
|
12
14
|
if (valueColorScale) {
|
|
13
15
|
return dataIndex => {
|
|
14
16
|
if (dataIndex === undefined) {
|
|
15
17
|
return series.color;
|
|
16
18
|
}
|
|
17
19
|
const value = series.data[dataIndex];
|
|
18
|
-
const color = value === null ?
|
|
20
|
+
const color = value === null ? getSeriesColor({
|
|
21
|
+
value,
|
|
22
|
+
dataIndex
|
|
23
|
+
}) : valueColorScale(value);
|
|
19
24
|
if (color === null) {
|
|
20
|
-
return
|
|
25
|
+
return getSeriesColor({
|
|
26
|
+
value,
|
|
27
|
+
dataIndex
|
|
28
|
+
});
|
|
21
29
|
}
|
|
22
30
|
return color;
|
|
23
31
|
};
|
|
@@ -28,13 +36,28 @@ const getColor = (series, xAxis, yAxis) => {
|
|
|
28
36
|
return series.color;
|
|
29
37
|
}
|
|
30
38
|
const value = bandValues[dataIndex];
|
|
31
|
-
const color = value === null ?
|
|
39
|
+
const color = value === null ? getSeriesColor({
|
|
40
|
+
value,
|
|
41
|
+
dataIndex
|
|
42
|
+
}) : bandColorScale(value);
|
|
32
43
|
if (color === null) {
|
|
33
|
-
return
|
|
44
|
+
return getSeriesColor({
|
|
45
|
+
value,
|
|
46
|
+
dataIndex
|
|
47
|
+
});
|
|
34
48
|
}
|
|
35
49
|
return color;
|
|
36
50
|
};
|
|
37
51
|
}
|
|
38
|
-
return
|
|
52
|
+
return dataIndex => {
|
|
53
|
+
if (dataIndex === undefined) {
|
|
54
|
+
return series.color;
|
|
55
|
+
}
|
|
56
|
+
const value = series.data[dataIndex];
|
|
57
|
+
return getSeriesColor({
|
|
58
|
+
value,
|
|
59
|
+
dataIndex
|
|
60
|
+
});
|
|
61
|
+
};
|
|
39
62
|
};
|
|
40
63
|
var _default = exports.default = getColor;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _getLabel = require("
|
|
7
|
+
var _getLabel = require("../../../internals/getLabel");
|
|
8
8
|
const legendGetter = params => {
|
|
9
9
|
const {
|
|
10
10
|
seriesOrder,
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
11
|
-
var _stackSeries = require("
|
|
11
|
+
var _stackSeries = require("../../../internals/stackSeries");
|
|
12
12
|
const barValueFormatter = v => v == null ? '' : v.toLocaleString();
|
|
13
13
|
const seriesProcessor = (params, dataset) => {
|
|
14
14
|
const {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.axisTooltipGetter = void 0;
|
|
7
|
-
var _getLabel = require("
|
|
7
|
+
var _getLabel = require("../../../internals/getLabel");
|
|
8
8
|
const tooltipGetter = params => {
|
|
9
9
|
const {
|
|
10
10
|
series,
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _useBarPlotData = require("
|
|
7
|
+
var _useBarPlotData = require("../../useBarPlotData");
|
|
8
8
|
const tooltipItemPositionGetter = params => {
|
|
9
9
|
const {
|
|
10
10
|
series,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ChartSeriesTypeConfig } from "../../internals/plugins/models/seriesConfig/index.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const barSeriesConfig: ChartSeriesTypeConfig<'bar'>;
|
|
@@ -5,15 +5,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
var _extremums = require("./extremums");
|
|
10
|
-
var _seriesProcessor = _interopRequireDefault(require("./seriesProcessor"));
|
|
11
|
-
var _legend = _interopRequireDefault(require("./legend"));
|
|
12
|
-
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
13
|
-
var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
14
|
-
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
15
|
-
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
16
|
-
const
|
|
8
|
+
exports.barSeriesConfig = void 0;
|
|
9
|
+
var _extremums = require("./bar/extremums");
|
|
10
|
+
var _seriesProcessor = _interopRequireDefault(require("./bar/seriesProcessor"));
|
|
11
|
+
var _legend = _interopRequireDefault(require("./bar/legend"));
|
|
12
|
+
var _getColor = _interopRequireDefault(require("./bar/getColor"));
|
|
13
|
+
var _tooltip = _interopRequireWildcard(require("./bar/tooltip"));
|
|
14
|
+
var _tooltipPosition = _interopRequireDefault(require("./bar/tooltipPosition"));
|
|
15
|
+
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./bar/getSeriesWithDefaultValues"));
|
|
16
|
+
const barSeriesConfig = exports.barSeriesConfig = {
|
|
17
17
|
seriesProcessor: _seriesProcessor.default,
|
|
18
18
|
colorProcessor: _getColor.default,
|
|
19
19
|
legendGetter: _legend.default,
|
package/BarChart/types.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export type AnimationData = {
|
|
|
12
12
|
export interface ProcessedBarSeriesData {
|
|
13
13
|
seriesId: SeriesId;
|
|
14
14
|
data: ProcessedBarData[];
|
|
15
|
+
barLabel?: BarSeriesType['barLabel'];
|
|
16
|
+
barLabelPlacement?: BarSeriesType['barLabelPlacement'];
|
|
15
17
|
}
|
|
16
18
|
export interface ProcessedBarData extends AnimationData {
|
|
17
19
|
seriesId: SeriesId;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getBarDimensions = getBarDimensions;
|
|
8
8
|
exports.useBarPlotData = useBarPlotData;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _getColor = _interopRequireDefault(require("./seriesConfig/getColor"));
|
|
10
|
+
var _getColor = _interopRequireDefault(require("./seriesConfig/bar/getColor"));
|
|
11
11
|
var _hooks = require("../hooks");
|
|
12
12
|
var _checkScaleErrors = require("./checkScaleErrors");
|
|
13
13
|
var _useBarSeries = require("../hooks/useBarSeries");
|
|
@@ -63,8 +63,8 @@ function useBarPlotData(drawingArea, xAxes, yAxes) {
|
|
|
63
63
|
seriesId,
|
|
64
64
|
dataIndex,
|
|
65
65
|
layout: series[seriesId].layout,
|
|
66
|
-
xOrigin: xScale(0) ?? 0,
|
|
67
|
-
yOrigin: yScale(0) ?? 0
|
|
66
|
+
xOrigin: Math.round(xScale(0) ?? 0),
|
|
67
|
+
yOrigin: Math.round(yScale(0) ?? 0)
|
|
68
68
|
}, barDimensions, {
|
|
69
69
|
color: colorGetter(dataIndex),
|
|
70
70
|
value: series[seriesId].data[dataIndex],
|
|
@@ -99,6 +99,8 @@ function useBarPlotData(drawingArea, xAxes, yAxes) {
|
|
|
99
99
|
}
|
|
100
100
|
return {
|
|
101
101
|
seriesId,
|
|
102
|
+
barLabel: series[seriesId].barLabel,
|
|
103
|
+
barLabelPlacement: series[seriesId].barLabelPlacement,
|
|
102
104
|
data: seriesDataPoints
|
|
103
105
|
};
|
|
104
106
|
});
|