@mui/x-charts 8.0.0-alpha.0 → 8.0.0-alpha.2
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 +4 -9
- package/BarChart/BarChart.js +3 -35
- package/BarChart/BarElement.d.ts +5 -1342
- package/BarChart/BarElement.js +10 -20
- package/BarChart/BarLabel/BarLabel.d.ts +298 -298
- package/BarChart/BarPlot.js +12 -2
- package/BarChart/useBarChartProps.d.ts +0 -2
- package/BarChart/useBarChartProps.js +2 -8
- package/CHANGELOG.md +651 -6
- package/ChartContainer/ChartContainer.d.ts +26 -19
- package/ChartContainer/ChartContainer.js +31 -25
- package/ChartContainer/useChartContainerProps.d.ts +5 -7
- package/ChartContainer/useChartContainerProps.js +12 -27
- 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/ChartsAxisHighlight.types.js +1 -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/LegendPerItem.d.ts +2 -2
- package/ChartsLegend/chartsLegendClasses.js +2 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/ChartsSurface/ChartsSurface.d.ts +14 -15
- package/ChartsSurface/ChartsSurface.js +68 -35
- package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
- package/ChartsTooltip/ChartTooltip.types.js +1 -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 +143 -145
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
- package/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/ChartsTooltip/ChartsTooltipTable.js +1 -1
- 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 +19 -19
- package/ChartsTooltip/useItemTooltip.d.ts +2 -3
- package/ChartsTooltip/useItemTooltip.js +5 -4
- package/ChartsTooltip/utils.d.ts +0 -3
- package/ChartsTooltip/utils.js +0 -8
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
- package/ChartsXAxis/ChartsXAxis.js +3 -17
- package/ChartsYAxis/ChartsYAxis.js +2 -17
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/Gauge.js +0 -6
- package/Gauge/GaugeContainer.d.ts +3 -3
- package/Gauge/GaugeContainer.js +42 -76
- 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/AreaPlot.js +12 -2
- package/LineChart/CircleMarkElement.js +6 -5
- package/LineChart/LineChart.d.ts +4 -10
- package/LineChart/LineChart.js +3 -36
- package/LineChart/LineHighlightPlot.js +6 -5
- package/LineChart/LinePlot.js +12 -2
- package/LineChart/MarkElement.js +6 -5
- package/LineChart/useLineChartProps.d.ts +0 -2
- package/LineChart/useLineChartProps.js +2 -8
- package/PieChart/PieChart.d.ts +3 -9
- package/PieChart/PieChart.js +5 -41
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/README.md +2 -2
- package/ScatterChart/Scatter.js +6 -5
- package/ScatterChart/ScatterChart.d.ts +4 -10
- package/ScatterChart/ScatterChart.js +5 -36
- package/ScatterChart/useScatterChartProps.d.ts +0 -2
- package/ScatterChart/useScatterChartProps.js +1 -9
- package/SparkLineChart/SparkLineChart.d.ts +3 -4
- package/SparkLineChart/SparkLineChart.js +4 -35
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -11
- package/context/ChartDataProvider/ChartDataProvider.d.ts +36 -19
- package/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +25 -32
- package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -11
- package/context/ChartProvider/ChartContext.d.ts +6 -0
- package/context/ChartProvider/ChartContext.js +8 -0
- package/context/ChartProvider/ChartProvider.d.ts +4 -0
- package/context/ChartProvider/ChartProvider.js +19 -0
- package/context/ChartProvider/ChartProvider.types.d.ts +24 -0
- package/context/ChartProvider/ChartProvider.types.js +1 -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/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
- package/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +3 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.js +15 -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/InteractionSelectors.d.ts +382 -0
- package/context/InteractionSelectors.js +12 -0
- package/context/SizeProvider/Size.types.d.ts +30 -0
- package/context/SizeProvider/Size.types.js +1 -0
- package/context/SizeProvider/SizeContext.d.ts +4 -0
- package/context/SizeProvider/SizeContext.js +15 -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/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/context/SizeProvider/useSize.d.ts +5 -0
- package/context/SizeProvider/useSize.js +13 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +2 -1
- package/hooks/useAxisEvents.js +32 -19
- package/hooks/useChartId.js +5 -6
- package/hooks/useDrawingArea.d.ts +2 -2
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +22 -13
- package/hooks/useSvgRef.d.ts +1 -1
- package/hooks/useSvgRef.js +4 -8
- package/index.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
- package/internals/computeAxisValue.d.ts +2 -2
- package/internals/defaultizeColor.d.ts +1 -1
- package/internals/index.d.ts +3 -4
- package/internals/index.js +3 -4
- package/internals/plugins/allPlugins.d.ts +1 -0
- package/internals/plugins/allPlugins.js +3 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +10 -0
- package/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/internals/plugins/corePlugins/index.d.ts +2 -0
- package/internals/plugins/corePlugins/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/index.d.ts +2 -0
- package/internals/plugins/corePlugins/useChartId/index.js +1 -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.types.js +1 -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/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 +73 -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 +57 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -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 +3 -0
- package/internals/plugins/models/index.js +3 -0
- package/internals/plugins/models/plugin.d.ts +75 -0
- package/internals/plugins/models/plugin.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/useCharts.d.ts +14 -0
- package/internals/store/useCharts.js +72 -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 +3 -0
- package/internals/store/useStore.js +17 -0
- package/models/axis.d.ts +1 -13
- package/modern/BarChart/AnimatedBarElement.js +21 -0
- package/modern/BarChart/BarChart.js +3 -35
- package/modern/BarChart/BarElement.js +10 -20
- package/modern/BarChart/BarPlot.js +12 -2
- package/modern/BarChart/useBarChartProps.js +2 -8
- package/modern/ChartContainer/ChartContainer.js +31 -25
- package/modern/ChartContainer/useChartContainerProps.js +12 -27
- 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 +1 -1
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/modern/ChartsLegend/chartsLegendClasses.js +2 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/modern/ChartsSurface/ChartsSurface.js +68 -35
- 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 +143 -145
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/modern/ChartsTooltip/index.js +2 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +19 -19
- package/modern/ChartsTooltip/useItemTooltip.js +5 -4
- package/modern/ChartsTooltip/utils.js +0 -8
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
- package/modern/ChartsXAxis/ChartsXAxis.js +3 -17
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -17
- package/modern/Gauge/Gauge.js +0 -6
- package/modern/Gauge/GaugeContainer.js +42 -76
- package/modern/LineChart/AnimatedArea.js +9 -18
- package/modern/LineChart/AnimatedLine.js +9 -20
- package/modern/LineChart/AreaPlot.js +12 -2
- package/modern/LineChart/CircleMarkElement.js +6 -5
- package/modern/LineChart/LineChart.js +3 -36
- package/modern/LineChart/LineHighlightPlot.js +6 -5
- package/modern/LineChart/LinePlot.js +12 -2
- package/modern/LineChart/MarkElement.js +6 -5
- package/modern/LineChart/useLineChartProps.js +2 -8
- package/modern/PieChart/PieChart.js +5 -41
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/ScatterChart/Scatter.js +6 -5
- package/modern/ScatterChart/ScatterChart.js +5 -36
- package/modern/ScatterChart/useScatterChartProps.js +1 -9
- package/modern/SparkLineChart/SparkLineChart.js +4 -35
- package/modern/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/modern/context/ChartProvider/ChartContext.js +8 -0
- package/modern/context/ChartProvider/ChartProvider.js +19 -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/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
- package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/modern/context/DrawingAreaProvider/index.js +3 -0
- package/modern/context/InteractionSelectors.js +12 -0
- package/modern/context/SizeProvider/Size.types.js +1 -0
- package/modern/context/SizeProvider/SizeContext.js +15 -0
- package/modern/context/SizeProvider/SizeProvider.js +26 -0
- package/modern/context/SizeProvider/index.js +4 -0
- package/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/modern/context/SizeProvider/useSize.js +13 -0
- package/modern/context/index.js +2 -1
- package/modern/hooks/useAxisEvents.js +32 -19
- package/modern/hooks/useChartId.js +5 -6
- package/modern/hooks/useDrawingArea.js +2 -2
- package/modern/hooks/useInteractionItemProps.js +22 -13
- package/modern/hooks/useSvgRef.js +4 -8
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
- package/modern/internals/index.js +3 -4
- package/modern/internals/plugins/allPlugins.js +3 -0
- package/modern/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/modern/internals/plugins/corePlugins/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/index.js +1 -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/featurePlugins/useChartInteraction/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -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/models/chart.js +1 -0
- package/modern/internals/plugins/models/helpers.js +1 -0
- package/modern/internals/plugins/models/index.js +3 -0
- package/modern/internals/plugins/models/plugin.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/useCharts.js +72 -0
- package/modern/internals/store/useCharts.types.js +1 -0
- package/modern/internals/store/useSelector.js +6 -0
- package/modern/internals/store/useStore.js +17 -0
- package/node/BarChart/AnimatedBarElement.js +28 -0
- package/node/BarChart/BarChart.js +3 -35
- package/node/BarChart/BarElement.js +11 -21
- package/node/BarChart/BarPlot.js +11 -1
- package/node/BarChart/useBarChartProps.js +2 -8
- package/node/ChartContainer/ChartContainer.js +31 -25
- package/node/ChartContainer/useChartContainerProps.js +12 -27
- package/node/ChartsAxis/axisClasses.js +5 -3
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.types.js +5 -0
- 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/chartsLegendClasses.js +5 -3
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/node/ChartsSurface/ChartsSurface.js +68 -35
- package/node/ChartsTooltip/ChartTooltip.types.js +5 -0
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
- package/node/ChartsTooltip/ChartsTooltip.js +142 -144
- package/node/ChartsTooltip/ChartsTooltipContainer.js +286 -0
- package/node/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
- package/node/ChartsTooltip/index.js +19 -28
- package/node/ChartsTooltip/useAxisTooltip.js +19 -19
- package/node/ChartsTooltip/useItemTooltip.js +5 -4
- package/node/ChartsTooltip/utils.js +0 -9
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -37
- package/node/ChartsXAxis/ChartsXAxis.js +3 -17
- package/node/ChartsYAxis/ChartsYAxis.js +2 -17
- package/node/Gauge/Gauge.js +0 -6
- package/node/Gauge/GaugeContainer.js +42 -76
- package/node/LineChart/AnimatedArea.js +9 -19
- package/node/LineChart/AnimatedLine.js +9 -21
- package/node/LineChart/AreaPlot.js +11 -1
- package/node/LineChart/CircleMarkElement.js +6 -5
- package/node/LineChart/LineChart.js +3 -36
- package/node/LineChart/LineHighlightPlot.js +6 -5
- package/node/LineChart/LinePlot.js +11 -1
- package/node/LineChart/MarkElement.js +6 -5
- package/node/LineChart/useLineChartProps.js +2 -8
- package/node/PieChart/PieChart.js +5 -41
- package/node/PieChart/PiePlot.js +2 -2
- package/node/ScatterChart/Scatter.js +6 -5
- package/node/ScatterChart/ScatterChart.js +5 -36
- package/node/ScatterChart/useScatterChartProps.js +1 -9
- package/node/SparkLineChart/SparkLineChart.js +4 -35
- package/node/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
- package/node/context/ChartProvider/ChartContext.js +15 -0
- package/node/context/ChartProvider/ChartProvider.js +24 -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/DrawingAreaProvider/DrawingArea.types.js +5 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +21 -0
- package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
- package/node/context/DrawingAreaProvider/index.js +38 -0
- package/node/context/InteractionSelectors.js +18 -0
- package/node/context/SizeProvider/Size.types.js +5 -0
- package/node/context/SizeProvider/SizeContext.js +22 -0
- package/node/context/SizeProvider/SizeProvider.js +29 -0
- package/node/context/SizeProvider/index.js +49 -0
- package/node/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/node/context/SizeProvider/useSize.js +20 -0
- package/node/context/index.js +10 -2
- package/node/hooks/useAxisEvents.js +33 -19
- package/node/hooks/useChartId.js +5 -7
- package/node/hooks/useDrawingArea.js +2 -2
- package/node/hooks/useInteractionItemProps.js +23 -14
- package/node/hooks/useSvgRef.js +4 -9
- package/node/index.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +8 -6
- package/node/internals/index.js +28 -40
- package/node/internals/plugins/allPlugins.js +10 -0
- package/node/internals/plugins/corePlugins/corePlugins.js +12 -0
- package/node/internals/plugins/corePlugins/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/index.js +12 -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/featurePlugins/useChartInteraction/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +81 -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/models/chart.js +5 -0
- package/node/internals/plugins/models/helpers.js +5 -0
- package/node/internals/plugins/models/index.js +38 -0
- package/node/internals/plugins/models/plugin.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/useCharts.js +80 -0
- package/node/internals/store/useCharts.types.js +5 -0
- package/node/internals/store/useSelector.js +13 -0
- package/node/internals/store/useStore.js +23 -0
- package/package.json +7 -5
- 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/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/InteractionProvider.d.ts +0 -50
- package/context/InteractionProvider.js +0 -78
- package/modern/ChartContainer/ResizableContainer.js +0 -26
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/modern/context/InteractionProvider.js +0 -78
- package/node/ChartContainer/ResizableContainer.js +0 -32
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- package/node/context/InteractionProvider.js +0 -85
- /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
- /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { ChartRootSelector } from '../../utils/selectors';
|
|
2
|
+
import { UseChartInteractionSignature } from './useChartInteraction.types';
|
|
3
|
+
export declare const selectorChartsInteractionItem: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
4
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
5
|
+
}) => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null) & {
|
|
6
|
+
clearCache: () => void;
|
|
7
|
+
resultsCount: () => number;
|
|
8
|
+
resetResultsCount: () => void;
|
|
9
|
+
} & {
|
|
10
|
+
resultFunc: (resultFuncArgs_0: {
|
|
11
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
12
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
13
|
+
isVoronoiEnabled?: boolean;
|
|
14
|
+
}) => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null;
|
|
15
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
16
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
17
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
18
|
+
isVoronoiEnabled?: boolean;
|
|
19
|
+
}) => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null) & {
|
|
20
|
+
clearCache: () => void;
|
|
21
|
+
resultsCount: () => number;
|
|
22
|
+
resetResultsCount: () => void;
|
|
23
|
+
};
|
|
24
|
+
lastResult: () => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null;
|
|
25
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
26
|
+
recomputations: () => number;
|
|
27
|
+
resetRecomputations: () => void;
|
|
28
|
+
dependencyRecomputations: () => number;
|
|
29
|
+
resetDependencyRecomputations: () => void;
|
|
30
|
+
} & {
|
|
31
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
32
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
33
|
+
};
|
|
34
|
+
export declare const selectorChartsInteractionAxis: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
35
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
36
|
+
}) => import("./useChartInteraction.types").AxisInteractionData) & {
|
|
37
|
+
clearCache: () => void;
|
|
38
|
+
resultsCount: () => number;
|
|
39
|
+
resetResultsCount: () => void;
|
|
40
|
+
} & {
|
|
41
|
+
resultFunc: (resultFuncArgs_0: {
|
|
42
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
43
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
44
|
+
isVoronoiEnabled?: boolean;
|
|
45
|
+
}) => import("./useChartInteraction.types").AxisInteractionData;
|
|
46
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
47
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
48
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
49
|
+
isVoronoiEnabled?: boolean;
|
|
50
|
+
}) => import("./useChartInteraction.types").AxisInteractionData) & {
|
|
51
|
+
clearCache: () => void;
|
|
52
|
+
resultsCount: () => number;
|
|
53
|
+
resetResultsCount: () => void;
|
|
54
|
+
};
|
|
55
|
+
lastResult: () => import("./useChartInteraction.types").AxisInteractionData;
|
|
56
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
57
|
+
recomputations: () => number;
|
|
58
|
+
resetRecomputations: () => void;
|
|
59
|
+
dependencyRecomputations: () => number;
|
|
60
|
+
resetDependencyRecomputations: () => void;
|
|
61
|
+
} & {
|
|
62
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
63
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
64
|
+
};
|
|
65
|
+
export declare const selectorChartsInteractionXAxis: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
66
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
67
|
+
}) => {
|
|
68
|
+
value: number | Date | string;
|
|
69
|
+
index: number;
|
|
70
|
+
} | null) & {
|
|
71
|
+
clearCache: () => void;
|
|
72
|
+
resultsCount: () => number;
|
|
73
|
+
resetResultsCount: () => void;
|
|
74
|
+
} & {
|
|
75
|
+
resultFunc: (resultFuncArgs_0: {
|
|
76
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
77
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
78
|
+
isVoronoiEnabled?: boolean;
|
|
79
|
+
}) => {
|
|
80
|
+
value: number | Date | string;
|
|
81
|
+
index: number;
|
|
82
|
+
} | null;
|
|
83
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
84
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
85
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
86
|
+
isVoronoiEnabled?: boolean;
|
|
87
|
+
}) => {
|
|
88
|
+
value: number | Date | string;
|
|
89
|
+
index: number;
|
|
90
|
+
} | null) & {
|
|
91
|
+
clearCache: () => void;
|
|
92
|
+
resultsCount: () => number;
|
|
93
|
+
resetResultsCount: () => void;
|
|
94
|
+
};
|
|
95
|
+
lastResult: () => {
|
|
96
|
+
value: number | Date | string;
|
|
97
|
+
index: number;
|
|
98
|
+
} | null;
|
|
99
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
100
|
+
recomputations: () => number;
|
|
101
|
+
resetRecomputations: () => void;
|
|
102
|
+
dependencyRecomputations: () => number;
|
|
103
|
+
resetDependencyRecomputations: () => void;
|
|
104
|
+
} & {
|
|
105
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
106
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
107
|
+
};
|
|
108
|
+
export declare const selectorChartsInteractionYAxis: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
109
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
110
|
+
}) => {
|
|
111
|
+
value: number | Date | string;
|
|
112
|
+
index: number;
|
|
113
|
+
} | null) & {
|
|
114
|
+
clearCache: () => void;
|
|
115
|
+
resultsCount: () => number;
|
|
116
|
+
resetResultsCount: () => void;
|
|
117
|
+
} & {
|
|
118
|
+
resultFunc: (resultFuncArgs_0: {
|
|
119
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
120
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
121
|
+
isVoronoiEnabled?: boolean;
|
|
122
|
+
}) => {
|
|
123
|
+
value: number | Date | string;
|
|
124
|
+
index: number;
|
|
125
|
+
} | null;
|
|
126
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
127
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
128
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
129
|
+
isVoronoiEnabled?: boolean;
|
|
130
|
+
}) => {
|
|
131
|
+
value: number | Date | string;
|
|
132
|
+
index: number;
|
|
133
|
+
} | null) & {
|
|
134
|
+
clearCache: () => void;
|
|
135
|
+
resultsCount: () => number;
|
|
136
|
+
resetResultsCount: () => void;
|
|
137
|
+
};
|
|
138
|
+
lastResult: () => {
|
|
139
|
+
value: number | Date | string;
|
|
140
|
+
index: number;
|
|
141
|
+
} | null;
|
|
142
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
143
|
+
recomputations: () => number;
|
|
144
|
+
resetRecomputations: () => void;
|
|
145
|
+
dependencyRecomputations: () => number;
|
|
146
|
+
resetDependencyRecomputations: () => void;
|
|
147
|
+
} & {
|
|
148
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
149
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
150
|
+
};
|
|
151
|
+
export declare const selectorChartsInteractionItemIsDefined: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
152
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
153
|
+
}) => boolean) & {
|
|
154
|
+
clearCache: () => void;
|
|
155
|
+
resultsCount: () => number;
|
|
156
|
+
resetResultsCount: () => void;
|
|
157
|
+
} & {
|
|
158
|
+
resultFunc: (resultFuncArgs_0: import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null) => boolean;
|
|
159
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null) => boolean) & {
|
|
160
|
+
clearCache: () => void;
|
|
161
|
+
resultsCount: () => number;
|
|
162
|
+
resetResultsCount: () => void;
|
|
163
|
+
};
|
|
164
|
+
lastResult: () => boolean;
|
|
165
|
+
dependencies: [((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
166
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
167
|
+
}) => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null) & {
|
|
168
|
+
clearCache: () => void;
|
|
169
|
+
resultsCount: () => number;
|
|
170
|
+
resetResultsCount: () => void;
|
|
171
|
+
} & {
|
|
172
|
+
resultFunc: (resultFuncArgs_0: {
|
|
173
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
174
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
175
|
+
isVoronoiEnabled?: boolean;
|
|
176
|
+
}) => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null;
|
|
177
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
178
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
179
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
180
|
+
isVoronoiEnabled?: boolean;
|
|
181
|
+
}) => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null) & {
|
|
182
|
+
clearCache: () => void;
|
|
183
|
+
resultsCount: () => number;
|
|
184
|
+
resetResultsCount: () => void;
|
|
185
|
+
};
|
|
186
|
+
lastResult: () => import("../../../..").BarItemIdentifier | import("../../../..").ScatterItemIdentifier | import("../../../..").LineItemIdentifier | import("../../../..").PieItemIdentifier | null;
|
|
187
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
188
|
+
recomputations: () => number;
|
|
189
|
+
resetRecomputations: () => void;
|
|
190
|
+
dependencyRecomputations: () => number;
|
|
191
|
+
resetDependencyRecomputations: () => void;
|
|
192
|
+
} & {
|
|
193
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
194
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
195
|
+
}];
|
|
196
|
+
recomputations: () => number;
|
|
197
|
+
resetRecomputations: () => void;
|
|
198
|
+
dependencyRecomputations: () => number;
|
|
199
|
+
resetDependencyRecomputations: () => void;
|
|
200
|
+
} & {
|
|
201
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
202
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
203
|
+
};
|
|
204
|
+
export declare const selectorChartsInteractionXAxisIsDefined: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
205
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
206
|
+
}) => boolean) & {
|
|
207
|
+
clearCache: () => void;
|
|
208
|
+
resultsCount: () => number;
|
|
209
|
+
resetResultsCount: () => void;
|
|
210
|
+
} & {
|
|
211
|
+
resultFunc: (resultFuncArgs_0: {
|
|
212
|
+
value: number | Date | string;
|
|
213
|
+
index: number;
|
|
214
|
+
} | null) => boolean;
|
|
215
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
216
|
+
value: number | Date | string;
|
|
217
|
+
index: number;
|
|
218
|
+
} | null) => boolean) & {
|
|
219
|
+
clearCache: () => void;
|
|
220
|
+
resultsCount: () => number;
|
|
221
|
+
resetResultsCount: () => void;
|
|
222
|
+
};
|
|
223
|
+
lastResult: () => boolean;
|
|
224
|
+
dependencies: [((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
225
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
226
|
+
}) => {
|
|
227
|
+
value: number | Date | string;
|
|
228
|
+
index: number;
|
|
229
|
+
} | null) & {
|
|
230
|
+
clearCache: () => void;
|
|
231
|
+
resultsCount: () => number;
|
|
232
|
+
resetResultsCount: () => void;
|
|
233
|
+
} & {
|
|
234
|
+
resultFunc: (resultFuncArgs_0: {
|
|
235
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
236
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
237
|
+
isVoronoiEnabled?: boolean;
|
|
238
|
+
}) => {
|
|
239
|
+
value: number | Date | string;
|
|
240
|
+
index: number;
|
|
241
|
+
} | null;
|
|
242
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
243
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
244
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
245
|
+
isVoronoiEnabled?: boolean;
|
|
246
|
+
}) => {
|
|
247
|
+
value: number | Date | string;
|
|
248
|
+
index: number;
|
|
249
|
+
} | null) & {
|
|
250
|
+
clearCache: () => void;
|
|
251
|
+
resultsCount: () => number;
|
|
252
|
+
resetResultsCount: () => void;
|
|
253
|
+
};
|
|
254
|
+
lastResult: () => {
|
|
255
|
+
value: number | Date | string;
|
|
256
|
+
index: number;
|
|
257
|
+
} | null;
|
|
258
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
259
|
+
recomputations: () => number;
|
|
260
|
+
resetRecomputations: () => void;
|
|
261
|
+
dependencyRecomputations: () => number;
|
|
262
|
+
resetDependencyRecomputations: () => void;
|
|
263
|
+
} & {
|
|
264
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
265
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
266
|
+
}];
|
|
267
|
+
recomputations: () => number;
|
|
268
|
+
resetRecomputations: () => void;
|
|
269
|
+
dependencyRecomputations: () => number;
|
|
270
|
+
resetDependencyRecomputations: () => void;
|
|
271
|
+
} & {
|
|
272
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
273
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
274
|
+
};
|
|
275
|
+
export declare const selectorChartsInteractionYAxisIsDefined: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
276
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
277
|
+
}) => boolean) & {
|
|
278
|
+
clearCache: () => void;
|
|
279
|
+
resultsCount: () => number;
|
|
280
|
+
resetResultsCount: () => void;
|
|
281
|
+
} & {
|
|
282
|
+
resultFunc: (resultFuncArgs_0: {
|
|
283
|
+
value: number | Date | string;
|
|
284
|
+
index: number;
|
|
285
|
+
} | null) => boolean;
|
|
286
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
287
|
+
value: number | Date | string;
|
|
288
|
+
index: number;
|
|
289
|
+
} | null) => boolean) & {
|
|
290
|
+
clearCache: () => void;
|
|
291
|
+
resultsCount: () => number;
|
|
292
|
+
resetResultsCount: () => void;
|
|
293
|
+
};
|
|
294
|
+
lastResult: () => boolean;
|
|
295
|
+
dependencies: [((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
296
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
297
|
+
}) => {
|
|
298
|
+
value: number | Date | string;
|
|
299
|
+
index: number;
|
|
300
|
+
} | null) & {
|
|
301
|
+
clearCache: () => void;
|
|
302
|
+
resultsCount: () => number;
|
|
303
|
+
resetResultsCount: () => void;
|
|
304
|
+
} & {
|
|
305
|
+
resultFunc: (resultFuncArgs_0: {
|
|
306
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
307
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
308
|
+
isVoronoiEnabled?: boolean;
|
|
309
|
+
}) => {
|
|
310
|
+
value: number | Date | string;
|
|
311
|
+
index: number;
|
|
312
|
+
} | null;
|
|
313
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
314
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
315
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
316
|
+
isVoronoiEnabled?: boolean;
|
|
317
|
+
}) => {
|
|
318
|
+
value: number | Date | string;
|
|
319
|
+
index: number;
|
|
320
|
+
} | null) & {
|
|
321
|
+
clearCache: () => void;
|
|
322
|
+
resultsCount: () => number;
|
|
323
|
+
resetResultsCount: () => void;
|
|
324
|
+
};
|
|
325
|
+
lastResult: () => {
|
|
326
|
+
value: number | Date | string;
|
|
327
|
+
index: number;
|
|
328
|
+
} | null;
|
|
329
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
330
|
+
recomputations: () => number;
|
|
331
|
+
resetRecomputations: () => void;
|
|
332
|
+
dependencyRecomputations: () => number;
|
|
333
|
+
resetDependencyRecomputations: () => void;
|
|
334
|
+
} & {
|
|
335
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
336
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
337
|
+
}];
|
|
338
|
+
recomputations: () => number;
|
|
339
|
+
resetRecomputations: () => void;
|
|
340
|
+
dependencyRecomputations: () => number;
|
|
341
|
+
resetDependencyRecomputations: () => void;
|
|
342
|
+
} & {
|
|
343
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
344
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
345
|
+
};
|
|
346
|
+
export declare const selectorChartsInteractionIsVoronoiEnabled: ((state: import("../../corePlugins/useChartId/useChartId.types").UseChartIdState & import("./useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
347
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
348
|
+
}) => boolean | undefined) & {
|
|
349
|
+
clearCache: () => void;
|
|
350
|
+
resultsCount: () => number;
|
|
351
|
+
resetResultsCount: () => void;
|
|
352
|
+
} & {
|
|
353
|
+
resultFunc: (resultFuncArgs_0: {
|
|
354
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
355
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
356
|
+
isVoronoiEnabled?: boolean;
|
|
357
|
+
}) => boolean | undefined;
|
|
358
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
359
|
+
item: null | import("../../..").ChartItemIdentifier<import("../../..").ChartSeriesType>;
|
|
360
|
+
axis: import("./useChartInteraction.types").AxisInteractionData;
|
|
361
|
+
isVoronoiEnabled?: boolean;
|
|
362
|
+
}) => boolean | undefined) & {
|
|
363
|
+
clearCache: () => void;
|
|
364
|
+
resultsCount: () => number;
|
|
365
|
+
resetResultsCount: () => void;
|
|
366
|
+
};
|
|
367
|
+
lastResult: () => boolean | undefined;
|
|
368
|
+
dependencies: [ChartRootSelector<UseChartInteractionSignature>];
|
|
369
|
+
recomputations: () => number;
|
|
370
|
+
resetRecomputations: () => void;
|
|
371
|
+
dependencyRecomputations: () => number;
|
|
372
|
+
resetDependencyRecomputations: () => void;
|
|
373
|
+
} & {
|
|
374
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
375
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
376
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createSelector } from "../../utils/selectors.js";
|
|
2
|
+
const selectInteraction = state => state.interaction;
|
|
3
|
+
export const selectorChartsInteractionItem = createSelector(selectInteraction, interaction => interaction.item);
|
|
4
|
+
export const selectorChartsInteractionAxis = createSelector(selectInteraction, interaction => interaction.axis);
|
|
5
|
+
export const selectorChartsInteractionXAxis = createSelector(selectInteraction, interaction => interaction.axis.x);
|
|
6
|
+
export const selectorChartsInteractionYAxis = createSelector(selectInteraction, interaction => interaction.axis.y);
|
|
7
|
+
export const selectorChartsInteractionItemIsDefined = createSelector(selectorChartsInteractionItem, item => item !== null);
|
|
8
|
+
export const selectorChartsInteractionXAxisIsDefined = createSelector(selectorChartsInteractionXAxis, x => x !== null);
|
|
9
|
+
export const selectorChartsInteractionYAxisIsDefined = createSelector(selectorChartsInteractionYAxis, y => y !== null);
|
|
10
|
+
export const selectorChartsInteractionIsVoronoiEnabled = createSelector(selectInteraction, interaction => interaction.isVoronoiEnabled);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ChartPluginSignature } from '../../models';
|
|
2
|
+
import { ChartItemIdentifier, ChartSeriesType } from '../../../../models/seriesType/config';
|
|
3
|
+
export interface UseChartInteractionInstance {
|
|
4
|
+
/**
|
|
5
|
+
* Remove all interaction.
|
|
6
|
+
*/
|
|
7
|
+
cleanInteraction: () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Setter for the item the user is interacting with.
|
|
10
|
+
* @param {ChartItemIdentifier} newItem The identifier of the item.
|
|
11
|
+
*/
|
|
12
|
+
setItemInteraction: (newItem: ChartItemIdentifier<ChartSeriesType>) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Set the new axis the user is interacting with.
|
|
15
|
+
* @param {Partial<AxisInteractionData>} newAxis The new axis identifier.
|
|
16
|
+
*/
|
|
17
|
+
setAxisInteraction: (newAxis: Partial<AxisInteractionData>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Enable the voronoi computation.
|
|
20
|
+
*/
|
|
21
|
+
enableVoronoid: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Disable the voronoi computation.
|
|
24
|
+
*/
|
|
25
|
+
disableVoronoid: () => void;
|
|
26
|
+
}
|
|
27
|
+
export type AxisInteractionData = {
|
|
28
|
+
x: null | {
|
|
29
|
+
value: number | Date | string;
|
|
30
|
+
index: number;
|
|
31
|
+
};
|
|
32
|
+
y: null | {
|
|
33
|
+
value: number | Date | string;
|
|
34
|
+
index: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export interface UseChartInteractionState {
|
|
38
|
+
interaction: {
|
|
39
|
+
/**
|
|
40
|
+
* The item currently interacting.
|
|
41
|
+
*/
|
|
42
|
+
item: null | ChartItemIdentifier<ChartSeriesType>;
|
|
43
|
+
/**
|
|
44
|
+
* The x- and y-axes currently interacting.
|
|
45
|
+
*/
|
|
46
|
+
axis: AxisInteractionData;
|
|
47
|
+
/**
|
|
48
|
+
* Set to `true` when `VoronoiHandler` is active.
|
|
49
|
+
* Used to prevent collision with mouseEnter events.
|
|
50
|
+
*/
|
|
51
|
+
isVoronoiEnabled?: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export type UseChartInteractionSignature = ChartPluginSignature<{
|
|
55
|
+
instance: UseChartInteractionInstance;
|
|
56
|
+
state: UseChartInteractionState;
|
|
57
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChartAnyPluginSignature } from './plugin';
|
|
2
|
+
import type { MergeSignaturesProperty } from './helpers';
|
|
3
|
+
import type { ChartCorePluginSignatures } from '../corePlugins';
|
|
4
|
+
export type ChartInstance<TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []> = MergeSignaturesProperty<[...ChartCorePluginSignatures, ...TSignatures], 'instance'> & Partial<MergeSignaturesProperty<TOptionalSignatures, 'instance'>>;
|
|
5
|
+
export type ChartPublicAPI<TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []> = MergeSignaturesProperty<[...ChartCorePluginSignatures, ...TSignatures], 'publicAPI'> & Partial<MergeSignaturesProperty<TOptionalSignatures, 'instance'>>;
|
|
6
|
+
export type ChartStateCacheKey = {
|
|
7
|
+
id: number;
|
|
8
|
+
};
|
|
9
|
+
export type ChartState<TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []> = MergeSignaturesProperty<[...ChartCorePluginSignatures, ...TSignatures], 'state'> & Partial<MergeSignaturesProperty<TOptionalSignatures, 'state'>> & {
|
|
10
|
+
/**
|
|
11
|
+
* The key used to identify the chart in the global cache object.
|
|
12
|
+
*/
|
|
13
|
+
cacheKey: ChartStateCacheKey;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartAnyPluginSignature, ChartPlugin } from './plugin';
|
|
2
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
3
|
+
export type OptionalIfEmpty<A extends string, B> = keyof B extends never ? Partial<Record<A, B>> : IsAny<B> extends true ? Partial<Record<A, B>> : Record<A, B>;
|
|
4
|
+
export type MergeSignaturesProperty<TSignatures extends readonly any[], TProperty extends keyof ChartAnyPluginSignature> = TSignatures extends readonly [plugin: infer P, ...otherPlugin: infer R] ? P extends ChartAnyPluginSignature ? P[TProperty] & MergeSignaturesProperty<R, TProperty> : {} : {};
|
|
5
|
+
export type ConvertPluginsIntoSignatures<TPlugins extends readonly ChartPlugin<ChartAnyPluginSignature>[]> = TPlugins extends readonly [plugin: infer TPlugin, ...otherPlugin: infer R] ? R extends readonly ChartPlugin<any>[] ? TPlugin extends ChartPlugin<infer TSignature> ? readonly [TSignature, ...ConvertPluginsIntoSignatures<R>] : never : never : [];
|
|
6
|
+
export type ConvertSignaturesIntoPlugins<TSignatures extends readonly ChartAnyPluginSignature[]> = TSignatures extends readonly [signature: infer TSignature, ...otherSignatures: infer R] ? R extends readonly ChartAnyPluginSignature[] ? TSignature extends ChartAnyPluginSignature ? readonly [ChartPlugin<TSignature>, ...ConvertSignaturesIntoPlugins<R>] : never : never : [];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MergeSignaturesProperty, OptionalIfEmpty } from './helpers';
|
|
3
|
+
import type { ChartCorePluginSignatures } from '../corePlugins';
|
|
4
|
+
import { ChartStore } from '../utils/ChartStore';
|
|
5
|
+
export interface ChartPluginOptions<TSignature extends ChartAnyPluginSignature> {
|
|
6
|
+
instance: ChartUsedInstance<TSignature>;
|
|
7
|
+
params: ChartUsedDefaultizedParams<TSignature>;
|
|
8
|
+
store: ChartUsedStore<TSignature>;
|
|
9
|
+
svgRef: React.RefObject<SVGSVGElement>;
|
|
10
|
+
plugins: ChartPlugin<ChartAnyPluginSignature>[];
|
|
11
|
+
}
|
|
12
|
+
type ChartResponse<TSignature extends ChartAnyPluginSignature> = OptionalIfEmpty<'publicAPI', TSignature['publicAPI']> & OptionalIfEmpty<'instance', TSignature['instance']>;
|
|
13
|
+
export type ChartPluginSignature<T extends {
|
|
14
|
+
params?: {};
|
|
15
|
+
defaultizedParams?: {};
|
|
16
|
+
instance?: {};
|
|
17
|
+
publicAPI?: {};
|
|
18
|
+
state?: {};
|
|
19
|
+
dependencies?: readonly ChartAnyPluginSignature[];
|
|
20
|
+
optionalDependencies?: readonly ChartAnyPluginSignature[];
|
|
21
|
+
}> = {
|
|
22
|
+
params: T extends {
|
|
23
|
+
params: {};
|
|
24
|
+
} ? T['params'] : {};
|
|
25
|
+
defaultizedParams: T extends {
|
|
26
|
+
defaultizedParams: {};
|
|
27
|
+
} ? T['defaultizedParams'] : {};
|
|
28
|
+
instance: T extends {
|
|
29
|
+
instance: {};
|
|
30
|
+
} ? T['instance'] : {};
|
|
31
|
+
state: T extends {
|
|
32
|
+
state: {};
|
|
33
|
+
} ? T['state'] : {};
|
|
34
|
+
publicAPI: T extends {
|
|
35
|
+
publicAPI: {};
|
|
36
|
+
} ? T['publicAPI'] : {};
|
|
37
|
+
dependencies: T extends {
|
|
38
|
+
dependencies: Array<any>;
|
|
39
|
+
} ? T['dependencies'] : [];
|
|
40
|
+
optionalDependencies: T extends {
|
|
41
|
+
optionalDependencies: Array<any>;
|
|
42
|
+
} ? T['optionalDependencies'] : [];
|
|
43
|
+
};
|
|
44
|
+
export type ChartAnyPluginSignature = {
|
|
45
|
+
state: any;
|
|
46
|
+
instance: any;
|
|
47
|
+
params: any;
|
|
48
|
+
defaultizedParams: any;
|
|
49
|
+
dependencies: any;
|
|
50
|
+
optionalDependencies: any;
|
|
51
|
+
publicAPI: any;
|
|
52
|
+
};
|
|
53
|
+
type ChartRequiredPlugins<TSignature extends ChartAnyPluginSignature> = [
|
|
54
|
+
...ChartCorePluginSignatures,
|
|
55
|
+
...TSignature['dependencies']
|
|
56
|
+
];
|
|
57
|
+
type PluginPropertyWithDependencies<TSignature extends ChartAnyPluginSignature, TProperty extends keyof ChartAnyPluginSignature> = TSignature[TProperty] & MergeSignaturesProperty<ChartRequiredPlugins<TSignature>, TProperty> & Partial<MergeSignaturesProperty<TSignature['optionalDependencies'], TProperty>>;
|
|
58
|
+
export type ChartUsedParams<TSignature extends ChartAnyPluginSignature> = PluginPropertyWithDependencies<TSignature, 'params'>;
|
|
59
|
+
type ChartUsedDefaultizedParams<TSignature extends ChartAnyPluginSignature> = PluginPropertyWithDependencies<TSignature, 'defaultizedParams'>;
|
|
60
|
+
export type ChartUsedInstance<TSignature extends ChartAnyPluginSignature> = PluginPropertyWithDependencies<TSignature, 'instance'> & {
|
|
61
|
+
/**
|
|
62
|
+
* Private property only defined in TypeScript to be able to access the plugin signature from the instance object.
|
|
63
|
+
*/
|
|
64
|
+
$$signature: TSignature;
|
|
65
|
+
};
|
|
66
|
+
export type ChartUsedStore<TSignature extends ChartAnyPluginSignature> = ChartStore<[
|
|
67
|
+
TSignature,
|
|
68
|
+
...TSignature['dependencies']
|
|
69
|
+
]>;
|
|
70
|
+
export type ChartPlugin<TSignature extends ChartAnyPluginSignature> = {
|
|
71
|
+
(options: ChartPluginOptions<TSignature>): ChartResponse<TSignature>;
|
|
72
|
+
getInitialState?: (params: ChartUsedDefaultizedParams<TSignature>) => TSignature['state'];
|
|
73
|
+
params: Record<keyof TSignature['params'], true>;
|
|
74
|
+
};
|
|
75
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartState } from '../models/chart';
|
|
2
|
+
import type { ChartAnyPluginSignature } from '../models/plugin';
|
|
3
|
+
type Listener<T> = (value: T) => void;
|
|
4
|
+
export type StoreUpdater<TSignatures extends readonly ChartAnyPluginSignature[]> = (prevState: ChartState<TSignatures>) => ChartState<TSignatures>;
|
|
5
|
+
export declare class ChartStore<TSignatures extends readonly ChartAnyPluginSignature[]> {
|
|
6
|
+
value: ChartState<TSignatures>;
|
|
7
|
+
private listeners;
|
|
8
|
+
constructor(value: ChartState<TSignatures>);
|
|
9
|
+
subscribe: (fn: Listener<ChartState<TSignatures>>) => () => void;
|
|
10
|
+
getSnapshot: () => ChartState<TSignatures>;
|
|
11
|
+
update: (updater: StoreUpdater<TSignatures>) => void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class ChartStore {
|
|
2
|
+
constructor(value) {
|
|
3
|
+
this.value = void 0;
|
|
4
|
+
this.listeners = void 0;
|
|
5
|
+
this.subscribe = fn => {
|
|
6
|
+
this.listeners.add(fn);
|
|
7
|
+
return () => {
|
|
8
|
+
this.listeners.delete(fn);
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
this.getSnapshot = () => {
|
|
12
|
+
return this.value;
|
|
13
|
+
};
|
|
14
|
+
this.update = updater => {
|
|
15
|
+
const newState = updater(this.value);
|
|
16
|
+
if (newState !== this.value) {
|
|
17
|
+
this.value = newState;
|
|
18
|
+
this.listeners.forEach(l => l(newState));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
this.value = value;
|
|
22
|
+
this.listeners = new Set();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CreateSelectorFunction } from 'reselect';
|
|
2
|
+
import { ChartAnyPluginSignature, ChartState } from '../models';
|
|
3
|
+
export type ChartRootSelector<TSignature extends ChartAnyPluginSignature> = <TSignatures extends [TSignature]>(state: ChartState<TSignatures>) => TSignature['state'][keyof TSignature['state']];
|
|
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;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { lruMemoize, createSelectorCreator } from 'reselect';
|
|
2
|
+
const reselectCreateSelector = createSelectorCreator({
|
|
3
|
+
memoize: lruMemoize,
|
|
4
|
+
memoizeOptions: {
|
|
5
|
+
maxSize: 1,
|
|
6
|
+
equalityCheck: Object.is
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const cache = new WeakMap();
|
|
10
|
+
/**
|
|
11
|
+
* Method wrapping reselect's createSelector to provide caching for chart instances.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export const createSelector = (...createSelectorArgs) => {
|
|
15
|
+
const selector = (state, selectorArgs) => {
|
|
16
|
+
const cacheKey = state.cacheKey;
|
|
17
|
+
|
|
18
|
+
// If there is no cache for the current chart instance, create one.
|
|
19
|
+
let cacheForCurrentChartInstance = cache.get(cacheKey);
|
|
20
|
+
if (!cacheForCurrentChartInstance) {
|
|
21
|
+
cacheForCurrentChartInstance = new Map();
|
|
22
|
+
cache.set(cacheKey, cacheForCurrentChartInstance);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// If there is a cached selector, execute it.
|
|
26
|
+
const cachedSelector = cacheForCurrentChartInstance.get(createSelectorArgs);
|
|
27
|
+
if (cachedSelector) {
|
|
28
|
+
return cachedSelector(state, selectorArgs);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Otherwise, create a new selector and cache it and execute it.
|
|
32
|
+
const fn = reselectCreateSelector(...createSelectorArgs);
|
|
33
|
+
cacheForCurrentChartInstance.set(createSelectorArgs, fn);
|
|
34
|
+
return fn(state, selectorArgs);
|
|
35
|
+
};
|
|
36
|
+
return selector;
|
|
37
|
+
};
|