@mui/x-charts 7.22.3 → 8.0.0-alpha.1
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 +21 -0
- package/BarChart/BarChart.d.ts +11 -16
- package/BarChart/BarChart.js +9 -59
- package/BarChart/BarElement.d.ts +6 -1343
- package/BarChart/BarElement.js +10 -20
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarPlot.js +24 -6
- package/BarChart/extremums.js +3 -3
- package/BarChart/useBarChartProps.d.ts +2 -4
- package/BarChart/useBarChartProps.js +4 -11
- package/CHANGELOG.md +348 -12
- package/ChartContainer/ChartContainer.d.ts +4 -38
- package/ChartContainer/ChartContainer.js +15 -44
- package/ChartContainer/ResizableContainer.d.ts +22 -0
- package/ChartContainer/ResizableContainer.js +60 -0
- package/ChartContainer/useChartContainerProps.d.ts +8 -92
- package/ChartContainer/useChartContainerProps.js +29 -59
- 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 +1 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/ChartsLegend/ChartsLegend.js +0 -3
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
- package/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/ChartsLegend/LegendPerItem.d.ts +3 -3
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.d.ts +0 -15
- package/ChartsSurface/ChartsSurface.js +35 -34
- package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
- package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
- package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
- package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
- package/ChartsTooltip/ChartsTooltip.js +162 -107
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
- package/ChartsTooltip/ChartsTooltipContainer.js +298 -0
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
- package/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/ChartsTooltip/index.d.ts +3 -3
- package/ChartsTooltip/index.js +2 -3
- package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
- package/ChartsTooltip/useAxisTooltip.js +21 -21
- package/ChartsTooltip/useItemTooltip.d.ts +1 -1
- package/ChartsTooltip/useItemTooltip.js +8 -7
- package/ChartsTooltip/utils.d.ts +5 -16
- package/ChartsTooltip/utils.js +45 -50
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -39
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/Gauge.js +0 -6
- package/Gauge/GaugeContainer.d.ts +3 -3
- package/Gauge/GaugeContainer.js +60 -61
- package/LineChart/AnimatedArea.d.ts +0 -1333
- package/LineChart/AnimatedArea.js +9 -18
- package/LineChart/AnimatedLine.d.ts +0 -1333
- package/LineChart/AnimatedLine.js +9 -20
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.js +14 -8
- package/LineChart/CircleMarkElement.js +6 -5
- package/LineChart/LineChart.d.ts +11 -17
- package/LineChart/LineChart.js +9 -60
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LineHighlightPlot.js +8 -11
- package/LineChart/LinePlot.js +14 -8
- package/LineChart/MarkElement.js +6 -5
- package/LineChart/MarkPlot.js +2 -6
- package/LineChart/extremums.js +10 -6
- package/LineChart/useLineChartProps.d.ts +2 -4
- package/LineChart/useLineChartProps.js +4 -11
- package/PieChart/PieArc.d.ts +0 -5
- package/PieChart/PieArc.js +1 -10
- package/PieChart/PieArcPlot.js +0 -5
- package/PieChart/PieChart.d.ts +10 -39
- package/PieChart/PieChart.js +20 -137
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/README.md +4 -4
- package/ScatterChart/Scatter.js +6 -5
- package/ScatterChart/ScatterChart.d.ts +11 -17
- package/ScatterChart/ScatterChart.js +11 -60
- package/ScatterChart/ScatterPlot.js +3 -6
- package/ScatterChart/extremums.js +6 -6
- package/ScatterChart/useScatterChartProps.d.ts +2 -4
- package/ScatterChart/useScatterChartProps.js +3 -12
- package/SparkLineChart/SparkLineChart.d.ts +7 -8
- package/SparkLineChart/SparkLineChart.js +6 -33
- package/context/CartesianProvider/defaultizeAxis.d.ts +1 -1
- package/context/ChartDataProvider/ChartDataProvider.d.ts +31 -0
- package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
- package/context/ChartDataProvider/index.d.ts +1 -0
- package/context/ChartDataProvider/index.js +1 -0
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +94 -0
- package/context/ChartDataProvider/useChartDataProviderProps.js +66 -0
- package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +12 -12
- package/{modern/ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +8 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
- package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
- package/{modern/context/DrawingProvider.js → context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/context/DrawingAreaProvider/index.d.ts +3 -0
- package/context/DrawingAreaProvider/index.js +3 -0
- package/context/HighlightedProvider/HighlightedContext.d.ts +0 -8
- package/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/context/InteractionProvider.d.ts +5 -48
- package/context/InteractionProvider.js +8 -64
- package/context/InteractionSelectors.d.ts +359 -0
- package/context/InteractionSelectors.js +12 -0
- package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
- package/context/SizeProvider/Size.types.d.ts +30 -0
- package/context/SizeProvider/SizeContext.d.ts +4 -0
- package/context/SizeProvider/SizeContext.js +13 -0
- package/context/SizeProvider/SizeProvider.d.ts +11 -0
- package/context/SizeProvider/SizeProvider.js +26 -0
- package/context/SizeProvider/index.d.ts +4 -0
- package/context/SizeProvider/index.js +4 -0
- package/context/SizeProvider/useChartContainerDimensions.d.ts +9 -0
- package/{modern/ResponsiveChartContainer → context/SizeProvider}/useChartContainerDimensions.js +15 -7
- package/context/SizeProvider/useSize.d.ts +5 -0
- package/context/SizeProvider/useSize.js +13 -0
- package/context/SvgRefProvider/SvgRef.types.d.ts +8 -0
- package/context/SvgRefProvider/SvgRef.types.js +1 -0
- package/context/SvgRefProvider/SvgRefContext.d.ts +4 -0
- package/context/SvgRefProvider/SvgRefContext.js +17 -0
- package/context/SvgRefProvider/SvgRefProvider.d.ts +3 -0
- package/context/SvgRefProvider/SvgRefProvider.js +24 -0
- package/context/SvgRefProvider/index.d.ts +4 -0
- package/context/SvgRefProvider/index.js +4 -0
- package/context/SvgRefProvider/useSurfaceRef.d.ts +2 -0
- package/context/SvgRefProvider/useSurfaceRef.js +14 -0
- package/context/ZAxisContextProvider.d.ts +1 -1
- package/context/index.d.ts +2 -0
- package/context/index.js +2 -1
- package/hooks/useAxisEvents.js +32 -19
- package/hooks/useChartId.js +2 -2
- package/hooks/useDrawingArea.d.ts +2 -2
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +19 -12
- package/hooks/useSvgRef.js +3 -3
- package/index.d.ts +1 -2
- package/index.js +2 -3
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/internals/computeAxisValue.d.ts +2 -2
- package/internals/defaultizeColor.d.ts +1 -8
- package/internals/getSymbol.js +19 -3
- package/internals/index.d.ts +7 -6
- package/internals/index.js +7 -6
- package/internals/plugins/models/index.d.ts +35 -0
- package/internals/plugins/models/index.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +12 -0
- package/internals/plugins/utils/ChartStore.js +26 -0
- package/internals/plugins/utils/ChartsStore.d.ts +12 -0
- package/internals/plugins/utils/ChartsStore.js +26 -0
- package/internals/plugins/utils/selectors.d.ts +9 -0
- package/internals/plugins/utils/selectors.js +37 -0
- package/internals/useCharts.d.ts +6 -0
- package/internals/useCharts.js +29 -0
- package/internals/useSelector.d.ts +4 -0
- package/internals/useSelector.js +6 -0
- package/internals/useStore.d.ts +2 -0
- package/internals/useStore.js +17 -0
- package/internals/useStringInterpolator.js +1 -0
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.ts +0 -10
- package/models/seriesType/config.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +1 -6
- package/modern/BarChart/AnimatedBarElement.js +21 -0
- package/modern/BarChart/BarChart.js +9 -59
- package/modern/BarChart/BarElement.js +10 -20
- package/modern/BarChart/BarPlot.js +24 -6
- package/modern/BarChart/extremums.js +3 -3
- package/modern/BarChart/useBarChartProps.js +4 -11
- package/modern/ChartContainer/ChartContainer.js +15 -44
- package/modern/ChartContainer/ResizableContainer.js +60 -0
- package/modern/ChartContainer/useChartContainerProps.js +29 -59
- 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 +1 -1
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/modern/ChartsLegend/ChartsLegend.js +0 -3
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
- package/modern/ChartsSurface/ChartsSurface.js +35 -34
- package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
- package/modern/ChartsTooltip/ChartsTooltip.js +162 -107
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +298 -0
- package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/modern/ChartsTooltip/index.js +2 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +21 -21
- package/modern/ChartsTooltip/useItemTooltip.js +8 -7
- package/modern/ChartsTooltip/utils.js +45 -50
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -39
- package/modern/Gauge/Gauge.js +0 -6
- package/modern/Gauge/GaugeContainer.js +60 -61
- package/modern/LineChart/AnimatedArea.js +9 -18
- package/modern/LineChart/AnimatedLine.js +9 -20
- package/modern/LineChart/AreaPlot.js +14 -8
- package/modern/LineChart/CircleMarkElement.js +6 -5
- package/modern/LineChart/LineChart.js +9 -60
- package/modern/LineChart/LineHighlightPlot.js +8 -11
- package/modern/LineChart/LinePlot.js +14 -8
- package/modern/LineChart/MarkElement.js +6 -5
- package/modern/LineChart/MarkPlot.js +2 -6
- package/modern/LineChart/extremums.js +10 -6
- package/modern/LineChart/useLineChartProps.js +4 -11
- package/modern/PieChart/PieArc.js +1 -10
- package/modern/PieChart/PieArcPlot.js +0 -5
- package/modern/PieChart/PieChart.js +20 -137
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/ScatterChart/Scatter.js +6 -5
- package/modern/ScatterChart/ScatterChart.js +11 -60
- package/modern/ScatterChart/ScatterPlot.js +3 -6
- package/modern/ScatterChart/extremums.js +6 -6
- package/modern/ScatterChart/useScatterChartProps.js +3 -12
- package/modern/SparkLineChart/SparkLineChart.js +6 -33
- package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
- package/modern/context/ChartDataProvider/index.js +1 -0
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +66 -0
- package/{ChartContainer → modern/context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
- package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/modern/context/DrawingAreaProvider/index.js +3 -0
- package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/modern/context/InteractionProvider.js +8 -64
- package/modern/context/InteractionSelectors.js +12 -0
- package/modern/context/SizeProvider/Size.types.js +1 -0
- package/modern/context/SizeProvider/SizeContext.js +13 -0
- package/modern/context/SizeProvider/SizeProvider.js +26 -0
- package/modern/context/SizeProvider/index.js +4 -0
- package/{ResponsiveChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +15 -7
- package/modern/context/SizeProvider/useSize.js +13 -0
- package/modern/context/SvgRefProvider/SvgRef.types.js +1 -0
- package/modern/context/SvgRefProvider/SvgRefContext.js +17 -0
- package/modern/context/SvgRefProvider/SvgRefProvider.js +24 -0
- package/modern/context/SvgRefProvider/index.js +4 -0
- package/modern/context/SvgRefProvider/useSurfaceRef.js +14 -0
- package/modern/context/index.js +2 -1
- package/modern/hooks/useAxisEvents.js +32 -19
- package/modern/hooks/useChartId.js +2 -2
- package/modern/hooks/useDrawingArea.js +2 -2
- package/modern/hooks/useInteractionItemProps.js +19 -12
- package/modern/hooks/useSvgRef.js +3 -3
- package/modern/index.js +2 -3
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/modern/internals/getSymbol.js +19 -3
- package/modern/internals/index.js +7 -6
- package/modern/internals/plugins/models/index.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +26 -0
- package/modern/internals/plugins/utils/ChartsStore.js +26 -0
- package/modern/internals/plugins/utils/selectors.js +37 -0
- package/modern/internals/useCharts.js +29 -0
- package/modern/internals/useSelector.js +6 -0
- package/modern/internals/useStore.js +17 -0
- package/modern/internals/useStringInterpolator.js +1 -0
- package/node/BarChart/AnimatedBarElement.js +28 -0
- package/node/BarChart/BarChart.js +9 -59
- package/node/BarChart/BarElement.js +11 -21
- package/node/BarChart/BarPlot.js +22 -4
- package/node/BarChart/extremums.js +3 -3
- package/node/BarChart/useBarChartProps.js +4 -11
- package/node/ChartContainer/ChartContainer.js +14 -43
- package/node/ChartContainer/ResizableContainer.js +68 -0
- package/node/ChartContainer/useChartContainerProps.js +29 -60
- 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 +2 -2
- package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
- package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
- package/node/ChartsLegend/ChartsLegend.js +0 -3
- package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
- package/node/ChartsSurface/ChartsSurface.js +35 -34
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
- package/node/ChartsTooltip/ChartsTooltip.js +161 -106
- package/node/ChartsTooltip/ChartsTooltipContainer.js +304 -0
- package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
- package/node/ChartsTooltip/index.js +19 -28
- package/node/ChartsTooltip/useAxisTooltip.js +21 -21
- package/node/ChartsTooltip/useItemTooltip.js +8 -7
- package/node/ChartsTooltip/utils.js +46 -53
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +51 -40
- package/node/Gauge/Gauge.js +0 -6
- package/node/Gauge/GaugeContainer.js +60 -61
- package/node/LineChart/AnimatedArea.js +9 -19
- package/node/LineChart/AnimatedLine.js +9 -21
- package/node/LineChart/AreaPlot.js +13 -7
- package/node/LineChart/CircleMarkElement.js +6 -5
- package/node/LineChart/LineChart.js +9 -60
- package/node/LineChart/LineHighlightPlot.js +8 -11
- package/node/LineChart/LinePlot.js +13 -7
- package/node/LineChart/MarkElement.js +6 -5
- package/node/LineChart/MarkPlot.js +2 -6
- package/node/LineChart/extremums.js +10 -6
- package/node/LineChart/useLineChartProps.js +4 -11
- package/node/PieChart/PieArc.js +1 -10
- package/node/PieChart/PieArcPlot.js +0 -5
- package/node/PieChart/PieChart.js +20 -137
- package/node/PieChart/PiePlot.js +2 -2
- package/node/ScatterChart/Scatter.js +6 -5
- package/node/ScatterChart/ScatterChart.js +11 -60
- package/node/ScatterChart/ScatterPlot.js +3 -6
- package/node/ScatterChart/extremums.js +6 -6
- package/node/ScatterChart/useScatterChartProps.js +3 -12
- package/node/SparkLineChart/SparkLineChart.js +6 -33
- package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
- package/node/context/ChartDataProvider/index.js +16 -0
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +72 -0
- package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +22 -0
- package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
- package/node/context/DrawingAreaProvider/index.js +38 -0
- package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/node/context/InteractionProvider.js +9 -66
- package/node/context/InteractionSelectors.js +18 -0
- package/node/context/SizeProvider/Size.types.js +5 -0
- package/node/context/SizeProvider/SizeContext.js +20 -0
- package/node/context/SizeProvider/SizeProvider.js +29 -0
- package/node/context/SizeProvider/index.js +49 -0
- package/node/{ResponsiveChartContainer → context/SizeProvider}/useChartContainerDimensions.js +15 -7
- package/node/context/SizeProvider/useSize.js +20 -0
- package/node/context/SvgRefProvider/SvgRef.types.js +5 -0
- package/node/context/SvgRefProvider/SvgRefContext.js +23 -0
- package/node/context/SvgRefProvider/SvgRefProvider.js +31 -0
- package/node/context/SvgRefProvider/index.js +49 -0
- package/node/context/SvgRefProvider/useSurfaceRef.js +20 -0
- package/node/context/index.js +10 -2
- package/node/hooks/useAxisEvents.js +33 -19
- package/node/hooks/useChartId.js +2 -2
- package/node/hooks/useDrawingArea.js +2 -2
- package/node/hooks/useInteractionItemProps.js +20 -13
- package/node/hooks/useSvgRef.js +3 -3
- package/node/index.js +5 -16
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/node/internals/getSymbol.js +19 -3
- package/node/internals/index.js +64 -44
- package/node/internals/plugins/models/index.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +33 -0
- package/node/internals/plugins/utils/ChartsStore.js +33 -0
- package/node/internals/plugins/utils/selectors.js +44 -0
- package/node/internals/useCharts.js +36 -0
- package/node/internals/useSelector.js +13 -0
- package/node/internals/useStore.js +24 -0
- package/node/internals/useStringInterpolator.js +2 -0
- package/package.json +8 -6
- package/themeAugmentation/props.d.ts +1 -2
- 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/ResponsiveChartContainer/ResizableContainer.d.ts +0 -9
- package/ResponsiveChartContainer/ResizableContainer.js +0 -26
- package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
- package/ResponsiveChartContainer/index.d.ts +0 -1
- package/ResponsiveChartContainer/index.js +0 -1
- package/ResponsiveChartContainer/package.json +0 -6
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +0 -6
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/internals/SlotComponentPropsFromProps.d.ts +0 -1
- package/models/helpers.d.ts +0 -3
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/modern/ResponsiveChartContainer/ResizableContainer.js +0 -26
- package/modern/ResponsiveChartContainer/index.js +0 -1
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- package/node/ResponsiveChartContainer/ResizableContainer.js +0 -32
- package/node/ResponsiveChartContainer/index.js +0 -16
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
- /package/{internals/SlotComponentPropsFromProps.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/{models/helpers.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
- /package/{modern/internals/SlotComponentPropsFromProps.js → context/DrawingAreaProvider/DrawingArea.types.js} +0 -0
- /package/{modern/models/helpers.js → context/SizeProvider/Size.types.js} +0 -0
- /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/{internals/SlotComponentPropsFromProps.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
- /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/{models/helpers.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { SvgRefContext } from "./SvgRefContext.js";
|
|
5
|
+
export function useSurfaceRef() {
|
|
6
|
+
const {
|
|
7
|
+
isInitialized,
|
|
8
|
+
data
|
|
9
|
+
} = React.useContext(SvgRefContext);
|
|
10
|
+
if (!isInitialized) {
|
|
11
|
+
throw new Error(['MUI X: Could not find the svg ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
12
|
+
}
|
|
13
|
+
return data.surfaceRef;
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
3
|
import { DatasetType } from '../models/seriesType/config';
|
|
3
|
-
import { MakeOptional } from '../models/helpers';
|
|
4
4
|
import { ZAxisConfig, ZAxisDefaultized } from '../models/z-axis';
|
|
5
5
|
export type ZAxisContextProviderProps = {
|
|
6
6
|
/**
|
package/context/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './HighlightedProvider';
|
|
2
2
|
export { ZAxisContextProvider } from './ZAxisContextProvider';
|
|
3
3
|
export type { ZAxisContextProviderProps } from './ZAxisContextProvider';
|
|
4
|
+
export { ChartDataProvider } from './ChartDataProvider';
|
|
5
|
+
export type { ChartDataProviderProps } from './ChartDataProvider';
|
package/context/index.js
CHANGED
package/hooks/useAxisEvents.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
import { InteractionContext } from "../context/InteractionProvider.js";
|
|
5
5
|
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
6
6
|
import { isBandScale } from "../internals/isBandScale.js";
|
|
7
7
|
import { getSVGPoint } from "../internals/getSVGPoint.js";
|
|
8
8
|
import { useSvgRef } from "./useSvgRef.js";
|
|
9
9
|
import { useDrawingArea } from "./useDrawingArea.js";
|
|
10
|
+
import { useStore } from "../internals/useStore.js";
|
|
10
11
|
function getAsANumber(value) {
|
|
11
12
|
return value instanceof Date ? value.getTime() : value;
|
|
12
13
|
}
|
|
@@ -19,9 +20,7 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
19
20
|
xAxisIds,
|
|
20
21
|
yAxisIds
|
|
21
22
|
} = useCartesianContext();
|
|
22
|
-
const
|
|
23
|
-
dispatch
|
|
24
|
-
} = React.useContext(InteractionContext);
|
|
23
|
+
const store = useStore(disableAxisListener);
|
|
25
24
|
const usedXAxis = xAxisIds[0];
|
|
26
25
|
const usedYAxis = yAxisIds[0];
|
|
27
26
|
|
|
@@ -33,7 +32,7 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
33
32
|
});
|
|
34
33
|
React.useEffect(() => {
|
|
35
34
|
const element = svgRef.current;
|
|
36
|
-
if (element === null || disableAxisListener) {
|
|
35
|
+
if (element === null || disableAxisListener || !store) {
|
|
37
36
|
return () => {};
|
|
38
37
|
}
|
|
39
38
|
function getNewAxisState(axisConfig, mouseValue) {
|
|
@@ -92,9 +91,15 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
92
91
|
x: -1,
|
|
93
92
|
y: -1
|
|
94
93
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
store.update(prev => _extends({}, prev, {
|
|
95
|
+
interaction: {
|
|
96
|
+
item: null,
|
|
97
|
+
axis: {
|
|
98
|
+
x: null,
|
|
99
|
+
y: null
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
98
103
|
};
|
|
99
104
|
const handleMove = event => {
|
|
100
105
|
const target = 'targetTouches' in event ? event.targetTouches[0] : event;
|
|
@@ -105,9 +110,15 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
105
110
|
targetElement: event.target
|
|
106
111
|
})) {
|
|
107
112
|
if (mousePosition.current.isInChart) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
store.update(prev => _extends({}, prev, {
|
|
114
|
+
interaction: {
|
|
115
|
+
item: null,
|
|
116
|
+
axis: {
|
|
117
|
+
x: null,
|
|
118
|
+
y: null
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}));
|
|
111
122
|
mousePosition.current.isInChart = false;
|
|
112
123
|
}
|
|
113
124
|
return;
|
|
@@ -115,13 +126,15 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
115
126
|
mousePosition.current.isInChart = true;
|
|
116
127
|
const newStateX = getNewAxisState(xAxis[usedXAxis], svgPoint.x);
|
|
117
128
|
const newStateY = getNewAxisState(yAxis[usedYAxis], svgPoint.y);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
store.update(prev => _extends({}, prev, {
|
|
130
|
+
interaction: _extends({}, prev.interaction, {
|
|
131
|
+
axis: _extends({}, prev.interaction.axis, prev.interaction.axis.x?.index !== newStateX?.index || prev.interaction.axis.x?.value !== newStateX?.value ? {
|
|
132
|
+
x: newStateX
|
|
133
|
+
} : {}, prev.interaction.axis.y?.index !== newStateY?.index || prev.interaction.axis.y?.value !== newStateY?.value ? {
|
|
134
|
+
y: newStateY
|
|
135
|
+
} : {})
|
|
136
|
+
})
|
|
137
|
+
}));
|
|
125
138
|
};
|
|
126
139
|
const handleDown = event => {
|
|
127
140
|
const target = event.currentTarget;
|
|
@@ -144,5 +157,5 @@ export const useAxisEvents = disableAxisListener => {
|
|
|
144
157
|
element.removeEventListener('pointercancel', handleOut);
|
|
145
158
|
element.removeEventListener('pointerleave', handleOut);
|
|
146
159
|
};
|
|
147
|
-
}, [svgRef,
|
|
160
|
+
}, [svgRef, store, usedYAxis, yAxis, usedXAxis, xAxis, disableAxisListener, drawingArea]);
|
|
148
161
|
};
|
package/hooks/useChartId.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { DrawingAreaContext } from "../context/DrawingAreaProvider/index.js";
|
|
5
5
|
export function useChartId() {
|
|
6
6
|
const {
|
|
7
7
|
chartId
|
|
8
|
-
} = React.useContext(
|
|
8
|
+
} = React.useContext(DrawingAreaContext);
|
|
9
9
|
return React.useMemo(() => chartId, [chartId]);
|
|
10
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useDrawingArea():
|
|
1
|
+
import { DrawingAreaState } from '../context/DrawingAreaProvider';
|
|
2
|
+
export declare function useDrawingArea(): DrawingAreaState;
|
package/hooks/useDrawingArea.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { DrawingAreaContext } from "../context/DrawingAreaProvider/index.js";
|
|
5
5
|
export function useDrawingArea() {
|
|
6
6
|
const {
|
|
7
7
|
left,
|
|
@@ -11,7 +11,7 @@ export function useDrawingArea() {
|
|
|
11
11
|
bottom,
|
|
12
12
|
right,
|
|
13
13
|
isPointInside
|
|
14
|
-
} = React.useContext(
|
|
14
|
+
} = React.useContext(DrawingAreaContext);
|
|
15
15
|
return React.useMemo(() => ({
|
|
16
16
|
left,
|
|
17
17
|
top,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { InteractionContext } from "../context/InteractionProvider.js";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
4
|
import { useHighlighted } from "../context/index.js";
|
|
5
|
+
import { useStore } from "../internals/useStore.js";
|
|
6
6
|
export const useInteractionItemProps = skip => {
|
|
7
|
-
const
|
|
8
|
-
dispatch: dispatchInteraction
|
|
9
|
-
} = React.useContext(InteractionContext);
|
|
7
|
+
const store = useStore();
|
|
10
8
|
const {
|
|
11
9
|
setHighlighted,
|
|
12
10
|
clearHighlighted
|
|
@@ -21,10 +19,11 @@ export const useInteractionItemProps = skip => {
|
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
21
|
const onPointerEnter = () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
store.update(prev => _extends({}, prev, {
|
|
23
|
+
interaction: _extends({}, prev.interaction, {
|
|
24
|
+
item: data
|
|
25
|
+
})
|
|
26
|
+
}));
|
|
28
27
|
setHighlighted({
|
|
29
28
|
seriesId: data.seriesId,
|
|
30
29
|
dataIndex: data.dataIndex
|
|
@@ -32,9 +31,17 @@ export const useInteractionItemProps = skip => {
|
|
|
32
31
|
};
|
|
33
32
|
const onPointerLeave = event => {
|
|
34
33
|
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
data
|
|
34
|
+
store.update(prev => {
|
|
35
|
+
const prevItem = prev.interaction.item;
|
|
36
|
+
if (prevItem === null || Object.keys(data).some(key => data[key] !== prevItem[key])) {
|
|
37
|
+
// The item is already something else, no need to clean it.
|
|
38
|
+
return prev;
|
|
39
|
+
}
|
|
40
|
+
return _extends({}, prev, {
|
|
41
|
+
interaction: _extends({}, prev.interaction, {
|
|
42
|
+
item: null
|
|
43
|
+
})
|
|
44
|
+
});
|
|
38
45
|
});
|
|
39
46
|
clearHighlighted();
|
|
40
47
|
};
|
package/hooks/useSvgRef.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { SvgRefContext } from "../context/SvgRefProvider/index.js";
|
|
5
5
|
export function useSvgRef() {
|
|
6
6
|
const {
|
|
7
7
|
isInitialized,
|
|
8
8
|
data
|
|
9
|
-
} = React.useContext(
|
|
9
|
+
} = React.useContext(SvgRefContext);
|
|
10
10
|
if (!isInitialized) {
|
|
11
11
|
throw new Error(['MUI X: Could not find the svg ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
12
12
|
}
|
|
13
|
-
return data;
|
|
13
|
+
return data.svgRef;
|
|
14
14
|
}
|
package/index.d.ts
CHANGED
|
@@ -21,6 +21,5 @@ export * from './PieChart';
|
|
|
21
21
|
export * from './ScatterChart';
|
|
22
22
|
export * from './SparkLineChart';
|
|
23
23
|
export * from './Gauge';
|
|
24
|
-
export * from './ChartContainer';
|
|
25
24
|
export * from './ChartsSurface';
|
|
26
|
-
export * from './
|
|
25
|
+
export * from './ChartContainer';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts
|
|
2
|
+
* @mui/x-charts v8.0.0-alpha.1
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -28,6 +28,5 @@ export * from "./PieChart/index.js";
|
|
|
28
28
|
export * from "./ScatterChart/index.js";
|
|
29
29
|
export * from "./SparkLineChart/index.js";
|
|
30
30
|
export * from "./Gauge/index.js";
|
|
31
|
-
export * from "./ChartContainer/index.js";
|
|
32
31
|
export * from "./ChartsSurface/index.js";
|
|
33
|
-
export * from "./
|
|
32
|
+
export * from "./ChartContainer/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AxisId } from '../../../models/axis';
|
|
3
3
|
export declare function useChartGradient(): (axisId: AxisId, direction: "x" | "y") => string;
|
|
4
|
-
export declare function ChartsAxesGradients(): React.JSX.Element;
|
|
4
|
+
export declare function ChartsAxesGradients(): React.JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCartesianContext } from "../../../context/CartesianProvider/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DrawingAreaContext } from "../../../context/DrawingAreaProvider/index.js";
|
|
4
4
|
import { useDrawingArea } from "../../../hooks/index.js";
|
|
5
5
|
import ChartsPiecewiseGradient from "./ChartsPiecewiseGradient.js";
|
|
6
6
|
import ChartsContinuousGradient from "./ChartsContinuousGradient.js";
|
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
export function useChartGradient() {
|
|
9
9
|
const {
|
|
10
10
|
chartId
|
|
11
|
-
} = React.useContext(
|
|
11
|
+
} = React.useContext(DrawingAreaContext);
|
|
12
12
|
return React.useCallback((axisId, direction) => `${chartId}-gradient-${direction}-${axisId}`, [chartId]);
|
|
13
13
|
}
|
|
14
14
|
export function ChartsAxesGradients() {
|
|
@@ -29,8 +29,13 @@ export function ChartsAxesGradients() {
|
|
|
29
29
|
yAxisIds,
|
|
30
30
|
yAxis
|
|
31
31
|
} = useCartesianContext();
|
|
32
|
+
const filteredYAxisIds = yAxisIds.filter(axisId => yAxis[axisId].colorMap !== undefined);
|
|
33
|
+
const filteredXAxisIds = xAxisIds.filter(axisId => xAxis[axisId].colorMap !== undefined);
|
|
34
|
+
if (filteredYAxisIds.length === 0 && filteredXAxisIds.length === 0) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
32
37
|
return /*#__PURE__*/_jsxs("defs", {
|
|
33
|
-
children: [
|
|
38
|
+
children: [filteredYAxisIds.map(axisId => {
|
|
34
39
|
const gradientId = getGradientId(axisId, 'y');
|
|
35
40
|
const {
|
|
36
41
|
colorMap,
|
|
@@ -60,7 +65,7 @@ export function ChartsAxesGradients() {
|
|
|
60
65
|
}, gradientId);
|
|
61
66
|
}
|
|
62
67
|
return null;
|
|
63
|
-
}),
|
|
68
|
+
}), filteredXAxisIds.map(axisId => {
|
|
64
69
|
const gradientId = getGradientId(axisId, 'x');
|
|
65
70
|
const {
|
|
66
71
|
colorMap,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxisConfig, ScaleName } from '../models';
|
|
2
2
|
import { ChartsXAxisProps, ChartsAxisProps, ChartsYAxisProps, ChartsRadiusAxisProps, ChartsRotationAxisProps } from '../models/axis';
|
|
3
3
|
import { CartesianChartSeriesType } from '../models/seriesType/config';
|
|
4
|
-
import {
|
|
4
|
+
import { DrawingAreaState } from '../context/DrawingAreaProvider';
|
|
5
5
|
import { FormattedSeries } from '../context/SeriesProvider';
|
|
6
6
|
import { ExtremumGetter } from '../context/PluginProvider';
|
|
7
7
|
import { DefaultizedAxisConfig, ZoomData, ZoomOptions, GetZoomAxisFilters } from '../context/CartesianProvider/Cartesian.types';
|
|
@@ -10,7 +10,7 @@ type ComputeResult<T extends ChartsAxisProps> = {
|
|
|
10
10
|
axisIds: string[];
|
|
11
11
|
};
|
|
12
12
|
type ComputeCommonParams = {
|
|
13
|
-
drawingArea:
|
|
13
|
+
drawingArea: DrawingAreaState;
|
|
14
14
|
formattedSeries: FormattedSeries;
|
|
15
15
|
extremumGetters: {
|
|
16
16
|
[K in CartesianChartSeriesType]?: ExtremumGetter<K>;
|
|
@@ -41,7 +41,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
41
41
|
};
|
|
42
42
|
id?: import(".").SeriesId;
|
|
43
43
|
color?: string;
|
|
44
|
-
valueFormatter?: import(".").SeriesValueFormatter<import("
|
|
44
|
+
valueFormatter?: import(".").SeriesValueFormatter<import("@mui/x-internals/types").MakeOptional<import("..").PieValueType, "id">> | undefined;
|
|
45
45
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
46
46
|
} | {
|
|
47
47
|
type: "bar";
|
|
@@ -54,8 +54,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
54
54
|
color: string;
|
|
55
55
|
valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
|
|
56
56
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
57
|
-
xAxisKey?: string;
|
|
58
|
-
yAxisKey?: string;
|
|
59
57
|
xAxisId?: string;
|
|
60
58
|
yAxisId?: string;
|
|
61
59
|
stack?: string;
|
|
@@ -66,7 +64,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
66
64
|
markerSize?: number;
|
|
67
65
|
label?: string | ((location: "tooltip" | "legend") => string);
|
|
68
66
|
disableHover?: boolean;
|
|
69
|
-
zAxisKey?: string;
|
|
70
67
|
zAxisId?: string;
|
|
71
68
|
datasetKeys?: {
|
|
72
69
|
x: string;
|
|
@@ -78,8 +75,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
78
75
|
color: string;
|
|
79
76
|
valueFormatter?: import(".").SeriesValueFormatter<import("..").ScatterValueType> | undefined;
|
|
80
77
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
81
|
-
xAxisKey?: string;
|
|
82
|
-
yAxisKey?: string;
|
|
83
78
|
xAxisId?: string;
|
|
84
79
|
yAxisId?: string;
|
|
85
80
|
} | {
|
|
@@ -99,8 +94,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
99
94
|
color: string;
|
|
100
95
|
valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
|
|
101
96
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
102
|
-
xAxisKey?: string;
|
|
103
|
-
yAxisKey?: string;
|
|
104
97
|
xAxisId?: string;
|
|
105
98
|
yAxisId?: string;
|
|
106
99
|
stackOrder?: import("..").StackOrderType;
|
package/internals/getSymbol.js
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
// Returns the index of a defined shape
|
|
2
1
|
export function getSymbol(shape) {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
switch (shape) {
|
|
4
|
+
case 'circle':
|
|
5
|
+
return 0;
|
|
6
|
+
case 'cross':
|
|
7
|
+
return 1;
|
|
8
|
+
case 'diamond':
|
|
9
|
+
return 2;
|
|
10
|
+
case 'square':
|
|
11
|
+
return 3;
|
|
12
|
+
case 'star':
|
|
13
|
+
return 4;
|
|
14
|
+
case 'triangle':
|
|
15
|
+
return 5;
|
|
16
|
+
case 'wye':
|
|
17
|
+
return 6;
|
|
18
|
+
default:
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
5
21
|
}
|
package/internals/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export * from './components/ChartsAxesGradients';
|
|
2
|
-
export * from '../
|
|
3
|
-
export * from '../ResponsiveChartContainer/ResizableContainer';
|
|
2
|
+
export * from '../ChartContainer/ResizableContainer';
|
|
4
3
|
export { useSeries } from '../hooks/useSeries';
|
|
5
4
|
export { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
6
5
|
export { useDrawingArea } from '../hooks/useDrawingArea';
|
|
7
6
|
export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
|
|
8
7
|
export { useLineChartProps } from '../LineChart/useLineChartProps';
|
|
9
8
|
export { useBarChartProps } from '../BarChart/useBarChartProps';
|
|
10
|
-
export
|
|
11
|
-
export
|
|
9
|
+
export * from '../ChartContainer/useChartContainerProps';
|
|
10
|
+
export * from '../context/ChartDataProvider/useChartDataProviderProps';
|
|
12
11
|
export * from './defaultizeValueFormatter';
|
|
13
12
|
export * from './configInit';
|
|
14
13
|
export * from './getLabel';
|
|
@@ -18,7 +17,7 @@ export { unstable_cleanupDOM } from './domUtils';
|
|
|
18
17
|
export * from './getScale';
|
|
19
18
|
export * from './computeAxisValue';
|
|
20
19
|
export * from '../context/CartesianProvider';
|
|
21
|
-
export * from '../context/
|
|
20
|
+
export * from '../context/DrawingAreaProvider';
|
|
22
21
|
export * from '../context/InteractionProvider';
|
|
23
22
|
export * from '../context/SeriesProvider';
|
|
24
23
|
export * from '../context/ZAxisContextProvider';
|
|
@@ -26,8 +25,10 @@ export * from '../context/PluginProvider';
|
|
|
26
25
|
export * from '../context/AnimationProvider';
|
|
27
26
|
export type * from '../context/context.types';
|
|
28
27
|
export { getAxisExtremum } from '../context/CartesianProvider/getAxisExtremum';
|
|
28
|
+
export * from '../context/ChartDataProvider';
|
|
29
|
+
export * from '../context/SizeProvider';
|
|
30
|
+
export * from '../context/SvgRefProvider';
|
|
29
31
|
export * from '../models/seriesType/config';
|
|
30
32
|
export * from '../models/seriesType/common';
|
|
31
|
-
export * from '../models/helpers';
|
|
32
33
|
export * from '../models/z-axis';
|
|
33
34
|
export * from '../models/axis';
|
package/internals/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Components
|
|
2
2
|
export * from "./components/ChartsAxesGradients/index.js";
|
|
3
|
-
export * from "../
|
|
4
|
-
export * from "../ResponsiveChartContainer/ResizableContainer.js";
|
|
3
|
+
export * from "../ChartContainer/ResizableContainer.js";
|
|
5
4
|
|
|
6
5
|
// hooks
|
|
7
6
|
export { useSeries } from "../hooks/useSeries.js";
|
|
@@ -10,8 +9,8 @@ export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
|
10
9
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
11
10
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
12
11
|
export { useBarChartProps } from "../BarChart/useBarChartProps.js";
|
|
13
|
-
export
|
|
14
|
-
export
|
|
12
|
+
export * from "../ChartContainer/useChartContainerProps.js";
|
|
13
|
+
export * from "../context/ChartDataProvider/useChartDataProviderProps.js";
|
|
15
14
|
|
|
16
15
|
// utils
|
|
17
16
|
export * from "./defaultizeValueFormatter.js";
|
|
@@ -26,17 +25,19 @@ export * from "./computeAxisValue.js";
|
|
|
26
25
|
// contexts
|
|
27
26
|
|
|
28
27
|
export * from "../context/CartesianProvider/index.js";
|
|
29
|
-
export * from "../context/
|
|
28
|
+
export * from "../context/DrawingAreaProvider/index.js";
|
|
30
29
|
export * from "../context/InteractionProvider.js";
|
|
31
30
|
export * from "../context/SeriesProvider/index.js";
|
|
32
31
|
export * from "../context/ZAxisContextProvider.js";
|
|
33
32
|
export * from "../context/PluginProvider/index.js";
|
|
34
33
|
export * from "../context/AnimationProvider/index.js";
|
|
35
34
|
export { getAxisExtremum } from "../context/CartesianProvider/getAxisExtremum.js";
|
|
35
|
+
export * from "../context/ChartDataProvider/index.js";
|
|
36
|
+
export * from "../context/SizeProvider/index.js";
|
|
37
|
+
export * from "../context/SvgRefProvider/index.js";
|
|
36
38
|
|
|
37
39
|
// series configuration
|
|
38
40
|
export * from "../models/seriesType/config.js";
|
|
39
41
|
export * from "../models/seriesType/common.js";
|
|
40
|
-
export * from "../models/helpers.js";
|
|
41
42
|
export * from "../models/z-axis.js";
|
|
42
43
|
export * from "../models/axis.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ChartItemIdentifier, ChartSeriesType } from '../../../models/seriesType/config';
|
|
2
|
+
export type ItemInteractionData<T extends ChartSeriesType> = ChartItemIdentifier<T>;
|
|
3
|
+
export type AxisInteractionData = {
|
|
4
|
+
x: null | {
|
|
5
|
+
value: number | Date | string;
|
|
6
|
+
index: number;
|
|
7
|
+
};
|
|
8
|
+
y: null | {
|
|
9
|
+
value: number | Date | string;
|
|
10
|
+
index: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type InteractionState = {
|
|
14
|
+
/**
|
|
15
|
+
* The item currently interacting.
|
|
16
|
+
*/
|
|
17
|
+
item: null | ItemInteractionData<ChartSeriesType>;
|
|
18
|
+
/**
|
|
19
|
+
* The x- and y-axes currently interacting.
|
|
20
|
+
*/
|
|
21
|
+
axis: AxisInteractionData;
|
|
22
|
+
/**
|
|
23
|
+
* Set to `true` when `VoronoiHandler` is active.
|
|
24
|
+
* Used to prevent collision with mouseEnter events.
|
|
25
|
+
*/
|
|
26
|
+
isVoronoiEnabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type ChartStateCacheKey = {
|
|
29
|
+
id: number;
|
|
30
|
+
};
|
|
31
|
+
export type ChartState = {
|
|
32
|
+
interaction: InteractionState;
|
|
33
|
+
cacheKey: ChartStateCacheKey;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartState } from '../models';
|
|
2
|
+
type Listener<T> = (value: T) => void;
|
|
3
|
+
export type StoreUpdater = (prevState: ChartState) => ChartState;
|
|
4
|
+
export declare class ChartStore {
|
|
5
|
+
value: ChartState;
|
|
6
|
+
private listeners;
|
|
7
|
+
constructor(value: ChartState);
|
|
8
|
+
subscribe: (fn: Listener<ChartState>) => () => void;
|
|
9
|
+
getSnapshot: () => ChartState;
|
|
10
|
+
update: (updater: StoreUpdater) => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// For now this is fixed. Will need to support generic if we add plugins
|
|
2
|
+
|
|
3
|
+
export class ChartStore {
|
|
4
|
+
constructor(value) {
|
|
5
|
+
this.value = void 0;
|
|
6
|
+
this.listeners = void 0;
|
|
7
|
+
this.subscribe = fn => {
|
|
8
|
+
this.listeners.add(fn);
|
|
9
|
+
return () => {
|
|
10
|
+
this.listeners.delete(fn);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
this.getSnapshot = () => {
|
|
14
|
+
return this.value;
|
|
15
|
+
};
|
|
16
|
+
this.update = updater => {
|
|
17
|
+
const newState = updater(this.value);
|
|
18
|
+
if (newState !== this.value) {
|
|
19
|
+
this.value = newState;
|
|
20
|
+
this.listeners.forEach(l => l(newState));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.value = value;
|
|
24
|
+
this.listeners = new Set();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChartState } from '../models';
|
|
2
|
+
type Listener<T> = (value: T) => void;
|
|
3
|
+
export type StoreUpdater = (prevState: ChartState) => ChartState;
|
|
4
|
+
export declare class ChartsStore {
|
|
5
|
+
value: ChartState;
|
|
6
|
+
private listeners;
|
|
7
|
+
constructor(value: ChartState);
|
|
8
|
+
subscribe: (fn: Listener<ChartState>) => () => void;
|
|
9
|
+
getSnapshot: () => ChartState;
|
|
10
|
+
update: (updater: StoreUpdater) => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// For now this is fixed. Will need to support generic if we add plugins
|
|
2
|
+
|
|
3
|
+
export class ChartsStore {
|
|
4
|
+
constructor(value) {
|
|
5
|
+
this.value = void 0;
|
|
6
|
+
this.listeners = void 0;
|
|
7
|
+
this.subscribe = fn => {
|
|
8
|
+
this.listeners.add(fn);
|
|
9
|
+
return () => {
|
|
10
|
+
this.listeners.delete(fn);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
this.getSnapshot = () => {
|
|
14
|
+
return this.value;
|
|
15
|
+
};
|
|
16
|
+
this.update = updater => {
|
|
17
|
+
const newState = updater(this.value);
|
|
18
|
+
if (newState !== this.value) {
|
|
19
|
+
this.value = newState;
|
|
20
|
+
this.listeners.forEach(l => l(newState));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.value = value;
|
|
24
|
+
this.listeners = new Set();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreateSelectorFunction } from 'reselect';
|
|
2
|
+
import { ChartState } from '../models';
|
|
3
|
+
export type ChartsRootSelector = (state: ChartState) => ChartState[keyof ChartState];
|
|
4
|
+
export type ChartsSelector<TState, TArgs, TResult> = (state: TState, args: TArgs) => TResult;
|
|
5
|
+
/**
|
|
6
|
+
* Method wrapping reselect's createSelector to provide caching for chart instances.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare const createSelector: CreateSelectorFunction;
|