@mui/x-charts 8.0.0-alpha.1 → 8.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +0 -4
- package/BarChart/BarLabel/BarLabel.d.ts +298 -298
- package/CHANGELOG.md +228 -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 +1 -1
- 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/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 +1 -1
- 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/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 +2 -2
- 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/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
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { DrawingAreaProvider } from "../DrawingAreaProvider/index.js";
|
|
7
7
|
import { SeriesProvider } from "../SeriesProvider/index.js";
|
|
8
|
-
import { InteractionProvider } from "../InteractionProvider.js";
|
|
9
8
|
import { CartesianProvider } from "../CartesianProvider/index.js";
|
|
10
9
|
import { PluginProvider } from "../PluginProvider/index.js";
|
|
11
10
|
import { useChartDataProviderProps } from "./useChartDataProviderProps.js";
|
|
@@ -13,8 +12,35 @@ import { AnimationProvider } from "../AnimationProvider/index.js";
|
|
|
13
12
|
import { ZAxisContextProvider } from "../ZAxisContextProvider.js";
|
|
14
13
|
import { HighlightedProvider } from "../HighlightedProvider/index.js";
|
|
15
14
|
import { SizeProvider } from "../SizeProvider/index.js";
|
|
16
|
-
import {
|
|
15
|
+
import { ChartProvider } from "../ChartProvider/index.js";
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
/**
|
|
18
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
19
|
+
*
|
|
20
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
21
|
+
*
|
|
22
|
+
* Demos:
|
|
23
|
+
*
|
|
24
|
+
* - [Composition](http://localhost:3001/x/react-charts/composition/)
|
|
25
|
+
*
|
|
26
|
+
* API:
|
|
27
|
+
*
|
|
28
|
+
* - [ChartDataProvider API](https://mui.com/x/api/charts/chart-data-provider/)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <ChartDataProvider
|
|
33
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
34
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
35
|
+
* >
|
|
36
|
+
* <ChartsSurface>
|
|
37
|
+
* <BarPlot />
|
|
38
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
39
|
+
* </ChartsSurface>
|
|
40
|
+
* {'Custom Legend Component'}
|
|
41
|
+
* </ChartDataProvider>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
18
44
|
function ChartDataProvider(props) {
|
|
19
45
|
const {
|
|
20
46
|
children,
|
|
@@ -27,27 +53,25 @@ function ChartDataProvider(props) {
|
|
|
27
53
|
animationProviderProps,
|
|
28
54
|
sizeProviderProps
|
|
29
55
|
} = useChartDataProviderProps(props);
|
|
30
|
-
return /*#__PURE__*/_jsx(
|
|
31
|
-
children: /*#__PURE__*/_jsx(
|
|
32
|
-
children: /*#__PURE__*/_jsx(
|
|
33
|
-
children: /*#__PURE__*/_jsx(
|
|
34
|
-
children: /*#__PURE__*/_jsx(
|
|
35
|
-
children: /*#__PURE__*/_jsx(
|
|
36
|
-
children: /*#__PURE__*/_jsx(
|
|
56
|
+
return /*#__PURE__*/_jsx(ChartProvider, {
|
|
57
|
+
children: /*#__PURE__*/_jsx(SizeProvider, _extends({}, sizeProviderProps, {
|
|
58
|
+
children: /*#__PURE__*/_jsx(DrawingAreaProvider, _extends({}, drawingAreaProviderProps, {
|
|
59
|
+
children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
|
|
60
|
+
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
61
|
+
children: /*#__PURE__*/_jsx(CartesianProvider, _extends({}, cartesianProviderProps, {
|
|
62
|
+
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
37
63
|
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
38
64
|
children: /*#__PURE__*/_jsx(AnimationProvider, _extends({}, animationProviderProps, {
|
|
39
|
-
children:
|
|
40
|
-
children: children
|
|
41
|
-
})
|
|
65
|
+
children: children
|
|
42
66
|
}))
|
|
43
67
|
}))
|
|
44
|
-
})
|
|
68
|
+
}))
|
|
45
69
|
}))
|
|
46
70
|
}))
|
|
47
71
|
}))
|
|
48
72
|
}))
|
|
49
73
|
}))
|
|
50
|
-
})
|
|
74
|
+
});
|
|
51
75
|
}
|
|
52
76
|
process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
53
77
|
// ----------------------------- Warning --------------------------------
|
|
@@ -144,7 +168,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
|
144
168
|
hideTooltip: PropTypes.bool,
|
|
145
169
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
146
170
|
label: PropTypes.string,
|
|
147
|
-
labelFontSize: PropTypes.number,
|
|
148
171
|
labelStyle: PropTypes.object,
|
|
149
172
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
150
173
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -155,7 +178,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
|
155
178
|
slots: PropTypes.object,
|
|
156
179
|
stroke: PropTypes.string,
|
|
157
180
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
158
|
-
tickFontSize: PropTypes.number,
|
|
159
181
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
160
182
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
161
183
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -198,7 +220,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
|
198
220
|
hideTooltip: PropTypes.bool,
|
|
199
221
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
200
222
|
label: PropTypes.string,
|
|
201
|
-
labelFontSize: PropTypes.number,
|
|
202
223
|
labelStyle: PropTypes.object,
|
|
203
224
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
204
225
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -209,7 +230,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
|
209
230
|
slots: PropTypes.object,
|
|
210
231
|
stroke: PropTypes.string,
|
|
211
232
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
212
|
-
tickFontSize: PropTypes.number,
|
|
213
233
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
214
234
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
215
235
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -27,30 +27,28 @@ export declare const useChartDataProviderProps: (props: ChartDataProviderProps)
|
|
|
27
27
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
28
28
|
dataKey?: string | undefined;
|
|
29
29
|
sx?: import("@mui/system").SxProps | undefined;
|
|
30
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
31
30
|
tickMaxStep?: number | undefined;
|
|
32
31
|
tickMinStep?: number | undefined;
|
|
33
32
|
tickNumber?: number | undefined;
|
|
34
33
|
disableLine?: boolean | undefined;
|
|
35
34
|
disableTicks?: boolean | undefined;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
40
|
-
labelFontSize?: number | undefined;
|
|
35
|
+
tickLabelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
36
|
+
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
37
|
+
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
41
38
|
tickSize?: number | undefined;
|
|
39
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
42
40
|
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
43
41
|
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
44
|
-
tickInterval?:
|
|
45
|
-
tickPlacement?:
|
|
46
|
-
tickLabelPlacement?:
|
|
42
|
+
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
43
|
+
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
44
|
+
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
47
45
|
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
48
46
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
49
47
|
hideTooltip?: boolean | undefined;
|
|
50
|
-
domainLimit?:
|
|
48
|
+
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
51
49
|
min: number;
|
|
52
50
|
max: number;
|
|
53
|
-
})
|
|
51
|
+
}) | undefined;
|
|
54
52
|
id: import("../../internals").AxisId;
|
|
55
53
|
}[];
|
|
56
54
|
yAxis: {
|
|
@@ -64,30 +62,28 @@ export declare const useChartDataProviderProps: (props: ChartDataProviderProps)
|
|
|
64
62
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
65
63
|
dataKey?: string | undefined;
|
|
66
64
|
sx?: import("@mui/system").SxProps | undefined;
|
|
67
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
68
65
|
tickMaxStep?: number | undefined;
|
|
69
66
|
tickMinStep?: number | undefined;
|
|
70
67
|
tickNumber?: number | undefined;
|
|
71
68
|
disableLine?: boolean | undefined;
|
|
72
69
|
disableTicks?: boolean | undefined;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
77
|
-
labelFontSize?: number | undefined;
|
|
70
|
+
tickLabelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
71
|
+
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
72
|
+
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
78
73
|
tickSize?: number | undefined;
|
|
74
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
79
75
|
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
80
76
|
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
81
|
-
tickInterval?:
|
|
82
|
-
tickPlacement?:
|
|
83
|
-
tickLabelPlacement?:
|
|
77
|
+
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
78
|
+
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
79
|
+
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
84
80
|
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
85
81
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
86
82
|
hideTooltip?: boolean | undefined;
|
|
87
|
-
domainLimit?:
|
|
83
|
+
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
88
84
|
min: number;
|
|
89
85
|
max: number;
|
|
90
|
-
})
|
|
86
|
+
}) | undefined;
|
|
91
87
|
id: import("../../internals").AxisId;
|
|
92
88
|
}[];
|
|
93
89
|
sizeProviderProps: Omit<SizeProviderProps, "children">;
|
|
@@ -13,29 +13,27 @@ export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleN
|
|
|
13
13
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
14
14
|
dataKey?: string | undefined;
|
|
15
15
|
sx?: import("@mui/system").SxProps | undefined;
|
|
16
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
17
16
|
tickMaxStep?: number | undefined;
|
|
18
17
|
tickMinStep?: number | undefined;
|
|
19
18
|
tickNumber?: number | undefined;
|
|
20
19
|
disableLine?: boolean | undefined;
|
|
21
20
|
disableTicks?: boolean | undefined;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
26
|
-
labelFontSize?: number | undefined;
|
|
21
|
+
tickLabelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
22
|
+
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
23
|
+
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
27
24
|
tickSize?: number | undefined;
|
|
25
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
28
26
|
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
29
27
|
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
30
|
-
tickInterval?:
|
|
31
|
-
tickPlacement?:
|
|
32
|
-
tickLabelPlacement?:
|
|
28
|
+
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
29
|
+
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
30
|
+
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
33
31
|
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
34
32
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
35
33
|
hideTooltip?: boolean | undefined;
|
|
36
|
-
domainLimit?:
|
|
34
|
+
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
37
35
|
min: number;
|
|
38
36
|
max: number;
|
|
39
|
-
})
|
|
37
|
+
}) | undefined;
|
|
40
38
|
id: import("../../internals").AxisId;
|
|
41
39
|
}[][];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useCharts } from "../../internals/store/useCharts.js";
|
|
5
|
+
import { ChartContext } from "./ChartContext.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
function ChartProvider(props) {
|
|
8
|
+
const {
|
|
9
|
+
children
|
|
10
|
+
} = props;
|
|
11
|
+
const {
|
|
12
|
+
contextValue
|
|
13
|
+
} = useCharts([], {});
|
|
14
|
+
return /*#__PURE__*/_jsx(ChartContext.Provider, {
|
|
15
|
+
value: contextValue,
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export { ChartProvider };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI } from '../../internals/plugins/models';
|
|
3
|
+
import { ChartStore } from '../../internals/plugins/utils/ChartStore';
|
|
4
|
+
export type ChartContextValue<TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []> = {
|
|
5
|
+
/**
|
|
6
|
+
* And object with all the methods needed to interact with the chart.
|
|
7
|
+
*/
|
|
8
|
+
instance: ChartInstance<TSignatures, TOptionalSignatures>;
|
|
9
|
+
/**
|
|
10
|
+
* A subset of the `instance` method that are exposed to the developers.
|
|
11
|
+
*/
|
|
12
|
+
publicAPI: ChartPublicAPI<TSignatures, TOptionalSignatures>;
|
|
13
|
+
/**
|
|
14
|
+
* The internal state of the chart.
|
|
15
|
+
*/
|
|
16
|
+
store: ChartStore<TSignatures>;
|
|
17
|
+
/**
|
|
18
|
+
* The ref to the <svg />.
|
|
19
|
+
*/
|
|
20
|
+
svgRef: React.RefObject<SVGSVGElement>;
|
|
21
|
+
};
|
|
22
|
+
export interface ChartProviderProps {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ChartAnyPluginSignature } from '../../internals/plugins/models';
|
|
2
|
+
import { ChartContextValue } from './ChartProvider.types';
|
|
3
|
+
export declare const useChartContext: <TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []>() => ChartContextValue<TSignatures, TOptionalSignatures>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ChartContext } from "./ChartContext.js";
|
|
5
|
+
export const useChartContext = () => {
|
|
6
|
+
const context = React.useContext(ChartContext);
|
|
7
|
+
if (context == null) {
|
|
8
|
+
throw new Error(['MUI X: Could not find the Chart context.', 'It looks like you rendered your component outside of a ChartDataProvider.', 'This can also happen if you are bundling multiple versions of the library.'].join('\n'));
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DrawingAreaState } from './DrawingArea.types';
|
|
3
|
-
export declare const DrawingAreaContext: React.Context<DrawingAreaState
|
|
4
|
-
/**
|
|
5
|
-
* A random id used to distinguish each chart on the same page.
|
|
6
|
-
*/
|
|
7
|
-
chartId: string;
|
|
8
|
-
}>;
|
|
3
|
+
export declare const DrawingAreaContext: React.Context<DrawingAreaState>;
|