@mui/x-charts 8.0.0-alpha.1 → 8.0.0-alpha.11
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.js +1 -0
- package/BarChart/BarChart.d.ts +1 -2
- package/BarChart/BarChart.js +30 -17
- package/BarChart/BarChart.plugins.d.ts +12 -0
- package/BarChart/BarChart.plugins.js +5 -0
- package/BarChart/BarElement.js +1 -1
- package/BarChart/BarLabel/BarLabel.d.ts +2 -480
- package/BarChart/BarLabel/BarLabelItem.js +1 -1
- package/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/BarChart/BarLabel/barLabelClasses.d.ts +1 -1
- package/BarChart/BarPlot.js +8 -9
- package/BarChart/extremums.d.ts +3 -3
- package/BarChart/formatter.d.ts +2 -2
- package/BarChart/formatter.js +2 -1
- package/BarChart/getColor.d.ts +1 -1
- package/BarChart/legend.d.ts +1 -1
- package/BarChart/legend.js +1 -0
- package/BarChart/plugin.d.ts +2 -2
- package/BarChart/plugin.js +5 -2
- package/BarChart/tooltip.d.ts +3 -0
- package/BarChart/tooltip.js +25 -0
- package/BarChart/useBarChartProps.d.ts +6 -5
- package/BarChart/useBarChartProps.js +21 -11
- package/CHANGELOG.md +2007 -230
- package/ChartContainer/ChartContainer.d.ts +32 -4
- package/ChartContainer/ChartContainer.js +51 -21
- package/ChartContainer/useChartContainerProps.d.ts +7 -5
- package/ChartContainer/useChartContainerProps.js +18 -13
- package/ChartDataProvider/ChartDataProvider.d.ts +41 -0
- package/ChartDataProvider/ChartDataProvider.js +97 -0
- package/{ChartsOnAxisClickHandler → ChartDataProvider}/package.json +1 -1
- package/ChartDataProvider/useChartDataProviderProps.d.ts +11 -0
- package/ChartDataProvider/useChartDataProviderProps.js +45 -0
- package/ChartsAxis/ChartsAxis.js +5 -7
- package/ChartsAxis/axisClasses.js +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +3 -3
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +3 -3
- package/ChartsGrid/ChartsGrid.js +9 -5
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +4 -3
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +4 -3
- package/ChartsLabel/ChartsLabel.d.ts +18 -0
- package/ChartsLabel/ChartsLabel.js +43 -0
- package/ChartsLabel/ChartsLabelGradient.d.ts +41 -0
- package/ChartsLabel/ChartsLabelGradient.js +135 -0
- package/ChartsLabel/ChartsLabelMark.d.ts +26 -0
- package/ChartsLabel/ChartsLabelMark.js +111 -0
- package/ChartsLabel/index.d.ts +7 -0
- package/ChartsLabel/index.js +6 -0
- package/ChartsLabel/labelClasses.d.ts +8 -0
- package/ChartsLabel/labelClasses.js +13 -0
- package/ChartsLabel/labelGradientClasses.d.ts +16 -0
- package/ChartsLabel/labelGradientClasses.js +18 -0
- package/ChartsLabel/labelMarkClasses.d.ts +18 -0
- package/ChartsLabel/labelMarkClasses.js +18 -0
- package/ChartsLabel/package.json +6 -0
- package/ChartsLegend/ChartsLegend.d.ts +18 -22
- package/ChartsLegend/ChartsLegend.js +100 -109
- package/ChartsLegend/ContinuousColorLegend.d.ts +29 -38
- package/ChartsLegend/ContinuousColorLegend.js +198 -321
- package/ChartsLegend/PiecewiseColorLegend.d.ts +27 -19
- package/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/ChartsLegend/chartsLegend.types.d.ts +17 -60
- package/ChartsLegend/chartsLegendClasses.d.ts +7 -8
- package/ChartsLegend/chartsLegendClasses.js +18 -3
- package/ChartsLegend/colorLegend.types.d.ts +13 -0
- package/ChartsLegend/continuousColorLegendClasses.d.ts +26 -0
- package/ChartsLegend/continuousColorLegendClasses.js +23 -0
- package/ChartsLegend/direction.d.ts +1 -0
- package/ChartsLegend/index.d.ts +13 -3
- package/ChartsLegend/index.js +9 -3
- package/ChartsLegend/legend.types.d.ts +6 -59
- package/ChartsLegend/legendContext.types.d.ts +55 -0
- package/ChartsLegend/onClickContextBuilder.d.ts +2 -0
- package/ChartsLegend/onClickContextBuilder.js +7 -0
- package/ChartsLegend/piecewiseColorDefaultLabelFormatter.d.ts +2 -0
- package/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +9 -0
- package/ChartsLegend/piecewiseColorLegend.types.d.ts +26 -0
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +28 -0
- package/ChartsLegend/piecewiseColorLegendClasses.js +23 -0
- package/ChartsLegend/useAxis.d.ts +1 -1
- package/ChartsLegend/useAxis.js +7 -6
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.d.ts +14 -6
- package/ChartsSurface/ChartsSurface.js +46 -34
- package/ChartsTooltip/ChartsAxisTooltipContent.js +11 -6
- package/ChartsTooltip/ChartsItemTooltipContent.js +6 -3
- package/ChartsTooltip/ChartsTooltip.js +2 -20
- package/ChartsTooltip/ChartsTooltipContainer.js +7 -25
- package/ChartsTooltip/ChartsTooltipTable.d.ts +0 -6
- package/ChartsTooltip/ChartsTooltipTable.js +15 -33
- package/ChartsTooltip/chartsTooltipClasses.d.ts +3 -1
- package/ChartsTooltip/chartsTooltipClasses.js +3 -2
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +2 -1
- package/ChartsTooltip/useAxisTooltip.d.ts +3 -1
- package/ChartsTooltip/useAxisTooltip.js +16 -13
- package/ChartsTooltip/useItemTooltip.d.ts +8 -6
- package/ChartsTooltip/useItemTooltip.js +20 -45
- package/ChartsTooltip/utils.js +2 -0
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +22 -20
- package/ChartsXAxis/ChartsXAxis.js +14 -25
- package/ChartsYAxis/ChartsYAxis.js +10 -22
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/Gauge.js +5 -7
- package/Gauge/GaugeContainer.d.ts +4 -11
- package/Gauge/GaugeContainer.js +44 -83
- package/Gauge/GaugeProvider.js +2 -0
- package/LineChart/AnimatedArea.js +2 -1
- package/LineChart/AnimatedLine.js +2 -1
- package/LineChart/AppearingMask.js +2 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaPlot.js +60 -26
- package/LineChart/CircleMarkElement.d.ts +0 -4
- package/LineChart/CircleMarkElement.js +7 -11
- package/LineChart/LineChart.d.ts +1 -6
- package/LineChart/LineChart.js +33 -24
- package/LineChart/LineChart.plugins.d.ts +12 -0
- package/LineChart/LineChart.plugins.js +5 -0
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineHighlightElement.d.ts +5 -1
- package/LineChart/LineHighlightElement.js +29 -9
- package/LineChart/LineHighlightPlot.js +21 -16
- package/LineChart/LinePlot.js +60 -25
- package/LineChart/MarkElement.js +7 -5
- package/LineChart/MarkPlot.d.ts +0 -6
- package/LineChart/MarkPlot.js +20 -23
- package/LineChart/extremums.d.ts +3 -3
- package/LineChart/formatter.d.ts +2 -2
- package/LineChart/formatter.js +3 -1
- package/LineChart/getColor.d.ts +1 -1
- package/LineChart/legend.d.ts +1 -1
- package/LineChart/legend.js +1 -0
- package/LineChart/plugin.d.ts +2 -2
- package/LineChart/plugin.js +5 -2
- package/LineChart/tooltip.d.ts +3 -0
- package/LineChart/tooltip.js +25 -0
- package/LineChart/useLineChartProps.d.ts +6 -5
- package/LineChart/useLineChartProps.js +22 -14
- package/PieChart/PieArc.js +14 -6
- package/PieChart/PieArcLabel.js +13 -9
- package/PieChart/PieArcLabelPlot.js +4 -3
- package/PieChart/PieArcPlot.js +13 -16
- package/PieChart/PieChart.d.ts +3 -1
- package/PieChart/PieChart.js +61 -162
- package/PieChart/PieChart.plugins.d.ts +5 -0
- package/PieChart/PieChart.plugins.js +3 -0
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/dataTransform/transition.d.ts +2 -2
- package/PieChart/dataTransform/transition.js +8 -8
- package/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/PieChart/dataTransform/useTransformData.js +3 -2
- package/PieChart/formatter.d.ts +2 -2
- package/PieChart/formatter.js +4 -1
- package/PieChart/getColor.d.ts +1 -1
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/PieChart/legend.d.ts +1 -1
- package/PieChart/legend.js +4 -3
- package/PieChart/plugin.d.ts +2 -2
- package/PieChart/plugin.js +5 -2
- package/PieChart/tooltip.d.ts +3 -0
- package/PieChart/tooltip.js +29 -0
- package/README.md +1 -1
- package/ScatterChart/Scatter.js +12 -10
- package/ScatterChart/ScatterChart.d.ts +1 -2
- package/ScatterChart/ScatterChart.js +39 -21
- package/ScatterChart/ScatterChart.plugins.d.ts +12 -0
- package/ScatterChart/ScatterChart.plugins.js +5 -0
- package/ScatterChart/ScatterPlot.js +11 -10
- package/ScatterChart/extremums.d.ts +3 -3
- package/ScatterChart/extremums.js +1 -1
- package/ScatterChart/formatter.d.ts +2 -2
- package/ScatterChart/formatter.js +7 -5
- package/ScatterChart/getColor.d.ts +1 -1
- package/ScatterChart/legend.d.ts +1 -1
- package/ScatterChart/legend.js +1 -0
- package/ScatterChart/plugin.d.ts +2 -2
- package/ScatterChart/plugin.js +5 -2
- package/ScatterChart/tooltip.d.ts +3 -0
- package/ScatterChart/tooltip.js +25 -0
- package/ScatterChart/useScatterChartProps.d.ts +6 -5
- package/ScatterChart/useScatterChartProps.js +19 -7
- package/SparkLineChart/SparkLineChart.d.ts +14 -2
- package/SparkLineChart/SparkLineChart.js +40 -17
- package/colorPalettes/colorPalettes.d.ts +5 -0
- package/colorPalettes/colorPalettes.js +3 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +2 -1
- package/context/AnimationProvider/AnimationProvider.js +1 -1
- package/context/ChartProvider/ChartContext.d.ts +6 -0
- package/context/ChartProvider/ChartContext.js +8 -0
- package/context/ChartProvider/ChartProvider.d.ts +8 -0
- package/context/ChartProvider/ChartProvider.js +40 -0
- package/context/ChartProvider/ChartProvider.types.d.ts +40 -0
- package/context/ChartProvider/index.d.ts +3 -0
- package/context/ChartProvider/index.js +3 -0
- package/context/ChartProvider/useChartContext.d.ts +3 -0
- package/context/ChartProvider/useChartContext.js +11 -0
- package/context/PolarProvider/PolarProvider.d.ts +0 -4
- package/context/PolarProvider/PolarProvider.js +59 -47
- package/context/PolarProvider/getAxisExtremum.d.ts +0 -4
- package/context/PolarProvider/getAxisExtremum.js +48 -20
- package/context/PolarProvider/usePolarContext.d.ts +0 -2
- package/context/PolarProvider/usePolarContext.js +9 -8
- package/context/index.d.ts +1 -5
- package/context/index.js +1 -3
- package/hooks/index.d.ts +5 -0
- package/hooks/index.js +6 -1
- package/hooks/useAxis.d.ts +9 -1
- package/hooks/useAxis.js +32 -6
- package/hooks/useAxisEvents.d.ts +0 -1
- package/hooks/useAxisEvents.js +0 -161
- package/hooks/useChartGradientId.d.ts +31 -0
- package/hooks/useChartGradientId.js +47 -0
- package/hooks/useChartId.d.ts +1 -1
- package/hooks/useChartId.js +5 -6
- package/hooks/useColorScale.js +5 -6
- package/hooks/useDrawingArea.d.ts +16 -2
- package/hooks/useDrawingArea.js +5 -20
- package/hooks/useInteractionItemProps.js +10 -27
- package/hooks/useItemHighlighted.d.ts +23 -0
- package/hooks/useItemHighlighted.js +23 -0
- package/hooks/useItemHighlightedGetter.d.ts +12 -0
- package/hooks/useItemHighlightedGetter.js +23 -0
- package/hooks/useLegend.d.ts +13 -0
- package/hooks/useLegend.js +30 -0
- package/hooks/useSeries.d.ts +11 -6
- package/hooks/useSeries.js +5 -10
- package/hooks/useSvgRef.d.ts +1 -1
- package/hooks/useSvgRef.js +4 -8
- package/hooks/useZAxis.d.ts +7 -0
- package/hooks/useZAxis.js +27 -0
- package/index.d.ts +2 -1
- package/index.js +4 -3
- package/internals/calculateMargins.d.ts +7 -0
- package/internals/calculateMargins.js +25 -0
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +0 -2
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +65 -32
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +13 -0
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +61 -0
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +6 -0
- package/internals/components/ChartsWrapper/ChartsWrapper.d.ts +18 -0
- package/internals/components/ChartsWrapper/ChartsWrapper.js +66 -0
- package/internals/components/ChartsWrapper/index.d.ts +1 -0
- package/internals/components/ChartsWrapper/index.js +1 -0
- package/internals/consumeSlots.d.ts +48 -0
- package/internals/consumeSlots.js +101 -0
- package/internals/consumeThemeProps.d.ts +50 -0
- package/internals/consumeThemeProps.js +70 -0
- package/internals/defaultizeColor.d.ts +29 -22
- package/internals/defaultizeColor.js +1 -2
- package/internals/getCurve.d.ts +2 -2
- package/internals/getCurve.js +14 -26
- package/internals/index.d.ts +18 -13
- package/internals/index.js +21 -14
- package/internals/plugins/allPlugins.d.ts +14 -0
- package/internals/plugins/allPlugins.js +7 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +10 -0
- package/internals/plugins/corePlugins/corePlugins.js +9 -0
- package/internals/plugins/corePlugins/index.d.ts +2 -0
- package/internals/plugins/corePlugins/index.js +1 -0
- package/internals/plugins/corePlugins/useChartDimensions/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartDimensions/index.js +2 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +175 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +264 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +25 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +99 -0
- package/internals/plugins/corePlugins/useChartId/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartId/index.js +2 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +36 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +20 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/internals/plugins/corePlugins/useChartSeries/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartSeries/index.js +2 -0
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +18 -0
- package/{modern/context/SeriesProvider → internals/plugins/corePlugins/useChartSeries}/processSeries.js +9 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +72 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +61 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +4 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +54 -0
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.d.ts +10 -0
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +29 -0
- package/internals/{computeAxisValue.js → plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js} +19 -27
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +61 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +39 -0
- package/{modern/context/ChartDataProvider/useDefaultizeAxis.js → internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +3 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +22 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +9 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +59 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +205 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts +1336 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +92 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +12 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +12 -0
- package/internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartHighlight/index.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartHighlight/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +44 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +678 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +31 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +71 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +90 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +376 -0
- package/{context/InteractionSelectors.js → internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js} +2 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +62 -0
- package/internals/plugins/featurePlugins/useChartZAxis/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartZAxis/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +86 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +45 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +3 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +39 -0
- package/internals/plugins/featurePlugins/useChartZAxis/utils.d.ts +0 -0
- package/internals/plugins/featurePlugins/useChartZAxis/utils.js +0 -0
- package/internals/plugins/models/chart.d.ts +14 -0
- package/internals/plugins/models/helpers.d.ts +7 -0
- package/internals/plugins/models/index.d.ts +4 -35
- package/internals/plugins/models/index.js +4 -1
- package/internals/plugins/models/plugin.d.ts +105 -0
- package/internals/plugins/models/seriesConfig/colorProcessor.types.d.ts +5 -0
- package/internals/plugins/models/seriesConfig/extremumGetter.types.d.ts +22 -0
- package/internals/plugins/models/seriesConfig/extremumGetter.types.js +1 -0
- package/internals/plugins/models/seriesConfig/index.d.ts +6 -0
- package/internals/plugins/models/seriesConfig/index.js +6 -0
- package/internals/plugins/models/seriesConfig/legendGetter.types.d.ts +4 -0
- package/internals/plugins/models/seriesConfig/legendGetter.types.js +1 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +18 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.js +1 -0
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +16 -0
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.js +1 -0
- package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +7 -0
- package/internals/plugins/models/seriesConfig/tooltipGetter.types.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +9 -8
- package/internals/plugins/utils/ChartStore.js +0 -2
- package/internals/plugins/utils/selectors.d.ts +2 -2
- package/internals/store/extractPluginParamsFromProps.d.ts +7 -0
- package/internals/store/extractPluginParamsFromProps.js +28 -0
- package/internals/store/useChartModels.d.ts +7 -0
- package/internals/store/useChartModels.js +64 -0
- package/internals/store/useCharts.d.ts +16 -0
- package/internals/store/useCharts.js +83 -0
- package/internals/store/useCharts.types.d.ts +5 -0
- package/internals/store/useCharts.types.js +1 -0
- package/internals/store/useSelector.d.ts +4 -0
- package/internals/store/useStore.d.ts +9 -0
- package/internals/store/useStore.js +9 -0
- package/models/axis.d.ts +18 -13
- package/models/axis.js +5 -1
- package/models/curve.d.ts +6 -0
- package/models/curve.js +1 -0
- package/models/index.d.ts +3 -1
- package/models/layout.d.ts +2 -1
- package/models/position.d.ts +10 -0
- package/models/position.js +1 -0
- package/models/seriesType/common.d.ts +8 -1
- package/models/seriesType/line.d.ts +12 -1
- package/models/seriesType/pie.d.ts +7 -1
- package/models/seriesType/scatter.d.ts +3 -3
- package/modern/BarChart/AnimatedBarElement.js +1 -0
- package/modern/BarChart/BarChart.js +30 -17
- package/modern/BarChart/BarChart.plugins.js +5 -0
- package/modern/BarChart/BarElement.js +1 -1
- package/modern/BarChart/BarLabel/BarLabelItem.js +1 -1
- package/modern/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/modern/BarChart/BarPlot.js +8 -9
- package/modern/BarChart/formatter.js +2 -1
- package/modern/BarChart/legend.js +1 -0
- package/modern/BarChart/plugin.js +5 -2
- package/modern/BarChart/tooltip.js +25 -0
- package/modern/BarChart/useBarChartProps.js +21 -11
- package/modern/ChartContainer/ChartContainer.js +51 -21
- package/modern/ChartContainer/useChartContainerProps.js +18 -13
- package/modern/ChartDataProvider/ChartDataProvider.js +97 -0
- package/modern/ChartDataProvider/useChartDataProviderProps.js +45 -0
- package/modern/ChartsAxis/ChartsAxis.js +5 -7
- package/modern/ChartsAxis/axisClasses.js +2 -1
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +3 -3
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +3 -3
- package/modern/ChartsGrid/ChartsGrid.js +9 -5
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +4 -3
- package/modern/ChartsGrid/ChartsVerticalGrid.js +4 -3
- package/modern/ChartsLabel/ChartsLabel.js +43 -0
- package/modern/ChartsLabel/ChartsLabelGradient.js +135 -0
- package/modern/ChartsLabel/ChartsLabelMark.js +111 -0
- package/modern/ChartsLabel/index.js +6 -0
- package/modern/ChartsLabel/labelClasses.js +13 -0
- package/modern/ChartsLabel/labelGradientClasses.js +18 -0
- package/modern/ChartsLabel/labelMarkClasses.js +18 -0
- package/modern/ChartsLegend/ChartsLegend.js +100 -109
- package/modern/ChartsLegend/ContinuousColorLegend.js +198 -321
- package/modern/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/modern/ChartsLegend/chartsLegendClasses.js +18 -3
- package/modern/ChartsLegend/colorLegend.types.js +1 -0
- package/modern/ChartsLegend/continuousColorLegendClasses.js +23 -0
- package/modern/ChartsLegend/direction.js +1 -0
- package/modern/ChartsLegend/index.js +9 -3
- package/modern/ChartsLegend/legendContext.types.js +1 -0
- package/modern/ChartsLegend/onClickContextBuilder.js +7 -0
- package/modern/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +9 -0
- package/modern/ChartsLegend/piecewiseColorLegend.types.js +1 -0
- package/modern/ChartsLegend/piecewiseColorLegendClasses.js +23 -0
- package/modern/ChartsLegend/useAxis.js +7 -6
- package/modern/ChartsSurface/ChartsSurface.js +46 -34
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +11 -6
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +6 -3
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -20
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +7 -25
- package/modern/ChartsTooltip/ChartsTooltipTable.js +15 -33
- package/modern/ChartsTooltip/chartsTooltipClasses.js +3 -2
- package/modern/ChartsTooltip/index.js +2 -1
- package/modern/ChartsTooltip/useAxisTooltip.js +16 -13
- package/modern/ChartsTooltip/useItemTooltip.js +20 -45
- package/modern/ChartsTooltip/utils.js +2 -0
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +22 -20
- package/modern/ChartsXAxis/ChartsXAxis.js +14 -25
- package/modern/ChartsYAxis/ChartsYAxis.js +10 -22
- package/modern/Gauge/Gauge.js +5 -7
- package/modern/Gauge/GaugeContainer.js +44 -83
- package/modern/Gauge/GaugeProvider.js +2 -0
- package/modern/LineChart/AnimatedArea.js +2 -1
- package/modern/LineChart/AnimatedLine.js +2 -1
- package/modern/LineChart/AppearingMask.js +2 -1
- package/modern/LineChart/AreaElement.js +1 -1
- package/modern/LineChart/AreaPlot.js +60 -26
- package/modern/LineChart/CircleMarkElement.js +7 -11
- package/modern/LineChart/LineChart.js +33 -24
- package/modern/LineChart/LineChart.plugins.js +5 -0
- package/modern/LineChart/LineElement.js +1 -1
- package/modern/LineChart/LineHighlightElement.js +29 -9
- package/modern/LineChart/LineHighlightPlot.js +21 -16
- package/modern/LineChart/LinePlot.js +60 -25
- package/modern/LineChart/MarkElement.js +7 -5
- package/modern/LineChart/MarkPlot.js +20 -23
- package/modern/LineChart/formatter.js +3 -1
- package/modern/LineChart/legend.js +1 -0
- package/modern/LineChart/plugin.js +5 -2
- package/modern/LineChart/tooltip.js +25 -0
- package/modern/LineChart/useLineChartProps.js +22 -14
- package/modern/PieChart/PieArc.js +14 -6
- package/modern/PieChart/PieArcLabel.js +13 -9
- package/modern/PieChart/PieArcLabelPlot.js +4 -3
- package/modern/PieChart/PieArcPlot.js +13 -16
- package/modern/PieChart/PieChart.js +61 -162
- package/modern/PieChart/PieChart.plugins.js +3 -0
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/PieChart/dataTransform/transition.js +8 -8
- package/modern/PieChart/dataTransform/useTransformData.js +3 -2
- package/modern/PieChart/formatter.js +4 -1
- package/modern/PieChart/legend.js +4 -3
- package/modern/PieChart/plugin.js +5 -2
- package/modern/PieChart/tooltip.js +29 -0
- package/modern/ScatterChart/Scatter.js +12 -10
- package/modern/ScatterChart/ScatterChart.js +39 -21
- package/modern/ScatterChart/ScatterChart.plugins.js +5 -0
- package/modern/ScatterChart/ScatterPlot.js +11 -10
- package/modern/ScatterChart/extremums.js +1 -1
- package/modern/ScatterChart/formatter.js +7 -5
- package/modern/ScatterChart/legend.js +1 -0
- package/modern/ScatterChart/plugin.js +5 -2
- package/modern/ScatterChart/tooltip.js +25 -0
- package/modern/ScatterChart/useScatterChartProps.js +19 -7
- package/modern/SparkLineChart/SparkLineChart.js +40 -17
- package/modern/colorPalettes/colorPalettes.js +3 -0
- package/modern/constants/index.js +2 -1
- package/modern/context/AnimationProvider/AnimationProvider.js +1 -1
- package/modern/context/ChartProvider/ChartContext.js +8 -0
- package/modern/context/ChartProvider/ChartProvider.js +40 -0
- package/modern/context/ChartProvider/ChartProvider.types.js +1 -0
- package/modern/context/ChartProvider/index.js +3 -0
- package/modern/context/ChartProvider/useChartContext.js +11 -0
- package/modern/context/PolarProvider/PolarProvider.js +59 -47
- package/modern/context/PolarProvider/getAxisExtremum.js +48 -20
- package/modern/context/PolarProvider/usePolarContext.js +9 -8
- package/modern/context/index.js +1 -3
- package/modern/hooks/index.js +6 -1
- package/modern/hooks/useAxis.js +32 -6
- package/modern/hooks/useAxisEvents.js +0 -161
- package/modern/hooks/useChartGradientId.js +47 -0
- package/modern/hooks/useChartId.js +5 -6
- package/modern/hooks/useColorScale.js +5 -6
- package/modern/hooks/useDrawingArea.js +5 -20
- package/modern/hooks/useInteractionItemProps.js +10 -27
- package/modern/hooks/useItemHighlighted.js +23 -0
- package/modern/hooks/useItemHighlightedGetter.js +23 -0
- package/modern/hooks/useLegend.js +30 -0
- package/modern/hooks/useSeries.js +5 -10
- package/modern/hooks/useSvgRef.js +4 -8
- package/modern/hooks/useZAxis.js +27 -0
- package/modern/index.js +4 -3
- package/modern/internals/calculateMargins.js +25 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +65 -32
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +61 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +6 -0
- package/modern/internals/components/ChartsWrapper/ChartsWrapper.js +66 -0
- package/modern/internals/components/ChartsWrapper/index.js +1 -0
- package/modern/internals/consumeSlots.js +101 -0
- package/modern/internals/consumeThemeProps.js +70 -0
- package/modern/internals/defaultizeColor.js +1 -2
- package/modern/internals/getCurve.js +14 -26
- package/modern/internals/index.js +21 -14
- package/modern/internals/plugins/allPlugins.js +7 -0
- package/modern/internals/plugins/corePlugins/corePlugins.js +9 -0
- package/modern/internals/plugins/corePlugins/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/index.js +2 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +175 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +25 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/index.js +2 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/modern/internals/plugins/corePlugins/useChartSeries/index.js +2 -0
- package/{context/SeriesProvider → modern/internals/plugins/corePlugins/useChartSeries}/processSeries.js +9 -6
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +72 -0
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +4 -0
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +21 -0
- package/modern/internals/{computeAxisValue.js → plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js} +19 -27
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +61 -0
- package/{context/ChartDataProvider/useDefaultizeAxis.js → modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +3 -11
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +22 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +59 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +5 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +205 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +89 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +12 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +12 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +44 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +31 -0
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +90 -0
- package/modern/{context/InteractionSelectors.js → internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js} +2 -4
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +86 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +3 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/utils.js +0 -0
- package/modern/internals/plugins/models/chart.js +1 -0
- package/modern/internals/plugins/models/helpers.js +1 -0
- package/modern/internals/plugins/models/index.js +4 -1
- package/modern/internals/plugins/models/plugin.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/colorProcessor.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/extremumGetter.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/index.js +6 -0
- package/modern/internals/plugins/models/seriesConfig/legendGetter.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/seriesProcessor.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/tooltipGetter.types.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +0 -2
- package/modern/internals/store/extractPluginParamsFromProps.js +28 -0
- package/modern/internals/store/useChartModels.js +64 -0
- package/modern/internals/store/useCharts.js +83 -0
- package/modern/internals/store/useCharts.types.js +1 -0
- package/modern/internals/store/useStore.js +9 -0
- package/modern/models/axis.js +5 -1
- package/modern/models/curve.js +1 -0
- package/modern/models/position.js +1 -0
- package/node/BarChart/AnimatedBarElement.js +1 -0
- package/node/BarChart/BarChart.js +30 -17
- package/node/BarChart/BarChart.plugins.js +11 -0
- package/node/BarChart/BarElement.js +2 -2
- package/node/BarChart/BarLabel/BarLabelItem.js +2 -2
- package/node/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/node/BarChart/BarPlot.js +6 -6
- package/node/BarChart/formatter.js +2 -1
- package/node/BarChart/legend.js +1 -0
- package/node/BarChart/plugin.js +5 -2
- package/node/BarChart/tooltip.js +31 -0
- package/node/BarChart/useBarChartProps.js +20 -11
- package/node/ChartContainer/ChartContainer.js +51 -21
- package/node/ChartContainer/useChartContainerProps.js +18 -13
- package/node/ChartDataProvider/ChartDataProvider.js +103 -0
- package/node/ChartDataProvider/useChartDataProviderProps.js +52 -0
- package/node/ChartsAxis/ChartsAxis.js +5 -7
- package/node/ChartsAxis/axisClasses.js +5 -3
- package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/node/ChartsGrid/ChartsGrid.js +9 -5
- package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -3
- package/node/ChartsGrid/ChartsVerticalGrid.js +4 -3
- package/node/ChartsLabel/ChartsLabel.js +49 -0
- package/node/ChartsLabel/ChartsLabelGradient.js +141 -0
- package/node/ChartsLabel/ChartsLabelMark.js +117 -0
- package/node/ChartsLabel/index.js +26 -0
- package/node/ChartsLabel/labelClasses.js +22 -0
- package/node/ChartsLabel/labelGradientClasses.js +27 -0
- package/node/ChartsLabel/labelMarkClasses.js +27 -0
- package/node/ChartsLegend/ChartsLegend.js +99 -108
- package/node/ChartsLegend/ContinuousColorLegend.js +199 -322
- package/node/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/node/ChartsLegend/chartsLegendClasses.js +21 -5
- package/node/ChartsLegend/continuousColorLegendClasses.js +31 -0
- package/node/ChartsLegend/index.js +80 -16
- package/node/ChartsLegend/onClickContextBuilder.js +14 -0
- package/node/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +15 -0
- package/node/ChartsLegend/piecewiseColorLegendClasses.js +31 -0
- package/node/ChartsLegend/useAxis.js +7 -7
- package/node/ChartsSurface/ChartsSurface.js +46 -34
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +10 -5
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +5 -2
- package/node/ChartsTooltip/ChartsTooltip.js +2 -20
- package/node/ChartsTooltip/ChartsTooltipContainer.js +7 -25
- package/node/ChartsTooltip/ChartsTooltipTable.js +16 -34
- package/node/ChartsTooltip/chartsTooltipClasses.js +3 -2
- package/node/ChartsTooltip/index.js +13 -1
- package/node/ChartsTooltip/useAxisTooltip.js +16 -14
- package/node/ChartsTooltip/useItemTooltip.js +20 -47
- package/node/ChartsTooltip/utils.js +1 -0
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +24 -22
- package/node/ChartsXAxis/ChartsXAxis.js +14 -25
- package/node/ChartsYAxis/ChartsYAxis.js +10 -22
- package/node/Gauge/Gauge.js +5 -7
- package/node/Gauge/GaugeContainer.js +44 -83
- package/node/Gauge/GaugeProvider.js +2 -2
- package/node/LineChart/AnimatedArea.js +2 -1
- package/node/LineChart/AnimatedLine.js +2 -1
- package/node/LineChart/AppearingMask.js +2 -1
- package/node/LineChart/AreaElement.js +2 -2
- package/node/LineChart/AreaPlot.js +60 -26
- package/node/LineChart/CircleMarkElement.js +9 -13
- package/node/LineChart/LineChart.js +33 -24
- package/node/LineChart/LineChart.plugins.js +11 -0
- package/node/LineChart/LineElement.js +2 -2
- package/node/LineChart/LineHighlightElement.js +29 -9
- package/node/LineChart/LineHighlightPlot.js +22 -17
- package/node/LineChart/LinePlot.js +60 -25
- package/node/LineChart/MarkElement.js +9 -7
- package/node/LineChart/MarkPlot.js +20 -23
- package/node/LineChart/formatter.js +3 -1
- package/node/LineChart/legend.js +1 -0
- package/node/LineChart/plugin.js +5 -2
- package/node/LineChart/tooltip.js +31 -0
- package/node/LineChart/useLineChartProps.js +21 -14
- package/node/PieChart/PieArc.js +14 -6
- package/node/PieChart/PieArcLabel.js +13 -9
- package/node/PieChart/PieArcLabelPlot.js +3 -2
- package/node/PieChart/PieArcPlot.js +12 -15
- package/node/PieChart/PieChart.js +61 -162
- package/node/PieChart/PieChart.plugins.js +9 -0
- package/node/PieChart/PiePlot.js +2 -2
- package/node/PieChart/dataTransform/transition.js +11 -9
- package/node/PieChart/dataTransform/useTransformData.js +3 -2
- package/node/PieChart/formatter.js +4 -1
- package/node/PieChart/legend.js +4 -3
- package/node/PieChart/plugin.js +5 -2
- package/node/PieChart/tooltip.js +36 -0
- package/node/ScatterChart/Scatter.js +13 -11
- package/node/ScatterChart/ScatterChart.js +39 -21
- package/node/ScatterChart/ScatterChart.plugins.js +11 -0
- package/node/ScatterChart/ScatterPlot.js +11 -10
- package/node/ScatterChart/extremums.js +1 -1
- package/node/ScatterChart/formatter.js +7 -5
- package/node/ScatterChart/legend.js +1 -0
- package/node/ScatterChart/plugin.js +5 -2
- package/node/ScatterChart/tooltip.js +31 -0
- package/node/ScatterChart/useScatterChartProps.js +18 -7
- package/node/SparkLineChart/SparkLineChart.js +39 -16
- package/node/colorPalettes/colorPalettes.js +5 -1
- package/node/constants/index.js +3 -2
- package/node/context/AnimationProvider/AnimationProvider.js +1 -1
- package/node/context/{SeriesProvider/SeriesContext.js → ChartProvider/ChartContext.js} +6 -6
- package/node/context/ChartProvider/ChartProvider.js +46 -0
- package/node/context/ChartProvider/index.js +38 -0
- package/node/context/ChartProvider/useChartContext.js +18 -0
- package/node/context/PolarProvider/PolarProvider.js +59 -51
- package/node/context/PolarProvider/getAxisExtremum.js +49 -27
- package/node/context/PolarProvider/usePolarContext.js +9 -14
- package/node/context/index.js +1 -31
- package/node/hooks/index.js +65 -2
- package/node/hooks/useAxis.js +34 -6
- package/node/hooks/useAxisEvents.js +1 -169
- package/node/hooks/useChartGradientId.js +56 -0
- package/node/hooks/useChartId.js +5 -7
- package/node/hooks/useColorScale.js +5 -7
- package/node/hooks/useDrawingArea.js +5 -21
- package/node/hooks/useInteractionItemProps.js +10 -28
- package/node/hooks/useItemHighlighted.js +28 -0
- package/node/hooks/useItemHighlightedGetter.js +27 -0
- package/node/hooks/useLegend.js +35 -0
- package/node/hooks/useSeries.js +5 -9
- package/node/hooks/useSvgRef.js +4 -9
- package/node/hooks/useZAxis.js +33 -0
- package/node/index.js +23 -12
- package/node/internals/calculateMargins.js +33 -0
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +64 -32
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +69 -0
- package/node/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +6 -0
- package/node/internals/components/ChartsWrapper/ChartsWrapper.js +72 -0
- package/node/internals/components/ChartsWrapper/index.js +16 -0
- package/node/internals/consumeSlots.js +109 -0
- package/node/internals/consumeThemeProps.js +78 -0
- package/node/internals/defaultizeColor.js +1 -2
- package/node/internals/getCurve.js +13 -25
- package/node/internals/index.js +135 -75
- package/node/internals/plugins/allPlugins.js +13 -0
- package/node/internals/plugins/corePlugins/corePlugins.js +14 -0
- package/node/internals/plugins/corePlugins/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartDimensions/index.js +27 -0
- package/node/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +183 -0
- package/node/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +32 -0
- package/node/internals/plugins/corePlugins/useChartId/index.js +27 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.js +41 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +15 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.utils.js +12 -0
- package/node/internals/plugins/corePlugins/useChartSeries/index.js +27 -0
- package/node/{context/SeriesProvider → internals/plugins/corePlugins/useChartSeries}/processSeries.js +9 -6
- package/node/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +80 -0
- package/node/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +11 -0
- package/node/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +27 -0
- package/node/internals/{computeAxisValue.js → plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js} +19 -27
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +69 -0
- package/node/{context/ChartDataProvider/useDefaultizeAxis.js → internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +4 -13
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +29 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +65 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +59 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +213 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +98 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js +5 -0
- package/node/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +19 -0
- package/node/{context/HighlightedProvider → internals/plugins/featurePlugins/useChartHighlight}/createIsHighlighted.js +4 -4
- package/node/internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.js +5 -0
- package/node/internals/plugins/featurePlugins/useChartHighlight/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +52 -0
- package/node/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +37 -0
- package/node/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.js +5 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +98 -0
- package/node/{context/InteractionSelectors.js → internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js} +2 -4
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +5 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +94 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +9 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.js +5 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/utils.js +1 -0
- package/node/internals/plugins/models/chart.js +5 -0
- package/node/internals/plugins/models/helpers.js +5 -0
- package/node/internals/plugins/models/index.js +44 -0
- package/node/internals/plugins/models/plugin.js +5 -0
- package/node/internals/plugins/models/seriesConfig/colorProcessor.types.js +5 -0
- package/node/internals/plugins/models/seriesConfig/extremumGetter.types.js +5 -0
- package/node/internals/plugins/models/seriesConfig/index.js +71 -0
- package/node/internals/plugins/models/seriesConfig/legendGetter.types.js +5 -0
- package/node/internals/plugins/models/seriesConfig/seriesConfig.types.js +5 -0
- package/node/internals/plugins/models/seriesConfig/seriesProcessor.types.js +5 -0
- package/node/internals/plugins/models/seriesConfig/tooltipGetter.types.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +0 -2
- package/node/internals/store/extractPluginParamsFromProps.js +36 -0
- package/node/internals/store/useChartModels.js +73 -0
- package/node/internals/store/useCharts.js +92 -0
- package/node/internals/store/useCharts.types.js +5 -0
- package/node/internals/store/useStore.js +15 -0
- package/node/models/axis.js +5 -1
- package/node/models/curve.js +5 -0
- package/node/models/position.js +5 -0
- package/package.json +6 -5
- package/ChartContainer/ResizableContainer.d.ts +0 -22
- package/ChartContainer/ResizableContainer.js +0 -60
- package/ChartsLegend/ChartsLegendItem.d.ts +0 -26
- package/ChartsLegend/ChartsLegendItem.js +0 -65
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -25
- package/ChartsLegend/DefaultChartsLegend.js +0 -112
- package/ChartsLegend/LegendPerItem.d.ts +0 -65
- package/ChartsLegend/LegendPerItem.js +0 -129
- package/ChartsLegend/legendItemsPlacement.d.ts +0 -3
- package/ChartsLegend/legendItemsPlacement.js +0 -72
- package/ChartsLegend/utils.d.ts +0 -2
- package/ChartsLegend/utils.js +0 -16
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.d.ts +0 -20
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +0 -81
- package/ChartsOnAxisClickHandler/index.d.ts +0 -1
- package/ChartsOnAxisClickHandler/index.js +0 -1
- package/context/CartesianProvider/Cartesian.types.d.ts +0 -59
- package/context/CartesianProvider/CartesianContext.d.ts +0 -4
- package/context/CartesianProvider/CartesianContext.js +0 -13
- package/context/CartesianProvider/CartesianProvider.d.ts +0 -4
- package/context/CartesianProvider/CartesianProvider.js +0 -49
- package/context/CartesianProvider/defaultizeAxis.d.ts +0 -40
- package/context/CartesianProvider/defaultizeAxis.js +0 -13
- package/context/CartesianProvider/getAxisExtremum.d.ts +0 -5
- package/context/CartesianProvider/getAxisExtremum.js +0 -21
- package/context/CartesianProvider/index.d.ts +0 -4
- package/context/CartesianProvider/index.js +0 -4
- package/context/CartesianProvider/useCartesianContext.d.ts +0 -2
- package/context/CartesianProvider/useCartesianContext.js +0 -10
- package/context/ChartDataProvider/ChartDataProvider.d.ts +0 -31
- package/context/ChartDataProvider/ChartDataProvider.js +0 -250
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +0 -94
- package/context/ChartDataProvider/useChartDataProviderProps.js +0 -66
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +0 -41
- package/context/DrawingAreaProvider/DrawingArea.types.d.ts +0 -51
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +0 -8
- package/context/DrawingAreaProvider/DrawingAreaContext.js +0 -16
- package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +0 -3
- package/context/DrawingAreaProvider/DrawingAreaProvider.js +0 -48
- package/context/DrawingAreaProvider/index.d.ts +0 -3
- package/context/DrawingAreaProvider/index.js +0 -3
- package/context/HighlightedProvider/HighlightedContext.d.ts +0 -58
- package/context/HighlightedProvider/HighlightedContext.js +0 -32
- package/context/HighlightedProvider/HighlightedProvider.d.ts +0 -20
- package/context/HighlightedProvider/HighlightedProvider.js +0 -79
- package/context/HighlightedProvider/createIsFaded.d.ts +0 -2
- package/context/HighlightedProvider/createIsFaded.js +0 -12
- package/context/HighlightedProvider/createIsHighlighted.d.ts +0 -2
- package/context/HighlightedProvider/createIsHighlighted.js +0 -12
- package/context/HighlightedProvider/index.d.ts +0 -4
- package/context/HighlightedProvider/index.js +0 -4
- package/context/HighlightedProvider/useHighlighted.d.ts +0 -9
- package/context/HighlightedProvider/useHighlighted.js +0 -22
- package/context/HighlightedProvider/useItemHighlighted.d.ts +0 -21
- package/context/HighlightedProvider/useItemHighlighted.js +0 -27
- package/context/InteractionProvider.d.ts +0 -7
- package/context/InteractionProvider.js +0 -22
- package/context/InteractionSelectors.d.ts +0 -359
- package/context/PluginProvider/ColorProcessor.types.d.ts +0 -8
- package/context/PluginProvider/ExtremumGetter.types.d.ts +0 -25
- package/context/PluginProvider/Plugin.types.d.ts +0 -29
- package/context/PluginProvider/PluginContext.d.ts +0 -4
- package/context/PluginProvider/PluginContext.js +0 -15
- package/context/PluginProvider/PluginProvider.d.ts +0 -4
- package/context/PluginProvider/PluginProvider.js +0 -21
- package/context/PluginProvider/SeriesFormatter.types.d.ts +0 -21
- package/context/PluginProvider/index.d.ts +0 -12
- package/context/PluginProvider/index.js +0 -12
- package/context/PluginProvider/mergePlugins.d.ts +0 -46
- package/context/PluginProvider/mergePlugins.js +0 -40
- package/context/PluginProvider/useColorProcessor.d.ts +0 -4
- package/context/PluginProvider/useColorProcessor.js +0 -17
- package/context/PluginProvider/useRadiusExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useRadiusExtremumGetter.js +0 -17
- package/context/PluginProvider/useRotationExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useRotationExtremumGetter.js +0 -17
- package/context/PluginProvider/useSeriesFormatter.d.ts +0 -4
- package/context/PluginProvider/useSeriesFormatter.js +0 -17
- package/context/PluginProvider/useXExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useXExtremumGetter.js +0 -15
- package/context/PluginProvider/useYExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useYExtremumGetter.js +0 -15
- package/context/SeriesProvider/Series.types.d.ts +0 -26
- package/context/SeriesProvider/SeriesContext.d.ts +0 -4
- package/context/SeriesProvider/SeriesContext.js +0 -8
- package/context/SeriesProvider/SeriesProvider.d.ts +0 -5
- package/context/SeriesProvider/SeriesProvider.js +0 -33
- package/context/SeriesProvider/index.d.ts +0 -12
- package/context/SeriesProvider/index.js +0 -8
- package/context/SeriesProvider/processSeries.d.ts +0 -18
- package/context/SizeProvider/Size.types.d.ts +0 -30
- package/context/SizeProvider/SizeContext.d.ts +0 -4
- package/context/SizeProvider/SizeContext.js +0 -13
- package/context/SizeProvider/SizeProvider.d.ts +0 -11
- package/context/SizeProvider/SizeProvider.js +0 -26
- package/context/SizeProvider/index.d.ts +0 -4
- package/context/SizeProvider/index.js +0 -4
- package/context/SizeProvider/useChartContainerDimensions.d.ts +0 -9
- package/context/SizeProvider/useChartContainerDimensions.js +0 -104
- package/context/SizeProvider/useSize.d.ts +0 -5
- package/context/SizeProvider/useSize.js +0 -13
- package/context/SvgRefProvider/SvgRef.types.d.ts +0 -8
- package/context/SvgRefProvider/SvgRefContext.d.ts +0 -4
- package/context/SvgRefProvider/SvgRefContext.js +0 -17
- package/context/SvgRefProvider/SvgRefProvider.d.ts +0 -3
- package/context/SvgRefProvider/SvgRefProvider.js +0 -24
- package/context/SvgRefProvider/index.d.ts +0 -4
- package/context/SvgRefProvider/index.js +0 -4
- package/context/SvgRefProvider/useSurfaceRef.d.ts +0 -2
- package/context/SvgRefProvider/useSurfaceRef.js +0 -14
- package/context/ZAxisContextProvider.d.ts +0 -33
- package/context/ZAxisContextProvider.js +0 -96
- package/internals/computeAxisValue.d.ts +0 -38
- package/internals/plugins/utils/ChartsStore.d.ts +0 -12
- package/internals/plugins/utils/ChartsStore.js +0 -26
- package/internals/useCharts.d.ts +0 -6
- package/internals/useCharts.js +0 -29
- package/internals/useSelector.d.ts +0 -4
- package/internals/useStore.d.ts +0 -2
- package/internals/useStore.js +0 -17
- package/modern/ChartContainer/ResizableContainer.js +0 -60
- package/modern/ChartsLegend/ChartsLegendItem.js +0 -65
- package/modern/ChartsLegend/DefaultChartsLegend.js +0 -112
- package/modern/ChartsLegend/LegendPerItem.js +0 -129
- package/modern/ChartsLegend/legendItemsPlacement.js +0 -72
- package/modern/ChartsLegend/utils.js +0 -16
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +0 -81
- package/modern/ChartsOnAxisClickHandler/index.js +0 -1
- package/modern/context/CartesianProvider/CartesianContext.js +0 -13
- package/modern/context/CartesianProvider/CartesianProvider.js +0 -49
- package/modern/context/CartesianProvider/defaultizeAxis.js +0 -13
- package/modern/context/CartesianProvider/getAxisExtremum.js +0 -21
- package/modern/context/CartesianProvider/index.js +0 -4
- package/modern/context/CartesianProvider/useCartesianContext.js +0 -10
- package/modern/context/ChartDataProvider/ChartDataProvider.js +0 -250
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +0 -66
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +0 -16
- package/modern/context/DrawingAreaProvider/DrawingAreaProvider.js +0 -48
- package/modern/context/DrawingAreaProvider/index.js +0 -3
- package/modern/context/HighlightedProvider/HighlightedContext.js +0 -32
- package/modern/context/HighlightedProvider/HighlightedProvider.js +0 -79
- package/modern/context/HighlightedProvider/createIsFaded.js +0 -12
- package/modern/context/HighlightedProvider/createIsHighlighted.js +0 -12
- package/modern/context/HighlightedProvider/index.js +0 -4
- package/modern/context/HighlightedProvider/useHighlighted.js +0 -22
- package/modern/context/HighlightedProvider/useItemHighlighted.js +0 -27
- package/modern/context/InteractionProvider.js +0 -22
- package/modern/context/PluginProvider/PluginContext.js +0 -15
- package/modern/context/PluginProvider/PluginProvider.js +0 -21
- package/modern/context/PluginProvider/index.js +0 -12
- package/modern/context/PluginProvider/mergePlugins.js +0 -40
- package/modern/context/PluginProvider/useColorProcessor.js +0 -17
- package/modern/context/PluginProvider/useRadiusExtremumGetter.js +0 -17
- package/modern/context/PluginProvider/useRotationExtremumGetter.js +0 -17
- package/modern/context/PluginProvider/useSeriesFormatter.js +0 -17
- package/modern/context/PluginProvider/useXExtremumGetter.js +0 -15
- package/modern/context/PluginProvider/useYExtremumGetter.js +0 -15
- package/modern/context/SeriesProvider/SeriesContext.js +0 -8
- package/modern/context/SeriesProvider/SeriesProvider.js +0 -33
- package/modern/context/SeriesProvider/index.js +0 -8
- package/modern/context/SizeProvider/SizeContext.js +0 -13
- package/modern/context/SizeProvider/SizeProvider.js +0 -26
- package/modern/context/SizeProvider/index.js +0 -4
- package/modern/context/SizeProvider/useChartContainerDimensions.js +0 -104
- package/modern/context/SizeProvider/useSize.js +0 -13
- package/modern/context/SvgRefProvider/SvgRefContext.js +0 -17
- package/modern/context/SvgRefProvider/SvgRefProvider.js +0 -24
- package/modern/context/SvgRefProvider/index.js +0 -4
- package/modern/context/SvgRefProvider/useSurfaceRef.js +0 -14
- package/modern/context/ZAxisContextProvider.js +0 -96
- package/modern/internals/plugins/utils/ChartsStore.js +0 -26
- package/modern/internals/useCharts.js +0 -29
- package/modern/internals/useStore.js +0 -17
- package/node/ChartContainer/ResizableContainer.js +0 -68
- package/node/ChartsLegend/ChartsLegendItem.js +0 -72
- package/node/ChartsLegend/DefaultChartsLegend.js +0 -118
- package/node/ChartsLegend/LegendPerItem.js +0 -137
- package/node/ChartsLegend/legendItemsPlacement.js +0 -79
- package/node/ChartsLegend/utils.js +0 -23
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +0 -87
- package/node/ChartsOnAxisClickHandler/index.js +0 -16
- package/node/context/CartesianProvider/CartesianContext.js +0 -20
- package/node/context/CartesianProvider/CartesianProvider.js +0 -54
- package/node/context/CartesianProvider/defaultizeAxis.js +0 -21
- package/node/context/CartesianProvider/getAxisExtremum.js +0 -28
- package/node/context/CartesianProvider/index.js +0 -49
- package/node/context/CartesianProvider/useCartesianContext.js +0 -17
- package/node/context/ChartDataProvider/ChartDataProvider.js +0 -256
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +0 -72
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +0 -22
- package/node/context/DrawingAreaProvider/DrawingAreaProvider.js +0 -55
- package/node/context/DrawingAreaProvider/index.js +0 -38
- package/node/context/HighlightedProvider/HighlightedContext.js +0 -38
- package/node/context/HighlightedProvider/HighlightedProvider.js +0 -85
- package/node/context/HighlightedProvider/createIsFaded.js +0 -19
- package/node/context/HighlightedProvider/index.js +0 -49
- package/node/context/HighlightedProvider/useHighlighted.js +0 -27
- package/node/context/HighlightedProvider/useItemHighlighted.js +0 -32
- package/node/context/InteractionProvider.js +0 -28
- package/node/context/PluginProvider/PluginContext.js +0 -22
- package/node/context/PluginProvider/PluginProvider.js +0 -26
- package/node/context/PluginProvider/index.js +0 -137
- package/node/context/PluginProvider/mergePlugins.js +0 -47
- package/node/context/PluginProvider/useColorProcessor.js +0 -23
- package/node/context/PluginProvider/useRadiusExtremumGetter.js +0 -23
- package/node/context/PluginProvider/useRotationExtremumGetter.js +0 -23
- package/node/context/PluginProvider/useSeriesFormatter.js +0 -23
- package/node/context/PluginProvider/useXExtremumGetter.js +0 -22
- package/node/context/PluginProvider/useYExtremumGetter.js +0 -22
- package/node/context/SeriesProvider/SeriesProvider.js +0 -38
- package/node/context/SeriesProvider/index.js +0 -49
- package/node/context/SizeProvider/SizeContext.js +0 -20
- package/node/context/SizeProvider/SizeProvider.js +0 -29
- package/node/context/SizeProvider/index.js +0 -49
- package/node/context/SizeProvider/useChartContainerDimensions.js +0 -112
- package/node/context/SizeProvider/useSize.js +0 -20
- package/node/context/SvgRefProvider/SvgRefContext.js +0 -23
- package/node/context/SvgRefProvider/SvgRefProvider.js +0 -31
- package/node/context/SvgRefProvider/index.js +0 -49
- package/node/context/SvgRefProvider/useSurfaceRef.js +0 -20
- package/node/context/ZAxisContextProvider.js +0 -103
- package/node/internals/plugins/utils/ChartsStore.js +0 -33
- package/node/internals/useCharts.js +0 -36
- package/node/internals/useStore.js +0 -24
- /package/{context/ChartDataProvider → ChartDataProvider}/index.d.ts +0 -0
- /package/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/{context/CartesianProvider/Cartesian.types.js → ChartsLegend/colorLegend.types.js} +0 -0
- /package/{context/DrawingAreaProvider/DrawingArea.types.js → ChartsLegend/direction.js} +0 -0
- /package/{context/PluginProvider/ColorProcessor.types.js → ChartsLegend/legendContext.types.js} +0 -0
- /package/{context/PluginProvider/ExtremumGetter.types.js → ChartsLegend/piecewiseColorLegend.types.js} +0 -0
- /package/context/{PluginProvider/Plugin.types.js → ChartProvider/ChartProvider.types.js} +0 -0
- /package/{context/PluginProvider/SeriesFormatter.types.js → internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js} +0 -0
- /package/{context/SeriesProvider/Series.types.js → internals/plugins/corePlugins/useChartId/useChartId.types.js} +0 -0
- /package/{context/SizeProvider/Size.types.js → internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js} +0 -0
- /package/{context/SvgRefProvider/SvgRef.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js} +0 -0
- /package/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.d.ts +0 -0
- /package/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/{modern/context/CartesianProvider/Cartesian.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js} +0 -0
- /package/{modern/context/DrawingAreaProvider/DrawingArea.types.js → internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types.js} +0 -0
- /package/{modern/context/PluginProvider/ColorProcessor.types.js → internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.js} +0 -0
- /package/{modern/context/PluginProvider/ExtremumGetter.types.js → internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js} +0 -0
- /package/{modern/context/PluginProvider/Plugin.types.js → internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.js} +0 -0
- /package/{modern/context/PluginProvider/SeriesFormatter.types.js → internals/plugins/models/chart.js} +0 -0
- /package/{modern/context/SeriesProvider/Series.types.js → internals/plugins/models/helpers.js} +0 -0
- /package/{modern/context/SizeProvider/Size.types.js → internals/plugins/models/plugin.js} +0 -0
- /package/{modern/context/SvgRefProvider/SvgRef.types.js → internals/plugins/models/seriesConfig/colorProcessor.types.js} +0 -0
- /package/internals/{useSelector.js → store/useSelector.js} +0 -0
- /package/modern/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/modern/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/modern/internals/{useSelector.js → store/useSelector.js} +0 -0
- /package/node/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/node/{context/CartesianProvider/Cartesian.types.js → ChartsLegend/colorLegend.types.js} +0 -0
- /package/node/{context/DrawingAreaProvider/DrawingArea.types.js → ChartsLegend/direction.js} +0 -0
- /package/node/{context/PluginProvider/ColorProcessor.types.js → ChartsLegend/legendContext.types.js} +0 -0
- /package/node/{context/PluginProvider/ExtremumGetter.types.js → ChartsLegend/piecewiseColorLegend.types.js} +0 -0
- /package/node/context/{PluginProvider/Plugin.types.js → ChartProvider/ChartProvider.types.js} +0 -0
- /package/node/{context/PluginProvider/SeriesFormatter.types.js → internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js} +0 -0
- /package/node/{context/SeriesProvider/Series.types.js → internals/plugins/corePlugins/useChartId/useChartId.types.js} +0 -0
- /package/node/{context/SizeProvider/Size.types.js → internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js} +0 -0
- /package/node/{context/SvgRefProvider/SvgRef.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js} +0 -0
- /package/node/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/node/internals/{useSelector.js → store/useSelector.js} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartStore } from '../plugins/utils/ChartStore';
|
|
3
|
+
import { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ConvertSignaturesIntoPlugins } from '../plugins/models';
|
|
4
|
+
import { UseChartBaseProps } from './useCharts.types';
|
|
5
|
+
import { UseChartInteractionState } from '../plugins/featurePlugins/useChartInteraction/useChartInteraction.types';
|
|
6
|
+
import { ChartSeriesType } from '../../models/seriesType/config';
|
|
7
|
+
import { ChartSeriesConfig } from '../plugins/models/seriesConfig';
|
|
8
|
+
export declare function useChartApiInitialization<T>(inputApiRef: React.RefObject<T | undefined> | undefined): T;
|
|
9
|
+
export declare function useCharts<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(inPlugins: ConvertSignaturesIntoPlugins<TSignatures>, props: Partial<UseChartBaseProps<TSignatures>>, seriesConfig: ChartSeriesConfig<TSeriesType>): {
|
|
10
|
+
contextValue: {
|
|
11
|
+
store: ChartStore<readonly [import("..").UseChartIdSignature, import("..").UseChartDimensionsSignature, import("..").UseChartSeriesSignature, ...TSignatures]> & UseChartInteractionState;
|
|
12
|
+
publicAPI: ChartPublicAPI<TSignatures>;
|
|
13
|
+
instance: ChartInstance<TSignatures>;
|
|
14
|
+
svgRef: React.RefObject<SVGSVGElement | null>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import useId from '@mui/utils/useId';
|
|
3
|
+
import { ChartStore } from "../plugins/utils/ChartStore.js";
|
|
4
|
+
import { CHART_CORE_PLUGINS } from "../plugins/corePlugins/index.js";
|
|
5
|
+
import { extractPluginParamsFromProps } from "./extractPluginParamsFromProps.js";
|
|
6
|
+
import { useChartModels } from "./useChartModels.js";
|
|
7
|
+
export function useChartApiInitialization(inputApiRef) {
|
|
8
|
+
const fallbackPublicApiRef = React.useRef({});
|
|
9
|
+
if (inputApiRef) {
|
|
10
|
+
if (inputApiRef.current == null) {
|
|
11
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
12
|
+
inputApiRef.current = {};
|
|
13
|
+
}
|
|
14
|
+
return inputApiRef.current;
|
|
15
|
+
}
|
|
16
|
+
return fallbackPublicApiRef.current;
|
|
17
|
+
}
|
|
18
|
+
let globalId = 0;
|
|
19
|
+
export function useCharts(inPlugins, props, seriesConfig) {
|
|
20
|
+
const chartId = useId();
|
|
21
|
+
const plugins = React.useMemo(() => [...CHART_CORE_PLUGINS, ...inPlugins], [inPlugins]);
|
|
22
|
+
const pluginParams = extractPluginParamsFromProps({
|
|
23
|
+
plugins,
|
|
24
|
+
props
|
|
25
|
+
});
|
|
26
|
+
pluginParams.id = pluginParams.id ?? chartId;
|
|
27
|
+
const models = useChartModels(plugins, pluginParams);
|
|
28
|
+
const instanceRef = React.useRef({});
|
|
29
|
+
const instance = instanceRef.current;
|
|
30
|
+
const publicAPI = useChartApiInitialization(props.apiRef);
|
|
31
|
+
const innerSvgRef = React.useRef(null);
|
|
32
|
+
const storeRef = React.useRef(null);
|
|
33
|
+
if (storeRef.current == null) {
|
|
34
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
35
|
+
globalId += 1;
|
|
36
|
+
const initialState = {
|
|
37
|
+
// TODO remove when the interaction moves to plugin
|
|
38
|
+
interaction: {
|
|
39
|
+
item: null,
|
|
40
|
+
axis: {
|
|
41
|
+
x: null,
|
|
42
|
+
y: null
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
cacheKey: {
|
|
46
|
+
id: globalId
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
plugins.forEach(plugin => {
|
|
50
|
+
if (plugin.getInitialState) {
|
|
51
|
+
Object.assign(initialState, plugin.getInitialState(pluginParams, initialState, seriesConfig));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
storeRef.current = new ChartStore(initialState);
|
|
55
|
+
}
|
|
56
|
+
const runPlugin = plugin => {
|
|
57
|
+
const pluginResponse = plugin({
|
|
58
|
+
instance,
|
|
59
|
+
params: pluginParams,
|
|
60
|
+
plugins: plugins,
|
|
61
|
+
store: storeRef.current,
|
|
62
|
+
svgRef: innerSvgRef,
|
|
63
|
+
seriesConfig,
|
|
64
|
+
models
|
|
65
|
+
});
|
|
66
|
+
if (pluginResponse.publicAPI) {
|
|
67
|
+
Object.assign(publicAPI, pluginResponse.publicAPI);
|
|
68
|
+
}
|
|
69
|
+
if (pluginResponse.instance) {
|
|
70
|
+
Object.assign(instance, pluginResponse.instance);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
plugins.forEach(runPlugin);
|
|
74
|
+
const contextValue = React.useMemo(() => ({
|
|
75
|
+
store: storeRef.current,
|
|
76
|
+
publicAPI,
|
|
77
|
+
instance,
|
|
78
|
+
svgRef: innerSvgRef
|
|
79
|
+
}), [instance, publicAPI]);
|
|
80
|
+
return {
|
|
81
|
+
contextValue
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartAnyPluginSignature, ChartPublicAPI } from '../plugins/models';
|
|
3
|
+
export interface UseChartBaseProps<TSignatures extends readonly ChartAnyPluginSignature[]> {
|
|
4
|
+
apiRef?: React.RefObject<ChartPublicAPI<TSignatures> | undefined>;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChartAnyPluginSignature, ChartState } from '../plugins/models';
|
|
2
|
+
import { ChartsSelector } from '../plugins/utils/selectors';
|
|
3
|
+
import { ChartStore } from '../plugins/utils/ChartStore';
|
|
4
|
+
export declare const useSelector: <TSignatures extends readonly ChartAnyPluginSignature[], TArgs, TValue>(store: ChartStore<TSignatures>, selector: ChartsSelector<ChartState<TSignatures>, TArgs, TValue>, args?: TArgs, equals?: (a: TValue, b: TValue) => boolean) => TValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChartStore } from '../plugins/utils/ChartStore';
|
|
2
|
+
import { UseChartInteractionSignature } from '../plugins/featurePlugins/useChartInteraction';
|
|
3
|
+
import { UseChartHighlightSignature } from '../plugins/featurePlugins/useChartHighlight';
|
|
4
|
+
import { ChartAnyPluginSignature } from '../plugins/models';
|
|
5
|
+
export declare function useStore<TSignatures extends ChartAnyPluginSignature[] = []>(): ChartStore<[
|
|
6
|
+
...TSignatures,
|
|
7
|
+
UseChartInteractionSignature,
|
|
8
|
+
UseChartHighlightSignature
|
|
9
|
+
]>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useChartContext } from "../../context/ChartProvider/index.js";
|
|
2
|
+
// This hook should be removed because user and us should not interact with the store directly, but with public/private APIs
|
|
3
|
+
export function useStore() {
|
|
4
|
+
const context = useChartContext();
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error(['MUI X: Could not find the charts context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
7
|
+
}
|
|
8
|
+
return context.store;
|
|
9
|
+
}
|
package/models/axis.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ScaleBand, ScaleLogarithmic, ScalePower, ScaleTime, ScaleLinear, ScalePoint, ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
|
|
2
|
-
import { SxProps } from '@mui/system';
|
|
2
|
+
import { SxProps } from '@mui/system/styleFunctionSx';
|
|
3
3
|
import { ChartsAxisClasses } from '../ChartsAxis/axisClasses';
|
|
4
4
|
import type { TickParams } from '../hooks/useTicks';
|
|
5
5
|
import { ChartsTextProps } from '../ChartsText';
|
|
@@ -58,12 +58,6 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
58
58
|
* @default 'currentColor'
|
|
59
59
|
*/
|
|
60
60
|
fill?: string;
|
|
61
|
-
/**
|
|
62
|
-
* The font size of the axis ticks text.
|
|
63
|
-
* @default 12
|
|
64
|
-
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
65
|
-
*/
|
|
66
|
-
tickFontSize?: number;
|
|
67
61
|
/**
|
|
68
62
|
* The style applied to ticks text.
|
|
69
63
|
*/
|
|
@@ -83,12 +77,6 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
83
77
|
* The label of the axis.
|
|
84
78
|
*/
|
|
85
79
|
label?: string;
|
|
86
|
-
/**
|
|
87
|
-
* The font size of the axis label.
|
|
88
|
-
* @default 14
|
|
89
|
-
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
90
|
-
*/
|
|
91
|
-
labelFontSize?: number;
|
|
92
80
|
/**
|
|
93
81
|
* The stroke color of the axis line.
|
|
94
82
|
* @default 'currentColor'
|
|
@@ -305,3 +293,20 @@ export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): s
|
|
|
305
293
|
export declare function isPointScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'point'> & {
|
|
306
294
|
scaleType: 'point';
|
|
307
295
|
};
|
|
296
|
+
/**
|
|
297
|
+
* The data format returned by onAxisClick.
|
|
298
|
+
*/
|
|
299
|
+
export interface ChartsAxisData {
|
|
300
|
+
/**
|
|
301
|
+
* The index in the axis' data property.
|
|
302
|
+
*/
|
|
303
|
+
dataIndex: number;
|
|
304
|
+
/**
|
|
305
|
+
* Tha value associated to the axis item.
|
|
306
|
+
*/
|
|
307
|
+
axisValue: number | Date | string;
|
|
308
|
+
/**
|
|
309
|
+
* The mapping of series ids to their value for this particular axis index.
|
|
310
|
+
*/
|
|
311
|
+
seriesValues: Record<string, number | null | undefined>;
|
|
312
|
+
}
|
package/models/axis.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of curve to use for the line.
|
|
3
|
+
* Read more about curves at
|
|
4
|
+
* [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
5
|
+
*/
|
|
6
|
+
export type CurveType = 'catmullRom' | 'linear' | 'monotoneX' | 'monotoneY' | 'natural' | 'step' | 'stepBefore' | 'stepAfter' | 'bumpY' | 'bumpX';
|
package/models/curve.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './seriesType';
|
|
2
2
|
export * from './layout';
|
|
3
3
|
export * from './stacking';
|
|
4
|
-
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, } from './axis';
|
|
4
|
+
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, } from './axis';
|
|
5
5
|
export type { PropsFromSlot } from '@mui/x-internals/slots';
|
|
6
|
+
export type { Position } from './position';
|
|
7
|
+
export type { CurveType } from './curve';
|
package/models/layout.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChartMargin } from '../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types';
|
|
1
2
|
export interface CardinalDirections<T> {
|
|
2
3
|
top?: T;
|
|
3
4
|
bottom?: T;
|
|
@@ -13,5 +14,5 @@ export type LayoutConfig = {
|
|
|
13
14
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
14
15
|
* @default object Depends on the charts type.
|
|
15
16
|
*/
|
|
16
|
-
margin?: Partial<
|
|
17
|
+
margin?: Partial<ChartMargin>;
|
|
17
18
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartsLabelMarkProps } from '../../ChartsLabel';
|
|
2
|
+
import { HighlightScope } from '../../internals/plugins/featurePlugins/useChartHighlight/highlightConfig.types';
|
|
2
3
|
import type { StackOffsetType, StackOrderType } from '../stacking';
|
|
3
4
|
export type SeriesId = number | string;
|
|
4
5
|
export type SeriesValueFormatterContext = {
|
|
@@ -22,6 +23,12 @@ export type CommonSeriesType<TValue> = {
|
|
|
22
23
|
* The scope to apply when the series is highlighted.
|
|
23
24
|
*/
|
|
24
25
|
highlightScope?: Partial<HighlightScope>;
|
|
26
|
+
/**
|
|
27
|
+
* Defines the mark type for the series.
|
|
28
|
+
*
|
|
29
|
+
* There is a default mark type for each series type.
|
|
30
|
+
*/
|
|
31
|
+
labelMarkType?: ChartsLabelMarkProps['type'];
|
|
25
32
|
};
|
|
26
33
|
export type CommonDefaultizedProps = 'id' | 'valueFormatter' | 'data';
|
|
27
34
|
export type CartesianSeriesType = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import type { StackOffsetType } from '../stacking';
|
|
3
3
|
import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, StackableSeriesType } from './common';
|
|
4
|
-
|
|
4
|
+
import { CurveType } from '../curve';
|
|
5
5
|
export interface ShowMarkParams<AxisValue = number | Date> {
|
|
6
6
|
/**
|
|
7
7
|
* The item index.
|
|
@@ -46,12 +46,23 @@ export interface LineSeriesType extends CommonSeriesType<number | null>, Cartesi
|
|
|
46
46
|
* @default 'monotoneX'
|
|
47
47
|
*/
|
|
48
48
|
curve?: CurveType;
|
|
49
|
+
/**
|
|
50
|
+
* If `true`, step curve starts and end at the first and last point.
|
|
51
|
+
* By default the line is extended to fill the space before and after.
|
|
52
|
+
*/
|
|
53
|
+
strictStepCurve?: boolean;
|
|
49
54
|
/**
|
|
50
55
|
* Define which items of the series should display a mark.
|
|
51
56
|
* If can be a boolean that applies to all items.
|
|
52
57
|
* Or a callback that gets some item properties and returns true if the item should be displayed.
|
|
53
58
|
*/
|
|
54
59
|
showMark?: boolean | ((params: ShowMarkParams) => boolean);
|
|
60
|
+
/**
|
|
61
|
+
* The shape of the mark elements.
|
|
62
|
+
* Using 'circle' renders a `<circle />` element, while all other options render a `<path />` instead. The path causes a small decrease in performance.
|
|
63
|
+
* @default 'circle'
|
|
64
|
+
*/
|
|
65
|
+
shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
|
|
55
66
|
/**
|
|
56
67
|
* Do not render the line highlight item if set to `true`.
|
|
57
68
|
* @default false
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { PieArcDatum as D3PieArcDatum } from '@mui/x-charts-vendor/d3-shape';
|
|
2
2
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
import { CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';
|
|
4
|
+
import type { ChartsLabelMarkProps } from '../../ChartsLabel';
|
|
4
5
|
export type PieItemId = string | number;
|
|
5
6
|
export type PieValueType = {
|
|
6
7
|
/**
|
|
7
8
|
* A unique identifier of the pie slice.
|
|
8
9
|
*/
|
|
9
|
-
id
|
|
10
|
+
id?: PieItemId;
|
|
10
11
|
value: number;
|
|
11
12
|
/**
|
|
12
13
|
* The label to display on the tooltip, arc, or the legend. It can be a string or a function.
|
|
13
14
|
*/
|
|
14
15
|
label?: string | ((location: 'tooltip' | 'legend' | 'arc') => string);
|
|
15
16
|
color?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Defines the mark type for the pie item.
|
|
19
|
+
* @default 'circle'
|
|
20
|
+
*/
|
|
21
|
+
labelMarkType?: ChartsLabelMarkProps['type'];
|
|
16
22
|
};
|
|
17
23
|
export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'data'> & {
|
|
18
24
|
color: string;
|
|
@@ -7,9 +7,9 @@ export type ScatterValueType = {
|
|
|
7
7
|
/**
|
|
8
8
|
* A unique identifier for the scatter point
|
|
9
9
|
*/
|
|
10
|
-
id
|
|
10
|
+
id?: string | number;
|
|
11
11
|
};
|
|
12
|
-
export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType>, CartesianSeriesType {
|
|
12
|
+
export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null>, CartesianSeriesType {
|
|
13
13
|
type: 'scatter';
|
|
14
14
|
data?: ScatterValueType[];
|
|
15
15
|
markerSize?: number;
|
|
@@ -48,7 +48,7 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType>, C
|
|
|
48
48
|
/**
|
|
49
49
|
* The key used to retrieve data from the dataset for the id.
|
|
50
50
|
*/
|
|
51
|
-
id
|
|
51
|
+
id?: string;
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
@@ -15,6 +15,7 @@ export function AnimatedBarElement(props) {
|
|
|
15
15
|
} = props,
|
|
16
16
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
17
|
return /*#__PURE__*/_jsx(animated.rect, _extends({}, other, {
|
|
18
|
+
// @ts-expect-error
|
|
18
19
|
filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
|
|
19
20
|
opacity: ownerState.isFaded ? 0.3 : 1
|
|
20
21
|
}));
|
|
@@ -5,16 +5,18 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import { BarPlot } from "./BarPlot.js";
|
|
8
|
-
import { ChartContainer } from "../ChartContainer/index.js";
|
|
9
8
|
import { ChartsAxis } from "../ChartsAxis/index.js";
|
|
10
9
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
11
10
|
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
12
11
|
import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
|
|
13
12
|
import { ChartsClipPath } from "../ChartsClipPath/index.js";
|
|
14
13
|
import { ChartsGrid } from "../ChartsGrid/index.js";
|
|
15
|
-
import { ChartsOnAxisClickHandler } from "../ChartsOnAxisClickHandler/index.js";
|
|
16
14
|
import { ChartsOverlay } from "../ChartsOverlay/ChartsOverlay.js";
|
|
17
15
|
import { useBarChartProps } from "./useBarChartProps.js";
|
|
16
|
+
import { ChartDataProvider } from "../ChartDataProvider/index.js";
|
|
17
|
+
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
18
|
+
import { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
|
|
19
|
+
import { ChartsWrapper } from "../internals/components/ChartsWrapper/index.js";
|
|
18
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
21
|
/**
|
|
20
22
|
* Demos:
|
|
@@ -33,9 +35,9 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
|
|
|
33
35
|
name: 'MuiBarChart'
|
|
34
36
|
});
|
|
35
37
|
const {
|
|
38
|
+
chartsWrapperProps,
|
|
36
39
|
chartContainerProps,
|
|
37
40
|
barPlotProps,
|
|
38
|
-
axisClickHandlerProps,
|
|
39
41
|
gridProps,
|
|
40
42
|
clipPathProps,
|
|
41
43
|
clipPathGroupProps,
|
|
@@ -45,13 +47,19 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
|
|
|
45
47
|
legendProps,
|
|
46
48
|
children
|
|
47
49
|
} = useBarChartProps(props);
|
|
50
|
+
const {
|
|
51
|
+
chartDataProviderProps,
|
|
52
|
+
chartsSurfaceProps
|
|
53
|
+
} = useChartContainerProps(chartContainerProps, ref);
|
|
48
54
|
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
49
|
-
return /*#__PURE__*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps, {
|
|
56
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
57
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
58
|
+
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
59
|
+
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
60
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
61
|
+
}))]
|
|
62
|
+
}))
|
|
55
63
|
}));
|
|
56
64
|
});
|
|
57
65
|
process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
@@ -59,6 +67,9 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
59
67
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
60
68
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
61
69
|
// ----------------------------------------------------------------------
|
|
70
|
+
apiRef: PropTypes.shape({
|
|
71
|
+
current: PropTypes.object
|
|
72
|
+
}),
|
|
62
73
|
/**
|
|
63
74
|
* The configuration of axes highlight.
|
|
64
75
|
* Default is set to 'band' in the bar direction.
|
|
@@ -91,7 +102,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
91
102
|
className: PropTypes.string,
|
|
92
103
|
/**
|
|
93
104
|
* Color palette used to colorize multiple series.
|
|
94
|
-
* @default
|
|
105
|
+
* @default rainbowSurgePalette
|
|
95
106
|
*/
|
|
96
107
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
97
108
|
/**
|
|
@@ -121,12 +132,18 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
121
132
|
*/
|
|
122
133
|
hideLegend: PropTypes.bool,
|
|
123
134
|
/**
|
|
124
|
-
* The
|
|
135
|
+
* The highlighted item.
|
|
136
|
+
* Used when the highlight is controlled.
|
|
125
137
|
*/
|
|
126
138
|
highlightedItem: PropTypes.shape({
|
|
127
139
|
dataIndex: PropTypes.number,
|
|
128
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
140
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
129
141
|
}),
|
|
142
|
+
/**
|
|
143
|
+
* This prop is used to help implement the accessibility logic.
|
|
144
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
145
|
+
*/
|
|
146
|
+
id: PropTypes.string,
|
|
130
147
|
/**
|
|
131
148
|
* The direction of the bar elements.
|
|
132
149
|
* @default 'vertical'
|
|
@@ -147,7 +164,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
147
164
|
* The margin between the SVG and the drawing area.
|
|
148
165
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
149
166
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
150
|
-
* @default object Depends on the charts type.
|
|
151
167
|
*/
|
|
152
168
|
margin: PropTypes.shape({
|
|
153
169
|
bottom: PropTypes.number,
|
|
@@ -201,6 +217,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
201
217
|
*/
|
|
202
218
|
slots: PropTypes.object,
|
|
203
219
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
220
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
204
221
|
title: PropTypes.string,
|
|
205
222
|
/**
|
|
206
223
|
* Indicate which axis to display the top of the charts.
|
|
@@ -243,7 +260,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
243
260
|
hideTooltip: PropTypes.bool,
|
|
244
261
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
245
262
|
label: PropTypes.string,
|
|
246
|
-
labelFontSize: PropTypes.number,
|
|
247
263
|
labelStyle: PropTypes.object,
|
|
248
264
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
249
265
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -254,7 +270,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
254
270
|
slots: PropTypes.object,
|
|
255
271
|
stroke: PropTypes.string,
|
|
256
272
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
257
|
-
tickFontSize: PropTypes.number,
|
|
258
273
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
259
274
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
260
275
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -297,7 +312,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
297
312
|
hideTooltip: PropTypes.bool,
|
|
298
313
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
299
314
|
label: PropTypes.string,
|
|
300
|
-
labelFontSize: PropTypes.number,
|
|
301
315
|
labelStyle: PropTypes.object,
|
|
302
316
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
303
317
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -308,7 +322,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
308
322
|
slots: PropTypes.object,
|
|
309
323
|
stroke: PropTypes.string,
|
|
310
324
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
311
|
-
tickFontSize: PropTypes.number,
|
|
312
325
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
313
326
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
314
327
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useChartZAxis } from "../internals/plugins/featurePlugins/useChartZAxis/index.js";
|
|
2
|
+
import { useChartCartesianAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
|
+
import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
|
+
import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
+
export const BAR_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight];
|
|
@@ -10,7 +10,7 @@ import useSlotProps from '@mui/utils/useSlotProps';
|
|
|
10
10
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
11
11
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
12
12
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
13
|
-
import { useItemHighlighted } from "../
|
|
13
|
+
import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
|
|
14
14
|
import { AnimatedBarElement } from "./AnimatedBarElement.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export function getBarElementUtilityClass(slot) {
|
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { useUtilityClasses } from "./barLabelClasses.js";
|
|
9
9
|
import { getBarLabel } from "./getBarLabel.js";
|
|
10
10
|
import { BarLabel } from "./BarLabel.js";
|
|
11
|
-
import { useItemHighlighted } from "../../
|
|
11
|
+
import { useItemHighlighted } from "../../hooks/useItemHighlighted.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
14
14
|
* @ignore - internal component.
|
|
@@ -46,7 +46,7 @@ function BarLabelPlot(props) {
|
|
|
46
46
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
47
|
const barLabelTransition = useTransition(bars, {
|
|
48
48
|
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
49
|
-
from: leaveStyle,
|
|
49
|
+
from: skipAnimation ? undefined : leaveStyle,
|
|
50
50
|
leave: null,
|
|
51
51
|
enter: enterStyle,
|
|
52
52
|
update: enterStyle,
|
|
@@ -7,16 +7,15 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useTransition } from '@react-spring/web';
|
|
9
9
|
import { styled } from '@mui/material/styles';
|
|
10
|
-
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
11
10
|
import { BarElement, barElementClasses } from "./BarElement.js";
|
|
12
11
|
import getColor from "./getColor.js";
|
|
13
|
-
import { useChartId, useDrawingArea } from "../hooks/index.js";
|
|
12
|
+
import { useChartId, useDrawingArea, useXAxes, useYAxes } from "../hooks/index.js";
|
|
14
13
|
import { BarClipPath } from "./BarClipPath.js";
|
|
15
14
|
import { BarLabelPlot } from "./BarLabel/BarLabelPlot.js";
|
|
16
15
|
import { checkScaleErrors } from "./checkScaleErrors.js";
|
|
17
16
|
import { useBarSeries } from "../hooks/useSeries.js";
|
|
18
17
|
import { useSkipAnimation } from "../context/AnimationProvider/index.js";
|
|
19
|
-
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
/**
|
|
21
20
|
* Solution of the equations
|
|
22
21
|
* W = barWidth * N + offset * (N-1)
|
|
@@ -26,7 +25,6 @@ import { useSkipAnimation } from "../context/AnimationProvider/index.js";
|
|
|
26
25
|
* @param gapRatio The ratio of the gap between bars over the bar width.
|
|
27
26
|
* @returns The bar width and the offset between bars.
|
|
28
27
|
*/
|
|
29
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
28
|
function getBandSize({
|
|
31
29
|
bandWidth: W,
|
|
32
30
|
numberOfGroups: N,
|
|
@@ -51,7 +49,6 @@ const useAggregatedData = () => {
|
|
|
51
49
|
stackingGroups: [],
|
|
52
50
|
seriesOrder: []
|
|
53
51
|
};
|
|
54
|
-
const axisData = useCartesianContext();
|
|
55
52
|
const drawingArea = useDrawingArea();
|
|
56
53
|
const chartId = useChartId();
|
|
57
54
|
const {
|
|
@@ -60,10 +57,12 @@ const useAggregatedData = () => {
|
|
|
60
57
|
} = seriesData;
|
|
61
58
|
const {
|
|
62
59
|
xAxis,
|
|
60
|
+
xAxisIds
|
|
61
|
+
} = useXAxes();
|
|
62
|
+
const {
|
|
63
63
|
yAxis,
|
|
64
|
-
xAxisIds,
|
|
65
64
|
yAxisIds
|
|
66
|
-
} =
|
|
65
|
+
} = useYAxes();
|
|
67
66
|
const defaultXAxisId = xAxisIds[0];
|
|
68
67
|
const defaultYAxisId = yAxisIds[0];
|
|
69
68
|
const masks = {};
|
|
@@ -217,7 +216,7 @@ function BarPlot(props) {
|
|
|
217
216
|
const withoutBorderRadius = !borderRadius || borderRadius <= 0;
|
|
218
217
|
const transition = useTransition(completedData, {
|
|
219
218
|
keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
|
|
220
|
-
from: leaveStyle,
|
|
219
|
+
from: skipAnimation ? undefined : leaveStyle,
|
|
221
220
|
leave: leaveStyle,
|
|
222
221
|
enter: enterStyle,
|
|
223
222
|
update: enterStyle,
|
|
@@ -225,7 +224,7 @@ function BarPlot(props) {
|
|
|
225
224
|
});
|
|
226
225
|
const maskTransition = useTransition(withoutBorderRadius ? [] : masksData, {
|
|
227
226
|
keys: v => v.id,
|
|
228
|
-
from: leaveStyle,
|
|
227
|
+
from: skipAnimation ? undefined : leaveStyle,
|
|
229
228
|
leave: leaveStyle,
|
|
230
229
|
enter: enterStyle,
|
|
231
230
|
update: enterStyle,
|
|
@@ -45,7 +45,8 @@ const formatter = (params, dataset) => {
|
|
|
45
45
|
ids.forEach((id, index) => {
|
|
46
46
|
const dataKey = series[id].dataKey;
|
|
47
47
|
completedSeries[id] = _extends({
|
|
48
|
-
layout: 'vertical'
|
|
48
|
+
layout: 'vertical',
|
|
49
|
+
labelMarkType: 'square'
|
|
49
50
|
}, series[id], {
|
|
50
51
|
data: dataKey ? dataset.map(data => {
|
|
51
52
|
const value = data[dataKey];
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
2
2
|
import formatter from "./formatter.js";
|
|
3
|
+
import legendGetter from "./legend.js";
|
|
3
4
|
import getColor from "./getColor.js";
|
|
5
|
+
import tooltipGetter from "./tooltip.js";
|
|
4
6
|
export const plugin = {
|
|
5
|
-
|
|
6
|
-
seriesFormatter: formatter,
|
|
7
|
+
seriesProcessor: formatter,
|
|
7
8
|
colorProcessor: getColor,
|
|
9
|
+
legendGetter,
|
|
10
|
+
tooltipGetter,
|
|
8
11
|
xExtremumGetter: getExtremumX,
|
|
9
12
|
yExtremumGetter: getExtremumY
|
|
10
13
|
};
|