@mui/x-charts-pro 7.22.3 → 8.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/BarChartPro/BarChartPro.d.ts +1 -1
  2. package/BarChartPro/BarChartPro.js +9 -59
  3. package/CHANGELOG.md +348 -12
  4. package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
  5. package/ChartContainerPro/ChartContainerPro.js +21 -47
  6. package/ChartContainerPro/useChartContainerProProps.d.ts +6 -14
  7. package/ChartContainerPro/useChartContainerProProps.js +11 -25
  8. package/Heatmap/Heatmap.d.ts +16 -8
  9. package/Heatmap/Heatmap.js +6 -37
  10. package/Heatmap/HeatmapTooltip.d.ts +9 -0
  11. package/Heatmap/HeatmapTooltip.js +294 -0
  12. package/Heatmap/index.d.ts +1 -1
  13. package/Heatmap/index.js +1 -1
  14. package/LineChartPro/LineChartPro.d.ts +1 -1
  15. package/LineChartPro/LineChartPro.js +9 -60
  16. package/README.md +4 -4
  17. package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
  18. package/ScatterChartPro/ScatterChartPro.js +9 -60
  19. package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +10 -0
  20. package/{modern/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → context/ChartDataProviderPro/ChartDataProviderPro.js} +50 -33
  21. package/context/ChartDataProviderPro/index.d.ts +1 -0
  22. package/context/ChartDataProviderPro/index.js +1 -0
  23. package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +14 -0
  24. package/context/ChartDataProviderPro/useChartDataProviderProProps.js +43 -0
  25. package/context/ZoomProvider/ZoomProvider.js +1 -0
  26. package/index.d.ts +0 -1
  27. package/index.js +1 -2
  28. package/internals/utils/releaseInfo.js +1 -1
  29. package/models/seriesType/heatmap.d.ts +2 -1
  30. package/modern/BarChartPro/BarChartPro.js +9 -59
  31. package/modern/ChartContainerPro/ChartContainerPro.js +21 -47
  32. package/modern/ChartContainerPro/useChartContainerProProps.js +11 -25
  33. package/modern/Heatmap/Heatmap.js +6 -37
  34. package/modern/Heatmap/HeatmapTooltip.js +294 -0
  35. package/modern/Heatmap/index.js +1 -1
  36. package/modern/LineChartPro/LineChartPro.js +9 -60
  37. package/modern/ScatterChartPro/ScatterChartPro.js +9 -60
  38. package/{ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → modern/context/ChartDataProviderPro/ChartDataProviderPro.js} +50 -33
  39. package/modern/context/ChartDataProviderPro/index.js +1 -0
  40. package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +43 -0
  41. package/modern/context/ZoomProvider/ZoomProvider.js +1 -0
  42. package/modern/index.js +1 -2
  43. package/modern/internals/utils/releaseInfo.js +1 -1
  44. package/node/BarChartPro/BarChartPro.js +9 -59
  45. package/node/ChartContainerPro/ChartContainerPro.js +20 -46
  46. package/node/ChartContainerPro/useChartContainerProProps.js +11 -25
  47. package/node/Heatmap/Heatmap.js +6 -37
  48. package/node/Heatmap/HeatmapTooltip.js +300 -0
  49. package/node/Heatmap/index.js +4 -4
  50. package/node/LineChartPro/LineChartPro.js +9 -60
  51. package/node/ScatterChartPro/ScatterChartPro.js +9 -60
  52. package/node/{ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → context/ChartDataProviderPro/ChartDataProviderPro.js} +48 -31
  53. package/node/context/ChartDataProviderPro/index.js +16 -0
  54. package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +50 -0
  55. package/node/context/ZoomProvider/ZoomProvider.js +1 -0
  56. package/node/index.js +1 -12
  57. package/node/internals/utils/releaseInfo.js +1 -1
  58. package/package.json +8 -8
  59. package/typeOverloads/modules.d.ts +1 -1
  60. package/Heatmap/DefaultHeatmapTooltip.d.ts +0 -7
  61. package/Heatmap/DefaultHeatmapTooltip.js +0 -99
  62. package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.d.ts +0 -7
  63. package/ResponsiveChartContainerPro/index.d.ts +0 -1
  64. package/ResponsiveChartContainerPro/index.js +0 -1
  65. package/ResponsiveChartContainerPro/package.json +0 -6
  66. package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.d.ts +0 -42
  67. package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -27
  68. package/modern/Heatmap/DefaultHeatmapTooltip.js +0 -99
  69. package/modern/ResponsiveChartContainerPro/index.js +0 -1
  70. package/modern/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -27
  71. package/node/Heatmap/DefaultHeatmapTooltip.js +0 -105
  72. package/node/ResponsiveChartContainerPro/index.js +0 -16
  73. package/node/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -34
@@ -1 +0,0 @@
1
- export * from './ResponsiveChartContainerPro';
@@ -1 +0,0 @@
1
- export * from "./ResponsiveChartContainerPro.js";
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "./index.js",
4
- "main": "../node/ResponsiveChartContainerPro/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,42 +0,0 @@
1
- import type { ResponsiveChartContainerProProps } from './ResponsiveChartContainerPro';
2
- export declare const useResponsiveChartContainerProProps: (props: ResponsiveChartContainerProProps, ref: React.ForwardedRef<unknown>) => {
3
- chartContainerProProps: {
4
- zoom?: import("..").ZoomData[] | undefined;
5
- onZoomChange?: ((zoomData: import("..").ZoomData[] | ((zoomData: import("..").ZoomData[]) => import("..").ZoomData[])) => void) | undefined;
6
- height: number;
7
- width: number;
8
- margin?: Partial<import("@mui/x-charts").CardinalDirections<number>> | undefined;
9
- title?: string | undefined;
10
- desc?: string | undefined;
11
- className?: string | undefined;
12
- viewBox?: {
13
- x?: number;
14
- y?: number;
15
- width?: number;
16
- height?: number;
17
- } | undefined;
18
- plugins?: import("@mui/x-charts/internals").ChartsPlugin<import("@mui/x-charts/internals").ChartSeriesType>[] | undefined;
19
- sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
20
- series: (import("@mui/x-charts").ScatterSeriesType | import("@mui/x-charts").LineSeriesType | import("@mui/x-charts").BarSeriesType | import("@mui/x-charts").PieSeriesType<import("@mui/x-charts/internals").MakeOptional<import("@mui/x-charts").PieValueType, "id">> | import("../models").HeatmapSeriesType)[];
21
- onHighlightChange?: ((highlightedItem: import("@mui/x-charts").HighlightItemData | null) => void) | undefined;
22
- skipAnimation?: boolean | undefined;
23
- zAxis?: import("@mui/x-charts/internals").MakeOptional<import("@mui/x-charts/internals").ZAxisConfig, "id">[] | undefined;
24
- dataset?: import("@mui/x-charts/internals").DatasetType | undefined;
25
- colors?: import("@mui/x-charts").ChartsColorPalette | undefined;
26
- disableAxisListener?: boolean | undefined;
27
- highlightedItem?: (import("@mui/x-charts").HighlightItemData | null) | undefined;
28
- xAxis?: import("@mui/x-charts/internals").MakeOptional<import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>, "id">[];
29
- yAxis?: import("@mui/x-charts/internals").MakeOptional<import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>, "id">[];
30
- children?: React.ReactNode;
31
- ref: React.ForwardedRef<unknown>;
32
- };
33
- resizableChartContainerProps: {
34
- ownerState: {
35
- width: number | undefined;
36
- height: number | undefined;
37
- };
38
- ref: import("react").MutableRefObject<null>;
39
- className?: string | undefined;
40
- };
41
- hasIntrinsicSize: number;
42
- };
@@ -1,27 +0,0 @@
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 = ["zoom", "onZoomChange"];
6
- import { useResponsiveChartContainerProps } from '@mui/x-charts/internals';
7
- export const useResponsiveChartContainerProProps = (props, ref) => {
8
- const {
9
- zoom,
10
- onZoomChange
11
- } = props,
12
- baseProps = _objectWithoutPropertiesLoose(props, _excluded);
13
- const chartContainerProProps = {
14
- zoom,
15
- onZoomChange
16
- };
17
- const {
18
- chartContainerProps,
19
- resizableChartContainerProps,
20
- hasIntrinsicSize
21
- } = useResponsiveChartContainerProps(baseProps, ref);
22
- return {
23
- chartContainerProProps: _extends({}, chartContainerProps, chartContainerProProps),
24
- resizableChartContainerProps,
25
- hasIntrinsicSize
26
- };
27
- };
@@ -1,99 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import PropTypes from 'prop-types';
5
- import clsx from 'clsx';
6
- import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, ChartsTooltipMark } from '@mui/x-charts/ChartsTooltip';
7
- import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
8
- import { getLabel } from '@mui/x-charts/internals';
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- function DefaultHeatmapTooltip(props) {
11
- const {
12
- series,
13
- itemData,
14
- sx,
15
- classes,
16
- getColor
17
- } = props;
18
- const xAxis = useXAxis();
19
- const yAxis = useYAxis();
20
- if (itemData.dataIndex === undefined || !series.data[itemData.dataIndex]) {
21
- return null;
22
- }
23
- const color = getColor(itemData.dataIndex);
24
- const valueItem = series.data[itemData.dataIndex];
25
- const [xIndex, yIndex] = valueItem;
26
- const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
27
- location: 'tooltip'
28
- }) ?? xAxis.data[xIndex].toLocaleString();
29
- const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
30
- location: 'tooltip'
31
- }) ?? yAxis.data[yIndex].toLocaleString();
32
- const formattedValue = series.valueFormatter(valueItem, {
33
- dataIndex: itemData.dataIndex
34
- });
35
- const seriesLabel = getLabel(series.label, 'tooltip');
36
- return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
37
- sx: sx,
38
- className: classes.root,
39
- children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
40
- className: classes.table,
41
- children: [/*#__PURE__*/_jsx("thead", {
42
- children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
43
- children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
44
- children: formattedX
45
- }), formattedX && formattedY && /*#__PURE__*/_jsx(ChartsTooltipCell, {}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
46
- children: formattedY
47
- })]
48
- })
49
- }), /*#__PURE__*/_jsx("tbody", {
50
- children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
51
- className: classes.row,
52
- children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
53
- className: clsx(classes.markCell, classes.cell),
54
- children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
55
- color: color,
56
- className: classes.mark
57
- })
58
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
59
- className: clsx(classes.labelCell, classes.cell),
60
- children: seriesLabel
61
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
62
- className: clsx(classes.valueCell, classes.cell),
63
- children: formattedValue
64
- })]
65
- })
66
- })]
67
- })
68
- });
69
- }
70
- process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltip.propTypes = {
71
- // ----------------------------- Warning --------------------------------
72
- // | These PropTypes are generated from the TypeScript type definitions |
73
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
74
- // ----------------------------------------------------------------------
75
- /**
76
- * Override or extend the styles applied to the component.
77
- */
78
- classes: PropTypes.object.isRequired,
79
- /**
80
- * Get the color of the item with index `dataIndex`.
81
- * @param {number} dataIndex The data index of the item.
82
- * @returns {string} The color to display.
83
- */
84
- getColor: PropTypes.func.isRequired,
85
- /**
86
- * The data used to identify the triggered item.
87
- */
88
- itemData: PropTypes.shape({
89
- dataIndex: PropTypes.number.isRequired,
90
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
91
- type: PropTypes.oneOf(['heatmap']).isRequired
92
- }).isRequired,
93
- /**
94
- * The series linked to the triggered item.
95
- */
96
- series: PropTypes.object.isRequired,
97
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
98
- } : void 0;
99
- export { DefaultHeatmapTooltip };
@@ -1 +0,0 @@
1
- export * from "./ResponsiveChartContainerPro.js";
@@ -1,27 +0,0 @@
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 = ["zoom", "onZoomChange"];
6
- import { useResponsiveChartContainerProps } from '@mui/x-charts/internals';
7
- export const useResponsiveChartContainerProProps = (props, ref) => {
8
- const {
9
- zoom,
10
- onZoomChange
11
- } = props,
12
- baseProps = _objectWithoutPropertiesLoose(props, _excluded);
13
- const chartContainerProProps = {
14
- zoom,
15
- onZoomChange
16
- };
17
- const {
18
- chartContainerProps,
19
- resizableChartContainerProps,
20
- hasIntrinsicSize
21
- } = useResponsiveChartContainerProps(baseProps, ref);
22
- return {
23
- chartContainerProProps: _extends({}, chartContainerProps, chartContainerProProps),
24
- resizableChartContainerProps,
25
- hasIntrinsicSize
26
- };
27
- };
@@ -1,105 +0,0 @@
1
- "use strict";
2
- 'use client';
3
-
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- exports.DefaultHeatmapTooltip = DefaultHeatmapTooltip;
10
- var React = _interopRequireWildcard(require("react"));
11
- var _propTypes = _interopRequireDefault(require("prop-types"));
12
- var _clsx = _interopRequireDefault(require("clsx"));
13
- var _ChartsTooltip = require("@mui/x-charts/ChartsTooltip");
14
- var _hooks = require("@mui/x-charts/hooks");
15
- var _internals = require("@mui/x-charts/internals");
16
- var _jsxRuntime = require("react/jsx-runtime");
17
- function DefaultHeatmapTooltip(props) {
18
- const {
19
- series,
20
- itemData,
21
- sx,
22
- classes,
23
- getColor
24
- } = props;
25
- const xAxis = (0, _hooks.useXAxis)();
26
- const yAxis = (0, _hooks.useYAxis)();
27
- if (itemData.dataIndex === undefined || !series.data[itemData.dataIndex]) {
28
- return null;
29
- }
30
- const color = getColor(itemData.dataIndex);
31
- const valueItem = series.data[itemData.dataIndex];
32
- const [xIndex, yIndex] = valueItem;
33
- const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
34
- location: 'tooltip'
35
- }) ?? xAxis.data[xIndex].toLocaleString();
36
- const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
37
- location: 'tooltip'
38
- }) ?? yAxis.data[yIndex].toLocaleString();
39
- const formattedValue = series.valueFormatter(valueItem, {
40
- dataIndex: itemData.dataIndex
41
- });
42
- const seriesLabel = (0, _internals.getLabel)(series.label, 'tooltip');
43
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipPaper, {
44
- sx: sx,
45
- className: classes.root,
46
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipTable, {
47
- className: classes.table,
48
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
49
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipRow, {
50
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
51
- children: formattedX
52
- }), formattedX && formattedY && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
53
- children: formattedY
54
- })]
55
- })
56
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
57
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltip.ChartsTooltipRow, {
58
- className: classes.row,
59
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
60
- className: (0, _clsx.default)(classes.markCell, classes.cell),
61
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipMark, {
62
- color: color,
63
- className: classes.mark
64
- })
65
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
66
- className: (0, _clsx.default)(classes.labelCell, classes.cell),
67
- children: seriesLabel
68
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltipCell, {
69
- className: (0, _clsx.default)(classes.valueCell, classes.cell),
70
- children: formattedValue
71
- })]
72
- })
73
- })]
74
- })
75
- });
76
- }
77
- process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltip.propTypes = {
78
- // ----------------------------- Warning --------------------------------
79
- // | These PropTypes are generated from the TypeScript type definitions |
80
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
81
- // ----------------------------------------------------------------------
82
- /**
83
- * Override or extend the styles applied to the component.
84
- */
85
- classes: _propTypes.default.object.isRequired,
86
- /**
87
- * Get the color of the item with index `dataIndex`.
88
- * @param {number} dataIndex The data index of the item.
89
- * @returns {string} The color to display.
90
- */
91
- getColor: _propTypes.default.func.isRequired,
92
- /**
93
- * The data used to identify the triggered item.
94
- */
95
- itemData: _propTypes.default.shape({
96
- dataIndex: _propTypes.default.number.isRequired,
97
- seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
98
- type: _propTypes.default.oneOf(['heatmap']).isRequired
99
- }).isRequired,
100
- /**
101
- * The series linked to the triggered item.
102
- */
103
- series: _propTypes.default.object.isRequired,
104
- sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
105
- } : void 0;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _ResponsiveChartContainerPro = require("./ResponsiveChartContainerPro");
7
- Object.keys(_ResponsiveChartContainerPro).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _ResponsiveChartContainerPro[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _ResponsiveChartContainerPro[key];
14
- }
15
- });
16
- });
@@ -1,34 +0,0 @@
1
- "use strict";
2
- 'use client';
3
-
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.useResponsiveChartContainerProProps = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
- var _internals = require("@mui/x-charts/internals");
12
- const _excluded = ["zoom", "onZoomChange"];
13
- const useResponsiveChartContainerProProps = (props, ref) => {
14
- const {
15
- zoom,
16
- onZoomChange
17
- } = props,
18
- baseProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
19
- const chartContainerProProps = {
20
- zoom,
21
- onZoomChange
22
- };
23
- const {
24
- chartContainerProps,
25
- resizableChartContainerProps,
26
- hasIntrinsicSize
27
- } = (0, _internals.useResponsiveChartContainerProps)(baseProps, ref);
28
- return {
29
- chartContainerProProps: (0, _extends2.default)({}, chartContainerProps, chartContainerProProps),
30
- resizableChartContainerProps,
31
- hasIntrinsicSize
32
- };
33
- };
34
- exports.useResponsiveChartContainerProProps = useResponsiveChartContainerProProps;