@mui/x-charts-pro 8.0.0-alpha.10 → 8.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.d.ts +3 -4
- package/BarChartPro/BarChartPro.js +229 -223
- package/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/BarChartPro/BarChartPro.plugins.js +9 -0
- package/BarChartPro/index.d.ts +1 -1
- package/BarChartPro/index.js +16 -1
- package/CHANGELOG.md +267 -2
- package/ChartContainerPro/ChartContainerPro.d.ts +7 -8
- package/ChartContainerPro/ChartContainerPro.js +178 -172
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +17 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +5 -5
- package/ChartContainerPro/useChartContainerProProps.js +25 -18
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +4 -4
- package/ChartDataProviderPro/ChartDataProviderPro.js +35 -213
- package/ChartDataProviderPro/index.d.ts +2 -1
- package/ChartDataProviderPro/index.js +17 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +4 -4
- package/ChartDataProviderPro/useChartDataProviderProProps.js +10 -4
- package/Heatmap/Heatmap.d.ts +44 -45
- package/Heatmap/Heatmap.js +212 -206
- package/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/Heatmap/Heatmap.plugins.js +8 -0
- package/Heatmap/HeatmapItem.d.ts +33 -33
- package/Heatmap/HeatmapItem.js +39 -32
- package/Heatmap/HeatmapPlot.d.ts +4 -5
- package/Heatmap/HeatmapPlot.js +22 -16
- package/Heatmap/HeatmapTooltip.d.ts +3 -4
- package/Heatmap/HeatmapTooltip.js +97 -89
- package/Heatmap/heatmapClasses.d.ts +7 -7
- package/Heatmap/heatmapClasses.js +15 -7
- package/Heatmap/index.d.ts +4 -4
- package/Heatmap/index.js +47 -4
- package/Heatmap/{extremums.d.ts → seriesConfig/extremums.d.ts} +1 -1
- package/Heatmap/{getColor.d.ts → seriesConfig/getColor.d.ts} +1 -1
- package/Heatmap/seriesConfig/index.d.ts +2 -0
- package/{node/Heatmap/plugin.js → Heatmap/seriesConfig/index.js} +4 -4
- package/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/{node/Heatmap/formatter.js → Heatmap/seriesConfig/seriesProcessor.js} +2 -2
- package/Heatmap/{tooltip.d.ts → seriesConfig/tooltip.d.ts} +1 -1
- package/LineChartPro/LineChartPro.d.ts +3 -4
- package/LineChartPro/LineChartPro.js +241 -235
- package/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/LineChartPro/LineChartPro.plugins.js +9 -0
- package/LineChartPro/index.d.ts +1 -1
- package/LineChartPro/index.js +16 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +4 -4
- package/ScatterChartPro/ScatterChartPro.js +224 -211
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/ScatterChartPro/ScatterChartPro.plugins.js +9 -0
- package/ScatterChartPro/index.d.ts +1 -1
- package/ScatterChartPro/index.js +16 -1
- package/esm/BarChartPro/BarChartPro.d.ts +17 -0
- package/esm/BarChartPro/BarChartPro.js +455 -0
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/esm/BarChartPro/BarChartPro.plugins.js +3 -0
- package/esm/BarChartPro/index.d.ts +1 -0
- package/esm/BarChartPro/index.js +1 -0
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/esm/ChartContainerPro/ChartContainerPro.js +290 -0
- package/esm/ChartContainerPro/index.d.ts +2 -0
- package/esm/ChartContainerPro/index.js +2 -0
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
- package/esm/ChartContainerPro/useChartContainerProProps.js +33 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +105 -0
- package/esm/ChartDataProviderPro/index.d.ts +2 -0
- package/esm/ChartDataProviderPro/index.js +2 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/esm/Heatmap/Heatmap.d.ts +56 -0
- package/esm/Heatmap/Heatmap.js +402 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/esm/Heatmap/Heatmap.plugins.js +2 -0
- package/esm/Heatmap/HeatmapItem.d.ts +49 -0
- package/esm/Heatmap/HeatmapItem.js +106 -0
- package/esm/Heatmap/HeatmapPlot.d.ts +8 -0
- package/{node → esm}/Heatmap/HeatmapPlot.js +16 -22
- package/esm/Heatmap/HeatmapTooltip.d.ts +8 -0
- package/esm/Heatmap/HeatmapTooltip.js +276 -0
- package/esm/Heatmap/heatmapClasses.d.ts +11 -0
- package/esm/Heatmap/heatmapClasses.js +14 -0
- package/esm/Heatmap/index.d.ts +4 -0
- package/esm/Heatmap/index.js +4 -0
- package/esm/Heatmap/seriesConfig/extremums.d.ts +2 -0
- package/esm/Heatmap/seriesConfig/getColor.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/index.d.ts +2 -0
- package/{Heatmap/plugin.js → esm/Heatmap/seriesConfig/index.js} +3 -3
- package/esm/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/{Heatmap/formatter.js → esm/Heatmap/seriesConfig/seriesProcessor.js} +2 -2
- package/esm/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/esm/LineChartPro/LineChartPro.d.ts +16 -0
- package/esm/LineChartPro/LineChartPro.js +506 -0
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/esm/LineChartPro/LineChartPro.plugins.js +3 -0
- package/esm/LineChartPro/index.d.ts +1 -0
- package/esm/LineChartPro/index.js +1 -0
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/esm/ScatterChartPro/ScatterChartPro.js +400 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- package/esm/ScatterChartPro/index.d.ts +1 -0
- package/esm/ScatterChartPro/index.js +1 -0
- package/esm/hooks/index.d.ts +2 -0
- package/esm/hooks/index.js +2 -0
- package/esm/hooks/useHeatmapSeries.d.ts +33 -0
- package/esm/hooks/useHeatmapSeries.js +42 -0
- package/esm/hooks/zoom/index.d.ts +1 -0
- package/esm/hooks/zoom/index.js +1 -0
- package/esm/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/esm/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/esm/index.d.ts +32 -0
- package/esm/index.js +43 -0
- package/esm/internals/plugins/allPlugins.d.ts +5 -0
- package/esm/internals/plugins/allPlugins.js +5 -0
- package/esm/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/esm/internals/plugins/useChartProZoom/index.js +3 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.js +33 -44
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +201 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +4 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +44 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/{node → esm}/internals/plugins/useChartProZoom/useChartProZoom.utils.js +8 -22
- package/esm/internals/utils/releaseInfo.d.ts +1 -0
- package/esm/internals/utils/releaseInfo.js +13 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/seriesType/heatmap.d.ts +28 -0
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/package.json +1 -0
- package/esm/themeAugmentation/components.d.ts +23 -0
- package/esm/themeAugmentation/index.d.ts +4 -0
- package/esm/themeAugmentation/index.js +0 -0
- package/esm/themeAugmentation/overrides.d.ts +11 -0
- package/esm/themeAugmentation/props.d.ts +20 -0
- package/esm/typeOverloads/index.d.ts +1 -0
- package/esm/typeOverloads/index.js +1 -0
- package/esm/typeOverloads/modules.d.ts +22 -0
- package/esm/typeOverloads/modules.js +1 -0
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +27 -2
- package/hooks/useHeatmapSeries.d.ts +33 -0
- package/hooks/useHeatmapSeries.js +48 -0
- package/hooks/zoom/index.d.ts +1 -1
- package/hooks/zoom/index.js +16 -1
- package/hooks/zoom/useIsZoomInteracting.d.ts +1 -1
- package/hooks/zoom/useIsZoomInteracting.js +10 -5
- package/index.d.ts +8 -8
- package/index.js +347 -37
- package/internals/plugins/allPlugins.d.ts +3 -9
- package/internals/plugins/allPlugins.js +9 -3
- package/internals/plugins/useChartProZoom/index.d.ts +3 -3
- package/internals/plugins/useChartProZoom/index.js +38 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.js +40 -37
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +149 -325
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +11 -10
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +35 -41
- package/internals/plugins/useChartProZoom/useChartProZoom.types.js +5 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +13 -13
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +22 -8
- package/internals/utils/releaseInfo.d.ts +1 -1
- package/internals/utils/releaseInfo.js +13 -5
- package/models/index.d.ts +1 -1
- package/models/index.js +16 -2
- package/models/seriesType/heatmap.d.ts +17 -18
- package/models/seriesType/heatmap.js +5 -1
- package/models/seriesType/index.d.ts +1 -1
- package/models/seriesType/index.js +16 -1
- package/modern/BarChartPro/BarChartPro.d.ts +17 -0
- package/modern/BarChartPro/BarChartPro.js +5 -5
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/modern/BarChartPro/BarChartPro.plugins.js +3 -0
- package/modern/BarChartPro/index.d.ts +1 -0
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/modern/ChartContainerPro/index.d.ts +2 -0
- package/modern/ChartContainerPro/index.js +1 -0
- package/modern/ChartContainerPro/useChartContainerProProps.d.ts +9 -0
- package/modern/ChartContainerPro/useChartContainerProProps.js +11 -11
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +11 -195
- package/modern/ChartDataProviderPro/index.d.ts +2 -0
- package/modern/ChartDataProviderPro/index.js +1 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/modern/Heatmap/Heatmap.d.ts +56 -0
- package/modern/Heatmap/Heatmap.js +7 -7
- package/modern/Heatmap/Heatmap.plugins.d.ts +3 -0
- package/modern/Heatmap/Heatmap.plugins.js +2 -0
- package/modern/Heatmap/HeatmapItem.d.ts +49 -0
- package/modern/Heatmap/HeatmapPlot.d.ts +8 -0
- package/modern/Heatmap/HeatmapPlot.js +2 -2
- package/modern/Heatmap/HeatmapTooltip.d.ts +8 -0
- package/modern/Heatmap/HeatmapTooltip.js +6 -4
- package/modern/Heatmap/heatmapClasses.d.ts +11 -0
- package/modern/Heatmap/index.d.ts +4 -0
- package/modern/Heatmap/seriesConfig/extremums.d.ts +2 -0
- package/modern/Heatmap/seriesConfig/getColor.d.ts +3 -0
- package/modern/Heatmap/seriesConfig/index.d.ts +2 -0
- package/modern/Heatmap/{plugin.js → seriesConfig/index.js} +3 -3
- package/modern/Heatmap/seriesConfig/seriesProcessor.d.ts +3 -0
- package/modern/Heatmap/{formatter.js → seriesConfig/seriesProcessor.js} +2 -2
- package/modern/Heatmap/seriesConfig/tooltip.d.ts +3 -0
- package/modern/LineChartPro/LineChartPro.d.ts +16 -0
- package/modern/LineChartPro/LineChartPro.js +5 -5
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/modern/LineChartPro/LineChartPro.plugins.js +3 -0
- package/modern/LineChartPro/index.d.ts +1 -0
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +12 -5
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- package/modern/ScatterChartPro/index.d.ts +1 -0
- package/modern/hooks/index.d.ts +2 -0
- package/modern/hooks/index.js +1 -1
- package/modern/hooks/useHeatmapSeries.d.ts +33 -0
- package/modern/hooks/useHeatmapSeries.js +42 -0
- package/modern/hooks/zoom/index.d.ts +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/modern/index.d.ts +32 -0
- package/modern/index.js +2 -3
- package/modern/internals/plugins/allPlugins.d.ts +5 -0
- package/modern/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +4 -8
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +201 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -7
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +44 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/modern/internals/utils/releaseInfo.d.ts +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/index.d.ts +2 -0
- package/modern/models/seriesType/heatmap.d.ts +28 -0
- package/modern/models/seriesType/index.d.ts +1 -0
- package/modern/package.json +1 -0
- package/modern/themeAugmentation/components.d.ts +23 -0
- package/modern/themeAugmentation/index.d.ts +4 -0
- package/modern/themeAugmentation/overrides.d.ts +11 -0
- package/modern/themeAugmentation/props.d.ts +20 -0
- package/modern/typeOverloads/index.d.ts +1 -0
- package/modern/typeOverloads/modules.d.ts +22 -0
- package/package.json +40 -10
- package/themeAugmentation/components.d.ts +1 -3
- package/themeAugmentation/index.d.ts +1 -1
- package/themeAugmentation/index.js +1 -0
- package/themeAugmentation/overrides.d.ts +2 -4
- package/themeAugmentation/props.d.ts +5 -7
- package/tsconfig.build.tsbuildinfo +1 -0
- package/typeOverloads/index.d.ts +1 -1
- package/typeOverloads/index.js +6 -1
- package/typeOverloads/modules.d.ts +20 -23
- package/typeOverloads/modules.js +5 -1
- package/BarChartPro/package.json +0 -6
- package/ChartContainerPro/package.json +0 -6
- package/ChartDataProviderPro/package.json +0 -6
- package/Heatmap/formatter.d.ts +0 -3
- package/Heatmap/package.json +0 -6
- package/Heatmap/plugin.d.ts +0 -2
- package/LineChartPro/package.json +0 -6
- package/ScatterChartPro/package.json +0 -6
- package/hooks/package.json +0 -6
- package/hooks/useSeries.d.ts +0 -9
- package/hooks/useSeries.js +0 -16
- package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +0 -3
- package/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +0 -2
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +0 -53
- package/models/package.json +0 -6
- package/modern/hooks/useSeries.js +0 -16
- package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -12
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -25
- package/node/BarChartPro/BarChartPro.js +0 -461
- package/node/BarChartPro/index.js +0 -16
- package/node/ChartContainerPro/ChartContainerPro.js +0 -296
- package/node/ChartContainerPro/index.js +0 -16
- package/node/ChartContainerPro/useChartContainerProProps.js +0 -40
- package/node/ChartDataProviderPro/ChartDataProviderPro.js +0 -295
- package/node/ChartDataProviderPro/index.js +0 -16
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +0 -21
- package/node/Heatmap/Heatmap.js +0 -408
- package/node/Heatmap/HeatmapItem.js +0 -113
- package/node/Heatmap/HeatmapTooltip.js +0 -280
- package/node/Heatmap/heatmapClasses.js +0 -22
- package/node/Heatmap/index.js +0 -47
- package/node/LineChartPro/LineChartPro.js +0 -512
- package/node/LineChartPro/index.js +0 -16
- package/node/ScatterChartPro/ScatterChartPro.js +0 -399
- package/node/ScatterChartPro/index.js +0 -16
- package/node/hooks/index.js +0 -27
- package/node/hooks/useSeries.js +0 -21
- package/node/hooks/zoom/index.js +0 -16
- package/node/hooks/zoom/useIsZoomInteracting.js +0 -19
- package/node/index.js +0 -365
- package/node/internals/plugins/allPlugins.js +0 -11
- package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +0 -19
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +0 -33
- package/node/internals/plugins/useChartProZoom/index.js +0 -38
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +0 -18
- package/node/internals/plugins/useChartProZoom/useChartProZoom.types.js +0 -5
- package/node/internals/plugins/useChartProZoom/zoom.types.js +0 -5
- package/node/internals/utils/releaseInfo.js +0 -21
- package/node/models/index.js +0 -16
- package/node/models/seriesType/heatmap.js +0 -5
- package/node/models/seriesType/index.js +0 -16
- package/node/themeAugmentation/index.js +0 -1
- package/node/typeOverloads/index.js +0 -6
- package/node/typeOverloads/modules.js +0 -5
- package/themeAugmentation/package.json +0 -6
- package/typeOverloads/package.json +0 -6
- /package/{node/Heatmap → Heatmap/seriesConfig}/extremums.js +0 -0
- /package/{node/Heatmap → Heatmap/seriesConfig}/getColor.js +0 -0
- /package/{node/Heatmap → Heatmap/seriesConfig}/tooltip.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/extremums.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/getColor.js +0 -0
- /package/{Heatmap → esm/Heatmap/seriesConfig}/tooltip.js +0 -0
- /package/{internals/plugins/useChartProZoom/zoom.types.js → esm/internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
- /package/{modern/internals/plugins/useChartProZoom/zoom.types.js → esm/models/seriesType/heatmap.js} +0 -0
- /package/modern/Heatmap/{extremums.js → seriesConfig/extremums.js} +0 -0
- /package/modern/Heatmap/{getColor.js → seriesConfig/getColor.js} +0 -0
- /package/modern/Heatmap/{tooltip.js → seriesConfig/tooltip.js} +0 -0
|
@@ -0,0 +1,402 @@
|
|
|
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 { useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import useId from '@mui/utils/useId';
|
|
8
|
+
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
9
|
+
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
10
|
+
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
11
|
+
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
12
|
+
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
13
|
+
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
14
|
+
import { seriesConfig as heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
15
|
+
import { HeatmapTooltip } from "./HeatmapTooltip.js";
|
|
16
|
+
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
19
|
+
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
20
|
+
const seriesConfig = {
|
|
21
|
+
heatmap: heatmapSeriesConfig
|
|
22
|
+
};
|
|
23
|
+
const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
24
|
+
const props = useThemeProps({
|
|
25
|
+
props: inProps,
|
|
26
|
+
name: 'MuiHeatmap'
|
|
27
|
+
});
|
|
28
|
+
const {
|
|
29
|
+
xAxis,
|
|
30
|
+
yAxis,
|
|
31
|
+
zAxis,
|
|
32
|
+
series,
|
|
33
|
+
width,
|
|
34
|
+
height,
|
|
35
|
+
margin,
|
|
36
|
+
colors,
|
|
37
|
+
dataset,
|
|
38
|
+
sx,
|
|
39
|
+
topAxis,
|
|
40
|
+
leftAxis,
|
|
41
|
+
rightAxis,
|
|
42
|
+
bottomAxis,
|
|
43
|
+
onAxisClick,
|
|
44
|
+
children,
|
|
45
|
+
slots,
|
|
46
|
+
slotProps,
|
|
47
|
+
loading,
|
|
48
|
+
highlightedItem,
|
|
49
|
+
onHighlightChange
|
|
50
|
+
} = props;
|
|
51
|
+
const id = useId();
|
|
52
|
+
const clipPathId = `${id}-clip-path`;
|
|
53
|
+
const defaultizedXAxis = React.useMemo(() => xAxis.map(axis => _extends({
|
|
54
|
+
scaleType: 'band',
|
|
55
|
+
categoryGapRatio: 0
|
|
56
|
+
}, axis)), [xAxis]);
|
|
57
|
+
const defaultizedYAxis = React.useMemo(() => yAxis.map(axis => _extends({
|
|
58
|
+
scaleType: 'band',
|
|
59
|
+
categoryGapRatio: 0
|
|
60
|
+
}, axis)), [yAxis]);
|
|
61
|
+
const defaultizedZAxis = React.useMemo(() => zAxis ?? [{
|
|
62
|
+
colorMap: {
|
|
63
|
+
type: 'continuous',
|
|
64
|
+
min: 0,
|
|
65
|
+
max: 100,
|
|
66
|
+
color: defaultColorMap
|
|
67
|
+
}
|
|
68
|
+
}], [zAxis]);
|
|
69
|
+
const Tooltip = props.slots?.tooltip ?? HeatmapTooltip;
|
|
70
|
+
return /*#__PURE__*/_jsxs(ChartContainerPro, {
|
|
71
|
+
ref: ref,
|
|
72
|
+
seriesConfig: seriesConfig,
|
|
73
|
+
series: series.map(s => _extends({
|
|
74
|
+
type: 'heatmap'
|
|
75
|
+
}, s)),
|
|
76
|
+
width: width,
|
|
77
|
+
height: height,
|
|
78
|
+
margin: margin,
|
|
79
|
+
xAxis: defaultizedXAxis,
|
|
80
|
+
yAxis: defaultizedYAxis,
|
|
81
|
+
zAxis: defaultizedZAxis,
|
|
82
|
+
colors: colors,
|
|
83
|
+
dataset: dataset,
|
|
84
|
+
sx: sx,
|
|
85
|
+
disableAxisListener: true,
|
|
86
|
+
highlightedItem: highlightedItem,
|
|
87
|
+
onHighlightChange: onHighlightChange,
|
|
88
|
+
onAxisClick: onAxisClick,
|
|
89
|
+
plugins: HEATMAP_PLUGINS,
|
|
90
|
+
children: [/*#__PURE__*/_jsxs("g", {
|
|
91
|
+
clipPath: `url(#${clipPathId})`,
|
|
92
|
+
children: [/*#__PURE__*/_jsx(HeatmapPlot, {
|
|
93
|
+
slots: slots,
|
|
94
|
+
slotProps: slotProps
|
|
95
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
96
|
+
loading: loading,
|
|
97
|
+
slots: slots,
|
|
98
|
+
slotProps: slotProps
|
|
99
|
+
})]
|
|
100
|
+
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
101
|
+
topAxis: topAxis,
|
|
102
|
+
leftAxis: leftAxis,
|
|
103
|
+
rightAxis: rightAxis,
|
|
104
|
+
bottomAxis: bottomAxis,
|
|
105
|
+
slots: slots,
|
|
106
|
+
slotProps: slotProps
|
|
107
|
+
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
108
|
+
id: clipPathId
|
|
109
|
+
}), children]
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
113
|
+
// ----------------------------- Warning --------------------------------
|
|
114
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
115
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
116
|
+
// ----------------------------------------------------------------------
|
|
117
|
+
apiRef: PropTypes.shape({
|
|
118
|
+
current: PropTypes.shape({
|
|
119
|
+
setZoomData: PropTypes.func.isRequired
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/**
|
|
123
|
+
* Indicate which axis to display the bottom of the charts.
|
|
124
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
125
|
+
* @default xAxisIds[0] The id of the first provided axis
|
|
126
|
+
*/
|
|
127
|
+
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
128
|
+
children: PropTypes.node,
|
|
129
|
+
className: PropTypes.string,
|
|
130
|
+
/**
|
|
131
|
+
* Color palette used to colorize multiple series.
|
|
132
|
+
* @default rainbowSurgePalette
|
|
133
|
+
*/
|
|
134
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
135
|
+
/**
|
|
136
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
137
|
+
*/
|
|
138
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
139
|
+
desc: PropTypes.string,
|
|
140
|
+
/**
|
|
141
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
142
|
+
* It might break interactive features, but will improve performance.
|
|
143
|
+
* @default false
|
|
144
|
+
*/
|
|
145
|
+
disableAxisListener: PropTypes.bool,
|
|
146
|
+
/**
|
|
147
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
148
|
+
*/
|
|
149
|
+
height: PropTypes.number,
|
|
150
|
+
/**
|
|
151
|
+
* The highlighted item.
|
|
152
|
+
* Used when the highlight is controlled.
|
|
153
|
+
*/
|
|
154
|
+
highlightedItem: PropTypes.shape({
|
|
155
|
+
dataIndex: PropTypes.number,
|
|
156
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
157
|
+
}),
|
|
158
|
+
/**
|
|
159
|
+
* This prop is used to help implement the accessibility logic.
|
|
160
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
161
|
+
*/
|
|
162
|
+
id: PropTypes.string,
|
|
163
|
+
/**
|
|
164
|
+
* The list of zoom data related to each axis.
|
|
165
|
+
*/
|
|
166
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
167
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
168
|
+
end: PropTypes.number.isRequired,
|
|
169
|
+
start: PropTypes.number.isRequired
|
|
170
|
+
})),
|
|
171
|
+
/**
|
|
172
|
+
* Indicate which axis to display the left of the charts.
|
|
173
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
174
|
+
* @default yAxisIds[0] The id of the first provided axis
|
|
175
|
+
*/
|
|
176
|
+
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
177
|
+
/**
|
|
178
|
+
* If `true`, a loading overlay is displayed.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
loading: PropTypes.bool,
|
|
182
|
+
/**
|
|
183
|
+
* The margin between the SVG and the drawing area.
|
|
184
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
185
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
186
|
+
*/
|
|
187
|
+
margin: PropTypes.shape({
|
|
188
|
+
bottom: PropTypes.number,
|
|
189
|
+
left: PropTypes.number,
|
|
190
|
+
right: PropTypes.number,
|
|
191
|
+
top: PropTypes.number
|
|
192
|
+
}),
|
|
193
|
+
/**
|
|
194
|
+
* The function called for onClick events.
|
|
195
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
196
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
197
|
+
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
198
|
+
*/
|
|
199
|
+
onAxisClick: PropTypes.func,
|
|
200
|
+
/**
|
|
201
|
+
* The callback fired when the highlighted item changes.
|
|
202
|
+
*
|
|
203
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
204
|
+
*/
|
|
205
|
+
onHighlightChange: PropTypes.func,
|
|
206
|
+
/**
|
|
207
|
+
* Indicate which axis to display the right of the charts.
|
|
208
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
209
|
+
* @default null
|
|
210
|
+
*/
|
|
211
|
+
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
212
|
+
/**
|
|
213
|
+
* The series to display in the bar chart.
|
|
214
|
+
* An array of [[HeatmapSeriesType]] objects.
|
|
215
|
+
*/
|
|
216
|
+
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
217
|
+
/**
|
|
218
|
+
* The configuration helpers used to compute attributes according to the serries type.
|
|
219
|
+
* @ignore Unstable props for internal usage.
|
|
220
|
+
*/
|
|
221
|
+
seriesConfig: PropTypes.object,
|
|
222
|
+
/**
|
|
223
|
+
* The props used for each component slot.
|
|
224
|
+
* @default {}
|
|
225
|
+
*/
|
|
226
|
+
slotProps: PropTypes.object,
|
|
227
|
+
/**
|
|
228
|
+
* Overridable component slots.
|
|
229
|
+
* @default {}
|
|
230
|
+
*/
|
|
231
|
+
slots: PropTypes.object,
|
|
232
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
233
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
234
|
+
title: PropTypes.string,
|
|
235
|
+
/**
|
|
236
|
+
* The configuration of the tooltip.
|
|
237
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
238
|
+
*/
|
|
239
|
+
tooltip: PropTypes.object,
|
|
240
|
+
/**
|
|
241
|
+
* Indicate which axis to display the top of the charts.
|
|
242
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
243
|
+
* @default null
|
|
244
|
+
*/
|
|
245
|
+
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
246
|
+
/**
|
|
247
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
248
|
+
*/
|
|
249
|
+
width: PropTypes.number,
|
|
250
|
+
/**
|
|
251
|
+
* The configuration of the x-axes.
|
|
252
|
+
* If not provided, a default axis config is used.
|
|
253
|
+
* An array of [[AxisConfig]] objects.
|
|
254
|
+
*/
|
|
255
|
+
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
256
|
+
barGapRatio: PropTypes.number,
|
|
257
|
+
categoryGapRatio: PropTypes.number,
|
|
258
|
+
classes: PropTypes.object,
|
|
259
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
260
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
261
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
262
|
+
unknownColor: PropTypes.string,
|
|
263
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
264
|
+
}), PropTypes.shape({
|
|
265
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
266
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
267
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
268
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
269
|
+
}), PropTypes.shape({
|
|
270
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
271
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
272
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
273
|
+
})]),
|
|
274
|
+
data: PropTypes.array,
|
|
275
|
+
dataKey: PropTypes.string,
|
|
276
|
+
disableLine: PropTypes.bool,
|
|
277
|
+
disableTicks: PropTypes.bool,
|
|
278
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
279
|
+
fill: PropTypes.string,
|
|
280
|
+
hideTooltip: PropTypes.bool,
|
|
281
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
282
|
+
label: PropTypes.string,
|
|
283
|
+
labelStyle: PropTypes.object,
|
|
284
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
285
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
286
|
+
position: PropTypes.oneOf(['bottom', 'top']),
|
|
287
|
+
reverse: PropTypes.bool,
|
|
288
|
+
scaleType: PropTypes.oneOf(['band']),
|
|
289
|
+
slotProps: PropTypes.object,
|
|
290
|
+
slots: PropTypes.object,
|
|
291
|
+
stroke: PropTypes.string,
|
|
292
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
293
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
294
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
295
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
296
|
+
tickLabelStyle: PropTypes.object,
|
|
297
|
+
tickMaxStep: PropTypes.number,
|
|
298
|
+
tickMinStep: PropTypes.number,
|
|
299
|
+
tickNumber: PropTypes.number,
|
|
300
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
301
|
+
tickSize: PropTypes.number,
|
|
302
|
+
valueFormatter: PropTypes.func,
|
|
303
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
304
|
+
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
305
|
+
maxEnd: PropTypes.number,
|
|
306
|
+
maxSpan: PropTypes.number,
|
|
307
|
+
minSpan: PropTypes.number,
|
|
308
|
+
minStart: PropTypes.number,
|
|
309
|
+
panning: PropTypes.bool,
|
|
310
|
+
step: PropTypes.number
|
|
311
|
+
}), PropTypes.bool])
|
|
312
|
+
})).isRequired,
|
|
313
|
+
/**
|
|
314
|
+
* The configuration of the y-axes.
|
|
315
|
+
* If not provided, a default axis config is used.
|
|
316
|
+
* An array of [[AxisConfig]] objects.
|
|
317
|
+
*/
|
|
318
|
+
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
319
|
+
barGapRatio: PropTypes.number,
|
|
320
|
+
categoryGapRatio: PropTypes.number,
|
|
321
|
+
classes: PropTypes.object,
|
|
322
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
323
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
324
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
325
|
+
unknownColor: PropTypes.string,
|
|
326
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
327
|
+
}), PropTypes.shape({
|
|
328
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
329
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
330
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
331
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
332
|
+
}), PropTypes.shape({
|
|
333
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
334
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
335
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
336
|
+
})]),
|
|
337
|
+
data: PropTypes.array,
|
|
338
|
+
dataKey: PropTypes.string,
|
|
339
|
+
disableLine: PropTypes.bool,
|
|
340
|
+
disableTicks: PropTypes.bool,
|
|
341
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
342
|
+
fill: PropTypes.string,
|
|
343
|
+
hideTooltip: PropTypes.bool,
|
|
344
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
345
|
+
label: PropTypes.string,
|
|
346
|
+
labelStyle: PropTypes.object,
|
|
347
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
348
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
349
|
+
position: PropTypes.oneOf(['left', 'right']),
|
|
350
|
+
reverse: PropTypes.bool,
|
|
351
|
+
scaleType: PropTypes.oneOf(['band']),
|
|
352
|
+
slotProps: PropTypes.object,
|
|
353
|
+
slots: PropTypes.object,
|
|
354
|
+
stroke: PropTypes.string,
|
|
355
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
356
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
357
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
358
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
359
|
+
tickLabelStyle: PropTypes.object,
|
|
360
|
+
tickMaxStep: PropTypes.number,
|
|
361
|
+
tickMinStep: PropTypes.number,
|
|
362
|
+
tickNumber: PropTypes.number,
|
|
363
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
364
|
+
tickSize: PropTypes.number,
|
|
365
|
+
valueFormatter: PropTypes.func,
|
|
366
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
367
|
+
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
368
|
+
maxEnd: PropTypes.number,
|
|
369
|
+
maxSpan: PropTypes.number,
|
|
370
|
+
minSpan: PropTypes.number,
|
|
371
|
+
minStart: PropTypes.number,
|
|
372
|
+
panning: PropTypes.bool,
|
|
373
|
+
step: PropTypes.number
|
|
374
|
+
}), PropTypes.bool])
|
|
375
|
+
})).isRequired,
|
|
376
|
+
/**
|
|
377
|
+
* The configuration of the z-axes.
|
|
378
|
+
*/
|
|
379
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
380
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
381
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
382
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
383
|
+
unknownColor: PropTypes.string,
|
|
384
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
385
|
+
}), PropTypes.shape({
|
|
386
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
387
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
388
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
389
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
390
|
+
}), PropTypes.shape({
|
|
391
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
392
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
393
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
394
|
+
})]),
|
|
395
|
+
data: PropTypes.array,
|
|
396
|
+
dataKey: PropTypes.string,
|
|
397
|
+
id: PropTypes.string,
|
|
398
|
+
max: PropTypes.number,
|
|
399
|
+
min: PropTypes.number
|
|
400
|
+
}))
|
|
401
|
+
} : void 0;
|
|
402
|
+
export { Heatmap };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
|
+
export type HeatmapPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartInteractionSignature, UseChartHighlightSignature];
|
|
3
|
+
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginsSignatures>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
+
import { HeatmapClasses } from "./heatmapClasses.js";
|
|
4
|
+
export interface HeatmapItemSlots {
|
|
5
|
+
/**
|
|
6
|
+
* The component that renders the heatmap cell.
|
|
7
|
+
* @default HeatmapCell
|
|
8
|
+
*/
|
|
9
|
+
cell?: React.ElementType;
|
|
10
|
+
}
|
|
11
|
+
export interface HeatmapItemSlotProps {
|
|
12
|
+
cell?: Partial<React.ComponentPropsWithRef<'rect'>>;
|
|
13
|
+
}
|
|
14
|
+
export interface HeatmapItemProps {
|
|
15
|
+
dataIndex: number;
|
|
16
|
+
seriesId: SeriesId;
|
|
17
|
+
value: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
color: string;
|
|
23
|
+
/**
|
|
24
|
+
* The props used for each component slot.
|
|
25
|
+
* @default {}
|
|
26
|
+
*/
|
|
27
|
+
slotProps?: HeatmapItemSlotProps;
|
|
28
|
+
/**
|
|
29
|
+
* Overridable component slots.
|
|
30
|
+
* @default {}
|
|
31
|
+
*/
|
|
32
|
+
slots?: HeatmapItemSlots;
|
|
33
|
+
}
|
|
34
|
+
export interface HeatmapItemOwnerState {
|
|
35
|
+
seriesId: SeriesId;
|
|
36
|
+
dataIndex: number;
|
|
37
|
+
color: string;
|
|
38
|
+
isFaded: boolean;
|
|
39
|
+
isHighlighted: boolean;
|
|
40
|
+
classes?: Partial<HeatmapClasses>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @ignore - internal component.
|
|
44
|
+
*/
|
|
45
|
+
declare function HeatmapItem(props: HeatmapItemProps): React.JSX.Element;
|
|
46
|
+
declare namespace HeatmapItem {
|
|
47
|
+
var propTypes: any;
|
|
48
|
+
}
|
|
49
|
+
export { HeatmapItem };
|
|
@@ -0,0 +1,106 @@
|
|
|
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 getInteractionItemProps = useInteractionItemProps();
|
|
51
|
+
const {
|
|
52
|
+
isFaded,
|
|
53
|
+
isHighlighted
|
|
54
|
+
} = useItemHighlighted({
|
|
55
|
+
seriesId,
|
|
56
|
+
dataIndex
|
|
57
|
+
});
|
|
58
|
+
const ownerState = {
|
|
59
|
+
seriesId,
|
|
60
|
+
dataIndex,
|
|
61
|
+
color,
|
|
62
|
+
value,
|
|
63
|
+
isFaded,
|
|
64
|
+
isHighlighted
|
|
65
|
+
};
|
|
66
|
+
const classes = useUtilityClasses(ownerState);
|
|
67
|
+
const Cell = slots?.cell ?? HeatmapCell;
|
|
68
|
+
const cellProps = useSlotProps({
|
|
69
|
+
elementType: Cell,
|
|
70
|
+
additionalProps: _extends({}, getInteractionItemProps({
|
|
71
|
+
type: 'heatmap',
|
|
72
|
+
seriesId,
|
|
73
|
+
dataIndex
|
|
74
|
+
})),
|
|
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 };
|
|
@@ -0,0 +1,8 @@
|
|
|
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,30 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _hooks = require("@mui/x-charts/hooks");
|
|
13
|
-
var _useSeries = require("../hooks/useSeries");
|
|
14
|
-
var _HeatmapItem = require("./HeatmapItem");
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
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";
|
|
16
9
|
function HeatmapPlot(props) {
|
|
17
|
-
const xScale =
|
|
18
|
-
const yScale =
|
|
19
|
-
const colorScale =
|
|
20
|
-
const series = (
|
|
10
|
+
const xScale = useXScale();
|
|
11
|
+
const yScale = useYScale();
|
|
12
|
+
const colorScale = useZColorScale();
|
|
13
|
+
const series = useHeatmapSeriesContext();
|
|
21
14
|
const xDomain = xScale.domain();
|
|
22
15
|
const yDomain = yScale.domain();
|
|
23
16
|
if (!series || series.seriesOrder.length === 0) {
|
|
24
17
|
return null;
|
|
25
18
|
}
|
|
26
19
|
const seriesToDisplay = series.series[series.seriesOrder[0]];
|
|
27
|
-
return /*#__PURE__*/(
|
|
20
|
+
return /*#__PURE__*/_jsx("g", {
|
|
28
21
|
children: seriesToDisplay.data.map(([xIndex, yIndex, value], dataIndex) => {
|
|
29
22
|
const x = xScale(xDomain[xIndex]);
|
|
30
23
|
const y = yScale(yDomain[yIndex]);
|
|
@@ -32,7 +25,7 @@ function HeatmapPlot(props) {
|
|
|
32
25
|
if (x === undefined || y === undefined || !color) {
|
|
33
26
|
return null;
|
|
34
27
|
}
|
|
35
|
-
return /*#__PURE__*/(
|
|
28
|
+
return /*#__PURE__*/_jsx(HeatmapItem, {
|
|
36
29
|
width: xScale.bandwidth(),
|
|
37
30
|
height: yScale.bandwidth(),
|
|
38
31
|
x: x,
|
|
@@ -56,10 +49,11 @@ process.env.NODE_ENV !== "production" ? HeatmapPlot.propTypes = {
|
|
|
56
49
|
* The props used for each component slot.
|
|
57
50
|
* @default {}
|
|
58
51
|
*/
|
|
59
|
-
slotProps:
|
|
52
|
+
slotProps: PropTypes.object,
|
|
60
53
|
/**
|
|
61
54
|
* Overridable component slots.
|
|
62
55
|
* @default {}
|
|
63
56
|
*/
|
|
64
|
-
slots:
|
|
65
|
-
} : void 0;
|
|
57
|
+
slots: PropTypes.object
|
|
58
|
+
} : void 0;
|
|
59
|
+
export { HeatmapPlot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
|
|
3
|
+
export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {}
|
|
4
|
+
declare function HeatmapTooltip(props: HeatmapTooltipProps): React.JSX.Element;
|
|
5
|
+
declare namespace HeatmapTooltip {
|
|
6
|
+
var propTypes: any;
|
|
7
|
+
}
|
|
8
|
+
export { HeatmapTooltip };
|