@mui/x-charts 8.0.0-alpha.0 → 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 +4 -9
- package/BarChart/BarChart.js +3 -31
- package/BarChart/BarElement.d.ts +5 -1342
- package/BarChart/BarElement.js +10 -20
- package/BarChart/BarPlot.js +12 -2
- package/BarChart/useBarChartProps.d.ts +0 -2
- package/BarChart/useBarChartProps.js +2 -8
- package/CHANGELOG.md +429 -5
- package/ChartContainer/ChartContainer.d.ts +2 -19
- package/ChartContainer/ChartContainer.js +10 -20
- package/ChartContainer/ResizableContainer.d.ts +17 -4
- package/ChartContainer/ResizableContainer.js +36 -2
- package/ChartContainer/useChartContainerProps.d.ts +6 -7
- package/ChartContainer/useChartContainerProps.js +14 -28
- 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/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/ChartsSurface/ChartsSurface.d.ts +0 -15
- package/ChartsSurface/ChartsSurface.js +35 -34
- 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 +161 -145
- 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 +19 -19
- package/ChartsTooltip/useItemTooltip.d.ts +1 -1
- package/ChartsTooltip/useItemTooltip.js +5 -4
- package/ChartsTooltip/utils.d.ts +0 -3
- package/ChartsTooltip/utils.js +0 -8
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +47 -34
- 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/AreaPlot.js +12 -2
- package/LineChart/CircleMarkElement.js +6 -5
- package/LineChart/LineChart.d.ts +4 -10
- package/LineChart/LineChart.js +3 -32
- 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 -37
- 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 -32
- 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 -31
- package/context/ChartDataProvider/ChartDataProvider.d.ts +9 -19
- package/context/ChartDataProvider/ChartDataProvider.js +30 -43
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +7 -10
- package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- 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 +8 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
- package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
- package/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/context/DrawingAreaProvider/index.d.ts +3 -0
- package/context/DrawingAreaProvider/index.js +3 -0
- 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/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 +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/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.d.ts +4 -1
- package/{modern/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +11 -5
- 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/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.js +1 -1
- 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/index.d.ts +3 -2
- package/internals/index.js +3 -2
- 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/modern/BarChart/AnimatedBarElement.js +21 -0
- package/modern/BarChart/BarChart.js +3 -31
- 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 +10 -20
- package/modern/ChartContainer/ResizableContainer.js +36 -2
- package/modern/ChartContainer/useChartContainerProps.js +14 -28
- 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/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- 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 +161 -145
- 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 +19 -19
- package/modern/ChartsTooltip/useItemTooltip.js +5 -4
- package/modern/ChartsTooltip/utils.js +0 -8
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +47 -34
- 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 +12 -2
- package/modern/LineChart/CircleMarkElement.js +6 -5
- package/modern/LineChart/LineChart.js +3 -32
- 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 -37
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/ScatterChart/Scatter.js +6 -5
- package/modern/ScatterChart/ScatterChart.js +5 -32
- package/modern/ScatterChart/useScatterChartProps.js +1 -9
- package/modern/SparkLineChart/SparkLineChart.js +4 -31
- package/modern/context/ChartDataProvider/ChartDataProvider.js +30 -43
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
- package/modern/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/modern/context/DrawingAreaProvider/index.js +3 -0
- 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/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +11 -5
- 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 +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/modern/internals/index.js +3 -2
- 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/node/BarChart/AnimatedBarElement.js +28 -0
- package/node/BarChart/BarChart.js +3 -31
- 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 +10 -20
- package/node/ChartContainer/ResizableContainer.js +39 -3
- package/node/ChartContainer/useChartContainerProps.js +14 -28
- 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/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/node/ChartsSurface/ChartsSurface.js +35 -34
- 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 +160 -144
- 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 +19 -19
- package/node/ChartsTooltip/useItemTooltip.js +5 -4
- package/node/ChartsTooltip/utils.js +0 -9
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +48 -35
- 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 +11 -1
- package/node/LineChart/CircleMarkElement.js +6 -5
- package/node/LineChart/LineChart.js +3 -32
- 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 -37
- package/node/PieChart/PiePlot.js +2 -2
- package/node/ScatterChart/Scatter.js +6 -5
- package/node/ScatterChart/ScatterChart.js +5 -32
- package/node/ScatterChart/useScatterChartProps.js +1 -9
- package/node/SparkLineChart/SparkLineChart.js +4 -31
- package/node/context/ChartDataProvider/ChartDataProvider.js +30 -43
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
- 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/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/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +11 -5
- 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 +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/node/internals/index.js +28 -16
- 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/package.json +7 -5
- 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/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- /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
|
@@ -3,42 +3,19 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useId from '@mui/utils/useId';
|
|
6
|
-
import useChartDimensions from "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Defines the area in which it is possible to draw the charts.
|
|
10
|
-
*/
|
|
6
|
+
import useChartDimensions from "../../hooks/useChartDimensions.js";
|
|
7
|
+
import { DrawingAreaContext } from "./DrawingAreaContext.js";
|
|
8
|
+
import { useSize } from "../SizeProvider/index.js";
|
|
11
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export
|
|
13
|
-
top: 0,
|
|
14
|
-
left: 0,
|
|
15
|
-
bottom: 0,
|
|
16
|
-
right: 0,
|
|
17
|
-
height: 300,
|
|
18
|
-
width: 400,
|
|
19
|
-
chartId: '',
|
|
20
|
-
isPointInside: () => false
|
|
21
|
-
});
|
|
22
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
23
|
-
DrawingContext.displayName = 'DrawingContext';
|
|
24
|
-
}
|
|
25
|
-
export const SvgContext = /*#__PURE__*/React.createContext({
|
|
26
|
-
isInitialized: false,
|
|
27
|
-
data: {
|
|
28
|
-
current: null
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
-
SvgContext.displayName = 'SvgContext';
|
|
33
|
-
}
|
|
34
|
-
export function DrawingProvider(props) {
|
|
10
|
+
export function DrawingAreaProvider(props) {
|
|
35
11
|
const {
|
|
36
|
-
width,
|
|
37
|
-
height,
|
|
38
12
|
margin,
|
|
39
|
-
svgRef,
|
|
40
13
|
children
|
|
41
14
|
} = props;
|
|
15
|
+
const {
|
|
16
|
+
width,
|
|
17
|
+
height
|
|
18
|
+
} = useSize();
|
|
42
19
|
const drawingArea = useChartDimensions(width, height, margin);
|
|
43
20
|
const chartId = useId();
|
|
44
21
|
const isPointInside = React.useCallback(({
|
|
@@ -64,15 +41,8 @@ export function DrawingProvider(props) {
|
|
|
64
41
|
}, drawingArea, {
|
|
65
42
|
isPointInside
|
|
66
43
|
}), [chartId, drawingArea, isPointInside]);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}), [svgRef]);
|
|
71
|
-
return /*#__PURE__*/_jsx(SvgContext.Provider, {
|
|
72
|
-
value: refValue,
|
|
73
|
-
children: /*#__PURE__*/_jsx(DrawingContext.Provider, {
|
|
74
|
-
value: value,
|
|
75
|
-
children: children
|
|
76
|
-
})
|
|
44
|
+
return /*#__PURE__*/_jsx(DrawingAreaContext.Provider, {
|
|
45
|
+
value: value,
|
|
46
|
+
children: children
|
|
77
47
|
});
|
|
78
48
|
}
|
|
@@ -1,50 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type AxisInteractionData = {
|
|
8
|
-
x: null | {
|
|
9
|
-
value: number | Date | string;
|
|
10
|
-
index: number;
|
|
11
|
-
};
|
|
12
|
-
y: null | {
|
|
13
|
-
value: number | Date | string;
|
|
14
|
-
index: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
type InteractionActions<T extends ChartSeriesType = ChartSeriesType> = {
|
|
18
|
-
type: 'enterItem';
|
|
19
|
-
data: ItemInteractionData<T>;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'leaveItem';
|
|
22
|
-
data: Partial<ItemInteractionData<T>>;
|
|
23
|
-
} | {
|
|
24
|
-
type: 'exitChart';
|
|
25
|
-
} | {
|
|
26
|
-
type: 'updateVoronoiUsage';
|
|
27
|
-
useVoronoiInteraction: boolean;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'updateAxis';
|
|
30
|
-
data: AxisInteractionData;
|
|
31
|
-
};
|
|
32
|
-
type InteractionState = {
|
|
33
|
-
/**
|
|
34
|
-
* The item currently interacting.
|
|
35
|
-
*/
|
|
36
|
-
item: null | ItemInteractionData<ChartSeriesType>;
|
|
37
|
-
/**
|
|
38
|
-
* The x- and y-axes currently interacting.
|
|
39
|
-
*/
|
|
40
|
-
axis: AxisInteractionData;
|
|
41
|
-
/**
|
|
42
|
-
* Set to `true` when `VoronoiHandler` is active.
|
|
43
|
-
* Used to prevent collision with mouseEnter events.
|
|
44
|
-
*/
|
|
45
|
-
useVoronoiInteraction: boolean;
|
|
46
|
-
dispatch: React.Dispatch<InteractionActions>;
|
|
47
|
-
};
|
|
48
|
-
export declare const InteractionContext: React.Context<InteractionState>;
|
|
49
|
-
declare function InteractionProvider(props: InteractionProviderProps): React.JSX.Element;
|
|
2
|
+
import { ChartStore } from '../internals/plugins/utils/ChartStore';
|
|
3
|
+
export declare const ChartsContext: React.Context<{
|
|
4
|
+
store: ChartStore;
|
|
5
|
+
} | null>;
|
|
6
|
+
declare function InteractionProvider(props: React.PropsWithChildren): React.JSX.Element;
|
|
50
7
|
export { InteractionProvider };
|
|
@@ -1,77 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
3
|
import * as React from 'react';
|
|
4
|
+
import { useCharts } from "../internals/useCharts.js";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
export const
|
|
7
|
-
item: null,
|
|
8
|
-
axis: {
|
|
9
|
-
x: null,
|
|
10
|
-
y: null
|
|
11
|
-
},
|
|
12
|
-
useVoronoiInteraction: false,
|
|
13
|
-
dispatch: () => null
|
|
14
|
-
});
|
|
6
|
+
export const ChartsContext = /*#__PURE__*/React.createContext(null);
|
|
15
7
|
if (process.env.NODE_ENV !== 'production') {
|
|
16
|
-
|
|
8
|
+
ChartsContext.displayName = 'ChartsContext';
|
|
17
9
|
}
|
|
18
|
-
const dataReducer = (prevState, action) => {
|
|
19
|
-
switch (action.type) {
|
|
20
|
-
case 'enterItem':
|
|
21
|
-
return _extends({}, prevState, {
|
|
22
|
-
item: action.data
|
|
23
|
-
});
|
|
24
|
-
case 'exitChart':
|
|
25
|
-
if (prevState.item === null && prevState.axis.x === null && prevState.axis.y === null) {
|
|
26
|
-
return prevState;
|
|
27
|
-
}
|
|
28
|
-
return _extends({}, prevState, {
|
|
29
|
-
axis: {
|
|
30
|
-
x: null,
|
|
31
|
-
y: null
|
|
32
|
-
},
|
|
33
|
-
item: null
|
|
34
|
-
});
|
|
35
|
-
case 'updateVoronoiUsage':
|
|
36
|
-
return _extends({}, prevState, {
|
|
37
|
-
useVoronoiInteraction: action.useVoronoiInteraction
|
|
38
|
-
});
|
|
39
|
-
case 'leaveItem':
|
|
40
|
-
if (prevState.item === null || Object.keys(action.data).some(key => action.data[key] !== prevState.item[key])) {
|
|
41
|
-
// The item is already something else
|
|
42
|
-
return prevState;
|
|
43
|
-
}
|
|
44
|
-
return _extends({}, prevState, {
|
|
45
|
-
item: null
|
|
46
|
-
});
|
|
47
|
-
case 'updateAxis':
|
|
48
|
-
if (action.data.x === prevState.axis.x && action.data.y === prevState.axis.y) {
|
|
49
|
-
return prevState;
|
|
50
|
-
}
|
|
51
|
-
return _extends({}, prevState, {
|
|
52
|
-
axis: action.data
|
|
53
|
-
});
|
|
54
|
-
default:
|
|
55
|
-
return prevState;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
10
|
function InteractionProvider(props) {
|
|
59
11
|
const {
|
|
60
12
|
children
|
|
61
13
|
} = props;
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
useVoronoiInteraction: false
|
|
69
|
-
});
|
|
70
|
-
const value = React.useMemo(() => _extends({}, data, {
|
|
71
|
-
dispatch
|
|
72
|
-
}), [data]);
|
|
73
|
-
return /*#__PURE__*/_jsx(InteractionContext.Provider, {
|
|
74
|
-
value: value,
|
|
14
|
+
const {
|
|
15
|
+
contextValue
|
|
16
|
+
} = useCharts();
|
|
17
|
+
return /*#__PURE__*/_jsx(ChartsContext.Provider, {
|
|
18
|
+
value: contextValue,
|
|
75
19
|
children: children
|
|
76
20
|
});
|
|
77
21
|
}
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { ChartState } from '../internals/plugins/models';
|
|
2
|
+
declare function selectInteraction(state: ChartState): {
|
|
3
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
4
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
5
|
+
isVoronoiEnabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const selectorChartsInteractionItem: ((state: ChartState) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
8
|
+
clearCache: () => void;
|
|
9
|
+
resultsCount: () => number;
|
|
10
|
+
resetResultsCount: () => void;
|
|
11
|
+
} & {
|
|
12
|
+
resultFunc: (resultFuncArgs_0: {
|
|
13
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
14
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
15
|
+
isVoronoiEnabled?: boolean;
|
|
16
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
17
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
18
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
19
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
20
|
+
isVoronoiEnabled?: boolean;
|
|
21
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
22
|
+
clearCache: () => void;
|
|
23
|
+
resultsCount: () => number;
|
|
24
|
+
resetResultsCount: () => void;
|
|
25
|
+
};
|
|
26
|
+
lastResult: () => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
27
|
+
dependencies: [typeof selectInteraction];
|
|
28
|
+
recomputations: () => number;
|
|
29
|
+
resetRecomputations: () => void;
|
|
30
|
+
dependencyRecomputations: () => number;
|
|
31
|
+
resetDependencyRecomputations: () => void;
|
|
32
|
+
} & {
|
|
33
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
34
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
35
|
+
};
|
|
36
|
+
export declare const selectorChartsInteractionAxis: ((state: ChartState) => import("../internals/plugins/models").AxisInteractionData) & {
|
|
37
|
+
clearCache: () => void;
|
|
38
|
+
resultsCount: () => number;
|
|
39
|
+
resetResultsCount: () => void;
|
|
40
|
+
} & {
|
|
41
|
+
resultFunc: (resultFuncArgs_0: {
|
|
42
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
43
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
44
|
+
isVoronoiEnabled?: boolean;
|
|
45
|
+
}) => import("../internals/plugins/models").AxisInteractionData;
|
|
46
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
47
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
48
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
49
|
+
isVoronoiEnabled?: boolean;
|
|
50
|
+
}) => import("../internals/plugins/models").AxisInteractionData) & {
|
|
51
|
+
clearCache: () => void;
|
|
52
|
+
resultsCount: () => number;
|
|
53
|
+
resetResultsCount: () => void;
|
|
54
|
+
};
|
|
55
|
+
lastResult: () => import("../internals/plugins/models").AxisInteractionData;
|
|
56
|
+
dependencies: [typeof selectInteraction];
|
|
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: ChartState) => {
|
|
66
|
+
value: number | Date | string;
|
|
67
|
+
index: number;
|
|
68
|
+
} | null) & {
|
|
69
|
+
clearCache: () => void;
|
|
70
|
+
resultsCount: () => number;
|
|
71
|
+
resetResultsCount: () => void;
|
|
72
|
+
} & {
|
|
73
|
+
resultFunc: (resultFuncArgs_0: {
|
|
74
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
75
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
76
|
+
isVoronoiEnabled?: boolean;
|
|
77
|
+
}) => {
|
|
78
|
+
value: number | Date | string;
|
|
79
|
+
index: number;
|
|
80
|
+
} | null;
|
|
81
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
82
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
83
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
84
|
+
isVoronoiEnabled?: boolean;
|
|
85
|
+
}) => {
|
|
86
|
+
value: number | Date | string;
|
|
87
|
+
index: number;
|
|
88
|
+
} | null) & {
|
|
89
|
+
clearCache: () => void;
|
|
90
|
+
resultsCount: () => number;
|
|
91
|
+
resetResultsCount: () => void;
|
|
92
|
+
};
|
|
93
|
+
lastResult: () => {
|
|
94
|
+
value: number | Date | string;
|
|
95
|
+
index: number;
|
|
96
|
+
} | null;
|
|
97
|
+
dependencies: [typeof selectInteraction];
|
|
98
|
+
recomputations: () => number;
|
|
99
|
+
resetRecomputations: () => void;
|
|
100
|
+
dependencyRecomputations: () => number;
|
|
101
|
+
resetDependencyRecomputations: () => void;
|
|
102
|
+
} & {
|
|
103
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
104
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
105
|
+
};
|
|
106
|
+
export declare const selectorChartsInteractionYAxis: ((state: ChartState) => {
|
|
107
|
+
value: number | Date | string;
|
|
108
|
+
index: number;
|
|
109
|
+
} | null) & {
|
|
110
|
+
clearCache: () => void;
|
|
111
|
+
resultsCount: () => number;
|
|
112
|
+
resetResultsCount: () => void;
|
|
113
|
+
} & {
|
|
114
|
+
resultFunc: (resultFuncArgs_0: {
|
|
115
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
116
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
117
|
+
isVoronoiEnabled?: boolean;
|
|
118
|
+
}) => {
|
|
119
|
+
value: number | Date | string;
|
|
120
|
+
index: number;
|
|
121
|
+
} | null;
|
|
122
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
123
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
124
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
125
|
+
isVoronoiEnabled?: boolean;
|
|
126
|
+
}) => {
|
|
127
|
+
value: number | Date | string;
|
|
128
|
+
index: number;
|
|
129
|
+
} | null) & {
|
|
130
|
+
clearCache: () => void;
|
|
131
|
+
resultsCount: () => number;
|
|
132
|
+
resetResultsCount: () => void;
|
|
133
|
+
};
|
|
134
|
+
lastResult: () => {
|
|
135
|
+
value: number | Date | string;
|
|
136
|
+
index: number;
|
|
137
|
+
} | null;
|
|
138
|
+
dependencies: [typeof selectInteraction];
|
|
139
|
+
recomputations: () => number;
|
|
140
|
+
resetRecomputations: () => void;
|
|
141
|
+
dependencyRecomputations: () => number;
|
|
142
|
+
resetDependencyRecomputations: () => void;
|
|
143
|
+
} & {
|
|
144
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
145
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
146
|
+
};
|
|
147
|
+
export declare const selectorChartsInteractionItemIsDefined: ((state: ChartState) => boolean) & {
|
|
148
|
+
clearCache: () => void;
|
|
149
|
+
resultsCount: () => number;
|
|
150
|
+
resetResultsCount: () => void;
|
|
151
|
+
} & {
|
|
152
|
+
resultFunc: (resultFuncArgs_0: import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) => boolean;
|
|
153
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) => boolean) & {
|
|
154
|
+
clearCache: () => void;
|
|
155
|
+
resultsCount: () => number;
|
|
156
|
+
resetResultsCount: () => void;
|
|
157
|
+
};
|
|
158
|
+
lastResult: () => boolean;
|
|
159
|
+
dependencies: [((state: ChartState) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
160
|
+
clearCache: () => void;
|
|
161
|
+
resultsCount: () => number;
|
|
162
|
+
resetResultsCount: () => void;
|
|
163
|
+
} & {
|
|
164
|
+
resultFunc: (resultFuncArgs_0: {
|
|
165
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
166
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
167
|
+
isVoronoiEnabled?: boolean;
|
|
168
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
169
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
170
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
171
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
172
|
+
isVoronoiEnabled?: boolean;
|
|
173
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
174
|
+
clearCache: () => void;
|
|
175
|
+
resultsCount: () => number;
|
|
176
|
+
resetResultsCount: () => void;
|
|
177
|
+
};
|
|
178
|
+
lastResult: () => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
179
|
+
dependencies: [typeof selectInteraction];
|
|
180
|
+
recomputations: () => number;
|
|
181
|
+
resetRecomputations: () => void;
|
|
182
|
+
dependencyRecomputations: () => number;
|
|
183
|
+
resetDependencyRecomputations: () => void;
|
|
184
|
+
} & {
|
|
185
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
186
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
187
|
+
}];
|
|
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
|
+
export declare const selectorChartsInteractionXAxisIsDefined: ((state: ChartState) => boolean) & {
|
|
197
|
+
clearCache: () => void;
|
|
198
|
+
resultsCount: () => number;
|
|
199
|
+
resetResultsCount: () => void;
|
|
200
|
+
} & {
|
|
201
|
+
resultFunc: (resultFuncArgs_0: {
|
|
202
|
+
value: number | Date | string;
|
|
203
|
+
index: number;
|
|
204
|
+
} | null) => boolean;
|
|
205
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
206
|
+
value: number | Date | string;
|
|
207
|
+
index: number;
|
|
208
|
+
} | null) => boolean) & {
|
|
209
|
+
clearCache: () => void;
|
|
210
|
+
resultsCount: () => number;
|
|
211
|
+
resetResultsCount: () => void;
|
|
212
|
+
};
|
|
213
|
+
lastResult: () => boolean;
|
|
214
|
+
dependencies: [((state: ChartState) => {
|
|
215
|
+
value: number | Date | string;
|
|
216
|
+
index: number;
|
|
217
|
+
} | null) & {
|
|
218
|
+
clearCache: () => void;
|
|
219
|
+
resultsCount: () => number;
|
|
220
|
+
resetResultsCount: () => void;
|
|
221
|
+
} & {
|
|
222
|
+
resultFunc: (resultFuncArgs_0: {
|
|
223
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
224
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
225
|
+
isVoronoiEnabled?: boolean;
|
|
226
|
+
}) => {
|
|
227
|
+
value: number | Date | string;
|
|
228
|
+
index: number;
|
|
229
|
+
} | null;
|
|
230
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
231
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
232
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
233
|
+
isVoronoiEnabled?: boolean;
|
|
234
|
+
}) => {
|
|
235
|
+
value: number | Date | string;
|
|
236
|
+
index: number;
|
|
237
|
+
} | null) & {
|
|
238
|
+
clearCache: () => void;
|
|
239
|
+
resultsCount: () => number;
|
|
240
|
+
resetResultsCount: () => void;
|
|
241
|
+
};
|
|
242
|
+
lastResult: () => {
|
|
243
|
+
value: number | Date | string;
|
|
244
|
+
index: number;
|
|
245
|
+
} | null;
|
|
246
|
+
dependencies: [typeof selectInteraction];
|
|
247
|
+
recomputations: () => number;
|
|
248
|
+
resetRecomputations: () => void;
|
|
249
|
+
dependencyRecomputations: () => number;
|
|
250
|
+
resetDependencyRecomputations: () => void;
|
|
251
|
+
} & {
|
|
252
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
253
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
254
|
+
}];
|
|
255
|
+
recomputations: () => number;
|
|
256
|
+
resetRecomputations: () => void;
|
|
257
|
+
dependencyRecomputations: () => number;
|
|
258
|
+
resetDependencyRecomputations: () => void;
|
|
259
|
+
} & {
|
|
260
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
261
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
262
|
+
};
|
|
263
|
+
export declare const selectorChartsInteractionYAxisIsDefined: ((state: ChartState) => boolean) & {
|
|
264
|
+
clearCache: () => void;
|
|
265
|
+
resultsCount: () => number;
|
|
266
|
+
resetResultsCount: () => void;
|
|
267
|
+
} & {
|
|
268
|
+
resultFunc: (resultFuncArgs_0: {
|
|
269
|
+
value: number | Date | string;
|
|
270
|
+
index: number;
|
|
271
|
+
} | null) => boolean;
|
|
272
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
273
|
+
value: number | Date | string;
|
|
274
|
+
index: number;
|
|
275
|
+
} | null) => boolean) & {
|
|
276
|
+
clearCache: () => void;
|
|
277
|
+
resultsCount: () => number;
|
|
278
|
+
resetResultsCount: () => void;
|
|
279
|
+
};
|
|
280
|
+
lastResult: () => boolean;
|
|
281
|
+
dependencies: [((state: ChartState) => {
|
|
282
|
+
value: number | Date | string;
|
|
283
|
+
index: number;
|
|
284
|
+
} | null) & {
|
|
285
|
+
clearCache: () => void;
|
|
286
|
+
resultsCount: () => number;
|
|
287
|
+
resetResultsCount: () => void;
|
|
288
|
+
} & {
|
|
289
|
+
resultFunc: (resultFuncArgs_0: {
|
|
290
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
291
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
292
|
+
isVoronoiEnabled?: boolean;
|
|
293
|
+
}) => {
|
|
294
|
+
value: number | Date | string;
|
|
295
|
+
index: number;
|
|
296
|
+
} | null;
|
|
297
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
298
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
299
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
300
|
+
isVoronoiEnabled?: boolean;
|
|
301
|
+
}) => {
|
|
302
|
+
value: number | Date | string;
|
|
303
|
+
index: number;
|
|
304
|
+
} | null) & {
|
|
305
|
+
clearCache: () => void;
|
|
306
|
+
resultsCount: () => number;
|
|
307
|
+
resetResultsCount: () => void;
|
|
308
|
+
};
|
|
309
|
+
lastResult: () => {
|
|
310
|
+
value: number | Date | string;
|
|
311
|
+
index: number;
|
|
312
|
+
} | null;
|
|
313
|
+
dependencies: [typeof selectInteraction];
|
|
314
|
+
recomputations: () => number;
|
|
315
|
+
resetRecomputations: () => void;
|
|
316
|
+
dependencyRecomputations: () => number;
|
|
317
|
+
resetDependencyRecomputations: () => void;
|
|
318
|
+
} & {
|
|
319
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
320
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
321
|
+
}];
|
|
322
|
+
recomputations: () => number;
|
|
323
|
+
resetRecomputations: () => void;
|
|
324
|
+
dependencyRecomputations: () => number;
|
|
325
|
+
resetDependencyRecomputations: () => void;
|
|
326
|
+
} & {
|
|
327
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
328
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
329
|
+
};
|
|
330
|
+
export declare const selectorChartsInteractionIsVoronoiEnabled: ((state: ChartState) => boolean | undefined) & {
|
|
331
|
+
clearCache: () => void;
|
|
332
|
+
resultsCount: () => number;
|
|
333
|
+
resetResultsCount: () => void;
|
|
334
|
+
} & {
|
|
335
|
+
resultFunc: (resultFuncArgs_0: {
|
|
336
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
337
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
338
|
+
isVoronoiEnabled?: boolean;
|
|
339
|
+
}) => boolean | undefined;
|
|
340
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
341
|
+
item: null | import("../internals/plugins/models").ItemInteractionData<import("../internals").ChartSeriesType>;
|
|
342
|
+
axis: import("../internals/plugins/models").AxisInteractionData;
|
|
343
|
+
isVoronoiEnabled?: boolean;
|
|
344
|
+
}) => boolean | undefined) & {
|
|
345
|
+
clearCache: () => void;
|
|
346
|
+
resultsCount: () => number;
|
|
347
|
+
resetResultsCount: () => void;
|
|
348
|
+
};
|
|
349
|
+
lastResult: () => boolean | undefined;
|
|
350
|
+
dependencies: [typeof selectInteraction];
|
|
351
|
+
recomputations: () => number;
|
|
352
|
+
resetRecomputations: () => void;
|
|
353
|
+
dependencyRecomputations: () => number;
|
|
354
|
+
resetDependencyRecomputations: () => void;
|
|
355
|
+
} & {
|
|
356
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
357
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
358
|
+
};
|
|
359
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSelector } from "../internals/plugins/utils/selectors.js";
|
|
2
|
+
function selectInteraction(state) {
|
|
3
|
+
return state.interaction;
|
|
4
|
+
}
|
|
5
|
+
export const selectorChartsInteractionItem = createSelector(selectInteraction, interaction => interaction.item);
|
|
6
|
+
export const selectorChartsInteractionAxis = createSelector(selectInteraction, interaction => interaction.axis);
|
|
7
|
+
export const selectorChartsInteractionXAxis = createSelector(selectInteraction, interaction => interaction.axis.x);
|
|
8
|
+
export const selectorChartsInteractionYAxis = createSelector(selectInteraction, interaction => interaction.axis.y);
|
|
9
|
+
export const selectorChartsInteractionItemIsDefined = createSelector(selectorChartsInteractionItem, item => item !== null);
|
|
10
|
+
export const selectorChartsInteractionXAxisIsDefined = createSelector(selectorChartsInteractionXAxis, x => x !== null);
|
|
11
|
+
export const selectorChartsInteractionYAxisIsDefined = createSelector(selectorChartsInteractionYAxis, y => y !== null);
|
|
12
|
+
export const selectorChartsInteractionIsVoronoiEnabled = createSelector(selectInteraction, interaction => interaction.isVoronoiEnabled);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SizeProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
5
|
+
*/
|
|
6
|
+
width?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
9
|
+
*/
|
|
10
|
+
height?: number;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface SizeContextState extends Required<Pick<SizeProviderProps, 'height' | 'width'>> {
|
|
14
|
+
/**
|
|
15
|
+
* The ref of the container element that the chart is rendered in.
|
|
16
|
+
*/
|
|
17
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
18
|
+
/**
|
|
19
|
+
* If the chart has a defined size.
|
|
20
|
+
*/
|
|
21
|
+
hasIntrinsicSize: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The input height of the chart in px.
|
|
24
|
+
*/
|
|
25
|
+
inHeight?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The input width of the chart in px.
|
|
28
|
+
*/
|
|
29
|
+
inWidth?: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const SizeContext = /*#__PURE__*/React.createContext({
|
|
3
|
+
isInitialized: false,
|
|
4
|
+
data: {
|
|
5
|
+
hasIntrinsicSize: false,
|
|
6
|
+
containerRef: null,
|
|
7
|
+
height: 0,
|
|
8
|
+
width: 0
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12
|
+
SizeContext.displayName = 'SizeContext';
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SizeProviderProps } from './Size.types';
|
|
3
|
+
/**
|
|
4
|
+
* The size provider.
|
|
5
|
+
*
|
|
6
|
+
* This differs from the DrawingProvider in that it provides the full size of the container.
|
|
7
|
+
*
|
|
8
|
+
* This provider is also responsible for resolving the size of the container before rendering and if the parent size changes.
|
|
9
|
+
*/
|
|
10
|
+
declare function SizeProvider(props: SizeProviderProps): React.JSX.Element;
|
|
11
|
+
export { SizeProvider };
|