@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
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { getSeriesColorFn } from "../../internals/getSeriesColorFn.js";
|
|
1
2
|
const getColor = (series, xAxis, yAxis, zAxis) => {
|
|
2
3
|
const zColorScale = zAxis?.colorScale;
|
|
3
4
|
const yColorScale = yAxis?.colorScale;
|
|
4
5
|
const xColorScale = xAxis?.colorScale;
|
|
6
|
+
const getSeriesColor = getSeriesColorFn(series);
|
|
5
7
|
if (zColorScale) {
|
|
6
8
|
return dataIndex => {
|
|
7
9
|
if (dataIndex === undefined) {
|
|
@@ -14,9 +16,15 @@ const getColor = (series, xAxis, yAxis, zAxis) => {
|
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
const value = series.data[dataIndex];
|
|
17
|
-
const color = value === null ?
|
|
19
|
+
const color = value === null ? getSeriesColor({
|
|
20
|
+
value,
|
|
21
|
+
dataIndex
|
|
22
|
+
}) : zColorScale(value.z);
|
|
18
23
|
if (color === null) {
|
|
19
|
-
return
|
|
24
|
+
return getSeriesColor({
|
|
25
|
+
value,
|
|
26
|
+
dataIndex
|
|
27
|
+
});
|
|
20
28
|
}
|
|
21
29
|
return color;
|
|
22
30
|
};
|
|
@@ -27,9 +35,15 @@ const getColor = (series, xAxis, yAxis, zAxis) => {
|
|
|
27
35
|
return series.color;
|
|
28
36
|
}
|
|
29
37
|
const value = series.data[dataIndex];
|
|
30
|
-
const color = value === null ?
|
|
38
|
+
const color = value === null ? getSeriesColor({
|
|
39
|
+
value,
|
|
40
|
+
dataIndex
|
|
41
|
+
}) : yColorScale(value.y);
|
|
31
42
|
if (color === null) {
|
|
32
|
-
return
|
|
43
|
+
return getSeriesColor({
|
|
44
|
+
value,
|
|
45
|
+
dataIndex
|
|
46
|
+
});
|
|
33
47
|
}
|
|
34
48
|
return color;
|
|
35
49
|
};
|
|
@@ -40,13 +54,28 @@ const getColor = (series, xAxis, yAxis, zAxis) => {
|
|
|
40
54
|
return series.color;
|
|
41
55
|
}
|
|
42
56
|
const value = series.data[dataIndex];
|
|
43
|
-
const color = value === null ?
|
|
57
|
+
const color = value === null ? getSeriesColor({
|
|
58
|
+
value,
|
|
59
|
+
dataIndex
|
|
60
|
+
}) : xColorScale(value.x);
|
|
44
61
|
if (color === null) {
|
|
45
|
-
return
|
|
62
|
+
return getSeriesColor({
|
|
63
|
+
value,
|
|
64
|
+
dataIndex
|
|
65
|
+
});
|
|
46
66
|
}
|
|
47
67
|
return color;
|
|
48
68
|
};
|
|
49
69
|
}
|
|
50
|
-
return
|
|
70
|
+
return dataIndex => {
|
|
71
|
+
if (dataIndex === undefined) {
|
|
72
|
+
return series.color;
|
|
73
|
+
}
|
|
74
|
+
const value = series.data[dataIndex];
|
|
75
|
+
return getSeriesColor({
|
|
76
|
+
value,
|
|
77
|
+
dataIndex
|
|
78
|
+
});
|
|
79
|
+
};
|
|
51
80
|
};
|
|
52
81
|
export default getColor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ChartSeriesTypeConfig } from "../../internals/plugins/models/seriesConfig/index.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const scatterSeriesConfig: ChartSeriesTypeConfig<'scatter'>;
|
|
@@ -5,7 +5,7 @@ import legendGetter from "./legend.js";
|
|
|
5
5
|
import tooltipGetter from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
8
|
-
export const
|
|
8
|
+
export const scatterSeriesConfig = {
|
|
9
9
|
seriesProcessor,
|
|
10
10
|
colorProcessor: getColor,
|
|
11
11
|
legendGetter,
|
|
@@ -4,5 +4,5 @@ import { ChartAnyPluginSignature } from "../../internals/plugins/models/index.js
|
|
|
4
4
|
import { ChartSeriesConfig } from "../../internals/plugins/models/seriesConfig/index.js";
|
|
5
5
|
import { ChartSeriesType } from "../../models/seriesType/config.js";
|
|
6
6
|
export declare const defaultSeriesConfig: ChartSeriesConfig<'bar' | 'scatter' | 'line' | 'pie'>;
|
|
7
|
-
declare function ChartProvider<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(props: React.PropsWithChildren<ChartProviderProps<TSeriesType, TSignatures>>):
|
|
7
|
+
declare function ChartProvider<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(props: React.PropsWithChildren<ChartProviderProps<TSeriesType, TSignatures>>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export { ChartProvider };
|
|
@@ -7,10 +7,10 @@ import { useChartCartesianAxis } from "../../internals/plugins/featurePlugins/us
|
|
|
7
7
|
import { useChartInteraction } from "../../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
8
8
|
import { useChartZAxis } from "../../internals/plugins/featurePlugins/useChartZAxis/index.js";
|
|
9
9
|
import { useChartHighlight } from "../../internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { barSeriesConfig } from "../../BarChart/seriesConfig/index.js";
|
|
11
|
+
import { scatterSeriesConfig } from "../../ScatterChart/seriesConfig/index.js";
|
|
12
|
+
import { lineSeriesConfig } from "../../LineChart/seriesConfig/index.js";
|
|
13
|
+
import { pieSeriesConfig } from "../../PieChart/seriesConfig/index.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
export const defaultSeriesConfig = {
|
|
16
16
|
bar: barSeriesConfig,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
2
|
+
import { Store } from '@mui/x-internals/store';
|
|
3
|
+
import type { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ChartState, ConvertSignaturesIntoPlugins, MergeSignaturesProperty } from "../../internals/plugins/models/index.js";
|
|
4
4
|
import type { ChartCorePluginSignatures } from "../../internals/plugins/corePlugins/index.js";
|
|
5
5
|
import type { ChartSeriesConfig } from "../../internals/plugins/models/seriesConfig/index.js";
|
|
6
6
|
import type { UseChartBaseProps } from "../../internals/store/useCharts.types.js";
|
|
@@ -17,7 +17,7 @@ export type ChartContextValue<TSignatures extends readonly ChartAnyPluginSignatu
|
|
|
17
17
|
/**
|
|
18
18
|
* The internal state of the chart.
|
|
19
19
|
*/
|
|
20
|
-
store:
|
|
20
|
+
store: Store<ChartState<TSignatures, TOptionalSignatures>>;
|
|
21
21
|
/**
|
|
22
22
|
* The ref to the <svg />.
|
|
23
23
|
*/
|
|
@@ -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>): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { BarLabelProps } from "../../BarChart/index.js";
|
|
3
|
-
type UseAnimateBarLabelParams = Pick<BarLabelProps, 'xOrigin' | 'yOrigin' | 'x' | 'y' | 'width' | 'height' | 'layout' | 'skipAnimation'> & {
|
|
3
|
+
type UseAnimateBarLabelParams = Pick<BarLabelProps, 'xOrigin' | 'yOrigin' | 'x' | 'y' | 'width' | 'height' | 'layout' | 'skipAnimation' | 'placement'> & {
|
|
4
4
|
ref?: React.Ref<SVGTextElement>;
|
|
5
5
|
};
|
|
6
6
|
type UseAnimateBarLabelReturn = {
|
|
@@ -5,14 +5,12 @@ function barLabelPropsInterpolator(from, to) {
|
|
|
5
5
|
const interpolateY = interpolateNumber(from.y, to.y);
|
|
6
6
|
const interpolateWidth = interpolateNumber(from.width, to.width);
|
|
7
7
|
const interpolateHeight = interpolateNumber(from.height, to.height);
|
|
8
|
-
return t => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
};
|
|
8
|
+
return t => ({
|
|
9
|
+
x: interpolateX(t),
|
|
10
|
+
y: interpolateY(t),
|
|
11
|
+
width: interpolateWidth(t),
|
|
12
|
+
height: interpolateHeight(t)
|
|
13
|
+
});
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
/**
|
|
@@ -25,15 +23,21 @@ function barLabelPropsInterpolator(from, to) {
|
|
|
25
23
|
* pass the ref returned by this hook to the `path` element and the `ref` provided as argument will also be called.
|
|
26
24
|
*/
|
|
27
25
|
export function useAnimateBarLabel(props) {
|
|
26
|
+
const {
|
|
27
|
+
initialX,
|
|
28
|
+
currentX,
|
|
29
|
+
initialY,
|
|
30
|
+
currentY
|
|
31
|
+
} = props.placement === 'outside' ? getOutsidePlacement(props) : getCenterPlacement(props);
|
|
28
32
|
const initialProps = {
|
|
29
|
-
x:
|
|
30
|
-
y:
|
|
33
|
+
x: initialX,
|
|
34
|
+
y: initialY,
|
|
31
35
|
width: props.width,
|
|
32
36
|
height: props.height
|
|
33
37
|
};
|
|
34
38
|
const currentProps = {
|
|
35
|
-
x:
|
|
36
|
-
y:
|
|
39
|
+
x: currentX,
|
|
40
|
+
y: currentY,
|
|
37
41
|
width: props.width,
|
|
38
42
|
height: props.height
|
|
39
43
|
};
|
|
@@ -50,4 +54,49 @@ export function useAnimateBarLabel(props) {
|
|
|
50
54
|
skip: props.skipAnimation,
|
|
51
55
|
ref: props.ref
|
|
52
56
|
});
|
|
57
|
+
}
|
|
58
|
+
const LABEL_OFFSET = 4;
|
|
59
|
+
function getCenterPlacement(props) {
|
|
60
|
+
return {
|
|
61
|
+
initialX: props.layout === 'vertical' ? props.x + props.width / 2 : props.xOrigin,
|
|
62
|
+
initialY: props.layout === 'vertical' ? props.yOrigin : props.y + props.height / 2,
|
|
63
|
+
currentX: props.x + props.width / 2,
|
|
64
|
+
currentY: props.y + props.height / 2
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function getOutsidePlacement(props) {
|
|
68
|
+
let initialY = 0;
|
|
69
|
+
let currentY = 0;
|
|
70
|
+
let initialX = 0;
|
|
71
|
+
let currentX = 0;
|
|
72
|
+
if (props.layout === 'vertical') {
|
|
73
|
+
const shouldPlaceAbove = props.y < props.yOrigin;
|
|
74
|
+
if (shouldPlaceAbove) {
|
|
75
|
+
initialY = props.yOrigin - LABEL_OFFSET;
|
|
76
|
+
currentY = props.y - LABEL_OFFSET;
|
|
77
|
+
} else {
|
|
78
|
+
initialY = props.yOrigin + LABEL_OFFSET;
|
|
79
|
+
currentY = props.y + props.height + LABEL_OFFSET;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
initialX: props.x + props.width / 2,
|
|
83
|
+
currentX: props.x + props.width / 2,
|
|
84
|
+
initialY,
|
|
85
|
+
currentY
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const shouldPlaceToTheLeft = props.x < props.xOrigin;
|
|
89
|
+
if (shouldPlaceToTheLeft) {
|
|
90
|
+
initialX = props.xOrigin;
|
|
91
|
+
currentX = props.x - LABEL_OFFSET;
|
|
92
|
+
} else {
|
|
93
|
+
initialX = props.xOrigin;
|
|
94
|
+
currentX = props.x + props.width + LABEL_OFFSET;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
initialX,
|
|
98
|
+
currentX,
|
|
99
|
+
initialY: props.y + props.height / 2,
|
|
100
|
+
currentY: props.y + props.height / 2
|
|
101
|
+
};
|
|
53
102
|
}
|
package/esm/hooks/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./useZAxis.js";
|
|
|
6
6
|
export * from "./useColorScale.js";
|
|
7
7
|
export * from "./useSvgRef.js";
|
|
8
8
|
export * from "./useSeries.js";
|
|
9
|
+
export * from "./useDataset.js";
|
|
9
10
|
export * from "./useScatterSeries.js";
|
|
10
11
|
export * from "./usePieSeries.js";
|
|
11
12
|
export * from "./useBarSeries.js";
|
package/esm/hooks/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./useZAxis.js";
|
|
|
6
6
|
export * from "./useColorScale.js";
|
|
7
7
|
export * from "./useSvgRef.js";
|
|
8
8
|
export * from "./useSeries.js";
|
|
9
|
+
export * from "./useDataset.js";
|
|
9
10
|
export * from "./useScatterSeries.js";
|
|
10
11
|
export * from "./usePieSeries.js";
|
|
11
12
|
export * from "./useBarSeries.js";
|
package/esm/hooks/useAxis.d.ts
CHANGED
|
@@ -2,12 +2,17 @@ import { AxisId, ChartsRadiusAxisProps, ChartsRotationAxisProps, PolarAxisDefaul
|
|
|
2
2
|
/**
|
|
3
3
|
* Get all the x-axes.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Returns all X axes configured in the chart along with their IDs.
|
|
6
|
+
* This is useful when you need to iterate over multiple axes or access all axis configurations at once.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* @returns An object containing:
|
|
9
|
+
* - `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
10
|
+
* - `xAxisIds`: An array of all X axis IDs in the chart
|
|
9
11
|
*
|
|
10
|
-
* @
|
|
12
|
+
* @example
|
|
13
|
+
* const { xAxis, xAxisIds } = useXAxes();
|
|
14
|
+
*
|
|
15
|
+
* @see `useXAxis` for accessing a single X axis
|
|
11
16
|
*/
|
|
12
17
|
export declare function useXAxes(): {
|
|
13
18
|
xAxis: import("../internals/index.js").ComputedAxisConfig<ChartsXAxisProps>;
|
|
@@ -16,36 +21,131 @@ export declare function useXAxes(): {
|
|
|
16
21
|
/**
|
|
17
22
|
* Get all the y-axes.
|
|
18
23
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
24
|
+
* Returns all Y axes configured in the chart along with their IDs.
|
|
25
|
+
* This is useful when you need to iterate over multiple axes or access all axis configurations at once.
|
|
26
|
+
*
|
|
27
|
+
* @returns An object containing:
|
|
28
|
+
* - `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
29
|
+
* - `yAxisIds`: An array of all Y axis IDs in the chart
|
|
21
30
|
*
|
|
22
|
-
*
|
|
31
|
+
* @example
|
|
32
|
+
* const { yAxis, yAxisIds } = useYAxes();
|
|
23
33
|
*
|
|
24
|
-
* @
|
|
34
|
+
* @see `useYAxis` for accessing a single Y axis
|
|
25
35
|
*/
|
|
26
36
|
export declare function useYAxes(): {
|
|
27
37
|
yAxis: import("../internals/index.js").ComputedAxisConfig<ChartsYAxisProps>;
|
|
28
38
|
yAxisIds: AxisId[];
|
|
29
39
|
};
|
|
30
40
|
/**
|
|
31
|
-
* Get the X axis.
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
41
|
+
* Get a specific X axis or the default X axis.
|
|
42
|
+
*
|
|
43
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
44
|
+
* - A string or number matching the axis ID defined in the chart's `xAxis` prop
|
|
45
|
+
* - Undefined to get the default (first) X axis
|
|
46
|
+
* @returns The configuration for a single X axis.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Get the default X axis
|
|
50
|
+
* const xAxis = useXAxis();
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Get a specific X axis by string ID
|
|
54
|
+
* const xAxis = useXAxis('revenue');
|
|
34
55
|
*/
|
|
35
56
|
export declare function useXAxis<T extends keyof AxisScaleConfig>(axisId?: AxisId): ComputedAxis<T, any, ChartsXAxisProps>;
|
|
36
57
|
/**
|
|
37
|
-
* Get the Y axis.
|
|
38
|
-
*
|
|
39
|
-
* @
|
|
58
|
+
* Get a specific Y axis or the default Y axis.
|
|
59
|
+
*
|
|
60
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
61
|
+
* - A string or number matching the axis ID defined in the chart's `yAxis` prop
|
|
62
|
+
* - Undefined to get the default (first) Y axis
|
|
63
|
+
* @returns The configuration for a single Y axis.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Get the default Y axis
|
|
67
|
+
* const yAxis = useYAxis();
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // Get a specific Y axis by string ID
|
|
71
|
+
* const yAxis = useYAxis('temperature');
|
|
40
72
|
*/
|
|
41
73
|
export declare function useYAxis<T extends keyof AxisScaleConfig>(axisId?: AxisId): ComputedAxis<T, any, ChartsYAxisProps>;
|
|
74
|
+
/**
|
|
75
|
+
* Get all the rotation axes for polar charts.
|
|
76
|
+
*
|
|
77
|
+
* Returns all rotation axes configured in polar charts along with their IDs.
|
|
78
|
+
* Rotation axes are used in charts like `RadarChart` to define angular positioning.
|
|
79
|
+
*
|
|
80
|
+
* @returns An object containing:
|
|
81
|
+
* - `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
82
|
+
* - `rotationAxisIds`: An array of all rotation axis IDs in the chart
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* const { rotationAxis, rotationAxisIds } = useRotationAxes();
|
|
86
|
+
*
|
|
87
|
+
* @see `useRotationAxis` for accessing a single rotation axis
|
|
88
|
+
*/
|
|
42
89
|
export declare function useRotationAxes(): {
|
|
43
90
|
rotationAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js").DefaultizedAxisConfig<ChartsRotationAxisProps>;
|
|
44
91
|
rotationAxisIds: string[];
|
|
45
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* Get all the radius axes for polar charts.
|
|
95
|
+
*
|
|
96
|
+
* Returns all radial axes configured in polar charts along with their IDs.
|
|
97
|
+
* Radius axes are used in charts like `RadarChart` to define radial positioning and scaling.
|
|
98
|
+
*
|
|
99
|
+
* @returns An object containing:
|
|
100
|
+
* - `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
101
|
+
* - `radiusAxisIds`: An array of all radius axis IDs in the chart
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* const { radiusAxis, radiusAxisIds } = useRadiusAxes();
|
|
105
|
+
*
|
|
106
|
+
* @see `useRadiusAxis` for accessing a single radius axis
|
|
107
|
+
*/
|
|
46
108
|
export declare function useRadiusAxes(): {
|
|
47
109
|
radiusAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js").DefaultizedAxisConfig<ChartsRadiusAxisProps>;
|
|
48
110
|
radiusAxisIds: string[];
|
|
49
111
|
};
|
|
50
|
-
|
|
51
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Get a specific rotation axis or the default rotation axis for polar charts.
|
|
114
|
+
*
|
|
115
|
+
* Returns the configuration and scale for a rotation axis in polar charts.
|
|
116
|
+
* The rotation axis controls the angular positioning of data points around the circle.
|
|
117
|
+
*
|
|
118
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
119
|
+
* - A string or number matching the axis ID defined in the chart's rotation axis configuration
|
|
120
|
+
* - Undefined to get the default (first) rotation axis
|
|
121
|
+
* @returns The rotation axis configuration, or undefined if not found
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* // Get the default rotation axis
|
|
125
|
+
* const rotationAxis = useRotationAxis();
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // Get a specific rotation axis by string ID
|
|
129
|
+
* const rotationAxis = useRotationAxis('categories');
|
|
130
|
+
*/
|
|
131
|
+
export declare function useRotationAxis(axisId?: AxisId): PolarAxisDefaultized<ScaleName, any, ChartsRotationAxisProps> | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Get a specific radius axis or the default radius axis for polar charts.
|
|
134
|
+
*
|
|
135
|
+
* Returns the configuration and scale for a radial axis in polar charts.
|
|
136
|
+
* The radius axis controls the radial distance of data points from the center of the circle.
|
|
137
|
+
*
|
|
138
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
139
|
+
* - A string or number matching the axis ID defined in the chart's radius axis configuration
|
|
140
|
+
* - Undefined to get the default (first) radius axis
|
|
141
|
+
* @returns The radius axis configuration, or undefined if not found
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* // Get the default radius axis
|
|
145
|
+
* const radiusAxis = useRadiusAxis();
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* // Get a specific radius axis by string ID
|
|
149
|
+
* const radiusAxis = useRadiusAxis('magnitude');
|
|
150
|
+
*/
|
|
151
|
+
export declare function useRadiusAxis(axisId?: AxisId): PolarAxisDefaultized<ScaleName, any, ChartsRadiusAxisProps> | undefined;
|
package/esm/hooks/useAxis.js
CHANGED
|
@@ -7,12 +7,17 @@ import { useStore } from "../internals/store/useStore.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Get all the x-axes.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Returns all X axes configured in the chart along with their IDs.
|
|
11
|
+
* This is useful when you need to iterate over multiple axes or access all axis configurations at once.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* @returns An object containing:
|
|
14
|
+
* - `xAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
15
|
+
* - `xAxisIds`: An array of all X axis IDs in the chart
|
|
14
16
|
*
|
|
15
|
-
* @
|
|
17
|
+
* @example
|
|
18
|
+
* const { xAxis, xAxisIds } = useXAxes();
|
|
19
|
+
*
|
|
20
|
+
* @see `useXAxis` for accessing a single X axis
|
|
16
21
|
*/
|
|
17
22
|
export function useXAxes() {
|
|
18
23
|
const store = useStore();
|
|
@@ -29,12 +34,17 @@ export function useXAxes() {
|
|
|
29
34
|
/**
|
|
30
35
|
* Get all the y-axes.
|
|
31
36
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
37
|
+
* Returns all Y axes configured in the chart along with their IDs.
|
|
38
|
+
* This is useful when you need to iterate over multiple axes or access all axis configurations at once.
|
|
39
|
+
*
|
|
40
|
+
* @returns An object containing:
|
|
41
|
+
* - `yAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
42
|
+
* - `yAxisIds`: An array of all Y axis IDs in the chart
|
|
34
43
|
*
|
|
35
|
-
*
|
|
44
|
+
* @example
|
|
45
|
+
* const { yAxis, yAxisIds } = useYAxes();
|
|
36
46
|
*
|
|
37
|
-
* @
|
|
47
|
+
* @see `useYAxis` for accessing a single Y axis
|
|
38
48
|
*/
|
|
39
49
|
export function useYAxes() {
|
|
40
50
|
const store = useStore();
|
|
@@ -49,9 +59,20 @@ export function useYAxes() {
|
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
/**
|
|
52
|
-
* Get the X axis.
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
62
|
+
* Get a specific X axis or the default X axis.
|
|
63
|
+
*
|
|
64
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
65
|
+
* - A string or number matching the axis ID defined in the chart's `xAxis` prop
|
|
66
|
+
* - Undefined to get the default (first) X axis
|
|
67
|
+
* @returns The configuration for a single X axis.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // Get the default X axis
|
|
71
|
+
* const xAxis = useXAxis();
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* // Get a specific X axis by string ID
|
|
75
|
+
* const xAxis = useXAxis('revenue');
|
|
55
76
|
*/
|
|
56
77
|
export function useXAxis(axisId) {
|
|
57
78
|
const store = useStore();
|
|
@@ -64,9 +85,20 @@ export function useXAxis(axisId) {
|
|
|
64
85
|
}
|
|
65
86
|
|
|
66
87
|
/**
|
|
67
|
-
* Get the Y axis.
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
88
|
+
* Get a specific Y axis or the default Y axis.
|
|
89
|
+
*
|
|
90
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
91
|
+
* - A string or number matching the axis ID defined in the chart's `yAxis` prop
|
|
92
|
+
* - Undefined to get the default (first) Y axis
|
|
93
|
+
* @returns The configuration for a single Y axis.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* // Get the default Y axis
|
|
97
|
+
* const yAxis = useYAxis();
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* // Get a specific Y axis by string ID
|
|
101
|
+
* const yAxis = useYAxis('temperature');
|
|
70
102
|
*/
|
|
71
103
|
export function useYAxis(axisId) {
|
|
72
104
|
const store = useStore();
|
|
@@ -77,6 +109,22 @@ export function useYAxis(axisId) {
|
|
|
77
109
|
const id = axisId ?? yAxisIds[0];
|
|
78
110
|
return yAxis[id];
|
|
79
111
|
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get all the rotation axes for polar charts.
|
|
115
|
+
*
|
|
116
|
+
* Returns all rotation axes configured in polar charts along with their IDs.
|
|
117
|
+
* Rotation axes are used in charts like `RadarChart` to define angular positioning.
|
|
118
|
+
*
|
|
119
|
+
* @returns An object containing:
|
|
120
|
+
* - `rotationAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
121
|
+
* - `rotationAxisIds`: An array of all rotation axis IDs in the chart
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* const { rotationAxis, rotationAxisIds } = useRotationAxes();
|
|
125
|
+
*
|
|
126
|
+
* @see `useRotationAxis` for accessing a single rotation axis
|
|
127
|
+
*/
|
|
80
128
|
export function useRotationAxes() {
|
|
81
129
|
const store = useStore();
|
|
82
130
|
const {
|
|
@@ -88,6 +136,22 @@ export function useRotationAxes() {
|
|
|
88
136
|
rotationAxisIds
|
|
89
137
|
};
|
|
90
138
|
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Get all the radius axes for polar charts.
|
|
142
|
+
*
|
|
143
|
+
* Returns all radial axes configured in polar charts along with their IDs.
|
|
144
|
+
* Radius axes are used in charts like `RadarChart` to define radial positioning and scaling.
|
|
145
|
+
*
|
|
146
|
+
* @returns An object containing:
|
|
147
|
+
* - `radiusAxis`: An object mapping axis IDs to their configurations `{ [axisId]: axis }`
|
|
148
|
+
* - `radiusAxisIds`: An array of all radius axis IDs in the chart
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* const { radiusAxis, radiusAxisIds } = useRadiusAxes();
|
|
152
|
+
*
|
|
153
|
+
* @see `useRadiusAxis` for accessing a single radius axis
|
|
154
|
+
*/
|
|
91
155
|
export function useRadiusAxes() {
|
|
92
156
|
const store = useStore();
|
|
93
157
|
const {
|
|
@@ -99,21 +163,61 @@ export function useRadiusAxes() {
|
|
|
99
163
|
radiusAxisIds
|
|
100
164
|
};
|
|
101
165
|
}
|
|
102
|
-
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Get a specific rotation axis or the default rotation axis for polar charts.
|
|
169
|
+
*
|
|
170
|
+
* Returns the configuration and scale for a rotation axis in polar charts.
|
|
171
|
+
* The rotation axis controls the angular positioning of data points around the circle.
|
|
172
|
+
*
|
|
173
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
174
|
+
* - A string or number matching the axis ID defined in the chart's rotation axis configuration
|
|
175
|
+
* - Undefined to get the default (first) rotation axis
|
|
176
|
+
* @returns The rotation axis configuration, or undefined if not found
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* // Get the default rotation axis
|
|
180
|
+
* const rotationAxis = useRotationAxis();
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* // Get a specific rotation axis by string ID
|
|
184
|
+
* const rotationAxis = useRotationAxis('categories');
|
|
185
|
+
*/
|
|
186
|
+
export function useRotationAxis(axisId) {
|
|
103
187
|
const store = useStore();
|
|
104
188
|
const {
|
|
105
189
|
axis: rotationAxis,
|
|
106
190
|
axisIds: rotationAxisIds
|
|
107
191
|
} = useSelector(store, selectorChartRotationAxis);
|
|
108
|
-
const id =
|
|
192
|
+
const id = axisId ?? rotationAxisIds[0];
|
|
109
193
|
return rotationAxis[id];
|
|
110
194
|
}
|
|
111
|
-
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get a specific radius axis or the default radius axis for polar charts.
|
|
198
|
+
*
|
|
199
|
+
* Returns the configuration and scale for a radial axis in polar charts.
|
|
200
|
+
* The radius axis controls the radial distance of data points from the center of the circle.
|
|
201
|
+
*
|
|
202
|
+
* @param {AxisId} [axisId] - The axis identifier. Can be:
|
|
203
|
+
* - A string or number matching the axis ID defined in the chart's radius axis configuration
|
|
204
|
+
* - Undefined to get the default (first) radius axis
|
|
205
|
+
* @returns The radius axis configuration, or undefined if not found
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* // Get the default radius axis
|
|
209
|
+
* const radiusAxis = useRadiusAxis();
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* // Get a specific radius axis by string ID
|
|
213
|
+
* const radiusAxis = useRadiusAxis('magnitude');
|
|
214
|
+
*/
|
|
215
|
+
export function useRadiusAxis(axisId) {
|
|
112
216
|
const store = useStore();
|
|
113
217
|
const {
|
|
114
218
|
axis: radiusAxis,
|
|
115
219
|
axisIds: radiusAxisIds
|
|
116
220
|
} = useSelector(store, selectorChartRadiusAxis);
|
|
117
|
-
const id =
|
|
221
|
+
const id = axisId ?? radiusAxisIds[0];
|
|
118
222
|
return radiusAxis[id];
|
|
119
223
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DatasetType } from "../models/seriesType/config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get access to the dataset used to populate series and axes data.
|
|
4
|
+
* @returns {DatasetType | undefined} The dataset array if provided, otherwise undefined.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useDataset<T extends DatasetType>(): Readonly<T> | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
4
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
5
|
+
import { selectorChartDataset } from "../internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js";
|
|
6
|
+
/**
|
|
7
|
+
* Get access to the dataset used to populate series and axes data.
|
|
8
|
+
* @returns {DatasetType | undefined} The dataset array if provided, otherwise undefined.
|
|
9
|
+
*/
|
|
10
|
+
export function useDataset() {
|
|
11
|
+
const store = useStore();
|
|
12
|
+
return useSelector(store, selectorChartDataset);
|
|
13
|
+
}
|