@mui/x-charts 7.22.2 → 8.0.0-alpha.0
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.d.ts +7 -7
- package/BarChart/BarChart.js +7 -29
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarPlot.js +12 -4
- package/BarChart/extremums.js +3 -3
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/BarChart/useBarChartProps.js +3 -4
- package/CHANGELOG.md +142 -155
- package/ChartContainer/ChartContainer.d.ts +16 -33
- package/ChartContainer/ChartContainer.js +22 -41
- package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.d.ts +2 -2
- package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.d.ts +1 -1
- package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
- package/ChartContainer/useChartContainerProps.d.ts +11 -94
- package/ChartContainer/useChartContainerProps.js +42 -58
- package/ChartsLegend/ChartsLegend.js +0 -3
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
- package/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/ChartsLegend/LegendPerItem.d.ts +1 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
- package/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/ChartsTooltip/ChartsTooltip.js +45 -6
- package/ChartsTooltip/useAxisTooltip.js +3 -3
- package/ChartsTooltip/useItemTooltip.js +3 -3
- package/ChartsTooltip/utils.d.ts +5 -13
- package/ChartsTooltip/utils.js +45 -42
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
- package/Gauge/GaugeContainer.js +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.js +2 -6
- package/LineChart/LineChart.d.ts +7 -7
- package/LineChart/LineChart.js +7 -29
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LineHighlightPlot.js +2 -6
- package/LineChart/LinePlot.js +2 -6
- package/LineChart/MarkPlot.js +2 -6
- package/LineChart/extremums.js +10 -6
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/LineChart/useLineChartProps.js +3 -4
- package/PieChart/PieArc.d.ts +0 -5
- package/PieChart/PieArc.js +1 -10
- package/PieChart/PieArcPlot.js +0 -5
- package/PieChart/PieChart.d.ts +9 -32
- package/PieChart/PieChart.js +17 -102
- package/README.md +2 -2
- package/ScatterChart/ScatterChart.d.ts +7 -7
- package/ScatterChart/ScatterChart.js +7 -29
- package/ScatterChart/ScatterPlot.js +3 -6
- package/ScatterChart/extremums.js +6 -6
- package/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/ScatterChart/useScatterChartProps.js +3 -4
- package/SparkLineChart/SparkLineChart.d.ts +4 -4
- package/SparkLineChart/SparkLineChart.js +2 -2
- package/context/CartesianProvider/defaultizeAxis.d.ts +1 -1
- package/context/ChartDataProvider/ChartDataProvider.d.ts +41 -0
- package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +46 -27
- package/context/ChartDataProvider/index.d.ts +1 -0
- package/context/ChartDataProvider/index.js +1 -0
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +97 -0
- package/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
- package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +12 -12
- package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/context/HighlightedProvider/HighlightedContext.d.ts +0 -8
- package/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
- package/context/ZAxisContextProvider.d.ts +1 -1
- package/index.d.ts +1 -2
- package/index.js +2 -3
- package/internals/defaultizeColor.d.ts +1 -8
- package/internals/getSymbol.js +19 -3
- package/internals/index.d.ts +5 -5
- package/internals/index.js +5 -5
- package/internals/useStringInterpolator.js +1 -0
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.ts +0 -10
- package/models/seriesType/config.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +1 -6
- package/modern/BarChart/BarChart.js +7 -29
- package/modern/BarChart/BarPlot.js +12 -4
- package/modern/BarChart/extremums.js +3 -3
- package/modern/BarChart/useBarChartProps.js +3 -4
- package/modern/ChartContainer/ChartContainer.js +22 -41
- package/modern/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
- package/modern/ChartContainer/useChartContainerProps.js +42 -58
- package/modern/ChartsLegend/ChartsLegend.js +0 -3
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/modern/ChartsTooltip/ChartsTooltip.js +45 -6
- package/modern/ChartsTooltip/useAxisTooltip.js +3 -3
- package/modern/ChartsTooltip/useItemTooltip.js +3 -3
- package/modern/ChartsTooltip/utils.js +45 -42
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
- package/modern/Gauge/GaugeContainer.js +1 -1
- package/modern/LineChart/AreaPlot.js +2 -6
- package/modern/LineChart/LineChart.js +7 -29
- package/modern/LineChart/LineHighlightPlot.js +2 -6
- package/modern/LineChart/LinePlot.js +2 -6
- package/modern/LineChart/MarkPlot.js +2 -6
- package/modern/LineChart/extremums.js +10 -6
- package/modern/LineChart/useLineChartProps.js +3 -4
- package/modern/PieChart/PieArc.js +1 -10
- package/modern/PieChart/PieArcPlot.js +0 -5
- package/modern/PieChart/PieChart.js +17 -102
- package/modern/ScatterChart/ScatterChart.js +7 -29
- package/modern/ScatterChart/ScatterPlot.js +3 -6
- package/modern/ScatterChart/extremums.js +6 -6
- package/modern/ScatterChart/useScatterChartProps.js +3 -4
- package/modern/SparkLineChart/SparkLineChart.js +2 -2
- package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +46 -27
- package/modern/context/ChartDataProvider/index.js +1 -0
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
- package/modern/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/modern/index.js +2 -3
- package/modern/internals/getSymbol.js +19 -3
- package/modern/internals/index.js +5 -5
- package/modern/internals/useStringInterpolator.js +1 -0
- package/node/BarChart/BarChart.js +7 -29
- package/node/BarChart/BarPlot.js +11 -3
- package/node/BarChart/extremums.js +3 -3
- package/node/BarChart/useBarChartProps.js +3 -4
- package/node/ChartContainer/ChartContainer.js +21 -40
- package/node/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
- package/node/ChartContainer/useChartContainerProps.js +42 -59
- package/node/ChartsLegend/ChartsLegend.js +0 -3
- package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/node/ChartsTooltip/ChartsTooltip.js +44 -5
- package/node/ChartsTooltip/useAxisTooltip.js +3 -3
- package/node/ChartsTooltip/useItemTooltip.js +3 -3
- package/node/ChartsTooltip/utils.js +46 -44
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
- package/node/Gauge/GaugeContainer.js +1 -1
- package/node/LineChart/AreaPlot.js +2 -6
- package/node/LineChart/LineChart.js +7 -29
- package/node/LineChart/LineHighlightPlot.js +2 -6
- package/node/LineChart/LinePlot.js +2 -6
- package/node/LineChart/MarkPlot.js +2 -6
- package/node/LineChart/extremums.js +10 -6
- package/node/LineChart/useLineChartProps.js +3 -4
- package/node/PieChart/PieArc.js +1 -10
- package/node/PieChart/PieArcPlot.js +0 -5
- package/node/PieChart/PieChart.js +17 -102
- package/node/ScatterChart/ScatterChart.js +7 -29
- package/node/ScatterChart/ScatterPlot.js +3 -6
- package/node/ScatterChart/extremums.js +6 -6
- package/node/ScatterChart/useScatterChartProps.js +3 -4
- package/node/SparkLineChart/SparkLineChart.js +2 -2
- package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -26
- package/node/context/ChartDataProvider/index.js +16 -0
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +94 -0
- package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/node/index.js +5 -16
- package/node/internals/getSymbol.js +19 -3
- package/node/internals/index.js +37 -29
- package/node/internals/useStringInterpolator.js +2 -0
- package/package.json +4 -4
- package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
- package/ResponsiveChartContainer/index.d.ts +0 -1
- package/ResponsiveChartContainer/index.js +0 -1
- package/ResponsiveChartContainer/package.json +0 -6
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/internals/SlotComponentPropsFromProps.d.ts +0 -1
- package/internals/SlotComponentPropsFromProps.js +0 -1
- package/models/helpers.d.ts +0 -3
- package/models/helpers.js +0 -1
- package/modern/ResponsiveChartContainer/index.js +0 -1
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/modern/internals/SlotComponentPropsFromProps.js +0 -1
- package/modern/models/helpers.js +0 -1
- package/node/ResponsiveChartContainer/index.js +0 -16
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
- package/node/internals/SlotComponentPropsFromProps.js +0 -5
- package/node/models/helpers.js +0 -5
- /package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
- /package/modern/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
- /package/node/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ChartDataProvider.js";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { DrawingProviderProps } from '../DrawingProvider';
|
|
3
|
+
import type { CartesianProviderProps } from '../CartesianProvider';
|
|
4
|
+
import type { SeriesProviderProps } from '../SeriesProvider';
|
|
5
|
+
import type { ZAxisContextProviderProps } from '../ZAxisContextProvider';
|
|
6
|
+
import type { ChartDataProviderProps } from './ChartDataProvider';
|
|
7
|
+
import { HighlightedProviderProps } from '..';
|
|
8
|
+
import { ChartsSurfaceProps } from '../../ChartsSurface';
|
|
9
|
+
import { PluginProviderProps } from '../PluginProvider';
|
|
10
|
+
import { AnimationProviderProps } from '../AnimationProvider';
|
|
11
|
+
export declare const useChartDataProviderProps: (props: ChartDataProviderProps, ref: React.Ref<SVGSVGElement>) => {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
drawingProviderProps: Omit<DrawingProviderProps, "children">;
|
|
14
|
+
seriesProviderProps: Omit<SeriesProviderProps, "children">;
|
|
15
|
+
cartesianProviderProps: Omit<CartesianProviderProps, "children">;
|
|
16
|
+
zAxisContextProps: Omit<ZAxisContextProviderProps, "children">;
|
|
17
|
+
highlightedProviderProps: Omit<HighlightedProviderProps, "children">;
|
|
18
|
+
chartsSurfaceProps: ChartsSurfaceProps & {
|
|
19
|
+
ref: any;
|
|
20
|
+
};
|
|
21
|
+
pluginProviderProps: Omit<PluginProviderProps, "children">;
|
|
22
|
+
animationProviderProps: Omit<AnimationProviderProps, "children">;
|
|
23
|
+
xAxis: {
|
|
24
|
+
reverse?: boolean | undefined;
|
|
25
|
+
fill?: string | undefined;
|
|
26
|
+
stroke?: string | undefined;
|
|
27
|
+
data?: any[] | undefined;
|
|
28
|
+
label?: string | undefined;
|
|
29
|
+
max?: (number | Date) | undefined;
|
|
30
|
+
min?: (number | Date) | undefined;
|
|
31
|
+
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
32
|
+
dataKey?: string | undefined;
|
|
33
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
34
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
35
|
+
tickMaxStep?: number | undefined;
|
|
36
|
+
tickMinStep?: number | undefined;
|
|
37
|
+
tickNumber?: number | undefined;
|
|
38
|
+
disableLine?: boolean | undefined;
|
|
39
|
+
disableTicks?: boolean | undefined;
|
|
40
|
+
tickFontSize?: number | undefined;
|
|
41
|
+
tickLabelStyle?: import("../..").ChartsTextProps["style"];
|
|
42
|
+
labelStyle?: import("../..").ChartsTextProps["style"];
|
|
43
|
+
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
44
|
+
labelFontSize?: number | undefined;
|
|
45
|
+
tickSize?: number | undefined;
|
|
46
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
47
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
48
|
+
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
49
|
+
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
50
|
+
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
51
|
+
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
52
|
+
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
53
|
+
hideTooltip?: boolean | undefined;
|
|
54
|
+
domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
|
|
55
|
+
min: number;
|
|
56
|
+
max: number;
|
|
57
|
+
})) | undefined;
|
|
58
|
+
id: import("../../internals").AxisId;
|
|
59
|
+
}[];
|
|
60
|
+
yAxis: {
|
|
61
|
+
reverse?: boolean | undefined;
|
|
62
|
+
fill?: string | undefined;
|
|
63
|
+
stroke?: string | undefined;
|
|
64
|
+
data?: any[] | undefined;
|
|
65
|
+
label?: string | undefined;
|
|
66
|
+
max?: (number | Date) | undefined;
|
|
67
|
+
min?: (number | Date) | undefined;
|
|
68
|
+
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
69
|
+
dataKey?: string | undefined;
|
|
70
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
71
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
72
|
+
tickMaxStep?: number | undefined;
|
|
73
|
+
tickMinStep?: number | undefined;
|
|
74
|
+
tickNumber?: number | undefined;
|
|
75
|
+
disableLine?: boolean | undefined;
|
|
76
|
+
disableTicks?: boolean | undefined;
|
|
77
|
+
tickFontSize?: number | undefined;
|
|
78
|
+
tickLabelStyle?: import("../..").ChartsTextProps["style"];
|
|
79
|
+
labelStyle?: import("../..").ChartsTextProps["style"];
|
|
80
|
+
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
81
|
+
labelFontSize?: number | undefined;
|
|
82
|
+
tickSize?: number | undefined;
|
|
83
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
84
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
85
|
+
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
86
|
+
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
87
|
+
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
88
|
+
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
89
|
+
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
90
|
+
hideTooltip?: boolean | undefined;
|
|
91
|
+
domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
|
|
92
|
+
min: number;
|
|
93
|
+
max: number;
|
|
94
|
+
})) | undefined;
|
|
95
|
+
id: import("../../internals").AxisId;
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["width", "height", "series", "margin", "xAxis", "yAxis", "zAxis", "colors", "dataset", "sx", "title", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "children", "skipAnimation"];
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
8
|
+
import { useDefaultizeAxis } from "./useDefaultizeAxis.js";
|
|
9
|
+
export const useChartDataProviderProps = (props, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
width,
|
|
12
|
+
height,
|
|
13
|
+
series,
|
|
14
|
+
margin,
|
|
15
|
+
xAxis,
|
|
16
|
+
yAxis,
|
|
17
|
+
zAxis,
|
|
18
|
+
colors,
|
|
19
|
+
dataset,
|
|
20
|
+
sx,
|
|
21
|
+
title,
|
|
22
|
+
desc,
|
|
23
|
+
disableAxisListener,
|
|
24
|
+
highlightedItem,
|
|
25
|
+
onHighlightChange,
|
|
26
|
+
plugins,
|
|
27
|
+
children,
|
|
28
|
+
skipAnimation
|
|
29
|
+
} = props,
|
|
30
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
|
+
const svgRef = React.useRef(null);
|
|
32
|
+
const chartSurfaceRef = useForkRef(ref, svgRef);
|
|
33
|
+
const [defaultizedXAxis, defaultizedYAxis] = useDefaultizeAxis(xAxis, yAxis, dataset);
|
|
34
|
+
const drawingProviderProps = {
|
|
35
|
+
width,
|
|
36
|
+
height,
|
|
37
|
+
margin,
|
|
38
|
+
svgRef
|
|
39
|
+
};
|
|
40
|
+
const animationProviderProps = {
|
|
41
|
+
skipAnimation
|
|
42
|
+
};
|
|
43
|
+
const pluginProviderProps = {
|
|
44
|
+
plugins
|
|
45
|
+
};
|
|
46
|
+
const seriesProviderProps = {
|
|
47
|
+
series,
|
|
48
|
+
colors,
|
|
49
|
+
dataset
|
|
50
|
+
};
|
|
51
|
+
const cartesianProviderProps = {
|
|
52
|
+
xAxis: defaultizedXAxis,
|
|
53
|
+
yAxis: defaultizedYAxis,
|
|
54
|
+
dataset
|
|
55
|
+
};
|
|
56
|
+
const zAxisContextProps = {
|
|
57
|
+
zAxis,
|
|
58
|
+
dataset
|
|
59
|
+
};
|
|
60
|
+
const highlightedProviderProps = {
|
|
61
|
+
highlightedItem,
|
|
62
|
+
onHighlightChange
|
|
63
|
+
};
|
|
64
|
+
const chartsSurfaceProps = _extends({}, other, {
|
|
65
|
+
width,
|
|
66
|
+
height,
|
|
67
|
+
ref: chartSurfaceRef,
|
|
68
|
+
sx,
|
|
69
|
+
title,
|
|
70
|
+
desc,
|
|
71
|
+
disableAxisListener
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
children,
|
|
75
|
+
drawingProviderProps,
|
|
76
|
+
seriesProviderProps,
|
|
77
|
+
cartesianProviderProps,
|
|
78
|
+
zAxisContextProps,
|
|
79
|
+
highlightedProviderProps,
|
|
80
|
+
chartsSurfaceProps,
|
|
81
|
+
pluginProviderProps,
|
|
82
|
+
animationProviderProps,
|
|
83
|
+
xAxis: defaultizedXAxis,
|
|
84
|
+
yAxis: defaultizedYAxis
|
|
85
|
+
};
|
|
86
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MakeOptional } from '
|
|
2
|
-
import { AxisConfig, ScaleName } from '
|
|
3
|
-
import { ChartsAxisProps } from '
|
|
4
|
-
import { DatasetType } from '
|
|
1
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
|
+
import { AxisConfig, ScaleName } from '../../models';
|
|
3
|
+
import { ChartsAxisProps } from '../../models/axis';
|
|
4
|
+
import { DatasetType } from '../../models/seriesType/config';
|
|
5
5
|
export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, inYAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, dataset: DatasetType | undefined) => {
|
|
6
6
|
reverse?: boolean | undefined;
|
|
7
7
|
fill?: string | undefined;
|
|
@@ -10,32 +10,32 @@ export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleN
|
|
|
10
10
|
label?: string | undefined;
|
|
11
11
|
max?: (number | Date) | undefined;
|
|
12
12
|
min?: (number | Date) | undefined;
|
|
13
|
-
valueFormatter?: ((value: any, context: import("
|
|
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("
|
|
16
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
17
17
|
tickMaxStep?: number | undefined;
|
|
18
18
|
tickMinStep?: number | undefined;
|
|
19
19
|
tickNumber?: number | undefined;
|
|
20
20
|
disableLine?: boolean | undefined;
|
|
21
21
|
disableTicks?: boolean | undefined;
|
|
22
22
|
tickFontSize?: number | undefined;
|
|
23
|
-
tickLabelStyle?: import("
|
|
24
|
-
labelStyle?: import("
|
|
23
|
+
tickLabelStyle?: import("../..").ChartsTextProps["style"];
|
|
24
|
+
labelStyle?: import("../..").ChartsTextProps["style"];
|
|
25
25
|
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
26
26
|
labelFontSize?: number | undefined;
|
|
27
27
|
tickSize?: number | undefined;
|
|
28
|
-
slots?: Partial<import("
|
|
29
|
-
slotProps?: Partial<import("
|
|
28
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
29
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
30
30
|
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
31
31
|
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
32
32
|
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
33
33
|
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
34
|
-
colorMap?: import("
|
|
34
|
+
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
35
35
|
hideTooltip?: boolean | undefined;
|
|
36
36
|
domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
|
|
37
37
|
min: number;
|
|
38
38
|
max: number;
|
|
39
39
|
})) | undefined;
|
|
40
|
-
id: import("
|
|
40
|
+
id: import("../../internals").AxisId;
|
|
41
41
|
}[][];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "
|
|
5
|
+
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../../constants/index.js";
|
|
6
6
|
const defaultizeAxis = (inAxis, dataset, axisName) => {
|
|
7
7
|
const DEFAULT_AXIS_KEY = axisName === 'x' ? DEFAULT_X_AXIS_KEY : DEFAULT_Y_AXIS_KEY;
|
|
8
8
|
return [...(inAxis?.map((axis, index) => _extends({
|
|
@@ -30,10 +30,6 @@ export type HighlightItemData = {
|
|
|
30
30
|
export type HighlightOptions = 'none' | 'item' | 'series';
|
|
31
31
|
export type FadeOptions = 'none' | 'series' | 'global';
|
|
32
32
|
export type HighlightScope = {
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Use `highlight` instead.
|
|
35
|
-
*/
|
|
36
|
-
highlighted?: HighlightOptions;
|
|
37
33
|
/**
|
|
38
34
|
* The scope of highlighted elements.
|
|
39
35
|
* - 'none': no highlight.
|
|
@@ -42,10 +38,6 @@ export type HighlightScope = {
|
|
|
42
38
|
* @default 'none'
|
|
43
39
|
*/
|
|
44
40
|
highlight?: HighlightOptions;
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated Use `fade` instead.
|
|
47
|
-
*/
|
|
48
|
-
faded?: FadeOptions;
|
|
49
41
|
/**
|
|
50
42
|
* The scope of faded elements.
|
|
51
43
|
* - 'none': no fading.
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["highlighted", "faded"];
|
|
6
3
|
import * as React from 'react';
|
|
7
4
|
import PropTypes from 'prop-types';
|
|
8
5
|
import useControlled from '@mui/utils/useControlled';
|
|
@@ -11,18 +8,6 @@ import { createIsFaded } from "./createIsFaded.js";
|
|
|
11
8
|
import { createIsHighlighted } from "./createIsHighlighted.js";
|
|
12
9
|
import { useSeries } from "../../hooks/useSeries.js";
|
|
13
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const mergeDeprecatedOptions = options => {
|
|
15
|
-
const _ref = options ?? {},
|
|
16
|
-
{
|
|
17
|
-
highlighted,
|
|
18
|
-
faded
|
|
19
|
-
} = _ref,
|
|
20
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
21
|
-
return _extends({
|
|
22
|
-
highlight: highlighted,
|
|
23
|
-
fade: faded
|
|
24
|
-
}, other);
|
|
25
|
-
};
|
|
26
11
|
function HighlightedProvider({
|
|
27
12
|
children,
|
|
28
13
|
highlightedItem: highlightedItemProps,
|
|
@@ -41,7 +26,7 @@ function HighlightedProvider({
|
|
|
41
26
|
const seriesData = series[seriesType];
|
|
42
27
|
Object.keys(seriesData?.series ?? {}).forEach(seriesId => {
|
|
43
28
|
const seriesItem = seriesData?.series[seriesId];
|
|
44
|
-
map.set(seriesId,
|
|
29
|
+
map.set(seriesId, seriesItem?.highlightScope);
|
|
45
30
|
});
|
|
46
31
|
});
|
|
47
32
|
return map;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { CartesianChartSeriesType,
|
|
1
|
+
import type { CartesianChartSeriesType, ChartSeriesDefaultized, ChartSeriesType } from '../../models/seriesType/config';
|
|
2
2
|
import type { AxisConfig, AxisId } from '../../models/axis';
|
|
3
3
|
import type { SeriesId } from '../../models/seriesType/common';
|
|
4
4
|
export type ExtremumGettersConfig<T extends ChartSeriesType = CartesianChartSeriesType> = {
|
|
5
5
|
[K in T]?: ExtremumGetter<K>;
|
|
6
6
|
};
|
|
7
7
|
type ExtremumGetterParams<T extends ChartSeriesType> = {
|
|
8
|
-
series: Record<SeriesId,
|
|
8
|
+
series: Record<SeriesId, ChartSeriesDefaultized<T>>;
|
|
9
9
|
axis: AxisConfig;
|
|
10
10
|
axisIndex: number;
|
|
11
11
|
isDefaultAxis: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
3
|
import { DatasetType } from '../models/seriesType/config';
|
|
3
|
-
import { MakeOptional } from '../models/helpers';
|
|
4
4
|
import { ZAxisConfig, ZAxisDefaultized } from '../models/z-axis';
|
|
5
5
|
export type ZAxisContextProviderProps = {
|
|
6
6
|
/**
|
package/index.d.ts
CHANGED
|
@@ -21,6 +21,5 @@ export * from './PieChart';
|
|
|
21
21
|
export * from './ScatterChart';
|
|
22
22
|
export * from './SparkLineChart';
|
|
23
23
|
export * from './Gauge';
|
|
24
|
-
export * from './ChartContainer';
|
|
25
24
|
export * from './ChartsSurface';
|
|
26
|
-
export * from './
|
|
25
|
+
export * from './ChartContainer';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts
|
|
2
|
+
* @mui/x-charts v8.0.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -28,6 +28,5 @@ export * from "./PieChart/index.js";
|
|
|
28
28
|
export * from "./ScatterChart/index.js";
|
|
29
29
|
export * from "./SparkLineChart/index.js";
|
|
30
30
|
export * from "./Gauge/index.js";
|
|
31
|
-
export * from "./ChartContainer/index.js";
|
|
32
31
|
export * from "./ChartsSurface/index.js";
|
|
33
|
-
export * from "./
|
|
32
|
+
export * from "./ChartContainer/index.js";
|
|
@@ -41,7 +41,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
41
41
|
};
|
|
42
42
|
id?: import(".").SeriesId;
|
|
43
43
|
color?: string;
|
|
44
|
-
valueFormatter?: import(".").SeriesValueFormatter<import("
|
|
44
|
+
valueFormatter?: import(".").SeriesValueFormatter<import("@mui/x-internals/types").MakeOptional<import("..").PieValueType, "id">> | undefined;
|
|
45
45
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
46
46
|
} | {
|
|
47
47
|
type: "bar";
|
|
@@ -54,8 +54,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
54
54
|
color: string;
|
|
55
55
|
valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
|
|
56
56
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
57
|
-
xAxisKey?: string;
|
|
58
|
-
yAxisKey?: string;
|
|
59
57
|
xAxisId?: string;
|
|
60
58
|
yAxisId?: string;
|
|
61
59
|
stack?: string;
|
|
@@ -66,7 +64,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
66
64
|
markerSize?: number;
|
|
67
65
|
label?: string | ((location: "tooltip" | "legend") => string);
|
|
68
66
|
disableHover?: boolean;
|
|
69
|
-
zAxisKey?: string;
|
|
70
67
|
zAxisId?: string;
|
|
71
68
|
datasetKeys?: {
|
|
72
69
|
x: string;
|
|
@@ -78,8 +75,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
78
75
|
color: string;
|
|
79
76
|
valueFormatter?: import(".").SeriesValueFormatter<import("..").ScatterValueType> | undefined;
|
|
80
77
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
81
|
-
xAxisKey?: string;
|
|
82
|
-
yAxisKey?: string;
|
|
83
78
|
xAxisId?: string;
|
|
84
79
|
yAxisId?: string;
|
|
85
80
|
} | {
|
|
@@ -99,8 +94,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
99
94
|
color: string;
|
|
100
95
|
valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
|
|
101
96
|
highlightScope?: Partial<import("..").HighlightScope>;
|
|
102
|
-
xAxisKey?: string;
|
|
103
|
-
yAxisKey?: string;
|
|
104
97
|
xAxisId?: string;
|
|
105
98
|
yAxisId?: string;
|
|
106
99
|
stackOrder?: import("..").StackOrderType;
|
package/internals/getSymbol.js
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
// Returns the index of a defined shape
|
|
2
1
|
export function getSymbol(shape) {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
switch (shape) {
|
|
4
|
+
case 'circle':
|
|
5
|
+
return 0;
|
|
6
|
+
case 'cross':
|
|
7
|
+
return 1;
|
|
8
|
+
case 'diamond':
|
|
9
|
+
return 2;
|
|
10
|
+
case 'square':
|
|
11
|
+
return 3;
|
|
12
|
+
case 'star':
|
|
13
|
+
return 4;
|
|
14
|
+
case 'triangle':
|
|
15
|
+
return 5;
|
|
16
|
+
case 'wye':
|
|
17
|
+
return 6;
|
|
18
|
+
default:
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
5
21
|
}
|
package/internals/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export * from './components/ChartsAxesGradients';
|
|
2
|
-
export * from '../
|
|
3
|
-
export * from '../
|
|
2
|
+
export * from '../ChartContainer/useChartContainerDimensions';
|
|
3
|
+
export * from '../ChartContainer/ResizableContainer';
|
|
4
4
|
export { useSeries } from '../hooks/useSeries';
|
|
5
5
|
export { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
6
6
|
export { useDrawingArea } from '../hooks/useDrawingArea';
|
|
7
7
|
export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
|
|
8
8
|
export { useLineChartProps } from '../LineChart/useLineChartProps';
|
|
9
9
|
export { useBarChartProps } from '../BarChart/useBarChartProps';
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export * from '../ChartContainer/useChartContainerProps';
|
|
11
|
+
export * from '../context/ChartDataProvider/useChartDataProviderProps';
|
|
12
12
|
export * from './defaultizeValueFormatter';
|
|
13
13
|
export * from './configInit';
|
|
14
14
|
export * from './getLabel';
|
|
@@ -26,8 +26,8 @@ export * from '../context/PluginProvider';
|
|
|
26
26
|
export * from '../context/AnimationProvider';
|
|
27
27
|
export type * from '../context/context.types';
|
|
28
28
|
export { getAxisExtremum } from '../context/CartesianProvider/getAxisExtremum';
|
|
29
|
+
export * from '../context/ChartDataProvider';
|
|
29
30
|
export * from '../models/seriesType/config';
|
|
30
31
|
export * from '../models/seriesType/common';
|
|
31
|
-
export * from '../models/helpers';
|
|
32
32
|
export * from '../models/z-axis';
|
|
33
33
|
export * from '../models/axis';
|
package/internals/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Components
|
|
2
2
|
export * from "./components/ChartsAxesGradients/index.js";
|
|
3
|
-
export * from "../
|
|
4
|
-
export * from "../
|
|
3
|
+
export * from "../ChartContainer/useChartContainerDimensions.js";
|
|
4
|
+
export * from "../ChartContainer/ResizableContainer.js";
|
|
5
5
|
|
|
6
6
|
// hooks
|
|
7
7
|
export { useSeries } from "../hooks/useSeries.js";
|
|
@@ -10,8 +10,8 @@ export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
|
10
10
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
11
11
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
12
12
|
export { useBarChartProps } from "../BarChart/useBarChartProps.js";
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export * from "../ChartContainer/useChartContainerProps.js";
|
|
14
|
+
export * from "../context/ChartDataProvider/useChartDataProviderProps.js";
|
|
15
15
|
|
|
16
16
|
// utils
|
|
17
17
|
export * from "./defaultizeValueFormatter.js";
|
|
@@ -33,10 +33,10 @@ export * from "../context/ZAxisContextProvider.js";
|
|
|
33
33
|
export * from "../context/PluginProvider/index.js";
|
|
34
34
|
export * from "../context/AnimationProvider/index.js";
|
|
35
35
|
export { getAxisExtremum } from "../context/CartesianProvider/getAxisExtremum.js";
|
|
36
|
+
export * from "../context/ChartDataProvider/index.js";
|
|
36
37
|
|
|
37
38
|
// series configuration
|
|
38
39
|
export * from "../models/seriesType/config.js";
|
|
39
40
|
export * from "../models/seriesType/common.js";
|
|
40
|
-
export * from "../models/helpers.js";
|
|
41
41
|
export * from "../models/z-axis.js";
|
|
42
42
|
export * from "../models/axis.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultizedProps } from '
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import type { StackOffsetType } from '../stacking';
|
|
3
3
|
import { CartesianSeriesType, CommonSeriesType, CommonDefaultizedProps, StackableSeriesType } from './common';
|
|
4
4
|
export interface BarSeriesType extends CommonSeriesType<number | null>, CartesianSeriesType, StackableSeriesType {
|
|
@@ -25,16 +25,6 @@ export type CommonSeriesType<TValue> = {
|
|
|
25
25
|
};
|
|
26
26
|
export type CommonDefaultizedProps = 'id' | 'valueFormatter' | 'data';
|
|
27
27
|
export type CartesianSeriesType = {
|
|
28
|
-
/**
|
|
29
|
-
* The id of the x-axis used to render the series.
|
|
30
|
-
* @deprecated Use `xAxisId` instead
|
|
31
|
-
*/
|
|
32
|
-
xAxisKey?: string;
|
|
33
|
-
/**
|
|
34
|
-
* The id of the y-axis used to render the series.
|
|
35
|
-
* @deprecated Use `xAxisId` instead
|
|
36
|
-
*/
|
|
37
|
-
yAxisKey?: string;
|
|
38
28
|
/**
|
|
39
29
|
* The id of the x-axis used to render the series.
|
|
40
30
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { DefaultizedProps, MakeOptional } from '@mui/x-internals/types';
|
|
1
2
|
import { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from './scatter';
|
|
2
3
|
import { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from './line';
|
|
3
4
|
import { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from './bar';
|
|
4
5
|
import { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, DefaultizedPieValueType } from './pie';
|
|
5
|
-
import { DefaultizedProps, MakeOptional } from '../helpers';
|
|
6
6
|
export interface ChartsSeriesConfig {
|
|
7
7
|
bar: {
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultizedProps } from '
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import type { StackOffsetType } from '../stacking';
|
|
3
3
|
import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, StackableSeriesType } from './common';
|
|
4
4
|
export type CurveType = 'catmullRom' | 'linear' | 'monotoneX' | 'monotoneY' | 'natural' | 'step' | 'stepBefore' | 'stepAfter';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PieArcDatum as D3PieArcDatum } from '@mui/x-charts-vendor/d3-shape';
|
|
2
|
-
import { DefaultizedProps } from '
|
|
2
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
3
|
import { CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';
|
|
4
4
|
export type PieItemId = string | number;
|
|
5
5
|
export type PieValueType = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultizedProps } from '
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';
|
|
3
3
|
export type ScatterValueType = {
|
|
4
4
|
x: number;
|
|
@@ -22,11 +22,6 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType>, C
|
|
|
22
22
|
* @default false
|
|
23
23
|
*/
|
|
24
24
|
disableHover?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* The id of the z-axis used to render the series.
|
|
27
|
-
* @deprecated Use `zAxisId` instead.
|
|
28
|
-
*/
|
|
29
|
-
zAxisKey?: string;
|
|
30
25
|
/**
|
|
31
26
|
* The id of the z-axis used to render the series.
|
|
32
27
|
*/
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import { BarPlot } from "./BarPlot.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ChartContainer } from "../ChartContainer/index.js";
|
|
9
9
|
import { ChartsAxis } from "../ChartsAxis/index.js";
|
|
10
10
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
11
11
|
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
@@ -46,12 +46,12 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
|
|
|
46
46
|
tooltipProps,
|
|
47
47
|
children
|
|
48
48
|
} = useBarChartProps(props);
|
|
49
|
-
return /*#__PURE__*/_jsxs(
|
|
49
|
+
return /*#__PURE__*/_jsxs(ChartContainer, _extends({
|
|
50
50
|
ref: ref
|
|
51
51
|
}, chartContainerProps, {
|
|
52
52
|
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
53
53
|
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
54
|
-
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
54
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
55
55
|
}));
|
|
56
56
|
});
|
|
57
57
|
process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
@@ -116,6 +116,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
116
116
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
117
117
|
*/
|
|
118
118
|
height: PropTypes.number,
|
|
119
|
+
/**
|
|
120
|
+
* If `true`, the legend is not rendered.
|
|
121
|
+
*/
|
|
122
|
+
hideLegend: PropTypes.bool,
|
|
119
123
|
/**
|
|
120
124
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
121
125
|
*/
|
|
@@ -134,32 +138,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
134
138
|
* @default yAxisIds[0] The id of the first provided axis
|
|
135
139
|
*/
|
|
136
140
|
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
137
|
-
/**
|
|
138
|
-
* @deprecated Consider using `slotProps.legend` instead.
|
|
139
|
-
*/
|
|
140
|
-
legend: PropTypes.shape({
|
|
141
|
-
classes: PropTypes.object,
|
|
142
|
-
direction: PropTypes.oneOf(['column', 'row']),
|
|
143
|
-
hidden: PropTypes.bool,
|
|
144
|
-
itemGap: PropTypes.number,
|
|
145
|
-
itemMarkHeight: PropTypes.number,
|
|
146
|
-
itemMarkWidth: PropTypes.number,
|
|
147
|
-
labelStyle: PropTypes.object,
|
|
148
|
-
markGap: PropTypes.number,
|
|
149
|
-
onItemClick: PropTypes.func,
|
|
150
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
151
|
-
bottom: PropTypes.number,
|
|
152
|
-
left: PropTypes.number,
|
|
153
|
-
right: PropTypes.number,
|
|
154
|
-
top: PropTypes.number
|
|
155
|
-
})]),
|
|
156
|
-
position: PropTypes.shape({
|
|
157
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
158
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
159
|
-
}),
|
|
160
|
-
slotProps: PropTypes.object,
|
|
161
|
-
slots: PropTypes.object
|
|
162
|
-
}),
|
|
163
141
|
/**
|
|
164
142
|
* If `true`, a loading overlay is displayed.
|
|
165
143
|
* @default false
|