@mui/x-charts-pro 8.0.0-beta.3 → 8.0.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.
Files changed (187) hide show
  1. package/BarChartPro/BarChartPro.js +786 -9
  2. package/CHANGELOG.md +282 -96
  3. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  4. package/ChartDataProviderPro/ChartDataProviderPro.js +27 -22
  5. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
  6. package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  7. package/FunnelChart/FunnelChart.js +73 -4
  8. package/FunnelChart/categoryAxis.types.d.ts +3 -2
  9. package/FunnelChart/funnelSectionClasses.d.ts +5 -0
  10. package/FunnelChart/funnelSectionClasses.js +1 -1
  11. package/FunnelChart/index.d.ts +1 -0
  12. package/FunnelChart/index.js +12 -0
  13. package/FunnelChart/useFunnelChartProps.js +3 -3
  14. package/Heatmap/Heatmap.js +1 -2
  15. package/Heatmap/heatmapClasses.d.ts +5 -0
  16. package/Heatmap/heatmapClasses.js +1 -1
  17. package/LineChartPro/LineChartPro.js +786 -9
  18. package/ScatterChartPro/ScatterChartPro.js +786 -9
  19. package/esm/BarChartPro/BarChartPro.js +786 -9
  20. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  21. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +28 -23
  22. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -2
  23. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +0 -2
  24. package/esm/FunnelChart/FunnelChart.js +73 -4
  25. package/esm/FunnelChart/categoryAxis.types.d.ts +3 -2
  26. package/esm/FunnelChart/funnelSectionClasses.d.ts +5 -0
  27. package/esm/FunnelChart/funnelSectionClasses.js +1 -1
  28. package/esm/FunnelChart/index.d.ts +1 -0
  29. package/esm/FunnelChart/index.js +1 -0
  30. package/esm/FunnelChart/useFunnelChartProps.js +3 -3
  31. package/esm/Heatmap/Heatmap.js +1 -2
  32. package/esm/Heatmap/heatmapClasses.d.ts +5 -0
  33. package/esm/Heatmap/heatmapClasses.js +1 -1
  34. package/esm/LineChartPro/LineChartPro.js +786 -9
  35. package/esm/ScatterChartPro/ScatterChartPro.js +786 -9
  36. package/esm/index.js +1 -1
  37. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +28 -35
  38. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
  39. package/index.js +1 -1
  40. package/internals/plugins/useChartProZoom/useChartProZoom.js +28 -34
  41. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +7 -7
  42. package/package.json +6 -14
  43. package/esm/internals/utils/releaseInfo.d.ts +0 -1
  44. package/esm/internals/utils/releaseInfo.js +0 -13
  45. package/internals/utils/releaseInfo.d.ts +0 -1
  46. package/internals/utils/releaseInfo.js +0 -21
  47. package/modern/BarChartPro/BarChartPro.d.ts +0 -18
  48. package/modern/BarChartPro/BarChartPro.js +0 -406
  49. package/modern/BarChartPro/BarChartPro.plugins.d.ts +0 -4
  50. package/modern/BarChartPro/BarChartPro.plugins.js +0 -3
  51. package/modern/BarChartPro/index.d.ts +0 -1
  52. package/modern/BarChartPro/index.js +0 -1
  53. package/modern/ChartContainerPro/ChartContainerPro.d.ts +0 -35
  54. package/modern/ChartContainerPro/ChartContainerPro.js +0 -290
  55. package/modern/ChartContainerPro/index.d.ts +0 -2
  56. package/modern/ChartContainerPro/index.js +0 -2
  57. package/modern/ChartContainerPro/useChartContainerProProps.d.ts +0 -9
  58. package/modern/ChartContainerPro/useChartContainerProProps.js +0 -35
  59. package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -37
  60. package/modern/ChartDataProviderPro/ChartDataProviderPro.js +0 -106
  61. package/modern/ChartDataProviderPro/index.d.ts +0 -2
  62. package/modern/ChartDataProviderPro/index.js +0 -2
  63. package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -8
  64. package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +0 -15
  65. package/modern/FunnelChart/FunnelChart.d.ts +0 -37
  66. package/modern/FunnelChart/FunnelChart.js +0 -212
  67. package/modern/FunnelChart/FunnelPlot.d.ts +0 -16
  68. package/modern/FunnelChart/FunnelPlot.js +0 -184
  69. package/modern/FunnelChart/FunnelSection.d.ts +0 -15
  70. package/modern/FunnelChart/FunnelSection.js +0 -56
  71. package/modern/FunnelChart/categoryAxis.types.d.ts +0 -24
  72. package/modern/FunnelChart/categoryAxis.types.js +0 -1
  73. package/modern/FunnelChart/funnel.types.d.ts +0 -124
  74. package/modern/FunnelChart/funnel.types.js +0 -1
  75. package/modern/FunnelChart/funnelPlotSlots.types.d.ts +0 -20
  76. package/modern/FunnelChart/funnelPlotSlots.types.js +0 -1
  77. package/modern/FunnelChart/funnelSectionClasses.d.ts +0 -13
  78. package/modern/FunnelChart/funnelSectionClasses.js +0 -20
  79. package/modern/FunnelChart/funnelSlots.types.d.ts +0 -19
  80. package/modern/FunnelChart/funnelSlots.types.js +0 -1
  81. package/modern/FunnelChart/funnelStepCurve.d.ts +0 -4
  82. package/modern/FunnelChart/funnelStepCurve.js +0 -67
  83. package/modern/FunnelChart/index.d.ts +0 -7
  84. package/modern/FunnelChart/index.js +0 -5
  85. package/modern/FunnelChart/labelUtils.d.ts +0 -42
  86. package/modern/FunnelChart/labelUtils.js +0 -166
  87. package/modern/FunnelChart/seriesConfig/extremums.d.ts +0 -3
  88. package/modern/FunnelChart/seriesConfig/extremums.js +0 -42
  89. package/modern/FunnelChart/seriesConfig/getColor.d.ts +0 -3
  90. package/modern/FunnelChart/seriesConfig/getColor.js +0 -4
  91. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  92. package/modern/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +0 -11
  93. package/modern/FunnelChart/seriesConfig/index.d.ts +0 -2
  94. package/modern/FunnelChart/seriesConfig/index.js +0 -15
  95. package/modern/FunnelChart/seriesConfig/legend.d.ts +0 -3
  96. package/modern/FunnelChart/seriesConfig/legend.js +0 -25
  97. package/modern/FunnelChart/seriesConfig/seriesProcessor.d.ts +0 -3
  98. package/modern/FunnelChart/seriesConfig/seriesProcessor.js +0 -89
  99. package/modern/FunnelChart/seriesConfig/tooltip.d.ts +0 -3
  100. package/modern/FunnelChart/seriesConfig/tooltip.js +0 -29
  101. package/modern/FunnelChart/useFunnelChartProps.d.ts +0 -30
  102. package/modern/FunnelChart/useFunnelChartProps.js +0 -161
  103. package/modern/Heatmap/Heatmap.d.ts +0 -57
  104. package/modern/Heatmap/Heatmap.js +0 -389
  105. package/modern/Heatmap/Heatmap.plugins.d.ts +0 -3
  106. package/modern/Heatmap/Heatmap.plugins.js +0 -2
  107. package/modern/Heatmap/HeatmapItem.d.ts +0 -49
  108. package/modern/Heatmap/HeatmapItem.js +0 -106
  109. package/modern/Heatmap/HeatmapPlot.d.ts +0 -8
  110. package/modern/Heatmap/HeatmapPlot.js +0 -59
  111. package/modern/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +0 -16
  112. package/modern/Heatmap/HeatmapTooltip/HeatmapTooltip.js +0 -284
  113. package/modern/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +0 -4
  114. package/modern/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.js +0 -22
  115. package/modern/Heatmap/HeatmapTooltip/index.d.ts +0 -1
  116. package/modern/Heatmap/HeatmapTooltip/index.js +0 -1
  117. package/modern/Heatmap/heatmapClasses.d.ts +0 -11
  118. package/modern/Heatmap/heatmapClasses.js +0 -14
  119. package/modern/Heatmap/index.d.ts +0 -4
  120. package/modern/Heatmap/index.js +0 -4
  121. package/modern/Heatmap/seriesConfig/extremums.d.ts +0 -2
  122. package/modern/Heatmap/seriesConfig/extremums.js +0 -8
  123. package/modern/Heatmap/seriesConfig/getColor.d.ts +0 -3
  124. package/modern/Heatmap/seriesConfig/getColor.js +0 -15
  125. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  126. package/modern/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +0 -8
  127. package/modern/Heatmap/seriesConfig/index.d.ts +0 -2
  128. package/modern/Heatmap/seriesConfig/index.js +0 -14
  129. package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +0 -3
  130. package/modern/Heatmap/seriesConfig/seriesProcessor.js +0 -21
  131. package/modern/Heatmap/seriesConfig/tooltip.d.ts +0 -3
  132. package/modern/Heatmap/seriesConfig/tooltip.js +0 -25
  133. package/modern/LineChartPro/LineChartPro.d.ts +0 -17
  134. package/modern/LineChartPro/LineChartPro.js +0 -403
  135. package/modern/LineChartPro/LineChartPro.plugins.d.ts +0 -4
  136. package/modern/LineChartPro/LineChartPro.plugins.js +0 -3
  137. package/modern/LineChartPro/index.d.ts +0 -1
  138. package/modern/LineChartPro/index.js +0 -1
  139. package/modern/ScatterChartPro/ScatterChartPro.d.ts +0 -17
  140. package/modern/ScatterChartPro/ScatterChartPro.js +0 -397
  141. package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +0 -4
  142. package/modern/ScatterChartPro/ScatterChartPro.plugins.js +0 -3
  143. package/modern/ScatterChartPro/index.d.ts +0 -1
  144. package/modern/ScatterChartPro/index.js +0 -1
  145. package/modern/hooks/index.d.ts +0 -2
  146. package/modern/hooks/index.js +0 -2
  147. package/modern/hooks/useFunnelSeries.d.ts +0 -33
  148. package/modern/hooks/useFunnelSeries.js +0 -42
  149. package/modern/hooks/useHeatmapSeries.d.ts +0 -33
  150. package/modern/hooks/useHeatmapSeries.js +0 -42
  151. package/modern/hooks/zoom/index.d.ts +0 -1
  152. package/modern/hooks/zoom/index.js +0 -1
  153. package/modern/hooks/zoom/useIsZoomInteracting.d.ts +0 -6
  154. package/modern/hooks/zoom/useIsZoomInteracting.js +0 -14
  155. package/modern/index.d.ts +0 -34
  156. package/modern/index.js +0 -45
  157. package/modern/internals/plugins/allPlugins.d.ts +0 -8
  158. package/modern/internals/plugins/allPlugins.js +0 -6
  159. package/modern/internals/plugins/useChartProZoom/index.d.ts +0 -3
  160. package/modern/internals/plugins/useChartProZoom/index.js +0 -3
  161. package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +0 -3
  162. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +0 -350
  163. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +0 -203
  164. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -4
  165. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +0 -53
  166. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -1
  167. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +0 -45
  168. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +0 -126
  169. package/modern/internals/utils/releaseInfo.d.ts +0 -1
  170. package/modern/internals/utils/releaseInfo.js +0 -13
  171. package/modern/models/index.d.ts +0 -2
  172. package/modern/models/index.js +0 -2
  173. package/modern/models/seriesType/heatmap.d.ts +0 -28
  174. package/modern/models/seriesType/heatmap.js +0 -1
  175. package/modern/models/seriesType/index.d.ts +0 -1
  176. package/modern/models/seriesType/index.js +0 -1
  177. package/modern/package.json +0 -1
  178. package/modern/themeAugmentation/components.d.ts +0 -23
  179. package/modern/themeAugmentation/index.d.ts +0 -4
  180. package/modern/themeAugmentation/index.js +0 -0
  181. package/modern/themeAugmentation/overrides.d.ts +0 -11
  182. package/modern/themeAugmentation/props.d.ts +0 -20
  183. package/modern/typeOverloads/index.d.ts +0 -1
  184. package/modern/typeOverloads/index.js +0 -1
  185. package/modern/typeOverloads/modules.d.ts +0 -33
  186. package/modern/typeOverloads/modules.js +0 -1
  187. package/tsconfig.build.tsbuildinfo +0 -1
@@ -1,106 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["seriesId", "dataIndex", "color", "value", "slotProps", "slots"];
4
- import * as React from 'react';
5
- import PropTypes from 'prop-types';
6
- import { styled } from '@mui/material/styles';
7
- import useSlotProps from '@mui/utils/useSlotProps';
8
- import composeClasses from '@mui/utils/composeClasses';
9
- import { useItemHighlighted } from '@mui/x-charts/hooks';
10
- import { useInteractionItemProps } from '@mui/x-charts/internals';
11
- import { getHeatmapUtilityClass } from "./heatmapClasses.js";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- const HeatmapCell = styled('rect', {
14
- name: 'MuiHeatmap',
15
- slot: 'Cell',
16
- overridesResolver: (_, styles) => styles.arc
17
- })(({
18
- ownerState
19
- }) => ({
20
- filter: ownerState.isHighlighted && 'saturate(120%)' || ownerState.isFaded && 'saturate(80%)' || undefined,
21
- fill: ownerState.color,
22
- shapeRendering: 'crispEdges'
23
- }));
24
- const useUtilityClasses = ownerState => {
25
- const {
26
- classes,
27
- seriesId,
28
- isFaded,
29
- isHighlighted
30
- } = ownerState;
31
- const slots = {
32
- cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
33
- };
34
- return composeClasses(slots, getHeatmapUtilityClass, classes);
35
- };
36
-
37
- /**
38
- * @ignore - internal component.
39
- */
40
- function HeatmapItem(props) {
41
- const {
42
- seriesId,
43
- dataIndex,
44
- color,
45
- value,
46
- slotProps = {},
47
- slots = {}
48
- } = props,
49
- other = _objectWithoutPropertiesLoose(props, _excluded);
50
- const interactionProps = useInteractionItemProps({
51
- type: 'heatmap',
52
- seriesId,
53
- dataIndex
54
- });
55
- const {
56
- isFaded,
57
- isHighlighted
58
- } = useItemHighlighted({
59
- seriesId,
60
- dataIndex
61
- });
62
- const ownerState = {
63
- seriesId,
64
- dataIndex,
65
- color,
66
- value,
67
- isFaded,
68
- isHighlighted
69
- };
70
- const classes = useUtilityClasses(ownerState);
71
- const Cell = slots?.cell ?? HeatmapCell;
72
- const cellProps = useSlotProps({
73
- elementType: Cell,
74
- additionalProps: interactionProps,
75
- externalForwardedProps: _extends({}, other),
76
- externalSlotProps: slotProps.cell,
77
- ownerState,
78
- className: classes.cell
79
- });
80
- return /*#__PURE__*/_jsx(Cell, _extends({}, cellProps));
81
- }
82
- process.env.NODE_ENV !== "production" ? HeatmapItem.propTypes = {
83
- // ----------------------------- Warning --------------------------------
84
- // | These PropTypes are generated from the TypeScript type definitions |
85
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
86
- // ----------------------------------------------------------------------
87
- color: PropTypes.string.isRequired,
88
- dataIndex: PropTypes.number.isRequired,
89
- height: PropTypes.number.isRequired,
90
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
91
- /**
92
- * The props used for each component slot.
93
- * @default {}
94
- */
95
- slotProps: PropTypes.object,
96
- /**
97
- * Overridable component slots.
98
- * @default {}
99
- */
100
- slots: PropTypes.object,
101
- value: PropTypes.number.isRequired,
102
- width: PropTypes.number.isRequired,
103
- x: PropTypes.number.isRequired,
104
- y: PropTypes.number.isRequired
105
- } : void 0;
106
- export { HeatmapItem };
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { HeatmapItemProps } from "./HeatmapItem.js";
3
- export interface HeatmapPlotProps extends Pick<HeatmapItemProps, 'slots' | 'slotProps'> {}
4
- declare function HeatmapPlot(props: HeatmapPlotProps): React.JSX.Element | null;
5
- declare namespace HeatmapPlot {
6
- var propTypes: any;
7
- }
8
- export { HeatmapPlot };
@@ -1,59 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import PropTypes from 'prop-types';
5
- import { useXScale, useYScale, useZColorScale } from '@mui/x-charts/hooks';
6
- import { useHeatmapSeriesContext } from "../hooks/useHeatmapSeries.js";
7
- import { HeatmapItem } from "./HeatmapItem.js";
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- function HeatmapPlot(props) {
10
- const xScale = useXScale();
11
- const yScale = useYScale();
12
- const colorScale = useZColorScale();
13
- const series = useHeatmapSeriesContext();
14
- const xDomain = xScale.domain();
15
- const yDomain = yScale.domain();
16
- if (!series || series.seriesOrder.length === 0) {
17
- return null;
18
- }
19
- const seriesToDisplay = series.series[series.seriesOrder[0]];
20
- return /*#__PURE__*/_jsx("g", {
21
- children: seriesToDisplay.data.map(([xIndex, yIndex, value], dataIndex) => {
22
- const x = xScale(xDomain[xIndex]);
23
- const y = yScale(yDomain[yIndex]);
24
- const color = colorScale?.(value);
25
- if (x === undefined || y === undefined || !color) {
26
- return null;
27
- }
28
- return /*#__PURE__*/_jsx(HeatmapItem, {
29
- width: xScale.bandwidth(),
30
- height: yScale.bandwidth(),
31
- x: x,
32
- y: y,
33
- color: color,
34
- dataIndex: dataIndex,
35
- seriesId: series.seriesOrder[0],
36
- value: value,
37
- slots: props.slots,
38
- slotProps: props.slotProps
39
- }, `${xIndex}_${yIndex}`);
40
- })
41
- });
42
- }
43
- process.env.NODE_ENV !== "production" ? HeatmapPlot.propTypes = {
44
- // ----------------------------- Warning --------------------------------
45
- // | These PropTypes are generated from the TypeScript type definitions |
46
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
47
- // ----------------------------------------------------------------------
48
- /**
49
- * The props used for each component slot.
50
- * @default {}
51
- */
52
- slotProps: PropTypes.object,
53
- /**
54
- * Overridable component slots.
55
- * @default {}
56
- */
57
- slots: PropTypes.object
58
- } : void 0;
59
- export { HeatmapPlot };
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
3
- export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
4
- /**
5
- * Select the kind of tooltip to display
6
- * - 'item': Shows data about the item below the mouse.
7
- * - 'none': Does not display tooltip
8
- * @default 'item'
9
- */
10
- trigger?: 'item' | 'none';
11
- }
12
- declare function HeatmapTooltip(props: HeatmapTooltipProps): React.JSX.Element;
13
- declare namespace HeatmapTooltip {
14
- var propTypes: any;
15
- }
16
- export { HeatmapTooltip };
@@ -1,284 +0,0 @@
1
- 'use client';
2
-
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import * as React from 'react';
5
- import PropTypes from 'prop-types';
6
- import clsx from 'clsx';
7
- import HTMLElementType from '@mui/utils/HTMLElementType';
8
- import composeClasses from '@mui/utils/composeClasses';
9
- import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip, getChartsTooltipUtilityClass, ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
10
- import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
11
- import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
12
- import { useHeatmapSeriesContext } from "../../hooks/useHeatmapSeries.js";
13
- import { HeatmapTooltipAxesValue } from "./HeatmapTooltipAxesValue.js";
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- const useUtilityClasses = props => {
16
- const {
17
- classes
18
- } = props;
19
- const slots = {
20
- root: ['root'],
21
- paper: ['paper'],
22
- table: ['table'],
23
- row: ['row'],
24
- cell: ['cell'],
25
- mark: ['mark'],
26
- markContainer: ['markContainer'],
27
- labelCell: ['labelCell'],
28
- valueCell: ['valueCell']
29
- };
30
- return composeClasses(slots, getChartsTooltipUtilityClass, classes);
31
- };
32
- function DefaultHeatmapTooltipContent(props) {
33
- const classes = useUtilityClasses(props);
34
- const xAxis = useXAxis();
35
- const yAxis = useYAxis();
36
- const heatmapSeries = useHeatmapSeriesContext();
37
- const tooltipData = useItemTooltip();
38
- if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
39
- return null;
40
- }
41
- const {
42
- series,
43
- seriesOrder
44
- } = heatmapSeries;
45
- const seriesId = seriesOrder[0];
46
- const {
47
- color,
48
- value,
49
- identifier,
50
- markType
51
- } = tooltipData;
52
- const [xIndex, yIndex] = value;
53
- const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
54
- location: 'tooltip',
55
- scale: xAxis.scale
56
- }) ?? xAxis.data[xIndex].toLocaleString();
57
- const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
58
- location: 'tooltip',
59
- scale: yAxis.scale
60
- }) ?? yAxis.data[yIndex].toLocaleString();
61
- const formattedValue = series[seriesId].valueFormatter(value, {
62
- dataIndex: identifier.dataIndex
63
- });
64
- const seriesLabel = getLabel(series[seriesId].label, 'tooltip');
65
- return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
66
- className: classes.paper,
67
- children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
68
- className: classes.table,
69
- children: [/*#__PURE__*/_jsxs(HeatmapTooltipAxesValue, {
70
- children: [/*#__PURE__*/_jsx("span", {
71
- children: formattedX
72
- }), /*#__PURE__*/_jsx("span", {
73
- children: formattedY
74
- })]
75
- }), /*#__PURE__*/_jsx("tbody", {
76
- children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
77
- className: classes.row,
78
- children: [/*#__PURE__*/_jsxs(ChartsTooltipCell, {
79
- className: clsx(classes.labelCell, classes.cell),
80
- component: "th",
81
- children: [/*#__PURE__*/_jsx("div", {
82
- className: classes.markContainer,
83
- children: /*#__PURE__*/_jsx(ChartsLabelMark, {
84
- type: markType,
85
- color: color,
86
- className: classes.mark
87
- })
88
- }), seriesLabel]
89
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
90
- className: clsx(classes.valueCell, classes.cell),
91
- component: "td",
92
- children: formattedValue
93
- })]
94
- })
95
- })]
96
- })
97
- });
98
- }
99
- process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltipContent.propTypes = {
100
- // ----------------------------- Warning --------------------------------
101
- // | These PropTypes are generated from the TypeScript type definitions |
102
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
103
- // ----------------------------------------------------------------------
104
- /**
105
- * Override or extend the styles applied to the component.
106
- */
107
- classes: PropTypes.object
108
- } : void 0;
109
- function HeatmapTooltip(props) {
110
- const classes = useUtilityClasses({
111
- classes: props.classes
112
- });
113
- return /*#__PURE__*/_jsx(ChartsTooltipContainer, _extends({
114
- trigger: "item"
115
- }, props, {
116
- classes: classes,
117
- children: /*#__PURE__*/_jsx(DefaultHeatmapTooltipContent, {
118
- classes: classes
119
- })
120
- }));
121
- }
122
- process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
123
- // ----------------------------- Warning --------------------------------
124
- // | These PropTypes are generated from the TypeScript type definitions |
125
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
126
- // ----------------------------------------------------------------------
127
- /**
128
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
129
- * or a function that returns either.
130
- * It's used to set the position of the popper.
131
- * The return value will passed as the reference object of the Popper instance.
132
- */
133
- anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
134
- /**
135
- * Override or extend the styles applied to the component.
136
- */
137
- classes: PropTypes.object,
138
- /**
139
- * The component used for the root node.
140
- * Either a string to use a HTML element or a component.
141
- */
142
- component: PropTypes.elementType,
143
- /**
144
- * The components used for each slot inside the Popper.
145
- * Either a string to use a HTML element or a component.
146
- *
147
- * @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
148
- * @default {}
149
- */
150
- components: PropTypes.shape({
151
- Root: PropTypes.elementType
152
- }),
153
- /**
154
- * The props used for each slot inside the Popper.
155
- *
156
- * @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
157
- * @default {}
158
- */
159
- componentsProps: PropTypes.shape({
160
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
161
- }),
162
- /**
163
- * An HTML element or function that returns one.
164
- * The `container` will have the portal children appended to it.
165
- *
166
- * You can also provide a callback, which is called in a React layout effect.
167
- * This lets you set the container from a ref, and also makes server-side rendering possible.
168
- *
169
- * By default, it uses the body of the top-level document object,
170
- * so it's simply `document.body` most of the time.
171
- */
172
- container: PropTypes.oneOfType([(props, propName) => {
173
- if (props[propName] == null) {
174
- return new Error(`Prop '${propName}' is required but wasn't specified`);
175
- }
176
- if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
177
- return new Error(`Expected prop '${propName}' to be of type Element`);
178
- }
179
- return null;
180
- }, PropTypes.func]),
181
- /**
182
- * The `children` will be under the DOM hierarchy of the parent component.
183
- * @default false
184
- */
185
- disablePortal: PropTypes.bool,
186
- /**
187
- * Always keep the children in the DOM.
188
- * This prop can be useful in SEO situation or
189
- * when you want to maximize the responsiveness of the Popper.
190
- * @default false
191
- */
192
- keepMounted: PropTypes.bool,
193
- /**
194
- * Popper.js is based on a "plugin-like" architecture,
195
- * most of its features are fully encapsulated "modifiers".
196
- *
197
- * A modifier is a function that is called each time Popper.js needs to
198
- * compute the position of the popper.
199
- * For this reason, modifiers should be very performant to avoid bottlenecks.
200
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
201
- */
202
- modifiers: PropTypes.arrayOf(PropTypes.shape({
203
- data: PropTypes.object,
204
- effect: PropTypes.func,
205
- enabled: PropTypes.bool,
206
- fn: PropTypes.func,
207
- name: PropTypes.any,
208
- options: PropTypes.object,
209
- phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
210
- requires: PropTypes.arrayOf(PropTypes.string),
211
- requiresIfExists: PropTypes.arrayOf(PropTypes.string)
212
- })),
213
- /**
214
- * If `true`, the component is shown.
215
- */
216
- open: PropTypes.bool,
217
- /**
218
- * Popper placement.
219
- * @default 'bottom'
220
- */
221
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
222
- /**
223
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
224
- * @default {}
225
- */
226
- popperOptions: PropTypes.shape({
227
- modifiers: PropTypes.array,
228
- onFirstUpdate: PropTypes.func,
229
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
230
- strategy: PropTypes.oneOf(['absolute', 'fixed'])
231
- }),
232
- /**
233
- * A ref that points to the used popper instance.
234
- */
235
- popperRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
236
- current: PropTypes.shape({
237
- destroy: PropTypes.func.isRequired,
238
- forceUpdate: PropTypes.func.isRequired,
239
- setOptions: PropTypes.func.isRequired,
240
- state: PropTypes.shape({
241
- attributes: PropTypes.object.isRequired,
242
- elements: PropTypes.object.isRequired,
243
- modifiersData: PropTypes.object.isRequired,
244
- options: PropTypes.object.isRequired,
245
- orderedModifiers: PropTypes.arrayOf(PropTypes.object).isRequired,
246
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']).isRequired,
247
- rects: PropTypes.object.isRequired,
248
- reset: PropTypes.bool.isRequired,
249
- scrollParents: PropTypes.object.isRequired,
250
- strategy: PropTypes.oneOf(['absolute', 'fixed']).isRequired,
251
- styles: PropTypes.object.isRequired
252
- }).isRequired,
253
- update: PropTypes.func.isRequired
254
- })
255
- })]),
256
- /**
257
- * The props used for each slot inside the Popper.
258
- * @default {}
259
- */
260
- slotProps: PropTypes.object,
261
- /**
262
- * The components used for each slot inside the Popper.
263
- * Either a string to use a HTML element or a component.
264
- * @default {}
265
- */
266
- slots: PropTypes.object,
267
- /**
268
- * The system prop that allows defining system overrides as well as additional CSS styles.
269
- */
270
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
271
- /**
272
- * Help supporting a react-transition-group/Transition component.
273
- * @default false
274
- */
275
- transition: PropTypes.bool,
276
- /**
277
- * Select the kind of tooltip to display
278
- * - 'item': Shows data about the item below the mouse.
279
- * - 'none': Does not display tooltip
280
- * @default 'item'
281
- */
282
- trigger: PropTypes.oneOf(['item', 'none'])
283
- } : void 0;
284
- export { HeatmapTooltip };
@@ -1,4 +0,0 @@
1
- /**
2
- * @ignore - internal component.
3
- */
4
- export declare const HeatmapTooltipAxesValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof import("react").ClassAttributes<HTMLElement> | keyof import("react").HTMLAttributes<HTMLElement>>, {}>;
@@ -1,22 +0,0 @@
1
- 'use client';
2
-
3
- import { styled } from '@mui/material/styles';
4
-
5
- /**
6
- * @ignore - internal component.
7
- */
8
- export const HeatmapTooltipAxesValue = styled('caption', {
9
- name: 'MuiChartsHeatmapTooltip',
10
- slot: 'AxesValue'
11
- })(({
12
- theme
13
- }) => ({
14
- textAlign: 'start',
15
- whiteSpace: 'nowrap',
16
- padding: theme.spacing(0.5, 1.5),
17
- color: (theme.vars || theme).palette.text.secondary,
18
- borderBottom: `solid ${(theme.vars || theme).palette.divider} 1px`,
19
- [`& span`]: {
20
- marginRight: theme.spacing(1.5)
21
- }
22
- }));
@@ -1 +0,0 @@
1
- export * from "./HeatmapTooltip.js";
@@ -1 +0,0 @@
1
- export * from "./HeatmapTooltip.js";
@@ -1,11 +0,0 @@
1
- export interface HeatmapClasses {
2
- /** Styles applied to the heatmap cells. */
3
- cell: string;
4
- /** Styles applied to the cell element if highlighted. */
5
- highlighted: string;
6
- /** Styles applied to the cell element if faded. */
7
- faded: string;
8
- }
9
- export type HeatmapClassKey = keyof HeatmapClasses;
10
- export declare function getHeatmapUtilityClass(slot: string): string;
11
- export declare const heatmapClasses: HeatmapClasses;
@@ -1,14 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
- import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
4
- export function getHeatmapUtilityClass(slot) {
5
- // Those should be common to all charts
6
- if (['highlighted', 'faded'].includes(slot)) {
7
- return generateUtilityClass('Charts', slot);
8
- }
9
- return generateUtilityClass('MuiHeatmap', slot);
10
- }
11
- export const heatmapClasses = _extends({}, generateUtilityClasses('MuiHeatmap', ['cell']), {
12
- highlighted: 'Charts-highlighted',
13
- faded: 'Charts-faded'
14
- });
@@ -1,4 +0,0 @@
1
- export { Heatmap } from "./Heatmap.js";
2
- export { HeatmapPlot } from "./HeatmapPlot.js";
3
- export * from "./HeatmapTooltip/index.js";
4
- export * from "./heatmapClasses.js";
@@ -1,4 +0,0 @@
1
- export { Heatmap } from "./Heatmap.js";
2
- export { HeatmapPlot } from "./HeatmapPlot.js";
3
- export * from "./HeatmapTooltip/index.js";
4
- export * from "./heatmapClasses.js";
@@ -1,2 +0,0 @@
1
- import { CartesianExtremumGetter } from '@mui/x-charts/internals';
2
- export declare const getBaseExtremum: CartesianExtremumGetter<'heatmap'>;
@@ -1,8 +0,0 @@
1
- export const getBaseExtremum = params => {
2
- const {
3
- axis
4
- } = params;
5
- const minX = Math.min(...(axis.data ?? []));
6
- const maxX = Math.max(...(axis.data ?? []));
7
- return [minX, maxX];
8
- };
@@ -1,3 +0,0 @@
1
- import { ColorProcessor } from '@mui/x-charts/internals';
2
- declare const getColor: ColorProcessor<'heatmap'>;
3
- export default getColor;
@@ -1,15 +0,0 @@
1
- const getColor = (series, xAxis, yAxis, zAxis) => {
2
- const zColorScale = zAxis?.colorScale;
3
- if (zColorScale) {
4
- return dataIndex => {
5
- const value = series.data[dataIndex];
6
- const color = zColorScale(value[2]);
7
- if (color === null) {
8
- return '';
9
- }
10
- return color;
11
- };
12
- }
13
- return () => '';
14
- };
15
- export default getColor;
@@ -1,3 +0,0 @@
1
- import { GetSeriesWithDefaultValues } from '@mui/x-charts/internals';
2
- declare const getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'heatmap'>;
3
- export default getSeriesWithDefaultValues;
@@ -1,8 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
3
- return _extends({
4
- id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
5
- color: colors[seriesIndex % colors.length]
6
- }, seriesData);
7
- };
8
- export default getSeriesWithDefaultValues;
@@ -1,2 +0,0 @@
1
- import { ChartSeriesTypeConfig } from '@mui/x-charts/internals';
2
- export declare const seriesConfig: ChartSeriesTypeConfig<'heatmap'>;
@@ -1,14 +0,0 @@
1
- import { getBaseExtremum } from "./extremums.js";
2
- import seriesProcessor from "./seriesProcessor.js";
3
- import getColor from "./getColor.js";
4
- import tooltipGetter from "./tooltip.js";
5
- import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
6
- export const seriesConfig = {
7
- seriesProcessor,
8
- colorProcessor: getColor,
9
- legendGetter: () => [],
10
- tooltipGetter,
11
- xExtremumGetter: getBaseExtremum,
12
- yExtremumGetter: getBaseExtremum,
13
- getSeriesWithDefaultValues
14
- };
@@ -1,3 +0,0 @@
1
- import { SeriesProcessor } from '@mui/x-charts/internals';
2
- declare const seriesProcessor: SeriesProcessor<'heatmap'>;
3
- export default seriesProcessor;
@@ -1,21 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- const seriesProcessor = params => {
3
- const {
4
- series,
5
- seriesOrder
6
- } = params;
7
- const defaultizedSeries = {};
8
- Object.keys(series).forEach(seriesId => {
9
- defaultizedSeries[seriesId] = _extends({
10
- // Defaultize the data and the value formatter.
11
- valueFormatter: v => v[2].toString(),
12
- data: [],
13
- labelMarkType: 'square'
14
- }, series[seriesId]);
15
- });
16
- return {
17
- series: defaultizedSeries,
18
- seriesOrder
19
- };
20
- };
21
- export default seriesProcessor;
@@ -1,3 +0,0 @@
1
- import { TooltipGetter } from '@mui/x-charts/internals';
2
- declare const tooltipGetter: TooltipGetter<'heatmap'>;
3
- export default tooltipGetter;