@mui/x-charts-pro 8.0.0-alpha.11 → 8.0.0-alpha.13
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 +245 -244
- package/BarChartPro/BarChartPro.plugins.d.ts +3 -9
- package/BarChartPro/BarChartPro.plugins.js +9 -3
- package/BarChartPro/index.d.ts +1 -1
- package/BarChartPro/index.js +16 -1
- package/CHANGELOG.md +460 -1
- package/ChartContainerPro/ChartContainerPro.d.ts +5 -5
- package/ChartContainerPro/ChartContainerPro.js +179 -173
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +17 -1
- package/ChartContainerPro/useChartContainerProProps.d.ts +3 -3
- package/ChartContainerPro/useChartContainerProProps.js +20 -11
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +4 -4
- package/ChartDataProviderPro/ChartDataProviderPro.js +37 -30
- 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 +45 -44
- package/Heatmap/Heatmap.js +232 -241
- package/Heatmap/Heatmap.plugins.d.ts +2 -7
- package/Heatmap/Heatmap.plugins.js +8 -2
- 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 +257 -256
- package/LineChartPro/LineChartPro.plugins.d.ts +3 -9
- package/LineChartPro/LineChartPro.plugins.js +9 -3
- package/LineChartPro/index.d.ts +1 -1
- package/LineChartPro/index.js +16 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +4 -4
- package/ScatterChartPro/ScatterChartPro.js +234 -235
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -10
- package/ScatterChartPro/ScatterChartPro.plugins.js +9 -3
- 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 +450 -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 +35 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/{node → esm}/ChartDataProviderPro/ChartDataProviderPro.js +31 -36
- 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 +57 -0
- package/esm/Heatmap/Heatmap.js +387 -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 +501 -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 +395 -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 +94 -54
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +4 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -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 -7
- package/index.js +347 -36
- 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 +101 -47
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +154 -328
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +11 -10
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +42 -39
- 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 +18 -19
- 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 +25 -30
- package/modern/BarChartPro/BarChartPro.plugins.d.ts +4 -0
- package/modern/BarChartPro/index.d.ts +1 -0
- package/modern/ChartContainerPro/ChartContainerPro.d.ts +35 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +1 -1
- 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 +3 -1
- package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
- 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 +57 -0
- package/modern/Heatmap/Heatmap.js +39 -54
- package/modern/Heatmap/Heatmap.plugins.d.ts +3 -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 +25 -30
- package/modern/LineChartPro/LineChartPro.plugins.d.ts +4 -0
- package/modern/LineChartPro/index.d.ts +1 -0
- package/modern/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +26 -33
- package/modern/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -0
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +2 -2
- 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 -2
- 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 +65 -18
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +203 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +1 -7
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +53 -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 +41 -11
- 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/BarChartPro.plugins.js +0 -9
- 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/index.js +0 -16
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +0 -21
- package/node/Heatmap/Heatmap.js +0 -408
- package/node/Heatmap/Heatmap.plugins.js +0 -8
- 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/LineChartPro.plugins.js +0 -9
- package/node/LineChartPro/index.js +0 -16
- package/node/ScatterChartPro/ScatterChartPro.js +0 -408
- package/node/ScatterChartPro/ScatterChartPro.plugins.js +0 -9
- 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 -354
- 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,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartSeriesType, ChartAnyPluginSignature, ChartProviderProps } from '@mui/x-charts/internals';
|
|
3
|
+
import { ChartDataProviderProps } from '@mui/x-charts/ChartDataProvider';
|
|
4
|
+
import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
5
|
+
export type ChartDataProviderProProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartDataProviderProps<TSeries, TSignatures> & Omit<ChartProviderProps<TSeries, TSignatures>['pluginParams'], 'children'>;
|
|
6
|
+
/**
|
|
7
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
8
|
+
*
|
|
9
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
10
|
+
*
|
|
11
|
+
* Demos:
|
|
12
|
+
*
|
|
13
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
14
|
+
*
|
|
15
|
+
* API:
|
|
16
|
+
*
|
|
17
|
+
* - [ChartDataProviderPro API](https://mui.com/x/api/charts/chart-data-provider/)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```jsx
|
|
21
|
+
* <ChartDataProviderPro
|
|
22
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
23
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
24
|
+
* >
|
|
25
|
+
* <ChartsSurface>
|
|
26
|
+
* <BarPlot />
|
|
27
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
28
|
+
* </ChartsSurface>
|
|
29
|
+
* {'Custom Legend Component'}
|
|
30
|
+
* </ChartDataProviderPro>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare function ChartDataProviderPro<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>): React.JSX.Element;
|
|
34
|
+
declare namespace ChartDataProviderPro {
|
|
35
|
+
var propTypes: any;
|
|
36
|
+
}
|
|
37
|
+
export { ChartDataProviderPro };
|
|
@@ -32,7 +32,7 @@ const packageIdentifier = 'x-charts-pro';
|
|
|
32
32
|
* >
|
|
33
33
|
* <ChartsSurface>
|
|
34
34
|
* <BarPlot />
|
|
35
|
-
* <ChartsXAxis
|
|
35
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
36
36
|
* </ChartsSurface>
|
|
37
37
|
* {'Custom Legend Component'}
|
|
38
38
|
* </ChartDataProviderPro>
|
|
@@ -82,7 +82,8 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
82
82
|
/**
|
|
83
83
|
* The margin between the SVG and the drawing area.
|
|
84
84
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
85
|
-
*
|
|
85
|
+
*
|
|
86
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
86
87
|
*/
|
|
87
88
|
margin: PropTypes.any,
|
|
88
89
|
/**
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartAnyPluginSignature, ChartSeriesType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { ChartDataProviderProProps } from './ChartDataProviderPro';
|
|
3
|
+
import type { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
4
|
+
export declare const useChartDataProviderProProps: <TSeries extends ChartSeriesType = keyof import("@mui/x-charts/internals").ChartsSeriesConfig, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>) => {
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
animationProviderProps: Omit<import("@mui/x-charts/internals").AnimationProviderProps, "children">;
|
|
7
|
+
chartProviderProps: Omit<import("@mui/x-charts/internals").ChartProviderProps<TSeries, TSignatures>, "children">;
|
|
8
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
4
|
+
import { ChartsTooltipProps } from '@mui/x-charts/ChartsTooltip';
|
|
5
|
+
import { ChartsAxisSlots, ChartsAxisSlotProps, ChartsXAxisProps, ChartsYAxisProps, AxisConfig } from '@mui/x-charts/internals';
|
|
6
|
+
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
7
|
+
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
8
|
+
import { HeatmapSeriesType } from "../models/seriesType/heatmap.js";
|
|
9
|
+
import { HeatmapTooltipProps } from "./HeatmapTooltip.js";
|
|
10
|
+
import { HeatmapItemSlotProps, HeatmapItemSlots } from "./HeatmapItem.js";
|
|
11
|
+
import { HeatmapPluginsSignatures } from "./Heatmap.plugins.js";
|
|
12
|
+
export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, HeatmapItemSlots {
|
|
13
|
+
/**
|
|
14
|
+
* Custom component for the tooltip popper.
|
|
15
|
+
* @default ChartsTooltipRoot
|
|
16
|
+
*/
|
|
17
|
+
tooltip?: React.ElementType<HeatmapTooltipProps>;
|
|
18
|
+
}
|
|
19
|
+
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
20
|
+
tooltip?: Partial<HeatmapTooltipProps>;
|
|
21
|
+
}
|
|
22
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
23
|
+
/**
|
|
24
|
+
* The configuration of the x-axes.
|
|
25
|
+
* If not provided, a default axis config is used.
|
|
26
|
+
* An array of [[AxisConfig]] objects.
|
|
27
|
+
*/
|
|
28
|
+
xAxis: Readonly<MakeOptional<AxisConfig<'band', any, ChartsXAxisProps>, 'id' | 'scaleType'>[]>;
|
|
29
|
+
/**
|
|
30
|
+
* The configuration of the y-axes.
|
|
31
|
+
* If not provided, a default axis config is used.
|
|
32
|
+
* An array of [[AxisConfig]] objects.
|
|
33
|
+
*/
|
|
34
|
+
yAxis: Readonly<MakeOptional<AxisConfig<'band', any, ChartsYAxisProps>, 'id' | 'scaleType'>[]>;
|
|
35
|
+
/**
|
|
36
|
+
* The series to display in the bar chart.
|
|
37
|
+
* An array of [[HeatmapSeriesType]] objects.
|
|
38
|
+
*/
|
|
39
|
+
series: Readonly<MakeOptional<HeatmapSeriesType, 'type'>[]>;
|
|
40
|
+
/**
|
|
41
|
+
* The configuration of the tooltip.
|
|
42
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
43
|
+
*/
|
|
44
|
+
tooltip?: ChartsTooltipProps;
|
|
45
|
+
/**
|
|
46
|
+
* Overridable component slots.
|
|
47
|
+
* @default {}
|
|
48
|
+
*/
|
|
49
|
+
slots?: HeatmapSlots;
|
|
50
|
+
/**
|
|
51
|
+
* The props used for each component slot.
|
|
52
|
+
* @default {}
|
|
53
|
+
*/
|
|
54
|
+
slotProps?: HeatmapSlotProps;
|
|
55
|
+
}
|
|
56
|
+
declare const Heatmap: React.ForwardRefExoticComponent<HeatmapProps & React.RefAttributes<SVGSVGElement>>;
|
|
57
|
+
export { Heatmap };
|
|
@@ -9,17 +9,28 @@ import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
|
9
9
|
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
10
10
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
11
11
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
12
|
+
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
|
|
12
13
|
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
13
14
|
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
14
|
-
import {
|
|
15
|
+
import { seriesConfig as heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
15
16
|
import { HeatmapTooltip } from "./HeatmapTooltip.js";
|
|
16
17
|
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
19
20
|
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
20
21
|
const seriesConfig = {
|
|
21
|
-
heatmap:
|
|
22
|
+
heatmap: heatmapSeriesConfig
|
|
22
23
|
};
|
|
24
|
+
function getDefaultDataForAxis(series, dimension) {
|
|
25
|
+
if (series?.[0]?.data === undefined || series[0].data.length === 0) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
return Array.from({
|
|
29
|
+
length: Math.max(...series[0].data.map(dataPoint => dataPoint[dimension])) + 1
|
|
30
|
+
}, (_, index) => index);
|
|
31
|
+
}
|
|
32
|
+
const getDefaultDataForXAxis = series => getDefaultDataForAxis(series, 0);
|
|
33
|
+
const getDefaultDataForYAxis = series => getDefaultDataForAxis(series, 1);
|
|
23
34
|
const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
24
35
|
const props = useThemeProps({
|
|
25
36
|
props: inProps,
|
|
@@ -36,10 +47,6 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
36
47
|
colors,
|
|
37
48
|
dataset,
|
|
38
49
|
sx,
|
|
39
|
-
topAxis,
|
|
40
|
-
leftAxis,
|
|
41
|
-
rightAxis,
|
|
42
|
-
bottomAxis,
|
|
43
50
|
onAxisClick,
|
|
44
51
|
children,
|
|
45
52
|
slots,
|
|
@@ -50,14 +57,22 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
50
57
|
} = props;
|
|
51
58
|
const id = useId();
|
|
52
59
|
const clipPathId = `${id}-clip-path`;
|
|
53
|
-
const defaultizedXAxis = React.useMemo(() => xAxis.
|
|
60
|
+
const defaultizedXAxis = React.useMemo(() => (xAxis && xAxis.length > 0 ? xAxis : [{
|
|
61
|
+
id: DEFAULT_X_AXIS_KEY
|
|
62
|
+
}]).map(axis => _extends({
|
|
54
63
|
scaleType: 'band',
|
|
55
64
|
categoryGapRatio: 0
|
|
56
|
-
}, axis
|
|
57
|
-
|
|
65
|
+
}, axis, {
|
|
66
|
+
data: axis.data ?? getDefaultDataForXAxis(series)
|
|
67
|
+
})), [series, xAxis]);
|
|
68
|
+
const defaultizedYAxis = React.useMemo(() => (yAxis && yAxis.length > 0 ? yAxis : [{
|
|
69
|
+
id: DEFAULT_Y_AXIS_KEY
|
|
70
|
+
}]).map(axis => _extends({
|
|
58
71
|
scaleType: 'band',
|
|
59
72
|
categoryGapRatio: 0
|
|
60
|
-
}, axis
|
|
73
|
+
}, axis, {
|
|
74
|
+
data: axis.data ?? getDefaultDataForYAxis(series)
|
|
75
|
+
})), [series, yAxis]);
|
|
61
76
|
const defaultizedZAxis = React.useMemo(() => zAxis ?? [{
|
|
62
77
|
colorMap: {
|
|
63
78
|
type: 'continuous',
|
|
@@ -98,10 +113,6 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
98
113
|
slotProps: slotProps
|
|
99
114
|
})]
|
|
100
115
|
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
101
|
-
topAxis: topAxis,
|
|
102
|
-
leftAxis: leftAxis,
|
|
103
|
-
rightAxis: rightAxis,
|
|
104
|
-
bottomAxis: bottomAxis,
|
|
105
116
|
slots: slots,
|
|
106
117
|
slotProps: slotProps
|
|
107
118
|
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
@@ -115,16 +126,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
115
126
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
116
127
|
// ----------------------------------------------------------------------
|
|
117
128
|
apiRef: PropTypes.shape({
|
|
118
|
-
current: PropTypes.
|
|
119
|
-
setZoomData: PropTypes.func.isRequired
|
|
120
|
-
})
|
|
129
|
+
current: PropTypes.object
|
|
121
130
|
}),
|
|
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
131
|
children: PropTypes.node,
|
|
129
132
|
className: PropTypes.string,
|
|
130
133
|
/**
|
|
@@ -160,20 +163,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
160
163
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
161
164
|
*/
|
|
162
165
|
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
166
|
/**
|
|
178
167
|
* If `true`, a loading overlay is displayed.
|
|
179
168
|
* @default false
|
|
@@ -182,14 +171,15 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
182
171
|
/**
|
|
183
172
|
* The margin between the SVG and the drawing area.
|
|
184
173
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
185
|
-
*
|
|
174
|
+
*
|
|
175
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
186
176
|
*/
|
|
187
|
-
margin: PropTypes.shape({
|
|
177
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
188
178
|
bottom: PropTypes.number,
|
|
189
179
|
left: PropTypes.number,
|
|
190
180
|
right: PropTypes.number,
|
|
191
181
|
top: PropTypes.number
|
|
192
|
-
}),
|
|
182
|
+
})]),
|
|
193
183
|
/**
|
|
194
184
|
* The function called for onClick events.
|
|
195
185
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -203,12 +193,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
203
193
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
204
194
|
*/
|
|
205
195
|
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
196
|
/**
|
|
213
197
|
* The series to display in the bar chart.
|
|
214
198
|
* An array of [[HeatmapSeriesType]] objects.
|
|
@@ -237,12 +221,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
237
221
|
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
238
222
|
*/
|
|
239
223
|
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
224
|
/**
|
|
247
225
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
248
226
|
*/
|
|
@@ -253,6 +231,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
253
231
|
* An array of [[AxisConfig]] objects.
|
|
254
232
|
*/
|
|
255
233
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
234
|
+
axis: PropTypes.oneOf(['x']),
|
|
256
235
|
barGapRatio: PropTypes.number,
|
|
257
236
|
categoryGapRatio: PropTypes.number,
|
|
258
237
|
classes: PropTypes.object,
|
|
@@ -277,13 +256,15 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
277
256
|
disableTicks: PropTypes.bool,
|
|
278
257
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
279
258
|
fill: PropTypes.string,
|
|
259
|
+
height: PropTypes.number,
|
|
280
260
|
hideTooltip: PropTypes.bool,
|
|
281
261
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
282
262
|
label: PropTypes.string,
|
|
283
263
|
labelStyle: PropTypes.object,
|
|
284
264
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
285
265
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
286
|
-
|
|
266
|
+
offset: PropTypes.number,
|
|
267
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
287
268
|
reverse: PropTypes.bool,
|
|
288
269
|
scaleType: PropTypes.oneOf(['band']),
|
|
289
270
|
slotProps: PropTypes.object,
|
|
@@ -292,6 +273,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
292
273
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
293
274
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
294
275
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
276
|
+
tickLabelMinGap: PropTypes.number,
|
|
295
277
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
296
278
|
tickLabelStyle: PropTypes.object,
|
|
297
279
|
tickMaxStep: PropTypes.number,
|
|
@@ -316,6 +298,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
316
298
|
* An array of [[AxisConfig]] objects.
|
|
317
299
|
*/
|
|
318
300
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
301
|
+
axis: PropTypes.oneOf(['y']),
|
|
319
302
|
barGapRatio: PropTypes.number,
|
|
320
303
|
categoryGapRatio: PropTypes.number,
|
|
321
304
|
classes: PropTypes.object,
|
|
@@ -346,7 +329,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
346
329
|
labelStyle: PropTypes.object,
|
|
347
330
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
348
331
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
349
|
-
|
|
332
|
+
offset: PropTypes.number,
|
|
333
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
350
334
|
reverse: PropTypes.bool,
|
|
351
335
|
scaleType: PropTypes.oneOf(['band']),
|
|
352
336
|
slotProps: PropTypes.object,
|
|
@@ -363,6 +347,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
363
347
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
364
348
|
tickSize: PropTypes.number,
|
|
365
349
|
valueFormatter: PropTypes.func,
|
|
350
|
+
width: PropTypes.number,
|
|
366
351
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
367
352
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
368
353
|
maxEnd: PropTypes.number,
|
|
@@ -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,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 };
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useXScale, useYScale, useZColorScale } from '@mui/x-charts/hooks';
|
|
6
|
-
import {
|
|
6
|
+
import { useHeatmapSeriesContext } from "../hooks/useHeatmapSeries.js";
|
|
7
7
|
import { HeatmapItem } from "./HeatmapItem.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
function HeatmapPlot(props) {
|
|
10
10
|
const xScale = useXScale();
|
|
11
11
|
const yScale = useYScale();
|
|
12
12
|
const colorScale = useZColorScale();
|
|
13
|
-
const series =
|
|
13
|
+
const series = useHeatmapSeriesContext();
|
|
14
14
|
const xDomain = xScale.domain();
|
|
15
15
|
const yDomain = yScale.domain();
|
|
16
16
|
if (!series || series.seriesOrder.length === 0) {
|
|
@@ -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 };
|
|
@@ -9,7 +9,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
9
9
|
import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip, getChartsTooltipUtilityClass, ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
|
|
10
10
|
import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
|
|
11
11
|
import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
|
|
12
|
-
import {
|
|
12
|
+
import { useHeatmapSeriesContext } from "../hooks/useHeatmapSeries.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const useUtilityClasses = ownerState => {
|
|
15
15
|
const {
|
|
@@ -34,7 +34,7 @@ function DefaultHeatmapTooltipContent(props) {
|
|
|
34
34
|
} = props;
|
|
35
35
|
const xAxis = useXAxis();
|
|
36
36
|
const yAxis = useYAxis();
|
|
37
|
-
const heatmapSeries =
|
|
37
|
+
const heatmapSeries = useHeatmapSeriesContext();
|
|
38
38
|
const tooltipData = useItemTooltip();
|
|
39
39
|
if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
|
|
40
40
|
return null;
|
|
@@ -52,10 +52,12 @@ function DefaultHeatmapTooltipContent(props) {
|
|
|
52
52
|
} = tooltipData;
|
|
53
53
|
const [xIndex, yIndex] = value;
|
|
54
54
|
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
55
|
-
location: 'tooltip'
|
|
55
|
+
location: 'tooltip',
|
|
56
|
+
scale: xAxis.scale
|
|
56
57
|
}) ?? xAxis.data[xIndex].toLocaleString();
|
|
57
58
|
const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
|
|
58
|
-
location: 'tooltip'
|
|
59
|
+
location: 'tooltip',
|
|
60
|
+
scale: yAxis.scale
|
|
59
61
|
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
60
62
|
const formattedValue = series[seriesId].valueFormatter(value, {
|
|
61
63
|
dataIndex: identifier.dataIndex
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface HeatmapClasses {
|
|
2
|
+
/** Styles applied to the heatmap cells. */
|
|
3
|
+
cell: string;
|
|
4
|
+
/** Styles applied to the cell element if highlighted. */
|
|
5
|
+
highlighted: string;
|
|
6
|
+
/** Styles applied to the cell element if faded. */
|
|
7
|
+
faded: string;
|
|
8
|
+
}
|
|
9
|
+
export type HeatmapClassKey = keyof HeatmapClasses;
|
|
10
|
+
export declare function getHeatmapUtilityClass(slot: string): string;
|
|
11
|
+
export declare const heatmapClasses: HeatmapClasses;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getBaseExtremum } from "./extremums.js";
|
|
2
|
-
import
|
|
2
|
+
import seriesProcessor from "./seriesProcessor.js";
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
import tooltipGetter from "./tooltip.js";
|
|
5
|
-
export const
|
|
6
|
-
seriesProcessor
|
|
5
|
+
export const seriesConfig = {
|
|
6
|
+
seriesProcessor,
|
|
7
7
|
colorProcessor: getColor,
|
|
8
8
|
legendGetter: () => [],
|
|
9
9
|
tooltipGetter,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
const
|
|
2
|
+
const seriesProcessor = params => {
|
|
3
3
|
const {
|
|
4
4
|
series,
|
|
5
5
|
seriesOrder
|
|
@@ -18,4 +18,4 @@ const formatter = params => {
|
|
|
18
18
|
seriesOrder
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
export default
|
|
21
|
+
export default seriesProcessor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { LineChartProps } from '@mui/x-charts/LineChart';
|
|
3
|
+
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
4
|
+
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef'>, Omit<ChartContainerProProps<'line'>, 'series' | 'plugins' | 'seriesConfig'> {}
|
|
5
|
+
/**
|
|
6
|
+
* Demos:
|
|
7
|
+
*
|
|
8
|
+
* - [Lines](https://mui.com/x/react-charts/lines/)
|
|
9
|
+
* - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
|
|
10
|
+
*
|
|
11
|
+
* API:
|
|
12
|
+
*
|
|
13
|
+
* - [LineChart API](https://mui.com/x/api/charts/line-chart/)
|
|
14
|
+
*/
|
|
15
|
+
declare const LineChartPro: React.ForwardRefExoticComponent<LineChartProProps & React.RefAttributes<SVGSVGElement>>;
|
|
16
|
+
export { LineChartPro };
|