@mui/x-charts 8.0.0-alpha.0 → 8.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/AnimatedBarElement.d.ts +15 -0
- package/BarChart/AnimatedBarElement.js +22 -0
- package/BarChart/BarChart.d.ts +5 -10
- package/BarChart/BarChart.js +31 -44
- package/BarChart/BarElement.d.ts +5 -1342
- package/BarChart/BarElement.js +11 -21
- 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 +20 -11
- 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 +5 -5
- package/BarChart/useBarChartProps.js +18 -11
- package/CHANGELOG.md +2215 -119
- package/ChartContainer/ChartContainer.d.ts +32 -21
- package/ChartContainer/ChartContainer.js +48 -35
- package/ChartContainer/useChartContainerProps.d.ts +11 -11
- package/ChartContainer/useChartContainerProps.js +17 -30
- package/ChartDataProvider/ChartDataProvider.d.ts +41 -0
- package/ChartDataProvider/ChartDataProvider.js +94 -0
- package/ChartDataProvider/package.json +6 -0
- 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/ChartsAxisHighlight.d.ts +1 -17
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
- package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
- package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
- package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
- package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
- package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
- package/ChartsAxisHighlight/index.d.ts +3 -0
- package/ChartsAxisHighlight/index.js +4 -1
- package/ChartsGrid/ChartsGrid.js +10 -6
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +7 -6
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +7 -6
- 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/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +16 -13
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.d.ts +14 -15
- package/ChartsSurface/ChartsSurface.js +60 -38
- package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
- package/ChartsTooltip/ChartsAxisTooltipContent.js +88 -72
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
- package/ChartsTooltip/ChartsItemTooltipContent.js +57 -44
- package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
- package/ChartsTooltip/ChartsTooltip.js +143 -145
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
- package/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/ChartsTooltip/ChartsTooltipTable.d.ts +0 -6
- package/ChartsTooltip/ChartsTooltipTable.js +15 -33
- package/ChartsTooltip/chartsTooltipClasses.d.ts +3 -0
- package/ChartsTooltip/chartsTooltipClasses.js +19 -2
- package/ChartsTooltip/index.d.ts +4 -3
- package/ChartsTooltip/index.js +4 -4
- package/ChartsTooltip/useAxisTooltip.d.ts +5 -3
- package/ChartsTooltip/useAxisTooltip.js +31 -28
- package/ChartsTooltip/useItemTooltip.d.ts +8 -6
- package/ChartsTooltip/useItemTooltip.js +21 -45
- package/ChartsTooltip/utils.d.ts +0 -3
- package/ChartsTooltip/utils.js +2 -8
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +67 -52
- 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 +37 -71
- package/Gauge/GaugeProvider.js +2 -0
- package/LineChart/AnimatedArea.d.ts +0 -1333
- package/LineChart/AnimatedArea.js +11 -19
- package/LineChart/AnimatedLine.d.ts +0 -1333
- package/LineChart/AnimatedLine.js +11 -21
- package/LineChart/AppearingMask.js +2 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/AreaPlot.js +72 -28
- package/LineChart/CircleMarkElement.d.ts +0 -4
- package/LineChart/CircleMarkElement.js +10 -13
- package/LineChart/LineChart.d.ts +4 -14
- package/LineChart/LineChart.js +34 -52
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineHighlightElement.d.ts +5 -1
- package/LineChart/LineHighlightElement.js +29 -9
- package/LineChart/LineHighlightPlot.js +23 -17
- package/LineChart/LinePlot.js +72 -27
- package/LineChart/MarkElement.js +10 -7
- 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 +5 -5
- package/LineChart/useLineChartProps.js +19 -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 -9
- package/PieChart/PieChart.js +55 -81
- 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 +3 -3
- package/ScatterChart/Scatter.js +14 -11
- package/ScatterChart/ScatterChart.d.ts +5 -12
- package/ScatterChart/ScatterChart.js +33 -49
- 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 +5 -7
- package/ScatterChart/useScatterChartProps.js +17 -15
- package/SparkLineChart/SparkLineChart.d.ts +5 -6
- package/SparkLineChart/SparkLineChart.js +20 -44
- package/colorPalettes/colorPalettes.d.ts +3 -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 +39 -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 -3
- package/context/index.js +1 -2
- 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.js +42 -25
- 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 -20
- 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 -0
- package/index.js +4 -2
- package/internals/calculateMargins.d.ts +7 -0
- package/internals/calculateMargins.js +25 -0
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -3
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +71 -33
- 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 -12
- package/internals/index.js +21 -13
- 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/{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 +51 -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/{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/index.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +68 -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 +75 -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/highlightConfig.types.js +1 -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/useChartHighlight/useChartHighlight.types.js +1 -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/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +62 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -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/useChartZAxis.types.js +1 -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/chart.js +1 -0
- package/internals/plugins/models/helpers.d.ts +7 -0
- package/internals/plugins/models/helpers.js +1 -0
- package/internals/plugins/models/index.d.ts +4 -0
- package/internals/plugins/models/index.js +4 -0
- package/internals/plugins/models/plugin.d.ts +105 -0
- package/internals/plugins/models/plugin.js +1 -0
- package/internals/plugins/models/seriesConfig/colorProcessor.types.d.ts +5 -0
- package/internals/plugins/models/seriesConfig/colorProcessor.types.js +1 -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 +13 -0
- package/internals/plugins/utils/ChartStore.js +24 -0
- package/internals/plugins/utils/selectors.d.ts +9 -0
- package/internals/plugins/utils/selectors.js +37 -0
- 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/useSelector.js +6 -0
- package/internals/store/useStore.d.ts +9 -0
- package/internals/store/useStore.js +9 -0
- package/models/axis.d.ts +1 -13
- package/models/curve.d.ts +6 -0
- package/models/curve.js +1 -0
- package/models/index.d.ts +2 -0
- 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 +22 -0
- package/modern/BarChart/BarChart.js +31 -44
- package/modern/BarChart/BarElement.js +11 -21
- package/modern/BarChart/BarLabel/BarLabelItem.js +1 -1
- package/modern/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/modern/BarChart/BarPlot.js +20 -11
- 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 +18 -11
- package/modern/ChartContainer/ChartContainer.js +48 -35
- package/modern/ChartContainer/useChartContainerProps.js +17 -30
- package/modern/ChartDataProvider/ChartDataProvider.js +94 -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/ChartsAxisHighlight.js +10 -96
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
- package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
- package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
- package/modern/ChartsAxisHighlight/index.js +4 -1
- package/modern/ChartsGrid/ChartsGrid.js +10 -6
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +7 -6
- package/modern/ChartsGrid/ChartsVerticalGrid.js +7 -6
- 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/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +16 -13
- package/modern/ChartsSurface/ChartsSurface.js +60 -38
- package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +88 -72
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +57 -44
- package/modern/ChartsTooltip/ChartsTooltip.js +143 -145
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/modern/ChartsTooltip/ChartsTooltipTable.js +15 -33
- package/modern/ChartsTooltip/chartsTooltipClasses.js +19 -2
- package/modern/ChartsTooltip/index.js +4 -4
- package/modern/ChartsTooltip/useAxisTooltip.js +31 -28
- package/modern/ChartsTooltip/useItemTooltip.js +21 -45
- package/modern/ChartsTooltip/utils.js +2 -8
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +67 -52
- 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 +37 -71
- package/modern/Gauge/GaugeProvider.js +2 -0
- package/modern/LineChart/AnimatedArea.js +11 -19
- package/modern/LineChart/AnimatedLine.js +11 -21
- package/modern/LineChart/AppearingMask.js +2 -1
- package/modern/LineChart/AreaElement.js +1 -1
- package/modern/LineChart/AreaPlot.js +72 -28
- package/modern/LineChart/CircleMarkElement.js +10 -13
- package/modern/LineChart/LineChart.js +34 -52
- package/modern/LineChart/LineElement.js +1 -1
- package/modern/LineChart/LineHighlightElement.js +29 -9
- package/modern/LineChart/LineHighlightPlot.js +23 -17
- package/modern/LineChart/LinePlot.js +72 -27
- package/modern/LineChart/MarkElement.js +10 -7
- 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 +19 -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 +55 -81
- 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 +14 -11
- package/modern/ScatterChart/ScatterChart.js +33 -49
- 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 +17 -15
- package/modern/SparkLineChart/SparkLineChart.js +20 -44
- 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 -2
- package/modern/hooks/index.js +6 -1
- package/modern/hooks/useAxis.js +32 -6
- package/modern/hooks/useAxisEvents.js +42 -25
- 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 -20
- 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 -2
- package/modern/internals/calculateMargins.js +25 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +71 -33
- 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 -13
- 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/modern/{context/SeriesProvider → 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/modern/{context/ChartDataProvider/useDefaultizeAxis.js → internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +3 -11
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +22 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +5 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +68 -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/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- 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 -0
- 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 +24 -0
- package/modern/internals/plugins/utils/selectors.js +37 -0
- 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/useSelector.js +6 -0
- package/modern/internals/store/useStore.js +9 -0
- package/modern/models/curve.js +1 -0
- package/modern/models/position.js +1 -0
- package/node/BarChart/AnimatedBarElement.js +29 -0
- package/node/BarChart/BarChart.js +31 -44
- package/node/BarChart/BarElement.js +13 -23
- package/node/BarChart/BarLabel/BarLabelItem.js +2 -2
- package/node/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/node/BarChart/BarPlot.js +17 -7
- 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 +17 -11
- package/node/ChartContainer/ChartContainer.js +48 -35
- package/node/ChartContainer/useChartContainerProps.js +17 -30
- package/node/ChartDataProvider/ChartDataProvider.js +100 -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/ChartsAxisHighlight.js +12 -100
- package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
- package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
- package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
- package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
- package/node/ChartsAxisHighlight/index.js +33 -0
- package/node/ChartsGrid/ChartsGrid.js +11 -7
- package/node/ChartsGrid/ChartsHorizontalGrid.js +8 -7
- package/node/ChartsGrid/ChartsVerticalGrid.js +8 -7
- 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/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +15 -12
- package/node/ChartsSurface/ChartsSurface.js +60 -38
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +88 -73
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +57 -45
- package/node/ChartsTooltip/ChartsTooltip.js +142 -144
- package/node/ChartsTooltip/ChartsTooltipContainer.js +286 -0
- package/node/ChartsTooltip/ChartsTooltipTable.js +16 -34
- package/node/ChartsTooltip/chartsTooltipClasses.js +23 -3
- package/node/ChartsTooltip/index.js +32 -29
- package/node/ChartsTooltip/useAxisTooltip.js +31 -29
- package/node/ChartsTooltip/useItemTooltip.js +21 -47
- package/node/ChartsTooltip/utils.js +1 -9
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +70 -55
- 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 +37 -71
- package/node/Gauge/GaugeProvider.js +2 -2
- package/node/LineChart/AnimatedArea.js +11 -20
- package/node/LineChart/AnimatedLine.js +11 -22
- package/node/LineChart/AppearingMask.js +2 -1
- package/node/LineChart/AreaElement.js +2 -2
- package/node/LineChart/AreaPlot.js +71 -27
- package/node/LineChart/CircleMarkElement.js +11 -14
- package/node/LineChart/LineChart.js +34 -52
- package/node/LineChart/LineElement.js +2 -2
- package/node/LineChart/LineHighlightElement.js +29 -9
- package/node/LineChart/LineHighlightPlot.js +23 -17
- package/node/LineChart/LinePlot.js +71 -26
- package/node/LineChart/MarkElement.js +11 -8
- 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 +18 -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 +55 -81
- 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 +14 -11
- package/node/ScatterChart/ScatterChart.js +33 -49
- 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 +16 -15
- package/node/SparkLineChart/SparkLineChart.js +19 -43
- 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/ChartProvider.types.js +5 -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 -23
- package/node/hooks/index.js +65 -2
- package/node/hooks/useAxis.js +34 -6
- package/node/hooks/useAxisEvents.js +43 -25
- 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 -21
- 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 -1
- package/node/internals/calculateMargins.js +33 -0
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +70 -33
- 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 +139 -67
- 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/useChartDimensions/useChartDimensions.types.js +5 -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.types.js +5 -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/useChartSeries.types.js +5 -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/index.js +59 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +76 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +98 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js +5 -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/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +16 -0
- 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 +49 -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 +31 -0
- package/node/internals/plugins/utils/selectors.js +44 -0
- 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/useSelector.js +13 -0
- package/node/internals/store/useStore.js +15 -0
- package/node/models/curve.js +5 -0
- package/node/models/position.js +5 -0
- package/package.json +9 -6
- package/themeAugmentation/props.d.ts +1 -2
- package/ChartContainer/ResizableContainer.d.ts +0 -9
- package/ChartContainer/ResizableContainer.js +0 -26
- package/ChartContainer/useChartContainerDimensions.d.ts +0 -6
- package/ChartContainer/useChartContainerDimensions.js +0 -98
- 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/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- 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 -41
- package/context/ChartDataProvider/ChartDataProvider.js +0 -263
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +0 -97
- package/context/ChartDataProvider/useChartDataProviderProps.js +0 -86
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +0 -41
- package/context/DrawingProvider.d.ts +0 -62
- package/context/DrawingProvider.js +0 -78
- 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 -50
- package/context/InteractionProvider.js +0 -78
- 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/ZAxisContextProvider.d.ts +0 -33
- package/context/ZAxisContextProvider.js +0 -96
- package/internals/computeAxisValue.d.ts +0 -38
- package/modern/ChartContainer/ResizableContainer.js +0 -26
- package/modern/ChartContainer/useChartContainerDimensions.js +0 -98
- 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/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- 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 -263
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +0 -86
- package/modern/context/DrawingProvider.js +0 -78
- 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 -78
- 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/ZAxisContextProvider.js +0 -96
- package/node/ChartContainer/ResizableContainer.js +0 -32
- package/node/ChartContainer/useChartContainerDimensions.js +0 -106
- 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/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- 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 -269
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +0 -94
- package/node/context/DrawingProvider.js +0 -87
- 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 -85
- 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/ZAxisContextProvider.js +0 -103
- /package/{context/ChartDataProvider → ChartDataProvider}/index.d.ts +0 -0
- /package/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/{context/CartesianProvider/Cartesian.types.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
- /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
- /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/{context/PluginProvider/ColorProcessor.types.js → ChartsLegend/colorLegend.types.js} +0 -0
- /package/{context/PluginProvider/ExtremumGetter.types.js → ChartsLegend/direction.js} +0 -0
- /package/{context/PluginProvider/Plugin.types.js → ChartsLegend/legendContext.types.js} +0 -0
- /package/{context/PluginProvider/SeriesFormatter.types.js → ChartsLegend/piecewiseColorLegend.types.js} +0 -0
- /package/{context/SeriesProvider/Series.types.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
- /package/{modern/context/CartesianProvider/Cartesian.types.js → context/ChartProvider/ChartProvider.types.js} +0 -0
- /package/{modern/context/PluginProvider/ColorProcessor.types.js → internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js} +0 -0
- /package/{modern/context/PluginProvider/ExtremumGetter.types.js → internals/plugins/corePlugins/useChartId/useChartId.types.js} +0 -0
- /package/{modern/context/PluginProvider/Plugin.types.js → internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js} +0 -0
- /package/{modern/context/PluginProvider/SeriesFormatter.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/SeriesProvider/Series.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js} +0 -0
- /package/modern/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/modern/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/node/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/node/{context/CartesianProvider/Cartesian.types.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
- /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/{context/PluginProvider/ColorProcessor.types.js → ChartsLegend/colorLegend.types.js} +0 -0
- /package/node/{context/PluginProvider/ExtremumGetter.types.js → ChartsLegend/direction.js} +0 -0
- /package/node/{context/PluginProvider/Plugin.types.js → ChartsLegend/legendContext.types.js} +0 -0
- /package/node/{context/PluginProvider/SeriesFormatter.types.js → ChartsLegend/piecewiseColorLegend.types.js} +0 -0
- /package/node/{context/SeriesProvider/Series.types.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
- /package/node/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Implements the same behavior as `useControlled` but for several models.
|
|
5
|
+
* The controlled models are never stored in the state, and the state is only updated if the model is not controlled.
|
|
6
|
+
*/
|
|
7
|
+
export const useChartModels = (plugins, props) => {
|
|
8
|
+
const modelsRef = React.useRef({});
|
|
9
|
+
const [modelsState, setModelsState] = React.useState(() => {
|
|
10
|
+
const initialState = {};
|
|
11
|
+
plugins.forEach(plugin => {
|
|
12
|
+
if (plugin.models) {
|
|
13
|
+
Object.entries(plugin.models).forEach(([modelName, modelInitializer]) => {
|
|
14
|
+
modelsRef.current[modelName] = {
|
|
15
|
+
isControlled: props[modelName] !== undefined,
|
|
16
|
+
getDefaultValue: modelInitializer.getDefaultValue
|
|
17
|
+
};
|
|
18
|
+
initialState[modelName] = modelInitializer.getDefaultValue(props);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return initialState;
|
|
23
|
+
});
|
|
24
|
+
const models = Object.fromEntries(Object.entries(modelsRef.current).map(([modelName, model]) => {
|
|
25
|
+
const value = props[modelName] ?? modelsState[modelName];
|
|
26
|
+
return [modelName, {
|
|
27
|
+
value,
|
|
28
|
+
setControlledValue: newValue => {
|
|
29
|
+
if (!model.isControlled) {
|
|
30
|
+
setModelsState(prevState => _extends({}, prevState, {
|
|
31
|
+
[modelName]: typeof newValue === 'function' ? newValue(value) : newValue
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
isControlled: modelsRef.current[modelName].isControlled
|
|
36
|
+
}];
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
// We know that `modelsRef` do not vary across renders.
|
|
40
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
41
|
+
Object.entries(modelsRef.current).forEach(([modelName, model]) => {
|
|
42
|
+
const controlled = props[modelName];
|
|
43
|
+
const newDefaultValue = model.getDefaultValue(props);
|
|
44
|
+
|
|
45
|
+
/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps, react-compiler/react-compiler */
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
if (model.isControlled !== (controlled !== undefined)) {
|
|
48
|
+
console.error([`MUI X: A component is changing the ${model.isControlled ? '' : 'un'}controlled ${modelName} state of Chart to be ${model.isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${modelName} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
|
|
49
|
+
}
|
|
50
|
+
}, [controlled]);
|
|
51
|
+
const {
|
|
52
|
+
current: defaultValue
|
|
53
|
+
} = React.useRef(newDefaultValue);
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
if (!model.isControlled && defaultValue !== newDefaultValue) {
|
|
56
|
+
console.error([`MUI X: A component is changing the default ${modelName} state of an uncontrolled Chart after being initialized. ` + `To suppress this warning opt to use a controlled Chart.`].join('\n'));
|
|
57
|
+
}
|
|
58
|
+
}, [JSON.stringify(newDefaultValue)]);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/* eslint-enable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
|
|
62
|
+
|
|
63
|
+
return models;
|
|
64
|
+
};
|
|
@@ -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,6 @@
|
|
|
1
|
+
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector';
|
|
2
|
+
const defaultCompare = Object.is;
|
|
3
|
+
export const useSelector = (store, selector, args = undefined, equals = defaultCompare) => {
|
|
4
|
+
const selectorWithArgs = state => selector(state, args);
|
|
5
|
+
return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, selectorWithArgs, equals);
|
|
6
|
+
};
|
|
@@ -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'
|
|
@@ -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
|
@@ -3,3 +3,5 @@ export * from './layout';
|
|
|
3
3
|
export * from './stacking';
|
|
4
4
|
export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, } 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
|
/**
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["ownerState"];
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { animated } from '@react-spring/web';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* @ignore - internal component.
|
|
11
|
+
*/
|
|
12
|
+
export function AnimatedBarElement(props) {
|
|
13
|
+
const {
|
|
14
|
+
ownerState
|
|
15
|
+
} = props,
|
|
16
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
|
+
return /*#__PURE__*/_jsx(animated.rect, _extends({}, other, {
|
|
18
|
+
// @ts-expect-error
|
|
19
|
+
filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
|
|
20
|
+
opacity: ownerState.isFaded ? 0.3 : 1
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
@@ -5,7 +5,6 @@ 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";
|
|
@@ -15,6 +14,10 @@ import { ChartsGrid } from "../ChartsGrid/index.js";
|
|
|
15
14
|
import { ChartsOnAxisClickHandler } from "../ChartsOnAxisClickHandler/index.js";
|
|
16
15
|
import { ChartsOverlay } from "../ChartsOverlay/ChartsOverlay.js";
|
|
17
16
|
import { useBarChartProps } from "./useBarChartProps.js";
|
|
17
|
+
import { ChartDataProvider } from "../ChartDataProvider/index.js";
|
|
18
|
+
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
19
|
+
import { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
|
|
20
|
+
import { ChartsWrapper } from "../internals/components/ChartsWrapper/index.js";
|
|
18
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
22
|
/**
|
|
20
23
|
* Demos:
|
|
@@ -33,6 +36,7 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
|
|
|
33
36
|
name: 'MuiBarChart'
|
|
34
37
|
});
|
|
35
38
|
const {
|
|
39
|
+
chartsWrapperProps,
|
|
36
40
|
chartContainerProps,
|
|
37
41
|
barPlotProps,
|
|
38
42
|
axisClickHandlerProps,
|
|
@@ -43,15 +47,21 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
|
|
|
43
47
|
chartsAxisProps,
|
|
44
48
|
axisHighlightProps,
|
|
45
49
|
legendProps,
|
|
46
|
-
tooltipProps,
|
|
47
50
|
children
|
|
48
51
|
} = useBarChartProps(props);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const {
|
|
53
|
+
chartDataProviderProps,
|
|
54
|
+
chartsSurfaceProps
|
|
55
|
+
} = useChartContainerProps(chartContainerProps, ref);
|
|
56
|
+
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
57
|
+
return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps, {
|
|
58
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
59
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
60
|
+
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
61
|
+
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
62
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
63
|
+
}))]
|
|
64
|
+
}))
|
|
55
65
|
}));
|
|
56
66
|
});
|
|
57
67
|
process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
@@ -59,11 +69,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
59
69
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
60
70
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
61
71
|
// ----------------------------------------------------------------------
|
|
72
|
+
apiRef: PropTypes.shape({
|
|
73
|
+
current: PropTypes.object
|
|
74
|
+
}),
|
|
62
75
|
/**
|
|
63
76
|
* The configuration of axes highlight.
|
|
64
77
|
* Default is set to 'band' in the bar direction.
|
|
65
78
|
* Depends on `layout` prop.
|
|
66
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
79
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
67
80
|
*/
|
|
68
81
|
axisHighlight: PropTypes.shape({
|
|
69
82
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
@@ -121,12 +134,18 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
121
134
|
*/
|
|
122
135
|
hideLegend: PropTypes.bool,
|
|
123
136
|
/**
|
|
124
|
-
* The
|
|
137
|
+
* The highlighted item.
|
|
138
|
+
* Used when the highlight is controlled.
|
|
125
139
|
*/
|
|
126
140
|
highlightedItem: PropTypes.shape({
|
|
127
141
|
dataIndex: PropTypes.number,
|
|
128
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
142
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
129
143
|
}),
|
|
144
|
+
/**
|
|
145
|
+
* This prop is used to help implement the accessibility logic.
|
|
146
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
147
|
+
*/
|
|
148
|
+
id: PropTypes.string,
|
|
130
149
|
/**
|
|
131
150
|
* The direction of the bar elements.
|
|
132
151
|
* @default 'vertical'
|
|
@@ -147,7 +166,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
147
166
|
* The margin between the SVG and the drawing area.
|
|
148
167
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
149
168
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
150
|
-
* @default object Depends on the charts type.
|
|
151
169
|
*/
|
|
152
170
|
margin: PropTypes.shape({
|
|
153
171
|
bottom: PropTypes.number,
|
|
@@ -174,16 +192,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
174
192
|
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
175
193
|
*/
|
|
176
194
|
onItemClick: PropTypes.func,
|
|
177
|
-
/**
|
|
178
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
179
|
-
* before it renders for the first time.
|
|
180
|
-
*
|
|
181
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
182
|
-
* the first render, like when used inside a grid.
|
|
183
|
-
*
|
|
184
|
-
* @default false
|
|
185
|
-
*/
|
|
186
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
187
195
|
/**
|
|
188
196
|
* Indicate which axis to display the right of the charts.
|
|
189
197
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -211,31 +219,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
211
219
|
*/
|
|
212
220
|
slots: PropTypes.object,
|
|
213
221
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
222
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
214
223
|
title: PropTypes.string,
|
|
215
|
-
/**
|
|
216
|
-
* The configuration of the tooltip.
|
|
217
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
218
|
-
*/
|
|
219
|
-
tooltip: PropTypes.shape({
|
|
220
|
-
axisContent: PropTypes.elementType,
|
|
221
|
-
classes: PropTypes.object,
|
|
222
|
-
itemContent: PropTypes.elementType,
|
|
223
|
-
slotProps: PropTypes.object,
|
|
224
|
-
slots: PropTypes.object,
|
|
225
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
226
|
-
}),
|
|
227
224
|
/**
|
|
228
225
|
* Indicate which axis to display the top of the charts.
|
|
229
226
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
230
227
|
* @default null
|
|
231
228
|
*/
|
|
232
229
|
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
233
|
-
viewBox: PropTypes.shape({
|
|
234
|
-
height: PropTypes.number,
|
|
235
|
-
width: PropTypes.number,
|
|
236
|
-
x: PropTypes.number,
|
|
237
|
-
y: PropTypes.number
|
|
238
|
-
}),
|
|
239
230
|
/**
|
|
240
231
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
241
232
|
*/
|
|
@@ -271,7 +262,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
271
262
|
hideTooltip: PropTypes.bool,
|
|
272
263
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
273
264
|
label: PropTypes.string,
|
|
274
|
-
labelFontSize: PropTypes.number,
|
|
275
265
|
labelStyle: PropTypes.object,
|
|
276
266
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
277
267
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -282,7 +272,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
282
272
|
slots: PropTypes.object,
|
|
283
273
|
stroke: PropTypes.string,
|
|
284
274
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
285
|
-
tickFontSize: PropTypes.number,
|
|
286
275
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
287
276
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
288
277
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -325,7 +314,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
325
314
|
hideTooltip: PropTypes.bool,
|
|
326
315
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
327
316
|
label: PropTypes.string,
|
|
328
|
-
labelFontSize: PropTypes.number,
|
|
329
317
|
labelStyle: PropTypes.object,
|
|
330
318
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
331
319
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -336,7 +324,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
336
324
|
slots: PropTypes.object,
|
|
337
325
|
stroke: PropTypes.string,
|
|
338
326
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
339
|
-
tickFontSize: PropTypes.number,
|
|
340
327
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
341
328
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
342
329
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|