@mui/x-charts 8.0.0-alpha.1 → 8.0.0-alpha.3
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/BarChart.js +0 -4
- package/BarChart/BarLabel/BarLabel.d.ts +298 -298
- package/CHANGELOG.md +330 -7
- package/ChartContainer/ChartContainer.d.ts +24 -0
- package/ChartContainer/ChartContainer.js +26 -10
- package/ChartContainer/useChartContainerProps.d.ts +0 -1
- package/ChartContainer/useChartContainerProps.js +3 -4
- package/ChartsAxis/axisClasses.js +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +3 -3
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +3 -3
- package/ChartsLegend/chartsLegendClasses.js +2 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/ChartsSurface/ChartsSurface.d.ts +14 -0
- package/ChartsSurface/ChartsSurface.js +38 -6
- package/ChartsTooltip/ChartsTooltip.js +2 -20
- package/ChartsTooltip/ChartsTooltipContainer.js +5 -23
- package/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/ChartsTooltip/useAxisTooltip.js +3 -3
- package/ChartsTooltip/useItemTooltip.d.ts +2 -3
- package/ChartsTooltip/useItemTooltip.js +3 -3
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/ChartsXAxis/ChartsXAxis.js +3 -17
- package/ChartsYAxis/ChartsYAxis.js +2 -17
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/GaugeContainer.d.ts +2 -2
- package/Gauge/GaugeContainer.js +14 -47
- package/LineChart/CircleMarkElement.js +3 -3
- package/LineChart/LineChart.js +0 -4
- package/LineChart/LineHighlightPlot.js +3 -3
- package/LineChart/MarkElement.js +3 -3
- package/PieChart/PieArc.js +11 -5
- package/PieChart/PieArcPlot.js +9 -13
- package/PieChart/PieChart.js +0 -4
- package/ScatterChart/Scatter.js +3 -3
- package/ScatterChart/ScatterChart.js +0 -4
- package/SparkLineChart/SparkLineChart.js +0 -4
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -11
- package/context/ChartDataProvider/ChartDataProvider.d.ts +27 -0
- package/context/ChartDataProvider/ChartDataProvider.js +38 -18
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +18 -22
- 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/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/DrawingAreaProvider/DrawingAreaContext.d.ts +1 -6
- package/context/DrawingAreaProvider/DrawingAreaContext.js +0 -1
- package/context/InteractionSelectors.d.ts +72 -49
- package/context/SizeProvider/Size.types.d.ts +2 -2
- package/context/SizeProvider/SizeContext.js +3 -1
- package/context/SizeProvider/useChartContainerDimensions.d.ts +1 -1
- package/context/SizeProvider/useChartContainerDimensions.js +5 -1
- package/hooks/useAxisEvents.js +1 -1
- package/hooks/useChartId.js +5 -6
- package/hooks/useInteractionItemProps.js +4 -2
- package/hooks/useSvgRef.d.ts +1 -1
- package/hooks/useSvgRef.js +4 -8
- package/index.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -5
- package/internals/defaultizeColor.d.ts +1 -1
- package/internals/index.d.ts +1 -3
- package/internals/index.js +1 -3
- 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.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 -35
- package/internals/plugins/models/index.js +3 -1
- package/internals/plugins/models/plugin.d.ts +75 -0
- package/internals/plugins/models/plugin.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +9 -8
- package/internals/plugins/utils/ChartStore.js +0 -2
- package/internals/plugins/utils/selectors.d.ts +2 -2
- package/internals/store/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/useStore.d.ts +3 -0
- package/{modern/internals → internals/store}/useStore.js +6 -6
- package/models/axis.d.ts +1 -13
- package/modern/BarChart/BarChart.js +0 -4
- package/modern/ChartContainer/ChartContainer.js +26 -10
- package/modern/ChartContainer/useChartContainerProps.js +3 -4
- package/modern/ChartsAxis/axisClasses.js +2 -1
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +3 -3
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +3 -3
- package/modern/ChartsLegend/chartsLegendClasses.js +2 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/modern/ChartsSurface/ChartsSurface.js +38 -6
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -20
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +5 -23
- package/modern/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/modern/ChartsTooltip/useAxisTooltip.js +3 -3
- package/modern/ChartsTooltip/useItemTooltip.js +3 -3
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/modern/ChartsXAxis/ChartsXAxis.js +3 -17
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -17
- package/modern/Gauge/GaugeContainer.js +14 -47
- package/modern/LineChart/CircleMarkElement.js +3 -3
- package/modern/LineChart/LineChart.js +0 -4
- package/modern/LineChart/LineHighlightPlot.js +3 -3
- package/modern/LineChart/MarkElement.js +3 -3
- package/modern/PieChart/PieArc.js +11 -5
- package/modern/PieChart/PieArcPlot.js +9 -13
- package/modern/PieChart/PieChart.js +0 -4
- package/modern/ScatterChart/Scatter.js +3 -3
- package/modern/ScatterChart/ScatterChart.js +0 -4
- package/modern/SparkLineChart/SparkLineChart.js +0 -4
- package/modern/context/ChartDataProvider/ChartDataProvider.js +38 -18
- 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/DrawingAreaContext.js +0 -1
- package/modern/context/SizeProvider/SizeContext.js +3 -1
- package/modern/context/SizeProvider/useChartContainerDimensions.js +5 -1
- package/modern/hooks/useAxisEvents.js +1 -1
- package/modern/hooks/useChartId.js +5 -6
- package/modern/hooks/useInteractionItemProps.js +4 -2
- package/modern/hooks/useSvgRef.js +4 -8
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -5
- package/modern/internals/index.js +1 -3
- 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 -1
- package/modern/internals/plugins/models/plugin.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +0 -2
- package/modern/internals/store/useCharts.js +72 -0
- package/modern/internals/store/useCharts.types.js +1 -0
- package/{internals → modern/internals/store}/useStore.js +6 -6
- package/node/BarChart/BarChart.js +0 -4
- package/node/ChartContainer/ChartContainer.js +26 -10
- package/node/ChartContainer/useChartContainerProps.js +3 -4
- package/node/ChartsAxis/axisClasses.js +5 -3
- package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/node/ChartsLegend/chartsLegendClasses.js +5 -3
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/node/ChartsSurface/ChartsSurface.js +37 -5
- package/node/ChartsTooltip/ChartsTooltip.js +2 -20
- package/node/ChartsTooltip/ChartsTooltipContainer.js +6 -24
- package/node/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/node/ChartsTooltip/useAxisTooltip.js +4 -4
- package/node/ChartsTooltip/useItemTooltip.js +4 -4
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/node/ChartsXAxis/ChartsXAxis.js +3 -17
- package/node/ChartsYAxis/ChartsYAxis.js +2 -17
- package/node/Gauge/GaugeContainer.js +13 -46
- package/node/LineChart/CircleMarkElement.js +4 -4
- package/node/LineChart/LineChart.js +0 -4
- package/node/LineChart/LineHighlightPlot.js +4 -4
- package/node/LineChart/MarkElement.js +4 -4
- package/node/PieChart/PieArc.js +11 -5
- package/node/PieChart/PieArcPlot.js +9 -13
- package/node/PieChart/PieChart.js +0 -4
- package/node/ScatterChart/Scatter.js +4 -4
- package/node/ScatterChart/ScatterChart.js +0 -4
- package/node/SparkLineChart/SparkLineChart.js +0 -4
- package/node/context/ChartDataProvider/ChartDataProvider.js +38 -18
- package/node/context/ChartProvider/ChartContext.js +15 -0
- package/node/context/ChartProvider/ChartProvider.js +24 -0
- package/node/context/ChartProvider/index.js +38 -0
- package/node/context/ChartProvider/useChartContext.js +18 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +0 -1
- package/node/context/SizeProvider/SizeContext.js +3 -1
- package/node/context/SizeProvider/useChartContainerDimensions.js +5 -1
- package/node/hooks/useAxisEvents.js +1 -1
- package/node/hooks/useChartId.js +5 -7
- package/node/hooks/useInteractionItemProps.js +4 -2
- package/node/hooks/useSvgRef.js +4 -9
- package/node/index.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +1 -4
- package/node/internals/index.js +4 -28
- 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 +33 -0
- package/node/internals/plugins/models/plugin.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +0 -2
- package/node/internals/store/useCharts.js +80 -0
- package/node/internals/store/useCharts.types.js +5 -0
- package/node/internals/{useStore.js → store/useStore.js} +6 -7
- package/package.json +4 -4
- package/ChartContainer/ResizableContainer.d.ts +0 -22
- package/ChartContainer/ResizableContainer.js +0 -60
- package/context/InteractionProvider.d.ts +0 -7
- package/context/InteractionProvider.js +0 -22
- package/context/SvgRefProvider/SvgRef.types.d.ts +0 -8
- package/context/SvgRefProvider/SvgRefContext.d.ts +0 -4
- package/context/SvgRefProvider/SvgRefContext.js +0 -17
- package/context/SvgRefProvider/SvgRefProvider.d.ts +0 -3
- package/context/SvgRefProvider/SvgRefProvider.js +0 -24
- package/context/SvgRefProvider/index.d.ts +0 -4
- package/context/SvgRefProvider/index.js +0 -4
- package/context/SvgRefProvider/useSurfaceRef.d.ts +0 -2
- package/context/SvgRefProvider/useSurfaceRef.js +0 -14
- package/internals/plugins/utils/ChartsStore.d.ts +0 -12
- package/internals/plugins/utils/ChartsStore.js +0 -26
- package/internals/useCharts.d.ts +0 -6
- package/internals/useCharts.js +0 -29
- package/internals/useSelector.d.ts +0 -4
- package/internals/useStore.d.ts +0 -2
- package/modern/ChartContainer/ResizableContainer.js +0 -60
- package/modern/context/InteractionProvider.js +0 -22
- package/modern/context/SvgRefProvider/SvgRefContext.js +0 -17
- package/modern/context/SvgRefProvider/SvgRefProvider.js +0 -24
- package/modern/context/SvgRefProvider/index.js +0 -4
- package/modern/context/SvgRefProvider/useSurfaceRef.js +0 -14
- package/modern/internals/plugins/utils/ChartsStore.js +0 -26
- package/modern/internals/useCharts.js +0 -29
- package/node/ChartContainer/ResizableContainer.js +0 -68
- package/node/context/InteractionProvider.js +0 -28
- package/node/context/SvgRefProvider/SvgRefContext.js +0 -23
- package/node/context/SvgRefProvider/SvgRefProvider.js +0 -31
- package/node/context/SvgRefProvider/index.js +0 -49
- package/node/context/SvgRefProvider/useSurfaceRef.js +0 -20
- package/node/internals/plugins/utils/ChartsStore.js +0 -33
- package/node/internals/useCharts.js +0 -36
- /package/context/{SvgRefProvider/SvgRef.types.js → ChartProvider/ChartProvider.types.js} +0 -0
- /package/{modern/context/SvgRefProvider/SvgRef.types.js → internals/plugins/corePlugins/useChartId/useChartId.types.js} +0 -0
- /package/internals/{useSelector.js → store/useSelector.js} +0 -0
- /package/modern/internals/{useSelector.js → store/useSelector.js} +0 -0
- /package/node/context/{SvgRefProvider/SvgRef.types.js → ChartProvider/ChartProvider.types.js} +0 -0
- /package/node/internals/{useSelector.js → store/useSelector.js} +0 -0
|
@@ -1,22 +1,25 @@
|
|
|
1
|
+
import { UseChartInteractionSignature } from '../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types';
|
|
1
2
|
import { ChartState } from '../internals/plugins/models';
|
|
2
|
-
declare function selectInteraction(state: ChartState): {
|
|
3
|
-
item: null | import("../internals
|
|
4
|
-
axis: import("../internals/plugins/
|
|
3
|
+
declare function selectInteraction(state: ChartState<[UseChartInteractionSignature]>): {
|
|
4
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
5
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
5
6
|
isVoronoiEnabled?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare const selectorChartsInteractionItem: ((state:
|
|
8
|
+
export declare const selectorChartsInteractionItem: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
9
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
10
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
8
11
|
clearCache: () => void;
|
|
9
12
|
resultsCount: () => number;
|
|
10
13
|
resetResultsCount: () => void;
|
|
11
14
|
} & {
|
|
12
15
|
resultFunc: (resultFuncArgs_0: {
|
|
13
|
-
item: null | import("../internals
|
|
14
|
-
axis: import("../internals/plugins/
|
|
16
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
17
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
15
18
|
isVoronoiEnabled?: boolean;
|
|
16
19
|
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
17
20
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
18
|
-
item: null | import("../internals
|
|
19
|
-
axis: import("../internals/plugins/
|
|
21
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
22
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
20
23
|
isVoronoiEnabled?: boolean;
|
|
21
24
|
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
22
25
|
clearCache: () => void;
|
|
@@ -33,26 +36,28 @@ export declare const selectorChartsInteractionItem: ((state: ChartState) => impo
|
|
|
33
36
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
34
37
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
35
38
|
};
|
|
36
|
-
export declare const selectorChartsInteractionAxis: ((state:
|
|
39
|
+
export declare const selectorChartsInteractionAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
40
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
41
|
+
}) => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData) & {
|
|
37
42
|
clearCache: () => void;
|
|
38
43
|
resultsCount: () => number;
|
|
39
44
|
resetResultsCount: () => void;
|
|
40
45
|
} & {
|
|
41
46
|
resultFunc: (resultFuncArgs_0: {
|
|
42
|
-
item: null | import("../internals
|
|
43
|
-
axis: import("../internals/plugins/
|
|
47
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
48
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
44
49
|
isVoronoiEnabled?: boolean;
|
|
45
|
-
}) => import("../internals/plugins/
|
|
50
|
+
}) => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
46
51
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
47
|
-
item: null | import("../internals
|
|
48
|
-
axis: import("../internals/plugins/
|
|
52
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
53
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
49
54
|
isVoronoiEnabled?: boolean;
|
|
50
|
-
}) => import("../internals/plugins/
|
|
55
|
+
}) => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData) & {
|
|
51
56
|
clearCache: () => void;
|
|
52
57
|
resultsCount: () => number;
|
|
53
58
|
resetResultsCount: () => void;
|
|
54
59
|
};
|
|
55
|
-
lastResult: () => import("../internals/plugins/
|
|
60
|
+
lastResult: () => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
56
61
|
dependencies: [typeof selectInteraction];
|
|
57
62
|
recomputations: () => number;
|
|
58
63
|
resetRecomputations: () => void;
|
|
@@ -62,7 +67,9 @@ export declare const selectorChartsInteractionAxis: ((state: ChartState) => impo
|
|
|
62
67
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
63
68
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
64
69
|
};
|
|
65
|
-
export declare const selectorChartsInteractionXAxis: ((state:
|
|
70
|
+
export declare const selectorChartsInteractionXAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
71
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
72
|
+
}) => {
|
|
66
73
|
value: number | Date | string;
|
|
67
74
|
index: number;
|
|
68
75
|
} | null) & {
|
|
@@ -71,16 +78,16 @@ export declare const selectorChartsInteractionXAxis: ((state: ChartState) => {
|
|
|
71
78
|
resetResultsCount: () => void;
|
|
72
79
|
} & {
|
|
73
80
|
resultFunc: (resultFuncArgs_0: {
|
|
74
|
-
item: null | import("../internals
|
|
75
|
-
axis: import("../internals/plugins/
|
|
81
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
82
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
76
83
|
isVoronoiEnabled?: boolean;
|
|
77
84
|
}) => {
|
|
78
85
|
value: number | Date | string;
|
|
79
86
|
index: number;
|
|
80
87
|
} | null;
|
|
81
88
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
82
|
-
item: null | import("../internals
|
|
83
|
-
axis: import("../internals/plugins/
|
|
89
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
90
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
84
91
|
isVoronoiEnabled?: boolean;
|
|
85
92
|
}) => {
|
|
86
93
|
value: number | Date | string;
|
|
@@ -103,7 +110,9 @@ export declare const selectorChartsInteractionXAxis: ((state: ChartState) => {
|
|
|
103
110
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
104
111
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
105
112
|
};
|
|
106
|
-
export declare const selectorChartsInteractionYAxis: ((state:
|
|
113
|
+
export declare const selectorChartsInteractionYAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
114
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
115
|
+
}) => {
|
|
107
116
|
value: number | Date | string;
|
|
108
117
|
index: number;
|
|
109
118
|
} | null) & {
|
|
@@ -112,16 +121,16 @@ export declare const selectorChartsInteractionYAxis: ((state: ChartState) => {
|
|
|
112
121
|
resetResultsCount: () => void;
|
|
113
122
|
} & {
|
|
114
123
|
resultFunc: (resultFuncArgs_0: {
|
|
115
|
-
item: null | import("../internals
|
|
116
|
-
axis: import("../internals/plugins/
|
|
124
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
125
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
117
126
|
isVoronoiEnabled?: boolean;
|
|
118
127
|
}) => {
|
|
119
128
|
value: number | Date | string;
|
|
120
129
|
index: number;
|
|
121
130
|
} | null;
|
|
122
131
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
123
|
-
item: null | import("../internals
|
|
124
|
-
axis: import("../internals/plugins/
|
|
132
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
133
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
125
134
|
isVoronoiEnabled?: boolean;
|
|
126
135
|
}) => {
|
|
127
136
|
value: number | Date | string;
|
|
@@ -144,7 +153,9 @@ export declare const selectorChartsInteractionYAxis: ((state: ChartState) => {
|
|
|
144
153
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
145
154
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
146
155
|
};
|
|
147
|
-
export declare const selectorChartsInteractionItemIsDefined: ((state:
|
|
156
|
+
export declare const selectorChartsInteractionItemIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
157
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
158
|
+
}) => boolean) & {
|
|
148
159
|
clearCache: () => void;
|
|
149
160
|
resultsCount: () => number;
|
|
150
161
|
resetResultsCount: () => void;
|
|
@@ -156,19 +167,21 @@ export declare const selectorChartsInteractionItemIsDefined: ((state: ChartState
|
|
|
156
167
|
resetResultsCount: () => void;
|
|
157
168
|
};
|
|
158
169
|
lastResult: () => boolean;
|
|
159
|
-
dependencies: [((state:
|
|
170
|
+
dependencies: [((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
171
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
172
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
160
173
|
clearCache: () => void;
|
|
161
174
|
resultsCount: () => number;
|
|
162
175
|
resetResultsCount: () => void;
|
|
163
176
|
} & {
|
|
164
177
|
resultFunc: (resultFuncArgs_0: {
|
|
165
|
-
item: null | import("../internals
|
|
166
|
-
axis: import("../internals/plugins/
|
|
178
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
179
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
167
180
|
isVoronoiEnabled?: boolean;
|
|
168
181
|
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
169
182
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
170
|
-
item: null | import("../internals
|
|
171
|
-
axis: import("../internals/plugins/
|
|
183
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
184
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
172
185
|
isVoronoiEnabled?: boolean;
|
|
173
186
|
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
174
187
|
clearCache: () => void;
|
|
@@ -193,7 +206,9 @@ export declare const selectorChartsInteractionItemIsDefined: ((state: ChartState
|
|
|
193
206
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
194
207
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
195
208
|
};
|
|
196
|
-
export declare const selectorChartsInteractionXAxisIsDefined: ((state:
|
|
209
|
+
export declare const selectorChartsInteractionXAxisIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
210
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
211
|
+
}) => boolean) & {
|
|
197
212
|
clearCache: () => void;
|
|
198
213
|
resultsCount: () => number;
|
|
199
214
|
resetResultsCount: () => void;
|
|
@@ -211,7 +226,9 @@ export declare const selectorChartsInteractionXAxisIsDefined: ((state: ChartStat
|
|
|
211
226
|
resetResultsCount: () => void;
|
|
212
227
|
};
|
|
213
228
|
lastResult: () => boolean;
|
|
214
|
-
dependencies: [((state:
|
|
229
|
+
dependencies: [((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
230
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
231
|
+
}) => {
|
|
215
232
|
value: number | Date | string;
|
|
216
233
|
index: number;
|
|
217
234
|
} | null) & {
|
|
@@ -220,16 +237,16 @@ export declare const selectorChartsInteractionXAxisIsDefined: ((state: ChartStat
|
|
|
220
237
|
resetResultsCount: () => void;
|
|
221
238
|
} & {
|
|
222
239
|
resultFunc: (resultFuncArgs_0: {
|
|
223
|
-
item: null | import("../internals
|
|
224
|
-
axis: import("../internals/plugins/
|
|
240
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
241
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
225
242
|
isVoronoiEnabled?: boolean;
|
|
226
243
|
}) => {
|
|
227
244
|
value: number | Date | string;
|
|
228
245
|
index: number;
|
|
229
246
|
} | null;
|
|
230
247
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
231
|
-
item: null | import("../internals
|
|
232
|
-
axis: import("../internals/plugins/
|
|
248
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
249
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
233
250
|
isVoronoiEnabled?: boolean;
|
|
234
251
|
}) => {
|
|
235
252
|
value: number | Date | string;
|
|
@@ -260,7 +277,9 @@ export declare const selectorChartsInteractionXAxisIsDefined: ((state: ChartStat
|
|
|
260
277
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
261
278
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
262
279
|
};
|
|
263
|
-
export declare const selectorChartsInteractionYAxisIsDefined: ((state:
|
|
280
|
+
export declare const selectorChartsInteractionYAxisIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
281
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
282
|
+
}) => boolean) & {
|
|
264
283
|
clearCache: () => void;
|
|
265
284
|
resultsCount: () => number;
|
|
266
285
|
resetResultsCount: () => void;
|
|
@@ -278,7 +297,9 @@ export declare const selectorChartsInteractionYAxisIsDefined: ((state: ChartStat
|
|
|
278
297
|
resetResultsCount: () => void;
|
|
279
298
|
};
|
|
280
299
|
lastResult: () => boolean;
|
|
281
|
-
dependencies: [((state:
|
|
300
|
+
dependencies: [((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
301
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
302
|
+
}) => {
|
|
282
303
|
value: number | Date | string;
|
|
283
304
|
index: number;
|
|
284
305
|
} | null) & {
|
|
@@ -287,16 +308,16 @@ export declare const selectorChartsInteractionYAxisIsDefined: ((state: ChartStat
|
|
|
287
308
|
resetResultsCount: () => void;
|
|
288
309
|
} & {
|
|
289
310
|
resultFunc: (resultFuncArgs_0: {
|
|
290
|
-
item: null | import("../internals
|
|
291
|
-
axis: import("../internals/plugins/
|
|
311
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
312
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
292
313
|
isVoronoiEnabled?: boolean;
|
|
293
314
|
}) => {
|
|
294
315
|
value: number | Date | string;
|
|
295
316
|
index: number;
|
|
296
317
|
} | null;
|
|
297
318
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
298
|
-
item: null | import("../internals
|
|
299
|
-
axis: import("../internals/plugins/
|
|
319
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
320
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
300
321
|
isVoronoiEnabled?: boolean;
|
|
301
322
|
}) => {
|
|
302
323
|
value: number | Date | string;
|
|
@@ -327,19 +348,21 @@ export declare const selectorChartsInteractionYAxisIsDefined: ((state: ChartStat
|
|
|
327
348
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
328
349
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
329
350
|
};
|
|
330
|
-
export declare const selectorChartsInteractionIsVoronoiEnabled: ((state:
|
|
351
|
+
export declare const selectorChartsInteractionIsVoronoiEnabled: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
352
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
353
|
+
}) => boolean | undefined) & {
|
|
331
354
|
clearCache: () => void;
|
|
332
355
|
resultsCount: () => number;
|
|
333
356
|
resetResultsCount: () => void;
|
|
334
357
|
} & {
|
|
335
358
|
resultFunc: (resultFuncArgs_0: {
|
|
336
|
-
item: null | import("../internals
|
|
337
|
-
axis: import("../internals/plugins/
|
|
359
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
360
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
338
361
|
isVoronoiEnabled?: boolean;
|
|
339
362
|
}) => boolean | undefined;
|
|
340
363
|
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
341
|
-
item: null | import("../internals
|
|
342
|
-
axis: import("../internals/plugins/
|
|
364
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
365
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
343
366
|
isVoronoiEnabled?: boolean;
|
|
344
367
|
}) => boolean | undefined) & {
|
|
345
368
|
clearCache: () => void;
|
|
@@ -12,9 +12,9 @@ export interface SizeProviderProps {
|
|
|
12
12
|
}
|
|
13
13
|
export interface SizeContextState extends Required<Pick<SizeProviderProps, 'height' | 'width'>> {
|
|
14
14
|
/**
|
|
15
|
-
* The ref of the
|
|
15
|
+
* The ref of the svg element that the chart is rendered in.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
svgRef: React.RefObject<SVGSVGElement>;
|
|
18
18
|
/**
|
|
19
19
|
* If the chart has a defined size.
|
|
20
20
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const useChartContainerDimensions: (inWidth?: number, inHeight?: number) => {
|
|
3
|
-
|
|
3
|
+
svgRef: React.RefObject<SVGSVGElement>;
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
6
|
hasIntrinsicSize: boolean;
|
|
@@ -20,6 +20,10 @@ export const useChartContainerDimensions = (inWidth, inHeight) => {
|
|
|
20
20
|
const computeSize = React.useCallback(() => {
|
|
21
21
|
const mainEl = rootRef?.current;
|
|
22
22
|
if (!mainEl) {
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
// This is mostly for internal use.
|
|
25
|
+
throw new Error([`MUI X: ChartContainer does not have a valid reference to the <svg /> element.`, 'This may be caused by a ref forwarding issue.', 'Make sure that the ref from SizedProvider is forwarded correctly.'].join('\n'));
|
|
26
|
+
}
|
|
23
27
|
return {};
|
|
24
28
|
}
|
|
25
29
|
const win = ownerWindow(mainEl);
|
|
@@ -94,7 +98,7 @@ export const useChartContainerDimensions = (inWidth, inHeight) => {
|
|
|
94
98
|
const finalWidth = inWidth ?? width;
|
|
95
99
|
const finalHeight = inHeight ?? height;
|
|
96
100
|
return {
|
|
97
|
-
|
|
101
|
+
svgRef: rootRef,
|
|
98
102
|
width: finalWidth,
|
|
99
103
|
height: finalHeight,
|
|
100
104
|
hasIntrinsicSize: finalWidth > 0 && finalHeight > 0,
|
package/hooks/useAxisEvents.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isBandScale } from "../internals/isBandScale.js";
|
|
|
7
7
|
import { getSVGPoint } from "../internals/getSVGPoint.js";
|
|
8
8
|
import { useSvgRef } from "./useSvgRef.js";
|
|
9
9
|
import { useDrawingArea } from "./useDrawingArea.js";
|
|
10
|
-
import { useStore } from "../internals/useStore.js";
|
|
10
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
11
11
|
function getAsANumber(value) {
|
|
12
12
|
return value instanceof Date ? value.getTime() : value;
|
|
13
13
|
}
|
package/hooks/useChartId.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
4
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
5
|
+
import { selectorChartId } from "../internals/plugins/corePlugins/useChartId/useChartId.selectors.js";
|
|
5
6
|
export function useChartId() {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
} = React.useContext(DrawingAreaContext);
|
|
9
|
-
return React.useMemo(() => chartId, [chartId]);
|
|
7
|
+
const store = useStore();
|
|
8
|
+
return useSelector(store, selectorChartId);
|
|
10
9
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import { useHighlighted } from "../context/index.js";
|
|
5
|
-
import { useStore } from "../internals/useStore.js";
|
|
5
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
6
6
|
export const useInteractionItemProps = skip => {
|
|
7
7
|
const store = useStore();
|
|
8
8
|
const {
|
|
@@ -30,7 +30,9 @@ export const useInteractionItemProps = skip => {
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
const onPointerLeave = event => {
|
|
33
|
-
event.currentTarget.
|
|
33
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
34
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
35
|
+
}
|
|
34
36
|
store.update(prev => {
|
|
35
37
|
const prevItem = prev.interaction.item;
|
|
36
38
|
if (prevItem === null || Object.keys(data).some(key => data[key] !== prevItem[key])) {
|
package/hooks/useSvgRef.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function useSvgRef(): React.
|
|
2
|
+
export declare function useSvgRef(): React.RefObject<SVGSVGElement>;
|
package/hooks/useSvgRef.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { SvgRefContext } from "../context/SvgRefProvider/index.js";
|
|
3
|
+
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
5
4
|
export function useSvgRef() {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
data
|
|
9
|
-
} = React.useContext(SvgRefContext);
|
|
10
|
-
if (!isInitialized) {
|
|
5
|
+
const context = useChartContext();
|
|
6
|
+
if (!context) {
|
|
11
7
|
throw new Error(['MUI X: Could not find the svg ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
12
8
|
}
|
|
13
|
-
return
|
|
9
|
+
return context.svgRef;
|
|
14
10
|
}
|
package/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useCartesianContext } from "../../../context/CartesianProvider/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useDrawingArea } from "../../../hooks/index.js";
|
|
3
|
+
import { useChartId, useDrawingArea } from "../../../hooks/index.js";
|
|
5
4
|
import ChartsPiecewiseGradient from "./ChartsPiecewiseGradient.js";
|
|
6
5
|
import ChartsContinuousGradient from "./ChartsContinuousGradient.js";
|
|
7
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
7
|
export function useChartGradient() {
|
|
9
|
-
const
|
|
10
|
-
chartId
|
|
11
|
-
} = React.useContext(DrawingAreaContext);
|
|
8
|
+
const chartId = useChartId();
|
|
12
9
|
return React.useCallback((axisId, direction) => `${chartId}-gradient-${direction}-${axisId}`, [chartId]);
|
|
13
10
|
}
|
|
14
11
|
export function ChartsAxesGradients() {
|
|
@@ -2,7 +2,7 @@ import { AllSeriesType } from '../models/seriesType';
|
|
|
2
2
|
export declare function defaultizeColor(series: AllSeriesType, seriesIndex: number, colors?: string[]): {
|
|
3
3
|
data: {
|
|
4
4
|
color: string;
|
|
5
|
-
label?:
|
|
5
|
+
label?: string | ((location: "tooltip" | "legend" | "arc") => string) | undefined;
|
|
6
6
|
value: number;
|
|
7
7
|
id?: import("..").PieItemId | undefined;
|
|
8
8
|
}[];
|
package/internals/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './components/ChartsAxesGradients';
|
|
2
|
-
export * from '../ChartContainer/ResizableContainer';
|
|
3
2
|
export { useSeries } from '../hooks/useSeries';
|
|
4
3
|
export { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
5
4
|
export { useDrawingArea } from '../hooks/useDrawingArea';
|
|
@@ -18,7 +17,6 @@ export * from './getScale';
|
|
|
18
17
|
export * from './computeAxisValue';
|
|
19
18
|
export * from '../context/CartesianProvider';
|
|
20
19
|
export * from '../context/DrawingAreaProvider';
|
|
21
|
-
export * from '../context/InteractionProvider';
|
|
22
20
|
export * from '../context/SeriesProvider';
|
|
23
21
|
export * from '../context/ZAxisContextProvider';
|
|
24
22
|
export * from '../context/PluginProvider';
|
|
@@ -27,7 +25,7 @@ export type * from '../context/context.types';
|
|
|
27
25
|
export { getAxisExtremum } from '../context/CartesianProvider/getAxisExtremum';
|
|
28
26
|
export * from '../context/ChartDataProvider';
|
|
29
27
|
export * from '../context/SizeProvider';
|
|
30
|
-
export * from '../context/
|
|
28
|
+
export * from '../context/ChartProvider';
|
|
31
29
|
export * from '../models/seriesType/config';
|
|
32
30
|
export * from '../models/seriesType/common';
|
|
33
31
|
export * from '../models/z-axis';
|
package/internals/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Components
|
|
2
2
|
export * from "./components/ChartsAxesGradients/index.js";
|
|
3
|
-
export * from "../ChartContainer/ResizableContainer.js";
|
|
4
3
|
|
|
5
4
|
// hooks
|
|
6
5
|
export { useSeries } from "../hooks/useSeries.js";
|
|
@@ -26,7 +25,6 @@ export * from "./computeAxisValue.js";
|
|
|
26
25
|
|
|
27
26
|
export * from "../context/CartesianProvider/index.js";
|
|
28
27
|
export * from "../context/DrawingAreaProvider/index.js";
|
|
29
|
-
export * from "../context/InteractionProvider.js";
|
|
30
28
|
export * from "../context/SeriesProvider/index.js";
|
|
31
29
|
export * from "../context/ZAxisContextProvider.js";
|
|
32
30
|
export * from "../context/PluginProvider/index.js";
|
|
@@ -34,7 +32,7 @@ export * from "../context/AnimationProvider/index.js";
|
|
|
34
32
|
export { getAxisExtremum } from "../context/CartesianProvider/getAxisExtremum.js";
|
|
35
33
|
export * from "../context/ChartDataProvider/index.js";
|
|
36
34
|
export * from "../context/SizeProvider/index.js";
|
|
37
|
-
export * from "../context/
|
|
35
|
+
export * from "../context/ChartProvider/index.js";
|
|
38
36
|
|
|
39
37
|
// series configuration
|
|
40
38
|
export * from "../models/seriesType/config.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ALL_PLUGINS: readonly [import("./models").ChartPlugin<import("./featurePlugins/useChartInteraction").UseChartInteractionSignature>];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConvertPluginsIntoSignatures } from '../models/helpers';
|
|
2
|
+
import { UseChartIdParameters } from './useChartId';
|
|
3
|
+
/**
|
|
4
|
+
* Internal plugins that create the tools used by the other plugins.
|
|
5
|
+
* These plugins are used by the Charts components.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CHART_CORE_PLUGINS: readonly [import("../models").ChartPlugin<import("./useChartId").UseChartIdSignature>];
|
|
8
|
+
export type ChartCorePluginSignatures = ConvertPluginsIntoSignatures<typeof CHART_CORE_PLUGINS>;
|
|
9
|
+
export interface ChartCorePluginParameters extends UseChartIdParameters {
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CHART_CORE_PLUGINS } from "./corePlugins.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useChartId } from "./useChartId.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createChartDefaultId } from "./useChartId.utils.js";
|
|
4
|
+
export const useChartId = ({
|
|
5
|
+
params,
|
|
6
|
+
store
|
|
7
|
+
}) => {
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
store.update(prevState => {
|
|
10
|
+
if (params.id === prevState.id.providedChartId && prevState.id.chartId !== undefined) {
|
|
11
|
+
return prevState;
|
|
12
|
+
}
|
|
13
|
+
return _extends({}, prevState, {
|
|
14
|
+
id: _extends({}, prevState.id, {
|
|
15
|
+
chartId: params.id ?? createChartDefaultId()
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}, [store, params.id]);
|
|
20
|
+
return {};
|
|
21
|
+
};
|
|
22
|
+
useChartId.params = {
|
|
23
|
+
id: true
|
|
24
|
+
};
|
|
25
|
+
useChartId.getInitialState = ({
|
|
26
|
+
id
|
|
27
|
+
}) => ({
|
|
28
|
+
id: {
|
|
29
|
+
chartId: createChartDefaultId(),
|
|
30
|
+
providedChartId: id
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChartRootSelector } from '../../utils/selectors';
|
|
2
|
+
import { UseChartIdSignature } from './useChartId.types';
|
|
3
|
+
/**
|
|
4
|
+
* Get the id attribute of the chart.
|
|
5
|
+
* @param {ChartState<[UseChartIdSignature]>} state The state of the chart.
|
|
6
|
+
* @returns {string} The id attribute of the chart.
|
|
7
|
+
*/
|
|
8
|
+
export declare const selectorChartId: ((state: import("./useChartId.types").UseChartIdState & Partial<{}> & {
|
|
9
|
+
cacheKey: import("../../models").ChartStateCacheKey;
|
|
10
|
+
}) => string) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
} & {
|
|
15
|
+
resultFunc: (resultFuncArgs_0: {
|
|
16
|
+
chartId: string;
|
|
17
|
+
providedChartId: string | undefined;
|
|
18
|
+
}) => string;
|
|
19
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
20
|
+
chartId: string;
|
|
21
|
+
providedChartId: string | undefined;
|
|
22
|
+
}) => string) & {
|
|
23
|
+
clearCache: () => void;
|
|
24
|
+
resultsCount: () => number;
|
|
25
|
+
resetResultsCount: () => void;
|
|
26
|
+
};
|
|
27
|
+
lastResult: () => string;
|
|
28
|
+
dependencies: [ChartRootSelector<UseChartIdSignature>];
|
|
29
|
+
recomputations: () => number;
|
|
30
|
+
resetRecomputations: () => void;
|
|
31
|
+
dependencyRecomputations: () => number;
|
|
32
|
+
resetDependencyRecomputations: () => void;
|
|
33
|
+
} & {
|
|
34
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
35
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
36
|
+
};
|