@mui/x-charts-pro 9.0.0-alpha.2 → 9.0.0-alpha.4
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.mts +2 -2
- package/BarChartPro/BarChartPro.d.ts +2 -2
- package/BarChartPro/BarChartPro.js +43 -10
- package/BarChartPro/BarChartPro.mjs +43 -10
- package/CHANGELOG.md +246 -1
- package/ChartsContainerPro/ChartsContainerPro.d.mts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.d.ts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.js +2 -2
- package/ChartsContainerPro/ChartsContainerPro.mjs +2 -2
- package/ChartsContainerPro/useChartsContainerProProps.d.mts +4 -4
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +4 -4
- package/ChartsContainerPro/useChartsContainerProProps.js +3 -3
- package/ChartsContainerPro/useChartsContainerProProps.mjs +3 -3
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.mts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +8 -11
- package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +8 -11
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.mts +1 -1
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.mjs +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.mjs +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.mjs +2 -2
- package/ChartsToolbarPro/index.d.mts +2 -1
- package/ChartsToolbarPro/index.d.ts +2 -1
- package/ChartsToolbarPro/index.mjs +2 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.js +1 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.mjs +2 -2
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.js +1 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.mjs +2 -2
- package/FunnelChart/FunnelChart.d.mts +2 -2
- package/FunnelChart/FunnelChart.d.ts +2 -2
- package/FunnelChart/FunnelChart.js +23 -8
- package/FunnelChart/FunnelChart.mjs +23 -8
- package/FunnelChart/FunnelPlot.js +8 -3
- package/FunnelChart/FunnelPlot.mjs +8 -3
- package/FunnelChart/FunnelSection.d.mts +3 -3
- package/FunnelChart/FunnelSection.d.ts +3 -3
- package/FunnelChart/FunnelSection.js +8 -9
- package/FunnelChart/FunnelSection.mjs +8 -9
- package/FunnelChart/FunnelSectionLabel.d.mts +9 -3
- package/FunnelChart/FunnelSectionLabel.d.ts +9 -3
- package/FunnelChart/FunnelSectionLabel.js +15 -6
- package/FunnelChart/FunnelSectionLabel.mjs +15 -6
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.mts +3 -3
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +3 -3
- package/FunnelChart/funnelClasses.d.mts +29 -0
- package/FunnelChart/funnelClasses.d.ts +29 -0
- package/FunnelChart/funnelClasses.js +29 -0
- package/FunnelChart/funnelClasses.mjs +19 -0
- package/FunnelChart/index.d.mts +2 -2
- package/FunnelChart/index.d.ts +2 -2
- package/FunnelChart/index.js +4 -4
- package/FunnelChart/index.mjs +1 -1
- package/FunnelChart/seriesConfig/legend.js +0 -2
- package/FunnelChart/seriesConfig/legend.mjs +0 -2
- package/FunnelChart/useFunnelChartProps.d.mts +2 -2
- package/FunnelChart/useFunnelChartProps.d.ts +2 -2
- package/FunnelChart/useFunnelChartProps.js +2 -2
- package/FunnelChart/useFunnelChartProps.mjs +2 -2
- package/Heatmap/Heatmap.d.mts +2 -11
- package/Heatmap/Heatmap.d.ts +2 -11
- package/Heatmap/Heatmap.js +25 -19
- package/Heatmap/Heatmap.mjs +25 -19
- package/Heatmap/HeatmapCell.d.mts +33 -0
- package/Heatmap/HeatmapCell.d.ts +33 -0
- package/Heatmap/HeatmapCell.js +62 -0
- package/Heatmap/HeatmapCell.mjs +55 -0
- package/Heatmap/HeatmapItem.d.mts +1 -9
- package/Heatmap/HeatmapItem.d.ts +1 -9
- package/Heatmap/HeatmapItem.js +5 -23
- package/Heatmap/HeatmapItem.mjs +5 -23
- package/Heatmap/HeatmapSVGPlot.js +14 -7
- package/Heatmap/HeatmapSVGPlot.mjs +15 -8
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +2 -2
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.mjs +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +16 -13
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.mjs +16 -13
- package/Heatmap/heatmapClasses.d.mts +6 -1
- package/Heatmap/heatmapClasses.d.ts +6 -1
- package/Heatmap/heatmapClasses.js +18 -3
- package/Heatmap/heatmapClasses.mjs +16 -2
- package/Heatmap/index.d.mts +4 -2
- package/Heatmap/index.d.ts +4 -2
- package/Heatmap/index.js +17 -13
- package/Heatmap/index.mjs +2 -1
- package/Heatmap/seriesConfig/getColor.js +5 -3
- package/Heatmap/seriesConfig/getColor.mjs +5 -3
- package/Heatmap/seriesConfig/getItemAtPosition.d.mts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.js +3 -11
- package/Heatmap/seriesConfig/getItemAtPosition.mjs +3 -11
- package/Heatmap/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.js +15 -0
- package/Heatmap/seriesConfig/identifierCleaner.mjs +9 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.js +11 -0
- package/Heatmap/seriesConfig/identifierSerializer.mjs +5 -0
- package/Heatmap/seriesConfig/index.js +4 -2
- package/Heatmap/seriesConfig/index.mjs +5 -3
- package/Heatmap/seriesConfig/keyboardFocusHandler.js +6 -19
- package/Heatmap/seriesConfig/keyboardFocusHandler.mjs +6 -19
- package/Heatmap/seriesConfig/seriesProcessor.js +8 -3
- package/Heatmap/seriesConfig/seriesProcessor.mjs +8 -3
- package/Heatmap/seriesConfig/tooltip.js +7 -6
- package/Heatmap/seriesConfig/tooltip.mjs +7 -6
- package/Heatmap/seriesConfig/tooltipPosition.js +3 -4
- package/Heatmap/seriesConfig/tooltipPosition.mjs +3 -4
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.mjs +1 -1
- package/Heatmap/useHeatmapProps.d.mts +2 -2
- package/Heatmap/useHeatmapProps.d.ts +2 -2
- package/Heatmap/useHeatmapProps.js +4 -6
- package/Heatmap/useHeatmapProps.mjs +4 -6
- package/LineChartPro/LineChartPro.d.mts +2 -2
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +40 -13
- package/LineChartPro/LineChartPro.mjs +40 -13
- package/PieChartPro/PieChartPro.d.mts +2 -2
- package/PieChartPro/PieChartPro.d.ts +2 -2
- package/PieChartPro/PieChartPro.js +22 -7
- package/PieChartPro/PieChartPro.mjs +22 -7
- package/RadarChartPro/RadarChartPro.d.mts +1 -1
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +20 -2
- package/RadarChartPro/RadarChartPro.mjs +20 -2
- package/SankeyChart/SankeyChart.d.mts +2 -2
- package/SankeyChart/SankeyChart.d.ts +2 -2
- package/SankeyChart/SankeyChart.js +21 -12
- package/SankeyChart/SankeyChart.mjs +21 -12
- package/SankeyChart/SankeyDataProvider.d.mts +2 -2
- package/SankeyChart/SankeyDataProvider.d.ts +2 -2
- package/SankeyChart/SankeyDataProvider.js +2 -2
- package/SankeyChart/SankeyDataProvider.mjs +2 -2
- package/SankeyChart/SankeyLinkElement.js +7 -3
- package/SankeyChart/SankeyLinkElement.mjs +8 -4
- package/SankeyChart/SankeyLinkLabel.js +3 -0
- package/SankeyChart/SankeyLinkLabel.mjs +3 -0
- package/SankeyChart/SankeyLinkLabelPlot.d.mts +2 -2
- package/SankeyChart/SankeyLinkLabelPlot.d.ts +2 -2
- package/SankeyChart/SankeyLinkLabelPlot.js +1 -1
- package/SankeyChart/SankeyLinkLabelPlot.mjs +1 -1
- package/SankeyChart/SankeyLinkPlot.d.mts +2 -2
- package/SankeyChart/SankeyLinkPlot.d.ts +2 -2
- package/SankeyChart/SankeyLinkPlot.js +1 -1
- package/SankeyChart/SankeyLinkPlot.mjs +1 -1
- package/SankeyChart/SankeyNodeElement.d.mts +1 -1
- package/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.js +20 -18
- package/SankeyChart/SankeyNodeElement.mjs +21 -19
- package/SankeyChart/SankeyNodeLabel.js +3 -0
- package/SankeyChart/SankeyNodeLabel.mjs +3 -0
- package/SankeyChart/SankeyNodeLabelPlot.d.mts +2 -2
- package/SankeyChart/SankeyNodeLabelPlot.d.ts +2 -2
- package/SankeyChart/SankeyNodeLabelPlot.js +1 -1
- package/SankeyChart/SankeyNodeLabelPlot.mjs +1 -1
- package/SankeyChart/SankeyNodePlot.d.mts +2 -2
- package/SankeyChart/SankeyNodePlot.d.ts +2 -2
- package/SankeyChart/SankeyNodePlot.js +1 -1
- package/SankeyChart/SankeyNodePlot.mjs +1 -1
- package/SankeyChart/SankeyPlot.d.mts +2 -2
- package/SankeyChart/SankeyPlot.d.ts +2 -2
- package/SankeyChart/SankeyPlot.js +3 -3
- package/SankeyChart/SankeyPlot.mjs +3 -3
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.js +2 -2
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.mjs +1 -1
- package/SankeyChart/index.d.mts +2 -1
- package/SankeyChart/index.d.ts +2 -1
- package/SankeyChart/index.js +3 -3
- package/SankeyChart/index.mjs +1 -1
- package/SankeyChart/sankeyClasses.d.mts +15 -6
- package/SankeyChart/sankeyClasses.d.ts +15 -6
- package/SankeyChart/sankeyClasses.js +12 -8
- package/SankeyChart/sankeyClasses.mjs +10 -6
- package/SankeyChart/sankeyHighlightHooks.d.mts +2 -2
- package/SankeyChart/sankeyHighlightHooks.d.ts +2 -2
- package/SankeyChart/sankeyHighlightHooks.js +2 -10
- package/SankeyChart/sankeyHighlightHooks.mjs +3 -11
- package/SankeyChart/useSankeyChartProps.d.mts +2 -2
- package/SankeyChart/useSankeyChartProps.d.ts +2 -2
- package/SankeyChart/useSankeyChartProps.js +2 -2
- package/SankeyChart/useSankeyChartProps.mjs +2 -2
- package/ScatterChartPro/ScatterChartPro.d.mts +2 -2
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +62 -17
- package/ScatterChartPro/ScatterChartPro.mjs +62 -17
- package/context/useChartProApiContext.d.mts +1 -1
- package/context/useChartProApiContext.d.ts +1 -1
- package/context/useChartProApiContext.js +1 -1
- package/context/useChartProApiContext.mjs +1 -1
- package/index.d.mts +0 -4
- package/index.d.ts +0 -4
- package/index.js +2 -34
- package/index.mjs +1 -4
- package/internals/ChartsWatermark.d.mts +2 -2
- package/internals/ChartsWatermark.d.ts +2 -2
- package/internals/ChartsWatermark.js +5 -8
- package/internals/ChartsWatermark.mjs +3 -6
- package/internals/index.d.mts +0 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -8
- package/internals/index.mjs +0 -1
- package/internals/plugins/allPlugins.d.mts +4 -4
- package/internals/plugins/allPlugins.d.ts +4 -4
- package/internals/plugins/useChartProExport/common.js +4 -8
- package/internals/plugins/useChartProExport/common.mjs +4 -8
- package/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/internals/plugins/useChartProExport/exportImage.mjs +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.mts +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +16 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.mjs +16 -1
- package/models/seriesType/heatmap.d.mts +36 -9
- package/models/seriesType/heatmap.d.ts +36 -9
- package/models/seriesType/heatmap.js +28 -1
- package/models/seriesType/heatmap.mjs +25 -1
- package/package.json +5 -61
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.mts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +4 -4
- package/plugins/selectors/useChartHeatmapPosition.selectors.mjs +4 -4
- package/themeAugmentation/components.d.mts +19 -1
- package/themeAugmentation/components.d.ts +19 -1
- package/themeAugmentation/overrides.d.mts +5 -2
- package/themeAugmentation/overrides.d.ts +5 -2
- package/themeAugmentation/props.d.mts +8 -0
- package/themeAugmentation/props.d.ts +8 -0
- package/typeOverloads/modules.d.mts +2 -2
- package/typeOverloads/modules.d.ts +2 -2
- package/ChartContainer/index.d.mts +0 -1
- package/ChartContainer/index.d.ts +0 -1
- package/ChartContainer/index.js +0 -16
- package/ChartContainer/index.mjs +0 -2
- package/ChartContainerPro/ChartContainerPro.d.mts +0 -21
- package/ChartContainerPro/ChartContainerPro.d.ts +0 -21
- package/ChartContainerPro/ChartContainerPro.js +0 -24
- package/ChartContainerPro/ChartContainerPro.mjs +0 -20
- package/ChartContainerPro/index.d.mts +0 -9
- package/ChartContainerPro/index.d.ts +0 -9
- package/ChartContainerPro/index.js +0 -17
- package/ChartContainerPro/index.mjs +0 -6
- package/ChartContainerPro/useChartContainerProProps.d.mts +0 -12
- package/ChartContainerPro/useChartContainerProProps.d.ts +0 -12
- package/ChartContainerPro/useChartContainerProProps.js +0 -19
- package/ChartContainerPro/useChartContainerProProps.mjs +0 -14
- package/ChartDataProvider/index.d.mts +0 -1
- package/ChartDataProvider/index.d.ts +0 -1
- package/ChartDataProvider/index.js +0 -16
- package/ChartDataProvider/index.mjs +0 -2
- package/ChartDataProviderPro/ChartDataProviderPro.d.mts +0 -20
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -20
- package/ChartDataProviderPro/ChartDataProviderPro.js +0 -30
- package/ChartDataProviderPro/ChartDataProviderPro.mjs +0 -21
- package/ChartDataProviderPro/index.d.mts +0 -2
- package/ChartDataProviderPro/index.d.ts +0 -2
- package/ChartDataProviderPro/index.js +0 -13
- package/ChartDataProviderPro/index.mjs +0 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.d.mts +0 -10
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -10
- package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -12
- package/ChartDataProviderPro/useChartDataProviderProProps.mjs +0 -8
- package/FunnelChart/funnelSectionClasses.d.mts +0 -30
- package/FunnelChart/funnelSectionClasses.d.ts +0 -30
- package/FunnelChart/funnelSectionClasses.js +0 -44
- package/FunnelChart/funnelSectionClasses.mjs +0 -35
- package/Heatmap/internals/HeatmapCell.d.mts +0 -21
- package/Heatmap/internals/HeatmapCell.d.ts +0 -21
- package/Heatmap/internals/HeatmapCell.js +0 -18
- package/Heatmap/internals/HeatmapCell.mjs +0 -12
- package/tests/constants.js +0 -7
- package/tests/constants.mjs +0 -1
package/Heatmap/Heatmap.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay';
|
|
|
13
13
|
import { ChartsLayerContainer } from '@mui/x-charts/ChartsLayerContainer';
|
|
14
14
|
import { HeatmapPlot } from "./HeatmapPlot.mjs";
|
|
15
15
|
import { HeatmapTooltip } from "./HeatmapTooltip/index.mjs";
|
|
16
|
-
import {
|
|
16
|
+
import { ChartsDataProviderPro } from "../ChartsDataProviderPro/index.mjs";
|
|
17
17
|
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.mjs";
|
|
18
18
|
import { FocusedHeatmapCell } from "./FocusedHeatmapCell.mjs";
|
|
19
19
|
import { useHeatmapProps } from "./useHeatmapProps.mjs";
|
|
@@ -33,7 +33,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
33
33
|
showToolbar = false
|
|
34
34
|
} = props;
|
|
35
35
|
const {
|
|
36
|
-
|
|
36
|
+
chartsDataProviderProProps,
|
|
37
37
|
chartsWrapperProps,
|
|
38
38
|
chartsAxisProps,
|
|
39
39
|
clipPathProps,
|
|
@@ -45,7 +45,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
45
45
|
} = useHeatmapProps(props);
|
|
46
46
|
const Tooltip = slots?.tooltip ?? HeatmapTooltip;
|
|
47
47
|
const Toolbar = slots?.toolbar ?? ChartsToolbarPro;
|
|
48
|
-
return /*#__PURE__*/_jsx(
|
|
48
|
+
return /*#__PURE__*/_jsx(ChartsDataProviderPro, _extends({}, chartsDataProviderProProps, {
|
|
49
49
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
50
50
|
ref: ref,
|
|
51
51
|
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsLayerContainer, {
|
|
@@ -95,6 +95,10 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
95
95
|
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
96
96
|
*/
|
|
97
97
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
98
|
+
/**
|
|
99
|
+
* The description of the chart.
|
|
100
|
+
* Used to provide an accessible description for the chart.
|
|
101
|
+
*/
|
|
98
102
|
desc: PropTypes.string,
|
|
99
103
|
/**
|
|
100
104
|
* If `true`, the charts will not listen to the mouse move event.
|
|
@@ -102,7 +106,14 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
102
106
|
* @default false
|
|
103
107
|
*/
|
|
104
108
|
disableAxisListener: PropTypes.bool,
|
|
105
|
-
|
|
109
|
+
/**
|
|
110
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
111
|
+
*/
|
|
112
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
113
|
+
/**
|
|
114
|
+
* Options to enable features planned for the next major.
|
|
115
|
+
*/
|
|
116
|
+
experimentalFeatures: PropTypes.object,
|
|
106
117
|
/**
|
|
107
118
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
108
119
|
*/
|
|
@@ -160,15 +171,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
160
171
|
right: PropTypes.number,
|
|
161
172
|
top: PropTypes.number
|
|
162
173
|
})]),
|
|
163
|
-
/**
|
|
164
|
-
* The function called for onClick events.
|
|
165
|
-
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
166
|
-
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
167
|
-
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
168
|
-
*
|
|
169
|
-
* @deprecated Use `onItemClick` instead to get access to both x- and y-axis values.
|
|
170
|
-
*/
|
|
171
|
-
onAxisClick: PropTypes.func,
|
|
172
174
|
/**
|
|
173
175
|
* The callback fired when the highlighted item changes.
|
|
174
176
|
*
|
|
@@ -178,7 +180,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
178
180
|
/**
|
|
179
181
|
* The callback fired when an item is clicked.
|
|
180
182
|
*
|
|
181
|
-
* @param {React.MouseEvent<
|
|
183
|
+
* @param {React.MouseEvent<HTMLDivElement, MouseEvent>} event The click event.
|
|
182
184
|
* @param {SeriesItemIdentifierWithType<SeriesType>} item The clicked item.
|
|
183
185
|
*/
|
|
184
186
|
onItemClick: PropTypes.func,
|
|
@@ -193,7 +195,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
193
195
|
/**
|
|
194
196
|
* The callback fired when the tooltip item changes.
|
|
195
197
|
*
|
|
196
|
-
* @param {SeriesItemIdentifier<
|
|
198
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
197
199
|
*/
|
|
198
200
|
onTooltipItemChange: PropTypes.func,
|
|
199
201
|
/**
|
|
@@ -224,6 +226,10 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
224
226
|
slots: PropTypes.object,
|
|
225
227
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
226
228
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
229
|
+
/**
|
|
230
|
+
* The title of the chart.
|
|
231
|
+
* Used to provide an accessible label for the chart.
|
|
232
|
+
*/
|
|
227
233
|
title: PropTypes.string,
|
|
228
234
|
/**
|
|
229
235
|
* The configuration of the tooltip.
|
|
@@ -243,13 +249,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
243
249
|
* Used when the tooltip is controlled.
|
|
244
250
|
*/
|
|
245
251
|
tooltipItem: PropTypes.oneOfType([PropTypes.shape({
|
|
246
|
-
dataIndex: PropTypes.number,
|
|
247
252
|
seriesId: PropTypes.string.isRequired,
|
|
248
253
|
type: PropTypes.oneOf(['heatmap']).isRequired,
|
|
249
254
|
xIndex: PropTypes.number.isRequired,
|
|
250
255
|
yIndex: PropTypes.number.isRequired
|
|
251
256
|
}), PropTypes.shape({
|
|
252
|
-
dataIndex: PropTypes.number,
|
|
253
257
|
seriesId: PropTypes.string.isRequired,
|
|
254
258
|
xIndex: PropTypes.number.isRequired,
|
|
255
259
|
yIndex: PropTypes.number.isRequired
|
|
@@ -268,6 +272,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
268
272
|
barGapRatio: PropTypes.number,
|
|
269
273
|
categoryGapRatio: PropTypes.number,
|
|
270
274
|
classes: PropTypes.object,
|
|
275
|
+
className: PropTypes.string,
|
|
271
276
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
272
277
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
273
278
|
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
@@ -349,6 +354,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
349
354
|
barGapRatio: PropTypes.number,
|
|
350
355
|
categoryGapRatio: PropTypes.number,
|
|
351
356
|
classes: PropTypes.object,
|
|
357
|
+
className: PropTypes.string,
|
|
352
358
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
353
359
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
354
360
|
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
@@ -487,8 +493,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
487
493
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
488
494
|
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
489
495
|
}), PropTypes.shape({
|
|
490
|
-
pointerMode: PropTypes.
|
|
491
|
-
requiredKeys: PropTypes.
|
|
496
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
497
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
492
498
|
type: PropTypes.oneOf(['brush']).isRequired
|
|
493
499
|
})]).isRequired)
|
|
494
500
|
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SeriesId } from "../models/index.mjs";
|
|
3
|
+
import type { HeatmapClasses } from "./heatmapClasses.mjs";
|
|
4
|
+
export interface HeatmapCellOwnerState {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
color: string;
|
|
7
|
+
isFaded: boolean;
|
|
8
|
+
isHighlighted: boolean;
|
|
9
|
+
classes?: Partial<HeatmapClasses>;
|
|
10
|
+
value: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `HeatmapCellOwnerState` instead.
|
|
14
|
+
*/
|
|
15
|
+
export type HeatmapItemOwnerState = HeatmapCellOwnerState;
|
|
16
|
+
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
ownerState: HeatmapCellOwnerState;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Demos:
|
|
25
|
+
*
|
|
26
|
+
* - [Heatmap](https://mui.com/x/react-charts/heatmap/)
|
|
27
|
+
*
|
|
28
|
+
* API:
|
|
29
|
+
*
|
|
30
|
+
* - [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/)
|
|
31
|
+
*/
|
|
32
|
+
declare const HeatmapCell: React.ForwardRefExoticComponent<Omit<HeatmapCellProps, "ref"> & React.RefAttributes<SVGRectElement>>;
|
|
33
|
+
export { HeatmapCell };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SeriesId } from "../models/index.js";
|
|
3
|
+
import type { HeatmapClasses } from "./heatmapClasses.js";
|
|
4
|
+
export interface HeatmapCellOwnerState {
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
color: string;
|
|
7
|
+
isFaded: boolean;
|
|
8
|
+
isHighlighted: boolean;
|
|
9
|
+
classes?: Partial<HeatmapClasses>;
|
|
10
|
+
value: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `HeatmapCellOwnerState` instead.
|
|
14
|
+
*/
|
|
15
|
+
export type HeatmapItemOwnerState = HeatmapCellOwnerState;
|
|
16
|
+
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
ownerState: HeatmapCellOwnerState;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Demos:
|
|
25
|
+
*
|
|
26
|
+
* - [Heatmap](https://mui.com/x/react-charts/heatmap/)
|
|
27
|
+
*
|
|
28
|
+
* API:
|
|
29
|
+
*
|
|
30
|
+
* - [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/)
|
|
31
|
+
*/
|
|
32
|
+
declare const HeatmapCell: React.ForwardRefExoticComponent<Omit<HeatmapCellProps, "ref"> & React.RefAttributes<SVGRectElement>>;
|
|
33
|
+
export { HeatmapCell };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.HeatmapCell = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `HeatmapCellOwnerState` instead.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const HeatmapCellRoot = (0, _styles.styled)('rect', {
|
|
19
|
+
name: 'MuiHeatmap',
|
|
20
|
+
slot: 'Cell',
|
|
21
|
+
overridesResolver: (_, styles) => styles.cell
|
|
22
|
+
})(({
|
|
23
|
+
ownerState
|
|
24
|
+
}) => ({
|
|
25
|
+
filter: ownerState.isHighlighted && 'saturate(120%)' || ownerState.isFaded && 'saturate(80%)' || undefined,
|
|
26
|
+
fill: ownerState.color,
|
|
27
|
+
shapeRendering: 'crispEdges'
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Demos:
|
|
32
|
+
*
|
|
33
|
+
* - [Heatmap](https://mui.com/x/react-charts/heatmap/)
|
|
34
|
+
*
|
|
35
|
+
* API:
|
|
36
|
+
*
|
|
37
|
+
* - [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/)
|
|
38
|
+
*/
|
|
39
|
+
const HeatmapCell = exports.HeatmapCell = /*#__PURE__*/React.forwardRef(function HeatmapCell(props, ref) {
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(HeatmapCellRoot, (0, _extends2.default)({
|
|
41
|
+
ref: ref
|
|
42
|
+
}, props));
|
|
43
|
+
});
|
|
44
|
+
if (process.env.NODE_ENV !== "production") HeatmapCell.displayName = "HeatmapCell";
|
|
45
|
+
process.env.NODE_ENV !== "production" ? HeatmapCell.propTypes = {
|
|
46
|
+
// ----------------------------- Warning --------------------------------
|
|
47
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
48
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
49
|
+
// ----------------------------------------------------------------------
|
|
50
|
+
height: _propTypes.default.number.isRequired,
|
|
51
|
+
ownerState: _propTypes.default.shape({
|
|
52
|
+
classes: _propTypes.default.object,
|
|
53
|
+
color: _propTypes.default.string.isRequired,
|
|
54
|
+
isFaded: _propTypes.default.bool.isRequired,
|
|
55
|
+
isHighlighted: _propTypes.default.bool.isRequired,
|
|
56
|
+
seriesId: _propTypes.default.string.isRequired,
|
|
57
|
+
value: _propTypes.default.number.isRequired
|
|
58
|
+
}).isRequired,
|
|
59
|
+
width: _propTypes.default.number.isRequired,
|
|
60
|
+
x: _propTypes.default.number.isRequired,
|
|
61
|
+
y: _propTypes.default.number.isRequired
|
|
62
|
+
} : void 0;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `HeatmapCellOwnerState` instead.
|
|
8
|
+
*/
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const HeatmapCellRoot = styled('rect', {
|
|
11
|
+
name: 'MuiHeatmap',
|
|
12
|
+
slot: 'Cell',
|
|
13
|
+
overridesResolver: (_, styles) => styles.cell
|
|
14
|
+
})(({
|
|
15
|
+
ownerState
|
|
16
|
+
}) => ({
|
|
17
|
+
filter: ownerState.isHighlighted && 'saturate(120%)' || ownerState.isFaded && 'saturate(80%)' || undefined,
|
|
18
|
+
fill: ownerState.color,
|
|
19
|
+
shapeRendering: 'crispEdges'
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Demos:
|
|
24
|
+
*
|
|
25
|
+
* - [Heatmap](https://mui.com/x/react-charts/heatmap/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [HeatmapCell API](https://mui.com/x/api/charts/heatmap-cell/)
|
|
30
|
+
*/
|
|
31
|
+
const HeatmapCell = /*#__PURE__*/React.forwardRef(function HeatmapCell(props, ref) {
|
|
32
|
+
return /*#__PURE__*/_jsx(HeatmapCellRoot, _extends({
|
|
33
|
+
ref: ref
|
|
34
|
+
}, props));
|
|
35
|
+
});
|
|
36
|
+
if (process.env.NODE_ENV !== "production") HeatmapCell.displayName = "HeatmapCell";
|
|
37
|
+
process.env.NODE_ENV !== "production" ? HeatmapCell.propTypes = {
|
|
38
|
+
// ----------------------------- Warning --------------------------------
|
|
39
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
40
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
41
|
+
// ----------------------------------------------------------------------
|
|
42
|
+
height: PropTypes.number.isRequired,
|
|
43
|
+
ownerState: PropTypes.shape({
|
|
44
|
+
classes: PropTypes.object,
|
|
45
|
+
color: PropTypes.string.isRequired,
|
|
46
|
+
isFaded: PropTypes.bool.isRequired,
|
|
47
|
+
isHighlighted: PropTypes.bool.isRequired,
|
|
48
|
+
seriesId: PropTypes.string.isRequired,
|
|
49
|
+
value: PropTypes.number.isRequired
|
|
50
|
+
}).isRequired,
|
|
51
|
+
width: PropTypes.number.isRequired,
|
|
52
|
+
x: PropTypes.number.isRequired,
|
|
53
|
+
y: PropTypes.number.isRequired
|
|
54
|
+
} : void 0;
|
|
55
|
+
export { HeatmapCell };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type SeriesId } from '@mui/x-charts/internals';
|
|
3
|
-
import { type
|
|
3
|
+
import { type HeatmapCellProps } from "./HeatmapCell.mjs";
|
|
4
4
|
export interface HeatmapItemSlots {
|
|
5
5
|
/**
|
|
6
6
|
* The component that renders the heatmap cell.
|
|
@@ -12,7 +12,6 @@ export interface HeatmapItemSlotProps {
|
|
|
12
12
|
cell?: Partial<HeatmapCellProps>;
|
|
13
13
|
}
|
|
14
14
|
export interface HeatmapItemProps {
|
|
15
|
-
dataIndex: number;
|
|
16
15
|
seriesId: SeriesId;
|
|
17
16
|
value: number;
|
|
18
17
|
width: number;
|
|
@@ -39,13 +38,6 @@ export interface HeatmapItemProps {
|
|
|
39
38
|
*/
|
|
40
39
|
slots?: HeatmapItemSlots;
|
|
41
40
|
}
|
|
42
|
-
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
43
|
-
x: number;
|
|
44
|
-
y: number;
|
|
45
|
-
width: number;
|
|
46
|
-
height: number;
|
|
47
|
-
ownerState: HeatmapItemOwnerState;
|
|
48
|
-
}
|
|
49
41
|
/**
|
|
50
42
|
* @ignore - internal component.
|
|
51
43
|
*/
|
package/Heatmap/HeatmapItem.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type SeriesId } from '@mui/x-charts/internals';
|
|
3
|
-
import { type
|
|
3
|
+
import { type HeatmapCellProps } from "./HeatmapCell.js";
|
|
4
4
|
export interface HeatmapItemSlots {
|
|
5
5
|
/**
|
|
6
6
|
* The component that renders the heatmap cell.
|
|
@@ -12,7 +12,6 @@ export interface HeatmapItemSlotProps {
|
|
|
12
12
|
cell?: Partial<HeatmapCellProps>;
|
|
13
13
|
}
|
|
14
14
|
export interface HeatmapItemProps {
|
|
15
|
-
dataIndex: number;
|
|
16
15
|
seriesId: SeriesId;
|
|
17
16
|
value: number;
|
|
18
17
|
width: number;
|
|
@@ -39,13 +38,6 @@ export interface HeatmapItemProps {
|
|
|
39
38
|
*/
|
|
40
39
|
slots?: HeatmapItemSlots;
|
|
41
40
|
}
|
|
42
|
-
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
43
|
-
x: number;
|
|
44
|
-
y: number;
|
|
45
|
-
width: number;
|
|
46
|
-
height: number;
|
|
47
|
-
ownerState: HeatmapItemOwnerState;
|
|
48
|
-
}
|
|
49
41
|
/**
|
|
50
42
|
* @ignore - internal component.
|
|
51
43
|
*/
|
package/Heatmap/HeatmapItem.js
CHANGED
|
@@ -11,33 +11,18 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
14
|
-
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
14
|
var _internals = require("@mui/x-charts/internals");
|
|
16
15
|
var _heatmapClasses = require("./heatmapClasses");
|
|
17
|
-
var _HeatmapCell = require("./
|
|
16
|
+
var _HeatmapCell = require("./HeatmapCell");
|
|
18
17
|
var _shouldRegisterPointerInteractionsGlobally = require("./shouldRegisterPointerInteractionsGlobally");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["seriesId", "
|
|
21
|
-
const useUtilityClasses = ownerState => {
|
|
22
|
-
const {
|
|
23
|
-
classes,
|
|
24
|
-
seriesId,
|
|
25
|
-
isFaded,
|
|
26
|
-
isHighlighted
|
|
27
|
-
} = ownerState;
|
|
28
|
-
const slots = {
|
|
29
|
-
cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
|
|
30
|
-
};
|
|
31
|
-
return (0, _composeClasses.default)(slots, _heatmapClasses.getHeatmapUtilityClass, classes);
|
|
32
|
-
};
|
|
33
|
-
|
|
19
|
+
const _excluded = ["seriesId", "color", "value", "isHighlighted", "isFaded", "borderRadius", "xIndex", "yIndex", "slotProps", "slots"];
|
|
34
20
|
/**
|
|
35
21
|
* @ignore - internal component.
|
|
36
22
|
*/
|
|
37
23
|
function HeatmapItem(props) {
|
|
38
24
|
const {
|
|
39
25
|
seriesId,
|
|
40
|
-
dataIndex,
|
|
41
26
|
color,
|
|
42
27
|
value,
|
|
43
28
|
isHighlighted = false,
|
|
@@ -56,19 +41,17 @@ function HeatmapItem(props) {
|
|
|
56
41
|
const interactionProps = (0, _internals.useInteractionItemProps)({
|
|
57
42
|
type: 'heatmap',
|
|
58
43
|
seriesId,
|
|
59
|
-
dataIndex,
|
|
60
44
|
xIndex,
|
|
61
45
|
yIndex
|
|
62
46
|
}, skipInteractionItemProps);
|
|
63
47
|
const ownerState = {
|
|
64
48
|
seriesId,
|
|
65
|
-
dataIndex,
|
|
66
49
|
color,
|
|
67
|
-
value,
|
|
68
50
|
isFaded,
|
|
69
|
-
isHighlighted
|
|
51
|
+
isHighlighted,
|
|
52
|
+
value
|
|
70
53
|
};
|
|
71
|
-
const classes = useUtilityClasses(ownerState);
|
|
54
|
+
const classes = (0, _heatmapClasses.useUtilityClasses)(ownerState);
|
|
72
55
|
const Cell = slots?.cell ?? _HeatmapCell.HeatmapCell;
|
|
73
56
|
const cellProps = (0, _useSlotProps.default)({
|
|
74
57
|
elementType: Cell,
|
|
@@ -91,7 +74,6 @@ process.env.NODE_ENV !== "production" ? HeatmapItem.propTypes = {
|
|
|
91
74
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
92
75
|
// ----------------------------------------------------------------------
|
|
93
76
|
color: _propTypes.default.string.isRequired,
|
|
94
|
-
dataIndex: _propTypes.default.number.isRequired,
|
|
95
77
|
height: _propTypes.default.number.isRequired,
|
|
96
78
|
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
97
79
|
/**
|
package/Heatmap/HeatmapItem.mjs
CHANGED
|
@@ -1,35 +1,20 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId", "
|
|
3
|
+
const _excluded = ["seriesId", "color", "value", "isHighlighted", "isFaded", "borderRadius", "xIndex", "yIndex", "slotProps", "slots"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
7
|
-
import composeClasses from '@mui/utils/composeClasses';
|
|
8
7
|
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
9
|
-
import {
|
|
10
|
-
import { HeatmapCell } from "./
|
|
8
|
+
import { useUtilityClasses } from "./heatmapClasses.mjs";
|
|
9
|
+
import { HeatmapCell } from "./HeatmapCell.mjs";
|
|
11
10
|
import { shouldRegisterPointerInteractionsGlobally } from "./shouldRegisterPointerInteractionsGlobally.mjs";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
const useUtilityClasses = ownerState => {
|
|
14
|
-
const {
|
|
15
|
-
classes,
|
|
16
|
-
seriesId,
|
|
17
|
-
isFaded,
|
|
18
|
-
isHighlighted
|
|
19
|
-
} = ownerState;
|
|
20
|
-
const slots = {
|
|
21
|
-
cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
|
|
22
|
-
};
|
|
23
|
-
return composeClasses(slots, getHeatmapUtilityClass, classes);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
12
|
/**
|
|
27
13
|
* @ignore - internal component.
|
|
28
14
|
*/
|
|
29
15
|
function HeatmapItem(props) {
|
|
30
16
|
const {
|
|
31
17
|
seriesId,
|
|
32
|
-
dataIndex,
|
|
33
18
|
color,
|
|
34
19
|
value,
|
|
35
20
|
isHighlighted = false,
|
|
@@ -48,17 +33,15 @@ function HeatmapItem(props) {
|
|
|
48
33
|
const interactionProps = useInteractionItemProps({
|
|
49
34
|
type: 'heatmap',
|
|
50
35
|
seriesId,
|
|
51
|
-
dataIndex,
|
|
52
36
|
xIndex,
|
|
53
37
|
yIndex
|
|
54
38
|
}, skipInteractionItemProps);
|
|
55
39
|
const ownerState = {
|
|
56
40
|
seriesId,
|
|
57
|
-
dataIndex,
|
|
58
41
|
color,
|
|
59
|
-
value,
|
|
60
42
|
isFaded,
|
|
61
|
-
isHighlighted
|
|
43
|
+
isHighlighted,
|
|
44
|
+
value
|
|
62
45
|
};
|
|
63
46
|
const classes = useUtilityClasses(ownerState);
|
|
64
47
|
const Cell = slots?.cell ?? HeatmapCell;
|
|
@@ -83,7 +66,6 @@ process.env.NODE_ENV !== "production" ? HeatmapItem.propTypes = {
|
|
|
83
66
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
84
67
|
// ----------------------------------------------------------------------
|
|
85
68
|
color: PropTypes.string.isRequired,
|
|
86
|
-
dataIndex: PropTypes.number.isRequired,
|
|
87
69
|
height: PropTypes.number.isRequired,
|
|
88
70
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
89
71
|
/**
|
|
@@ -7,23 +7,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.HeatmapSVGPlot = HeatmapSVGPlot;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
10
11
|
var _hooks = require("@mui/x-charts/hooks");
|
|
11
12
|
var _internals = require("@mui/x-charts/internals");
|
|
12
13
|
var _hooks2 = require("../hooks");
|
|
13
14
|
var _HeatmapItem = require("./HeatmapItem");
|
|
14
15
|
var _useChartHeatmapPosition = require("../plugins/selectors/useChartHeatmapPosition.selectors");
|
|
15
16
|
var _shouldRegisterPointerInteractionsGlobally = require("./shouldRegisterPointerInteractionsGlobally");
|
|
17
|
+
var _heatmapClasses = require("./heatmapClasses");
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
19
|
const MemoHeatmapItem = /*#__PURE__*/React.memo(_HeatmapItem.HeatmapItem);
|
|
18
20
|
if (process.env.NODE_ENV !== "production") MemoHeatmapItem.displayName = "MemoHeatmapItem";
|
|
21
|
+
const HeatmapPlotRoot = (0, _styles.styled)('g', {
|
|
22
|
+
name: 'MuiHeatmapPlot',
|
|
23
|
+
slot: 'Root'
|
|
24
|
+
})();
|
|
19
25
|
function HeatmapSVGPlot(props) {
|
|
20
26
|
const store = (0, _internals.useStore)();
|
|
21
27
|
const xScale = (0, _hooks.useXScale)();
|
|
22
28
|
const yScale = (0, _hooks.useYScale)();
|
|
23
29
|
const colorScale = (0, _hooks.useZColorScale)();
|
|
24
30
|
const series = (0, _hooks2.useHeatmapSeriesContext)();
|
|
25
|
-
const
|
|
26
|
-
const isFaded = store.use(_internals.selectorChartsIsFadedCallback);
|
|
31
|
+
const getHighlightState = store.use(_internals.selectorChartsHighlightStateCallback);
|
|
27
32
|
const xDomain = xScale.domain();
|
|
28
33
|
const yDomain = yScale.domain();
|
|
29
34
|
if (!series || series.seriesOrder.length === 0) {
|
|
@@ -31,8 +36,10 @@ function HeatmapSVGPlot(props) {
|
|
|
31
36
|
}
|
|
32
37
|
const seriesToDisplay = series.series[series.seriesOrder[0]];
|
|
33
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
34
|
-
children: [(0, _shouldRegisterPointerInteractionsGlobally.shouldRegisterPointerInteractionsGlobally)(props.slots, props.slotProps) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RegisterHeatmapPointerInteractions, {}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
35
|
-
|
|
39
|
+
children: [(0, _shouldRegisterPointerInteractionsGlobally.shouldRegisterPointerInteractionsGlobally)(props.slots, props.slotProps) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RegisterHeatmapPointerInteractions, {}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(HeatmapPlotRoot, {
|
|
40
|
+
className: _heatmapClasses.heatmapClasses.root,
|
|
41
|
+
"data-series": seriesToDisplay.id,
|
|
42
|
+
children: seriesToDisplay.data.map(([xIndex, yIndex, value]) => {
|
|
36
43
|
const x = xScale(xDomain[xIndex]);
|
|
37
44
|
const y = yScale(yDomain[yIndex]);
|
|
38
45
|
const color = colorScale?.(value);
|
|
@@ -45,6 +52,7 @@ function HeatmapSVGPlot(props) {
|
|
|
45
52
|
xIndex,
|
|
46
53
|
yIndex
|
|
47
54
|
};
|
|
55
|
+
const highlightState = getHighlightState(item);
|
|
48
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MemoHeatmapItem, {
|
|
49
57
|
width: xScale.bandwidth(),
|
|
50
58
|
height: yScale.bandwidth(),
|
|
@@ -53,13 +61,12 @@ function HeatmapSVGPlot(props) {
|
|
|
53
61
|
xIndex: xIndex,
|
|
54
62
|
yIndex: yIndex,
|
|
55
63
|
color: color,
|
|
56
|
-
dataIndex: dataIndex,
|
|
57
64
|
seriesId: series.seriesOrder[0],
|
|
58
65
|
value: value,
|
|
59
66
|
slots: props.slots,
|
|
60
67
|
slotProps: props.slotProps,
|
|
61
|
-
isHighlighted:
|
|
62
|
-
isFaded:
|
|
68
|
+
isHighlighted: highlightState === 'highlighted',
|
|
69
|
+
isFaded: highlightState === 'faded',
|
|
63
70
|
borderRadius: props.borderRadius
|
|
64
71
|
}, `${xIndex}_${yIndex}`);
|
|
65
72
|
})
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
4
5
|
import { useXScale, useYScale, useZColorScale } from '@mui/x-charts/hooks';
|
|
5
|
-
import {
|
|
6
|
+
import { selectorChartsHighlightStateCallback, useStore, useRegisterPointerInteractions } from '@mui/x-charts/internals';
|
|
6
7
|
import { useHeatmapSeriesContext } from "../hooks/index.mjs";
|
|
7
8
|
import { HeatmapItem } from "./HeatmapItem.mjs";
|
|
8
9
|
import { selectorHeatmapItemAtPosition } from "../plugins/selectors/useChartHeatmapPosition.selectors.mjs";
|
|
9
10
|
import { shouldRegisterPointerInteractionsGlobally } from "./shouldRegisterPointerInteractionsGlobally.mjs";
|
|
11
|
+
import { heatmapClasses } from "./heatmapClasses.mjs";
|
|
10
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
const MemoHeatmapItem = /*#__PURE__*/React.memo(HeatmapItem);
|
|
12
14
|
if (process.env.NODE_ENV !== "production") MemoHeatmapItem.displayName = "MemoHeatmapItem";
|
|
15
|
+
const HeatmapPlotRoot = styled('g', {
|
|
16
|
+
name: 'MuiHeatmapPlot',
|
|
17
|
+
slot: 'Root'
|
|
18
|
+
})();
|
|
13
19
|
export function HeatmapSVGPlot(props) {
|
|
14
20
|
const store = useStore();
|
|
15
21
|
const xScale = useXScale();
|
|
16
22
|
const yScale = useYScale();
|
|
17
23
|
const colorScale = useZColorScale();
|
|
18
24
|
const series = useHeatmapSeriesContext();
|
|
19
|
-
const
|
|
20
|
-
const isFaded = store.use(selectorChartsIsFadedCallback);
|
|
25
|
+
const getHighlightState = store.use(selectorChartsHighlightStateCallback);
|
|
21
26
|
const xDomain = xScale.domain();
|
|
22
27
|
const yDomain = yScale.domain();
|
|
23
28
|
if (!series || series.seriesOrder.length === 0) {
|
|
@@ -25,8 +30,10 @@ export function HeatmapSVGPlot(props) {
|
|
|
25
30
|
}
|
|
26
31
|
const seriesToDisplay = series.series[series.seriesOrder[0]];
|
|
27
32
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
28
|
-
children: [shouldRegisterPointerInteractionsGlobally(props.slots, props.slotProps) ? /*#__PURE__*/_jsx(RegisterHeatmapPointerInteractions, {}) : null, /*#__PURE__*/_jsx(
|
|
29
|
-
|
|
33
|
+
children: [shouldRegisterPointerInteractionsGlobally(props.slots, props.slotProps) ? /*#__PURE__*/_jsx(RegisterHeatmapPointerInteractions, {}) : null, /*#__PURE__*/_jsx(HeatmapPlotRoot, {
|
|
34
|
+
className: heatmapClasses.root,
|
|
35
|
+
"data-series": seriesToDisplay.id,
|
|
36
|
+
children: seriesToDisplay.data.map(([xIndex, yIndex, value]) => {
|
|
30
37
|
const x = xScale(xDomain[xIndex]);
|
|
31
38
|
const y = yScale(yDomain[yIndex]);
|
|
32
39
|
const color = colorScale?.(value);
|
|
@@ -39,6 +46,7 @@ export function HeatmapSVGPlot(props) {
|
|
|
39
46
|
xIndex,
|
|
40
47
|
yIndex
|
|
41
48
|
};
|
|
49
|
+
const highlightState = getHighlightState(item);
|
|
42
50
|
return /*#__PURE__*/_jsx(MemoHeatmapItem, {
|
|
43
51
|
width: xScale.bandwidth(),
|
|
44
52
|
height: yScale.bandwidth(),
|
|
@@ -47,13 +55,12 @@ export function HeatmapSVGPlot(props) {
|
|
|
47
55
|
xIndex: xIndex,
|
|
48
56
|
yIndex: yIndex,
|
|
49
57
|
color: color,
|
|
50
|
-
dataIndex: dataIndex,
|
|
51
58
|
seriesId: series.seriesOrder[0],
|
|
52
59
|
value: value,
|
|
53
60
|
slots: props.slots,
|
|
54
61
|
slotProps: props.slotProps,
|
|
55
|
-
isHighlighted:
|
|
56
|
-
isFaded:
|
|
62
|
+
isHighlighted: highlightState === 'highlighted',
|
|
63
|
+
isFaded: highlightState === 'faded',
|
|
57
64
|
borderRadius: props.borderRadius
|
|
58
65
|
}, `${xIndex}_${yIndex}`);
|
|
59
66
|
})
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useUtilityClasses = void 0;
|
|
8
8
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
9
|
-
var
|
|
9
|
+
var _internals = require("@mui/x-charts/internals");
|
|
10
10
|
const useUtilityClasses = props => {
|
|
11
11
|
const {
|
|
12
12
|
classes
|
|
@@ -22,6 +22,6 @@ const useUtilityClasses = props => {
|
|
|
22
22
|
labelCell: ['labelCell'],
|
|
23
23
|
valueCell: ['valueCell']
|
|
24
24
|
};
|
|
25
|
-
return (0, _composeClasses.default)(slots,
|
|
25
|
+
return (0, _composeClasses.default)(slots, _internals.getChartsTooltipUtilityClass, classes);
|
|
26
26
|
};
|
|
27
27
|
exports.useUtilityClasses = useUtilityClasses;
|