@mui/x-charts-pro 7.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/BarChartPro/BarChartPro.d.ts +18 -0
- package/BarChartPro/BarChartPro.js +417 -0
- package/BarChartPro/index.d.ts +1 -0
- package/BarChartPro/index.js +1 -0
- package/BarChartPro/package.json +6 -0
- package/CHANGELOG.md +4404 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +7 -0
- package/ChartContainerPro/ChartContainerPro.js +282 -0
- package/ChartContainerPro/index.d.ts +1 -0
- package/ChartContainerPro/index.js +1 -0
- package/ChartContainerPro/package.json +6 -0
- package/ChartContainerPro/useChartContainerProProps.d.ts +15 -0
- package/ChartContainerPro/useChartContainerProProps.js +39 -0
- package/Heatmap/DefaultHeatmapTooltip.d.ts +7 -0
- package/Heatmap/DefaultHeatmapTooltip.js +97 -0
- package/Heatmap/Heatmap.d.ts +49 -0
- package/Heatmap/Heatmap.js +387 -0
- package/Heatmap/HeatmapItem.d.ts +49 -0
- package/Heatmap/HeatmapItem.js +106 -0
- package/Heatmap/HeatmapPlot.d.ts +9 -0
- package/Heatmap/HeatmapPlot.js +57 -0
- package/Heatmap/extremums.d.ts +2 -0
- package/Heatmap/extremums.js +8 -0
- package/Heatmap/formatter.d.ts +3 -0
- package/Heatmap/formatter.js +20 -0
- package/Heatmap/getColor.d.ts +3 -0
- package/Heatmap/getColor.js +15 -0
- package/Heatmap/heatmapClasses.d.ts +11 -0
- package/Heatmap/heatmapClasses.js +13 -0
- package/Heatmap/index.d.ts +4 -0
- package/Heatmap/index.js +4 -0
- package/Heatmap/package.json +6 -0
- package/Heatmap/plugin.d.ts +2 -0
- package/Heatmap/plugin.js +10 -0
- package/LICENSE +11 -0
- package/LineChartPro/LineChartPro.d.ts +17 -0
- package/LineChartPro/LineChartPro.js +473 -0
- package/LineChartPro/index.d.ts +1 -0
- package/LineChartPro/index.js +1 -0
- package/LineChartPro/package.json +6 -0
- package/README.md +26 -0
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.d.ts +7 -0
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +259 -0
- package/ResponsiveChartContainerPro/index.d.ts +1 -0
- package/ResponsiveChartContainerPro/index.js +1 -0
- package/ResponsiveChartContainerPro/package.json +6 -0
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.d.ts +41 -0
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +25 -0
- package/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/ScatterChartPro/ScatterChartPro.js +388 -0
- package/ScatterChartPro/index.d.ts +1 -0
- package/ScatterChartPro/index.js +1 -0
- package/ScatterChartPro/package.json +6 -0
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +6 -0
- package/context/CartesianProviderPro/CartesianProviderPro.js +54 -0
- package/context/CartesianProviderPro/index.d.ts +1 -0
- package/context/CartesianProviderPro/index.js +1 -0
- package/context/ZoomProvider/Zoom.types.d.ts +134 -0
- package/context/ZoomProvider/Zoom.types.js +1 -0
- package/context/ZoomProvider/ZoomContext.d.ts +4 -0
- package/context/ZoomProvider/ZoomContext.js +16 -0
- package/context/ZoomProvider/ZoomProvider.d.ts +3 -0
- package/context/ZoomProvider/ZoomProvider.js +53 -0
- package/context/ZoomProvider/ZoomSetup.d.ts +9 -0
- package/context/ZoomProvider/ZoomSetup.js +16 -0
- package/context/ZoomProvider/defaultizeZoom.d.ts +2 -0
- package/context/ZoomProvider/defaultizeZoom.js +31 -0
- package/context/ZoomProvider/index.d.ts +3 -0
- package/context/ZoomProvider/index.js +3 -0
- package/context/ZoomProvider/initializeZoomData.d.ts +6 -0
- package/context/ZoomProvider/initializeZoomData.js +13 -0
- package/context/ZoomProvider/useSetupPan.d.ts +1 -0
- package/context/ZoomProvider/useSetupPan.js +104 -0
- package/context/ZoomProvider/useSetupZoom.d.ts +1 -0
- package/context/ZoomProvider/useSetupZoom.js +272 -0
- package/context/ZoomProvider/useZoom.d.ts +7 -0
- package/context/ZoomProvider/useZoom.js +17 -0
- package/context/index.d.ts +3 -0
- package/context/index.js +5 -0
- package/context/package.json +6 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/package.json +6 -0
- package/hooks/useSeries.d.ts +11 -0
- package/hooks/useSeries.js +14 -0
- package/index.d.ts +31 -0
- package/index.js +45 -0
- package/internals/utils/releaseInfo.d.ts +1 -0
- package/internals/utils/releaseInfo.js +13 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/models/package.json +6 -0
- package/models/seriesType/heatmap.d.ts +28 -0
- package/models/seriesType/heatmap.js +1 -0
- package/models/seriesType/index.d.ts +1 -0
- package/models/seriesType/index.js +1 -0
- package/modern/BarChartPro/BarChartPro.js +417 -0
- package/modern/BarChartPro/index.js +1 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +282 -0
- package/modern/ChartContainerPro/index.js +1 -0
- package/modern/ChartContainerPro/useChartContainerProProps.js +39 -0
- package/modern/Heatmap/DefaultHeatmapTooltip.js +97 -0
- package/modern/Heatmap/Heatmap.js +387 -0
- package/modern/Heatmap/HeatmapItem.js +106 -0
- package/modern/Heatmap/HeatmapPlot.js +57 -0
- package/modern/Heatmap/extremums.js +8 -0
- package/modern/Heatmap/formatter.js +20 -0
- package/modern/Heatmap/getColor.js +15 -0
- package/modern/Heatmap/heatmapClasses.js +13 -0
- package/modern/Heatmap/index.js +4 -0
- package/modern/Heatmap/plugin.js +10 -0
- package/modern/LineChartPro/LineChartPro.js +473 -0
- package/modern/LineChartPro/index.js +1 -0
- package/modern/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +259 -0
- package/modern/ResponsiveChartContainerPro/index.js +1 -0
- package/modern/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +25 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +388 -0
- package/modern/ScatterChartPro/index.js +1 -0
- package/modern/context/CartesianProviderPro/CartesianProviderPro.js +54 -0
- package/modern/context/CartesianProviderPro/index.js +1 -0
- package/modern/context/ZoomProvider/Zoom.types.js +1 -0
- package/modern/context/ZoomProvider/ZoomContext.js +16 -0
- package/modern/context/ZoomProvider/ZoomProvider.js +53 -0
- package/modern/context/ZoomProvider/ZoomSetup.js +16 -0
- package/modern/context/ZoomProvider/defaultizeZoom.js +31 -0
- package/modern/context/ZoomProvider/index.js +3 -0
- package/modern/context/ZoomProvider/initializeZoomData.js +13 -0
- package/modern/context/ZoomProvider/useSetupPan.js +104 -0
- package/modern/context/ZoomProvider/useSetupZoom.js +272 -0
- package/modern/context/ZoomProvider/useZoom.js +17 -0
- package/modern/context/index.js +5 -0
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/useSeries.js +14 -0
- package/modern/index.js +45 -0
- package/modern/internals/utils/releaseInfo.js +13 -0
- package/modern/models/index.js +1 -0
- package/modern/models/seriesType/heatmap.js +1 -0
- package/modern/models/seriesType/index.js +1 -0
- package/modern/typeOverloads/index.js +1 -0
- package/modern/typeOverloads/modules.js +1 -0
- package/node/BarChartPro/BarChartPro.js +425 -0
- package/node/BarChartPro/index.js +16 -0
- package/node/ChartContainerPro/ChartContainerPro.js +290 -0
- package/node/ChartContainerPro/index.js +16 -0
- package/node/ChartContainerPro/useChartContainerProProps.js +47 -0
- package/node/Heatmap/DefaultHeatmapTooltip.js +105 -0
- package/node/Heatmap/Heatmap.js +395 -0
- package/node/Heatmap/HeatmapItem.js +114 -0
- package/node/Heatmap/HeatmapPlot.js +65 -0
- package/node/Heatmap/extremums.js +15 -0
- package/node/Heatmap/formatter.js +27 -0
- package/node/Heatmap/getColor.js +21 -0
- package/node/Heatmap/heatmapClasses.js +21 -0
- package/node/Heatmap/index.js +47 -0
- package/node/Heatmap/plugin.js +17 -0
- package/node/LineChartPro/LineChartPro.js +481 -0
- package/node/LineChartPro/index.js +16 -0
- package/node/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +267 -0
- package/node/ResponsiveChartContainerPro/index.js +16 -0
- package/node/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +33 -0
- package/node/ScatterChartPro/ScatterChartPro.js +396 -0
- package/node/ScatterChartPro/index.js +16 -0
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +61 -0
- package/node/context/CartesianProviderPro/index.js +16 -0
- package/node/context/ZoomProvider/Zoom.types.js +5 -0
- package/node/context/ZoomProvider/ZoomContext.js +24 -0
- package/node/context/ZoomProvider/ZoomProvider.js +62 -0
- package/node/context/ZoomProvider/ZoomSetup.js +20 -0
- package/node/context/ZoomProvider/defaultizeZoom.js +39 -0
- package/node/context/ZoomProvider/index.js +38 -0
- package/node/context/ZoomProvider/initializeZoomData.js +20 -0
- package/node/context/ZoomProvider/useSetupPan.js +114 -0
- package/node/context/ZoomProvider/useSetupZoom.js +281 -0
- package/node/context/ZoomProvider/useZoom.js +25 -0
- package/node/context/index.js +27 -0
- package/node/hooks/index.js +12 -0
- package/node/hooks/useSeries.js +21 -0
- package/node/index.js +354 -0
- package/node/internals/utils/releaseInfo.js +20 -0
- package/node/models/index.js +16 -0
- package/node/models/seriesType/heatmap.js +5 -0
- package/node/models/seriesType/index.js +16 -0
- package/node/typeOverloads/index.js +6 -0
- package/node/typeOverloads/modules.js +5 -0
- package/package.json +64 -0
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +1 -0
- package/typeOverloads/modules.d.ts +17 -0
- package/typeOverloads/modules.js +1 -0
- package/typeOverloads/package.json +6 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DefaultizedProps, CommonDefaultizedProps, CommonSeriesType, CartesianSeriesType } from '@mui/x-charts/internals';
|
|
2
|
+
export type HeatmapValueType = [number, number, number];
|
|
3
|
+
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType>, 'color'>, CartesianSeriesType {
|
|
4
|
+
type: 'heatmap';
|
|
5
|
+
/**
|
|
6
|
+
* Data associated to each bar.
|
|
7
|
+
*/
|
|
8
|
+
data?: HeatmapValueType[];
|
|
9
|
+
/**
|
|
10
|
+
* The key used to retrieve data from the dataset.
|
|
11
|
+
*/
|
|
12
|
+
dataKey?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
15
|
+
*/
|
|
16
|
+
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An object that allows to identify a single bar.
|
|
20
|
+
* Used for item interaction
|
|
21
|
+
*/
|
|
22
|
+
export type HeatmapItemIdentifier = {
|
|
23
|
+
type: 'heatmap';
|
|
24
|
+
seriesId: DefaultizedHeatmapSeriesType['id'];
|
|
25
|
+
dataIndex: number;
|
|
26
|
+
};
|
|
27
|
+
export interface DefaultizedHeatmapSeriesType extends DefaultizedProps<HeatmapSeriesType, CommonDefaultizedProps> {
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './heatmap';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './heatmap';
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["zoom", "onZoomChange"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { BarPlot } from '@mui/x-charts/BarChart';
|
|
7
|
+
import { ChartsOnAxisClickHandler } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
8
|
+
import { ChartsGrid } from '@mui/x-charts/ChartsGrid';
|
|
9
|
+
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
10
|
+
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
11
|
+
import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
12
|
+
import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
13
|
+
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
14
|
+
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
15
|
+
import { useBarChartProps } from '@mui/x-charts/internals';
|
|
16
|
+
import { ResponsiveChartContainerPro } from '../ResponsiveChartContainerPro';
|
|
17
|
+
import { ZoomSetup } from '../context/ZoomProvider/ZoomSetup';
|
|
18
|
+
import { useZoom } from '../context/ZoomProvider/useZoom';
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
/**
|
|
21
|
+
* Demos:
|
|
22
|
+
*
|
|
23
|
+
* - [Bars](https://mui.com/x/react-charts/bars/)
|
|
24
|
+
* - [Bar demonstration](https://mui.com/x/react-charts/bar-demo/)
|
|
25
|
+
* - [Stacking](https://mui.com/x/react-charts/stacking/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [BarChart API](https://mui.com/x/api/charts/bar-chart/)
|
|
30
|
+
*/
|
|
31
|
+
const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(props, ref) {
|
|
32
|
+
const {
|
|
33
|
+
zoom,
|
|
34
|
+
onZoomChange
|
|
35
|
+
} = props,
|
|
36
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
37
|
+
const {
|
|
38
|
+
chartContainerProps,
|
|
39
|
+
barPlotProps,
|
|
40
|
+
axisClickHandlerProps,
|
|
41
|
+
gridProps,
|
|
42
|
+
clipPathProps,
|
|
43
|
+
clipPathGroupProps,
|
|
44
|
+
overlayProps,
|
|
45
|
+
chartsAxisProps,
|
|
46
|
+
axisHighlightProps,
|
|
47
|
+
legendProps,
|
|
48
|
+
tooltipProps,
|
|
49
|
+
children
|
|
50
|
+
} = useBarChartProps(other);
|
|
51
|
+
return /*#__PURE__*/_jsxs(ResponsiveChartContainerPro, _extends({
|
|
52
|
+
ref: ref
|
|
53
|
+
}, chartContainerProps, {
|
|
54
|
+
zoom: zoom,
|
|
55
|
+
onZoomChange: onZoomChange,
|
|
56
|
+
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), props.grid && /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(BarChartPlotZoom, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
58
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), /*#__PURE__*/_jsx(ZoomSetup, {}), children]
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
61
|
+
process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
62
|
+
// ----------------------------- Warning --------------------------------
|
|
63
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
64
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
65
|
+
// ----------------------------------------------------------------------
|
|
66
|
+
/**
|
|
67
|
+
* The configuration of axes highlight.
|
|
68
|
+
* Default is set to 'band' in the bar direction.
|
|
69
|
+
* Depends on `layout` prop.
|
|
70
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
|
|
71
|
+
*/
|
|
72
|
+
axisHighlight: PropTypes.shape({
|
|
73
|
+
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
74
|
+
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
75
|
+
}),
|
|
76
|
+
/**
|
|
77
|
+
* If provided, the function will be used to format the label of the bar.
|
|
78
|
+
* It can be set to 'value' to display the current value.
|
|
79
|
+
* @param {BarItem} item The item to format.
|
|
80
|
+
* @param {BarLabelContext} context data about the bar.
|
|
81
|
+
* @returns {string} The formatted label.
|
|
82
|
+
*/
|
|
83
|
+
barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
|
|
84
|
+
/**
|
|
85
|
+
* Defines the border radius of the bar element.
|
|
86
|
+
*/
|
|
87
|
+
borderRadius: PropTypes.number,
|
|
88
|
+
/**
|
|
89
|
+
* Indicate which axis to display the bottom of the charts.
|
|
90
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
91
|
+
* @default xAxisIds[0] The id of the first provided axis
|
|
92
|
+
*/
|
|
93
|
+
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
94
|
+
children: PropTypes.node,
|
|
95
|
+
className: PropTypes.string,
|
|
96
|
+
/**
|
|
97
|
+
* Color palette used to colorize multiple series.
|
|
98
|
+
* @default blueberryTwilightPalette
|
|
99
|
+
*/
|
|
100
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
101
|
+
/**
|
|
102
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
103
|
+
*/
|
|
104
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
105
|
+
desc: PropTypes.string,
|
|
106
|
+
/**
|
|
107
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
108
|
+
* It might break interactive features, but will improve performance.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
disableAxisListener: PropTypes.bool,
|
|
112
|
+
/**
|
|
113
|
+
* Option to display a cartesian grid in the background.
|
|
114
|
+
*/
|
|
115
|
+
grid: PropTypes.shape({
|
|
116
|
+
horizontal: PropTypes.bool,
|
|
117
|
+
vertical: PropTypes.bool
|
|
118
|
+
}),
|
|
119
|
+
/**
|
|
120
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
121
|
+
*/
|
|
122
|
+
height: PropTypes.number,
|
|
123
|
+
/**
|
|
124
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
125
|
+
*/
|
|
126
|
+
highlightedItem: PropTypes.shape({
|
|
127
|
+
dataIndex: PropTypes.number,
|
|
128
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
129
|
+
}),
|
|
130
|
+
/**
|
|
131
|
+
* The direction of the bar elements.
|
|
132
|
+
* @default 'vertical'
|
|
133
|
+
*/
|
|
134
|
+
layout: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
135
|
+
/**
|
|
136
|
+
* Indicate which axis to display the left of the charts.
|
|
137
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
138
|
+
* @default yAxisIds[0] The id of the first provided axis
|
|
139
|
+
*/
|
|
140
|
+
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Consider using `slotProps.legend` instead.
|
|
143
|
+
*/
|
|
144
|
+
legend: PropTypes.shape({
|
|
145
|
+
classes: PropTypes.object,
|
|
146
|
+
direction: PropTypes.oneOf(['column', 'row']),
|
|
147
|
+
hidden: PropTypes.bool,
|
|
148
|
+
position: PropTypes.shape({
|
|
149
|
+
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
150
|
+
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
151
|
+
}),
|
|
152
|
+
slotProps: PropTypes.object,
|
|
153
|
+
slots: PropTypes.object
|
|
154
|
+
}),
|
|
155
|
+
/**
|
|
156
|
+
* If `true`, a loading overlay is displayed.
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
loading: PropTypes.bool,
|
|
160
|
+
/**
|
|
161
|
+
* The margin between the SVG and the drawing area.
|
|
162
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
163
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
164
|
+
* @default object Depends on the charts type.
|
|
165
|
+
*/
|
|
166
|
+
margin: PropTypes.shape({
|
|
167
|
+
bottom: PropTypes.number,
|
|
168
|
+
left: PropTypes.number,
|
|
169
|
+
right: PropTypes.number,
|
|
170
|
+
top: PropTypes.number
|
|
171
|
+
}),
|
|
172
|
+
/**
|
|
173
|
+
* The function called for onClick events.
|
|
174
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
175
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
176
|
+
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
177
|
+
*/
|
|
178
|
+
onAxisClick: PropTypes.func,
|
|
179
|
+
/**
|
|
180
|
+
* The callback fired when the highlighted item changes.
|
|
181
|
+
*
|
|
182
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
183
|
+
*/
|
|
184
|
+
onHighlightChange: PropTypes.func,
|
|
185
|
+
/**
|
|
186
|
+
* Callback fired when a bar item is clicked.
|
|
187
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
188
|
+
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
189
|
+
*/
|
|
190
|
+
onItemClick: PropTypes.func,
|
|
191
|
+
/**
|
|
192
|
+
* Indicate which axis to display the right of the charts.
|
|
193
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
194
|
+
* @default null
|
|
195
|
+
*/
|
|
196
|
+
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
197
|
+
/**
|
|
198
|
+
* The series to display in the bar chart.
|
|
199
|
+
* An array of [[BarSeriesType]] objects.
|
|
200
|
+
*/
|
|
201
|
+
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
202
|
+
/**
|
|
203
|
+
* If `true`, animations are skipped.
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
skipAnimation: PropTypes.bool,
|
|
207
|
+
/**
|
|
208
|
+
* The props used for each component slot.
|
|
209
|
+
* @default {}
|
|
210
|
+
*/
|
|
211
|
+
slotProps: PropTypes.object,
|
|
212
|
+
/**
|
|
213
|
+
* Overridable component slots.
|
|
214
|
+
* @default {}
|
|
215
|
+
*/
|
|
216
|
+
slots: PropTypes.object,
|
|
217
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
218
|
+
title: PropTypes.string,
|
|
219
|
+
/**
|
|
220
|
+
* The configuration of the tooltip.
|
|
221
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
222
|
+
*/
|
|
223
|
+
tooltip: PropTypes.shape({
|
|
224
|
+
axisContent: PropTypes.elementType,
|
|
225
|
+
classes: PropTypes.object,
|
|
226
|
+
itemContent: PropTypes.elementType,
|
|
227
|
+
slotProps: PropTypes.object,
|
|
228
|
+
slots: PropTypes.object,
|
|
229
|
+
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
230
|
+
}),
|
|
231
|
+
/**
|
|
232
|
+
* Indicate which axis to display the top of the charts.
|
|
233
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
234
|
+
* @default null
|
|
235
|
+
*/
|
|
236
|
+
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
237
|
+
viewBox: PropTypes.shape({
|
|
238
|
+
height: PropTypes.number,
|
|
239
|
+
width: PropTypes.number,
|
|
240
|
+
x: PropTypes.number,
|
|
241
|
+
y: PropTypes.number
|
|
242
|
+
}),
|
|
243
|
+
/**
|
|
244
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
245
|
+
*/
|
|
246
|
+
width: PropTypes.number,
|
|
247
|
+
/**
|
|
248
|
+
* The configuration of the x-axes.
|
|
249
|
+
* If not provided, a default axis config is used.
|
|
250
|
+
* An array of [[AxisConfig]] objects.
|
|
251
|
+
*/
|
|
252
|
+
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
253
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
254
|
+
classes: PropTypes.object,
|
|
255
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
256
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
257
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
258
|
+
unknownColor: PropTypes.string,
|
|
259
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
260
|
+
}), PropTypes.shape({
|
|
261
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
262
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
263
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
264
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
265
|
+
}), PropTypes.shape({
|
|
266
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
267
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
268
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
269
|
+
})]),
|
|
270
|
+
data: PropTypes.array,
|
|
271
|
+
dataKey: PropTypes.string,
|
|
272
|
+
disableLine: PropTypes.bool,
|
|
273
|
+
disableTicks: PropTypes.bool,
|
|
274
|
+
fill: PropTypes.string,
|
|
275
|
+
hideTooltip: PropTypes.bool,
|
|
276
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
277
|
+
label: PropTypes.string,
|
|
278
|
+
labelFontSize: PropTypes.number,
|
|
279
|
+
labelStyle: PropTypes.object,
|
|
280
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
281
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
282
|
+
position: PropTypes.oneOf(['bottom', 'top']),
|
|
283
|
+
reverse: PropTypes.bool,
|
|
284
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
285
|
+
slotProps: PropTypes.object,
|
|
286
|
+
slots: PropTypes.object,
|
|
287
|
+
stroke: PropTypes.string,
|
|
288
|
+
tickFontSize: PropTypes.number,
|
|
289
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
290
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
291
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
292
|
+
tickLabelStyle: PropTypes.object,
|
|
293
|
+
tickMaxStep: PropTypes.number,
|
|
294
|
+
tickMinStep: PropTypes.number,
|
|
295
|
+
tickNumber: PropTypes.number,
|
|
296
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
297
|
+
tickSize: PropTypes.number,
|
|
298
|
+
valueFormatter: PropTypes.func,
|
|
299
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
300
|
+
maxEnd: PropTypes.number,
|
|
301
|
+
maxSpan: PropTypes.number,
|
|
302
|
+
minSpan: PropTypes.number,
|
|
303
|
+
minStart: PropTypes.number,
|
|
304
|
+
panning: PropTypes.bool,
|
|
305
|
+
step: PropTypes.number
|
|
306
|
+
}), PropTypes.bool])
|
|
307
|
+
})),
|
|
308
|
+
/**
|
|
309
|
+
* The configuration of the y-axes.
|
|
310
|
+
* If not provided, a default axis config is used.
|
|
311
|
+
* An array of [[AxisConfig]] objects.
|
|
312
|
+
*/
|
|
313
|
+
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
314
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
315
|
+
classes: PropTypes.object,
|
|
316
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
317
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
318
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
319
|
+
unknownColor: PropTypes.string,
|
|
320
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
321
|
+
}), PropTypes.shape({
|
|
322
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
323
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
324
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
325
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
326
|
+
}), PropTypes.shape({
|
|
327
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
328
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
329
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
330
|
+
})]),
|
|
331
|
+
data: PropTypes.array,
|
|
332
|
+
dataKey: PropTypes.string,
|
|
333
|
+
disableLine: PropTypes.bool,
|
|
334
|
+
disableTicks: PropTypes.bool,
|
|
335
|
+
fill: PropTypes.string,
|
|
336
|
+
hideTooltip: PropTypes.bool,
|
|
337
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
338
|
+
label: PropTypes.string,
|
|
339
|
+
labelFontSize: PropTypes.number,
|
|
340
|
+
labelStyle: PropTypes.object,
|
|
341
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
342
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
343
|
+
position: PropTypes.oneOf(['left', 'right']),
|
|
344
|
+
reverse: PropTypes.bool,
|
|
345
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
346
|
+
slotProps: PropTypes.object,
|
|
347
|
+
slots: PropTypes.object,
|
|
348
|
+
stroke: PropTypes.string,
|
|
349
|
+
tickFontSize: PropTypes.number,
|
|
350
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
351
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
352
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
353
|
+
tickLabelStyle: PropTypes.object,
|
|
354
|
+
tickMaxStep: PropTypes.number,
|
|
355
|
+
tickMinStep: PropTypes.number,
|
|
356
|
+
tickNumber: PropTypes.number,
|
|
357
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
358
|
+
tickSize: PropTypes.number,
|
|
359
|
+
valueFormatter: PropTypes.func,
|
|
360
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
361
|
+
maxEnd: PropTypes.number,
|
|
362
|
+
maxSpan: PropTypes.number,
|
|
363
|
+
minSpan: PropTypes.number,
|
|
364
|
+
minStart: PropTypes.number,
|
|
365
|
+
panning: PropTypes.bool,
|
|
366
|
+
step: PropTypes.number
|
|
367
|
+
}), PropTypes.bool])
|
|
368
|
+
}))
|
|
369
|
+
} : void 0;
|
|
370
|
+
function BarChartPlotZoom(props) {
|
|
371
|
+
const {
|
|
372
|
+
isInteracting
|
|
373
|
+
} = useZoom();
|
|
374
|
+
return /*#__PURE__*/_jsx(BarPlot, _extends({}, props, {
|
|
375
|
+
skipAnimation: isInteracting ? true : props.skipAnimation
|
|
376
|
+
}));
|
|
377
|
+
}
|
|
378
|
+
process.env.NODE_ENV !== "production" ? BarChartPlotZoom.propTypes = {
|
|
379
|
+
// ----------------------------- Warning --------------------------------
|
|
380
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
381
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
382
|
+
// ----------------------------------------------------------------------
|
|
383
|
+
/**
|
|
384
|
+
* If provided, the function will be used to format the label of the bar.
|
|
385
|
+
* It can be set to 'value' to display the current value.
|
|
386
|
+
* @param {BarItem} item The item to format.
|
|
387
|
+
* @param {BarLabelContext} context data about the bar.
|
|
388
|
+
* @returns {string} The formatted label.
|
|
389
|
+
*/
|
|
390
|
+
barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
|
|
391
|
+
/**
|
|
392
|
+
* Defines the border radius of the bar element.
|
|
393
|
+
*/
|
|
394
|
+
borderRadius: PropTypes.number,
|
|
395
|
+
/**
|
|
396
|
+
* Callback fired when a bar item is clicked.
|
|
397
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
398
|
+
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
399
|
+
*/
|
|
400
|
+
onItemClick: PropTypes.func,
|
|
401
|
+
/**
|
|
402
|
+
* If `true`, animations are skipped.
|
|
403
|
+
* @default false
|
|
404
|
+
*/
|
|
405
|
+
skipAnimation: PropTypes.bool,
|
|
406
|
+
/**
|
|
407
|
+
* The props used for each component slot.
|
|
408
|
+
* @default {}
|
|
409
|
+
*/
|
|
410
|
+
slotProps: PropTypes.object,
|
|
411
|
+
/**
|
|
412
|
+
* Overridable component slots.
|
|
413
|
+
* @default {}
|
|
414
|
+
*/
|
|
415
|
+
slots: PropTypes.object
|
|
416
|
+
} : void 0;
|
|
417
|
+
export { BarChartPro };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BarChartPro';
|