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