@mui/x-charts-pro 8.14.1 → 8.16.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 +19 -2
- package/BarChartPro/BarChartPro.plugins.d.ts +2 -2
- package/BarChartPro/BarChartPro.plugins.js +1 -1
- package/CHANGELOG.md +207 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartsBrushOverlay/index.d.ts +1 -0
- package/ChartsBrushOverlay/index.js +16 -0
- package/FunnelChart/FunnelPlot.js +3 -23
- package/FunnelChart/coordinateMapper.d.ts +3 -0
- package/FunnelChart/coordinateMapper.js +18 -0
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.js +1 -2
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +5 -6
- package/FunnelChart/seriesConfig/index.js +2 -0
- package/FunnelChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/FunnelChart/seriesConfig/tooltipPosition.js +62 -0
- package/Heatmap/Heatmap.plugins.d.ts +1 -1
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.js +9 -0
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +3 -2
- package/Heatmap/seriesConfig/index.js +2 -0
- package/Heatmap/seriesConfig/tooltipPosition.d.ts +3 -0
- package/Heatmap/seriesConfig/tooltipPosition.js +57 -0
- package/LineChartPro/LineChartPro.js +19 -2
- package/LineChartPro/LineChartPro.plugins.d.ts +2 -2
- package/LineChartPro/LineChartPro.plugins.js +1 -1
- package/RadarChartPro/RadarChartPro.plugins.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/SankeyChart/SankeyTooltip/SankeyTooltip.js +9 -0
- package/ScatterChartPro/ScatterChartPro.js +19 -2
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.plugins.js +1 -1
- package/esm/BarChartPro/BarChartPro.js +19 -2
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +2 -2
- package/esm/BarChartPro/BarChartPro.plugins.js +2 -2
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartsBrushOverlay/index.d.ts +1 -0
- package/esm/ChartsBrushOverlay/index.js +2 -0
- package/esm/FunnelChart/FunnelPlot.js +4 -24
- package/esm/FunnelChart/coordinateMapper.d.ts +3 -0
- package/esm/FunnelChart/coordinateMapper.js +11 -0
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.js +1 -2
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +5 -6
- package/esm/FunnelChart/seriesConfig/index.js +2 -0
- package/esm/FunnelChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/tooltipPosition.js +56 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +1 -1
- package/esm/Heatmap/Heatmap.plugins.js +1 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.js +9 -0
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +3 -2
- package/esm/Heatmap/seriesConfig/index.js +2 -0
- package/esm/Heatmap/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/tooltipPosition.js +51 -0
- package/esm/LineChartPro/LineChartPro.js +19 -2
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +2 -2
- package/esm/LineChartPro/LineChartPro.plugins.js +2 -2
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.js +9 -0
- package/esm/ScatterChartPro/ScatterChartPro.js +19 -2
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -2
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +2 -2
- package/esm/index.js +1 -1
- package/esm/internals/plugins/allPlugins.d.ts +5 -5
- package/esm/internals/plugins/allPlugins.js +3 -3
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +11 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.js +3 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +11 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.js +8 -5
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +100 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +57 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +2 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +4 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +2 -2
- package/esm/tests/constants.js +1 -0
- package/index.js +1 -1
- package/internals/plugins/allPlugins.d.ts +5 -5
- package/internals/plugins/allPlugins.js +2 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +11 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.js +3 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +11 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.js +8 -5
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +107 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +64 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.js +4 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +2 -2
- package/package.json +6 -6
- package/tests/constants.js +7 -0
|
@@ -23,6 +23,7 @@ var _ChartsClipPath = require("@mui/x-charts/ChartsClipPath");
|
|
|
23
23
|
var _ChartsSurface = require("@mui/x-charts/ChartsSurface");
|
|
24
24
|
var _internals = require("@mui/x-charts/internals");
|
|
25
25
|
var _ChartsWrapper = require("@mui/x-charts/ChartsWrapper");
|
|
26
|
+
var _ChartsBrushOverlay = require("@mui/x-charts/ChartsBrushOverlay");
|
|
26
27
|
var _ChartZoomSlider = require("../ChartZoomSlider");
|
|
27
28
|
var _ChartsToolbarPro = require("../ChartsToolbarPro");
|
|
28
29
|
var _useChartContainerProProps = require("../ChartContainerPro/useChartContainerProProps");
|
|
@@ -89,7 +90,7 @@ const LineChartPro = exports.LineChartPro = /*#__PURE__*/React.forwardRef(functi
|
|
|
89
90
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartZoomSlider.ChartZoomSlider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
90
91
|
"data-drawing-container": true,
|
|
91
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.MarkPlot, (0, _extends2.default)({}, markPlotProps))
|
|
92
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, (0, _extends2.default)({}, lineHighlightPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
|
93
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, (0, _extends2.default)({}, lineHighlightPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsBrushOverlay.ChartsBrushOverlay, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
|
93
94
|
})), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
|
|
94
95
|
}))
|
|
95
96
|
}));
|
|
@@ -117,6 +118,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
117
118
|
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
118
119
|
y: _propTypes.default.oneOf(['band', 'line', 'none'])
|
|
119
120
|
}),
|
|
121
|
+
/**
|
|
122
|
+
* Configuration for the brush interaction.
|
|
123
|
+
*/
|
|
124
|
+
brushConfig: _propTypes.default.shape({
|
|
125
|
+
enabled: _propTypes.default.bool,
|
|
126
|
+
preventHighlight: _propTypes.default.bool,
|
|
127
|
+
preventTooltip: _propTypes.default.bool
|
|
128
|
+
}),
|
|
120
129
|
children: _propTypes.default.node,
|
|
121
130
|
className: _propTypes.default.string,
|
|
122
131
|
/**
|
|
@@ -1448,7 +1457,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1448
1457
|
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1449
1458
|
type: _propTypes.default.oneOf(['pressAndDrag']).isRequired
|
|
1450
1459
|
})]).isRequired),
|
|
1451
|
-
zoom: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf(['pinch', 'tapAndDrag', 'wheel']), _propTypes.default.shape({
|
|
1460
|
+
zoom: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), _propTypes.default.shape({
|
|
1452
1461
|
pointerMode: _propTypes.default.any,
|
|
1453
1462
|
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1454
1463
|
type: _propTypes.default.oneOf(['wheel']).isRequired
|
|
@@ -1460,6 +1469,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1460
1469
|
pointerMode: _propTypes.default.oneOf(['mouse', 'touch']),
|
|
1461
1470
|
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1462
1471
|
type: _propTypes.default.oneOf(['tapAndDrag']).isRequired
|
|
1472
|
+
}), _propTypes.default.shape({
|
|
1473
|
+
pointerMode: _propTypes.default.oneOf(['mouse', 'touch']),
|
|
1474
|
+
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1475
|
+
type: _propTypes.default.oneOf(['doubleTapReset']).isRequired
|
|
1476
|
+
}), _propTypes.default.shape({
|
|
1477
|
+
pointerMode: _propTypes.default.any,
|
|
1478
|
+
requiredKeys: _propTypes.default.array,
|
|
1479
|
+
type: _propTypes.default.oneOf(['brush']).isRequired
|
|
1463
1480
|
})]).isRequired)
|
|
1464
1481
|
})
|
|
1465
1482
|
} : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
1
|
+
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type LineChartProPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>,
|
|
4
|
+
export type LineChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'line'>, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const LINE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<LineChartProPluginSignatures>;
|
|
@@ -7,4 +7,4 @@ exports.LINE_CHART_PRO_PLUGINS = void 0;
|
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
9
|
var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
10
|
-
const LINE_CHART_PRO_PLUGINS = exports.LINE_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.
|
|
10
|
+
const LINE_CHART_PRO_PLUGINS = exports.LINE_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartBrush, _internals.useChartInteraction, _internals.useChartCartesianAxis, _internals.useChartHighlight, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type RadarChartProPluginSignatures = [
|
|
3
|
+
export type RadarChartProPluginSignatures = [UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
4
|
export declare const RADAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<RadarChartProPluginSignatures>;
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RADAR_CHART_PRO_PLUGINS = void 0;
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
|
-
const RADAR_CHART_PRO_PLUGINS = exports.RADAR_CHART_PRO_PLUGINS = [_internals.
|
|
9
|
+
const RADAR_CHART_PRO_PLUGINS = exports.RADAR_CHART_PRO_PLUGINS = [_internals.useChartInteraction, _internals.useChartPolarAxis, _internals.useChartHighlight, _useChartProExport.useChartProExport];
|
|
@@ -30,6 +30,11 @@ process.env.NODE_ENV !== "production" ? SankeyTooltip.propTypes = {
|
|
|
30
30
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
31
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
32
|
// ----------------------------------------------------------------------
|
|
33
|
+
/**
|
|
34
|
+
* Determine if the tooltip should be placed on the pointer location or on the node.
|
|
35
|
+
* @default 'pointer'
|
|
36
|
+
*/
|
|
37
|
+
anchor: _propTypes.default.oneOf(['node', 'pointer']),
|
|
33
38
|
/**
|
|
34
39
|
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
35
40
|
* or a function that returns either.
|
|
@@ -178,6 +183,10 @@ process.env.NODE_ENV !== "production" ? SankeyTooltip.propTypes = {
|
|
|
178
183
|
update: _propTypes.default.func.isRequired
|
|
179
184
|
})
|
|
180
185
|
})]),
|
|
186
|
+
/**
|
|
187
|
+
* Determines the tooltip position relatively to the anchor.
|
|
188
|
+
*/
|
|
189
|
+
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
181
190
|
/**
|
|
182
191
|
* The props used for each slot inside the Popper.
|
|
183
192
|
* @default {}
|
|
@@ -22,6 +22,7 @@ var _ChartsAxisHighlight = require("@mui/x-charts/ChartsAxisHighlight");
|
|
|
22
22
|
var _ChartsTooltip = require("@mui/x-charts/ChartsTooltip");
|
|
23
23
|
var _internals = require("@mui/x-charts/internals");
|
|
24
24
|
var _ChartsWrapper = require("@mui/x-charts/ChartsWrapper");
|
|
25
|
+
var _ChartsBrushOverlay = require("@mui/x-charts/ChartsBrushOverlay");
|
|
25
26
|
var _ChartZoomSlider = require("../ChartZoomSlider");
|
|
26
27
|
var _ChartsToolbarPro = require("../ChartsToolbarPro");
|
|
27
28
|
var _useChartContainerProProps = require("../ChartContainerPro/useChartContainerProProps");
|
|
@@ -81,7 +82,7 @@ const ScatterChartPro = exports.ScatterChartPro = /*#__PURE__*/React.forwardRef(
|
|
|
81
82
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartZoomSlider.ChartZoomSlider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
82
83
|
"data-drawing-container": true,
|
|
83
84
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScatterChart.ScatterPlot, (0, _extends2.default)({}, scatterPlotProps))
|
|
84
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), children]
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsBrushOverlay.ChartsBrushOverlay, {}), children]
|
|
85
86
|
})), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({
|
|
86
87
|
trigger: "item"
|
|
87
88
|
}, props.slotProps?.tooltip))]
|
|
@@ -111,6 +112,14 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
111
112
|
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
112
113
|
y: _propTypes.default.oneOf(['band', 'line', 'none'])
|
|
113
114
|
}),
|
|
115
|
+
/**
|
|
116
|
+
* Configuration for the brush interaction.
|
|
117
|
+
*/
|
|
118
|
+
brushConfig: _propTypes.default.shape({
|
|
119
|
+
enabled: _propTypes.default.bool,
|
|
120
|
+
preventHighlight: _propTypes.default.bool,
|
|
121
|
+
preventTooltip: _propTypes.default.bool
|
|
122
|
+
}),
|
|
114
123
|
children: _propTypes.default.node,
|
|
115
124
|
className: _propTypes.default.string,
|
|
116
125
|
/**
|
|
@@ -1430,7 +1439,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1430
1439
|
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1431
1440
|
type: _propTypes.default.oneOf(['pressAndDrag']).isRequired
|
|
1432
1441
|
})]).isRequired),
|
|
1433
|
-
zoom: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf(['pinch', 'tapAndDrag', 'wheel']), _propTypes.default.shape({
|
|
1442
|
+
zoom: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), _propTypes.default.shape({
|
|
1434
1443
|
pointerMode: _propTypes.default.any,
|
|
1435
1444
|
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1436
1445
|
type: _propTypes.default.oneOf(['wheel']).isRequired
|
|
@@ -1442,6 +1451,14 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1442
1451
|
pointerMode: _propTypes.default.oneOf(['mouse', 'touch']),
|
|
1443
1452
|
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1444
1453
|
type: _propTypes.default.oneOf(['tapAndDrag']).isRequired
|
|
1454
|
+
}), _propTypes.default.shape({
|
|
1455
|
+
pointerMode: _propTypes.default.oneOf(['mouse', 'touch']),
|
|
1456
|
+
requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
1457
|
+
type: _propTypes.default.oneOf(['doubleTapReset']).isRequired
|
|
1458
|
+
}), _propTypes.default.shape({
|
|
1459
|
+
pointerMode: _propTypes.default.any,
|
|
1460
|
+
requiredKeys: _propTypes.default.array,
|
|
1461
|
+
type: _propTypes.default.oneOf(['brush']).isRequired
|
|
1445
1462
|
})]).isRequired)
|
|
1446
1463
|
})
|
|
1447
1464
|
} : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
1
|
+
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type ScatterChartProPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>,
|
|
4
|
+
export type ScatterChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginSignatures>;
|
|
@@ -7,4 +7,4 @@ exports.SCATTER_CHART_PRO_PLUGINS = void 0;
|
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
9
|
var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
10
|
-
const SCATTER_CHART_PRO_PLUGINS = exports.SCATTER_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.
|
|
10
|
+
const SCATTER_CHART_PRO_PLUGINS = exports.SCATTER_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartBrush, _internals.useChartInteraction, _internals.useChartCartesianAxis, _internals.useChartHighlight, _internals.useChartClosestPoint, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
|
|
@@ -17,6 +17,7 @@ import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
|
17
17
|
import { useBarChartProps } from '@mui/x-charts/internals';
|
|
18
18
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
19
19
|
import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
|
|
20
|
+
import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay';
|
|
20
21
|
import { ChartZoomSlider } from "../ChartZoomSlider/index.js";
|
|
21
22
|
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.js";
|
|
22
23
|
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
@@ -77,7 +78,7 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
77
78
|
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
78
79
|
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
79
80
|
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
80
|
-
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
81
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsBrushOverlay, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
81
82
|
})), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
|
|
82
83
|
}))
|
|
83
84
|
}));
|
|
@@ -118,6 +119,14 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
118
119
|
* Defines the border radius of the bar element.
|
|
119
120
|
*/
|
|
120
121
|
borderRadius: PropTypes.number,
|
|
122
|
+
/**
|
|
123
|
+
* Configuration for the brush interaction.
|
|
124
|
+
*/
|
|
125
|
+
brushConfig: PropTypes.shape({
|
|
126
|
+
enabled: PropTypes.bool,
|
|
127
|
+
preventHighlight: PropTypes.bool,
|
|
128
|
+
preventTooltip: PropTypes.bool
|
|
129
|
+
}),
|
|
121
130
|
children: PropTypes.node,
|
|
122
131
|
className: PropTypes.string,
|
|
123
132
|
/**
|
|
@@ -1438,7 +1447,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1438
1447
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1439
1448
|
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
1440
1449
|
})]).isRequired),
|
|
1441
|
-
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1450
|
+
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1442
1451
|
pointerMode: PropTypes.any,
|
|
1443
1452
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1444
1453
|
type: PropTypes.oneOf(['wheel']).isRequired
|
|
@@ -1450,6 +1459,14 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1450
1459
|
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1451
1460
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1452
1461
|
type: PropTypes.oneOf(['tapAndDrag']).isRequired
|
|
1462
|
+
}), PropTypes.shape({
|
|
1463
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1464
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1465
|
+
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
1466
|
+
}), PropTypes.shape({
|
|
1467
|
+
pointerMode: PropTypes.any,
|
|
1468
|
+
requiredKeys: PropTypes.array,
|
|
1469
|
+
type: PropTypes.oneOf(['brush']).isRequired
|
|
1453
1470
|
})]).isRequired)
|
|
1454
1471
|
})
|
|
1455
1472
|
} : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
1
|
+
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type BarChartProPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>,
|
|
4
|
+
export type BarChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'bar'>, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const BAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<BarChartProPluginSignatures>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation } from '@mui/x-charts/internals';
|
|
1
|
+
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation, useChartBrush } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export const BAR_CHART_PRO_PLUGINS = [useChartZAxis,
|
|
4
|
+
export const BAR_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartKeyboardNavigation, useChartProZoom, useChartProExport];
|
|
@@ -11,7 +11,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
|
11
11
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
12
12
|
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const releaseInfo = "
|
|
14
|
+
const releaseInfo = "MTc2MTY5NjAwMDAwMA==";
|
|
15
15
|
const packageIdentifier = 'x-charts-pro';
|
|
16
16
|
/**
|
|
17
17
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsBrushOverlay';
|
|
@@ -4,13 +4,14 @@ const _excluded = ["onItemClick"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
|
|
7
|
-
import { cartesianSeriesTypes, useSelector, useStore
|
|
7
|
+
import { cartesianSeriesTypes, useSelector, useStore } from '@mui/x-charts/internals';
|
|
8
8
|
import { FunnelSection } from "./FunnelSection.js";
|
|
9
9
|
import { alignLabel, positionLabel } from "./labelUtils.js";
|
|
10
10
|
import { useFunnelSeriesContext } from "../hooks/useFunnelSeries.js";
|
|
11
11
|
import { getFunnelCurve } from "./curves/index.js";
|
|
12
12
|
import { FunnelSectionLabel } from "./FunnelSectionLabel.js";
|
|
13
13
|
import { selectorChartXAxis, selectorChartYAxis, selectorFunnelGap } from "./funnelAxisPlugin/useChartFunnelAxisRendering.selectors.js";
|
|
14
|
+
import { createPositionGetter } from "./coordinateMapper.js";
|
|
14
15
|
import { createElement as _createElement } from "react";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
cartesianSeriesTypes.addType('funnel');
|
|
@@ -43,31 +44,10 @@ const useAggregatedData = () => {
|
|
|
43
44
|
const yAxisId = currentSeries.yAxisId ?? defaultYAxisId;
|
|
44
45
|
const valueFormatter = currentSeries.valueFormatter;
|
|
45
46
|
const baseScaleConfig = isHorizontal ? xAxis[xAxisId] : yAxis[yAxisId];
|
|
46
|
-
const isXAxisBand = xAxis[xAxisId].scaleType === 'band';
|
|
47
|
-
const isYAxisBand = yAxis[yAxisId].scaleType === 'band';
|
|
48
|
-
const bandWidth = (isXAxisBand || isYAxisBand) && baseScaleConfig.scale?.bandwidth() || 0;
|
|
49
47
|
const xScale = xAxis[xAxisId].scale;
|
|
50
48
|
const yScale = yAxis[yAxisId].scale;
|
|
51
|
-
const xPosition = (
|
|
52
|
-
|
|
53
|
-
const position = xScale(bandIdentifier);
|
|
54
|
-
return useBand ? position + bandWidth : position;
|
|
55
|
-
}
|
|
56
|
-
if (isHorizontal) {
|
|
57
|
-
return xScale(value + (stackOffset || 0)) + bandIndex * gap;
|
|
58
|
-
}
|
|
59
|
-
return xScale(value);
|
|
60
|
-
};
|
|
61
|
-
const yPosition = (value, bandIndex, bandIdentifier, stackOffset, useBand) => {
|
|
62
|
-
if (isOrdinalScale(yScale)) {
|
|
63
|
-
const position = yScale(bandIdentifier);
|
|
64
|
-
return useBand ? position + bandWidth : position;
|
|
65
|
-
}
|
|
66
|
-
if (isHorizontal) {
|
|
67
|
-
return yScale(value);
|
|
68
|
-
}
|
|
69
|
-
return yScale(value + (stackOffset || 0)) + bandIndex * gap;
|
|
70
|
-
};
|
|
49
|
+
const xPosition = createPositionGetter(xScale, isHorizontal, gap);
|
|
50
|
+
const yPosition = createPositionGetter(yScale, !isHorizontal, gap);
|
|
71
51
|
const allY = currentSeries.dataPoints.flatMap((d, dataIndex) => d.flatMap(v => yPosition(v.y, dataIndex, baseScaleConfig.data?.[dataIndex], v.stackOffset, v.useBandWidth)));
|
|
72
52
|
const allX = currentSeries.dataPoints.flatMap((d, dataIndex) => d.flatMap(v => xPosition(v.x, dataIndex, baseScaleConfig.data?.[dataIndex], v.stackOffset, v.useBandWidth)));
|
|
73
53
|
const minPoint = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isOrdinalScale } from '@mui/x-charts/internals';
|
|
2
|
+
export const createPositionGetter = (scale, isCategoryDirection, gap) => (value, bandIndex, bandIdentifier, stackOffset, useBand) => {
|
|
3
|
+
if (isOrdinalScale(scale)) {
|
|
4
|
+
const position = scale(bandIdentifier);
|
|
5
|
+
return useBand ? position + scale.bandwidth() : position;
|
|
6
|
+
}
|
|
7
|
+
if (isCategoryDirection) {
|
|
8
|
+
return scale(value + (stackOffset || 0)) + bandIndex * gap;
|
|
9
|
+
}
|
|
10
|
+
return scale(value);
|
|
11
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { scaleBand } from '@mui/x-charts
|
|
3
|
-
import { getAxisExtrema, isBandScaleConfig, isPointScaleConfig, isContinuousScaleConfig, getScale, getColorScale, getOrdinalColorScale, getTickNumber, scaleTickNumberByRange, getCartesianAxisTriggerTooltip, isDateData, createDateFormatter, getDefaultTickNumber } from '@mui/x-charts/internals';
|
|
2
|
+
import { getAxisExtrema, isBandScaleConfig, isPointScaleConfig, isContinuousScaleConfig, getScale, getColorScale, getOrdinalColorScale, getTickNumber, scaleTickNumberByRange, getCartesianAxisTriggerTooltip, isDateData, createDateFormatter, getDefaultTickNumber, scaleBand } from '@mui/x-charts/internals';
|
|
4
3
|
export const xRangeGetter = (drawingArea, reverse, removedSpace = 0) => {
|
|
5
4
|
const range = [drawingArea.left, drawingArea.left + drawingArea.width - removedSpace];
|
|
6
5
|
return reverse ? [range[1], range[0]] : [range[0], range[1]];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
|
-
return _extends({
|
|
4
|
-
id: seriesData.id ?? `auto-generated-id-${seriesIndex}
|
|
5
|
-
}, seriesData, {
|
|
3
|
+
return _extends({}, seriesData, {
|
|
4
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
6
5
|
borderRadius: seriesData.borderRadius ?? 8,
|
|
7
|
-
data: seriesData.data.map((d, index) => _extends({
|
|
8
|
-
color: colors[index % colors.length]
|
|
9
|
-
}
|
|
6
|
+
data: seriesData.data.map((d, index) => _extends({}, d, {
|
|
7
|
+
color: d.color ?? colors[index % colors.length]
|
|
8
|
+
}))
|
|
10
9
|
});
|
|
11
10
|
};
|
|
12
11
|
export default getSeriesWithDefaultValues;
|
|
@@ -4,11 +4,13 @@ import getColor from "./getColor.js";
|
|
|
4
4
|
import legendGetter from "./legend.js";
|
|
5
5
|
import tooltipGetter from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
|
+
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
7
8
|
export const seriesConfig = {
|
|
8
9
|
seriesProcessor,
|
|
9
10
|
colorProcessor: getColor,
|
|
10
11
|
legendGetter,
|
|
11
12
|
tooltipGetter,
|
|
13
|
+
tooltipItemPositionGetter,
|
|
12
14
|
xExtremumGetter: getExtremumX,
|
|
13
15
|
yExtremumGetter: getExtremumY,
|
|
14
16
|
getSeriesWithDefaultValues
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { findMinMax } from '@mui/x-charts/internals';
|
|
2
|
+
import { createPositionGetter } from "../coordinateMapper.js";
|
|
3
|
+
const tooltipItemPositionGetter = params => {
|
|
4
|
+
const {
|
|
5
|
+
series,
|
|
6
|
+
identifier,
|
|
7
|
+
axesConfig,
|
|
8
|
+
placement
|
|
9
|
+
} = params;
|
|
10
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const itemSeries = series.funnel?.series[identifier.seriesId];
|
|
14
|
+
if (itemSeries == null) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (axesConfig.x === undefined || axesConfig.y === undefined) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const isHorizontal = itemSeries.layout === 'horizontal';
|
|
21
|
+
const baseScaleConfig = isHorizontal ? axesConfig.x : axesConfig.y;
|
|
22
|
+
|
|
23
|
+
// FIXME gap should be obtained from the store.
|
|
24
|
+
// Maybe moving it to the series would be a good idea similar to what we do with bar charts and their stackingGroups
|
|
25
|
+
const gap = 0;
|
|
26
|
+
const xPosition = createPositionGetter(axesConfig.x.scale, isHorizontal, gap);
|
|
27
|
+
const yPosition = createPositionGetter(axesConfig.y.scale, !isHorizontal, gap);
|
|
28
|
+
const allY = itemSeries.dataPoints[identifier.dataIndex].map(v => yPosition(v.y, identifier.dataIndex, baseScaleConfig.data?.[identifier.dataIndex], v.stackOffset, v.useBandWidth));
|
|
29
|
+
const allX = itemSeries.dataPoints[identifier.dataIndex].map(v => xPosition(v.x, identifier.dataIndex, baseScaleConfig.data?.[identifier.dataIndex], v.stackOffset, v.useBandWidth));
|
|
30
|
+
const [x0, x1] = findMinMax(allX);
|
|
31
|
+
const [y0, y1] = findMinMax(allY);
|
|
32
|
+
switch (placement) {
|
|
33
|
+
case 'bottom':
|
|
34
|
+
return {
|
|
35
|
+
x: (x1 + x0) / 2,
|
|
36
|
+
y: y1
|
|
37
|
+
};
|
|
38
|
+
case 'left':
|
|
39
|
+
return {
|
|
40
|
+
x: x0,
|
|
41
|
+
y: (y1 + y0) / 2
|
|
42
|
+
};
|
|
43
|
+
case 'right':
|
|
44
|
+
return {
|
|
45
|
+
x: x1,
|
|
46
|
+
y: (y1 + y0) / 2
|
|
47
|
+
};
|
|
48
|
+
case 'top':
|
|
49
|
+
default:
|
|
50
|
+
return {
|
|
51
|
+
x: (x1 + x0) / 2,
|
|
52
|
+
y: y0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export default tooltipItemPositionGetter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>,
|
|
3
|
+
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
4
|
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginSignatures>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export const HEATMAP_PLUGINS = [useChartZAxis,
|
|
3
|
+
export const HEATMAP_PLUGINS = [useChartZAxis, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartProExport];
|
|
@@ -26,6 +26,11 @@ process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
|
|
|
26
26
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
27
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
28
28
|
// ----------------------------------------------------------------------
|
|
29
|
+
/**
|
|
30
|
+
* Determine if the tooltip should be placed on the pointer location or on the node.
|
|
31
|
+
* @default 'pointer'
|
|
32
|
+
*/
|
|
33
|
+
anchor: PropTypes.oneOf(['node', 'pointer']),
|
|
29
34
|
/**
|
|
30
35
|
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
31
36
|
* or a function that returns either.
|
|
@@ -155,6 +160,10 @@ process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
|
|
|
155
160
|
update: PropTypes.func.isRequired
|
|
156
161
|
})
|
|
157
162
|
})]),
|
|
163
|
+
/**
|
|
164
|
+
* Determines the tooltip position relatively to the anchor.
|
|
165
|
+
*/
|
|
166
|
+
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
158
167
|
/**
|
|
159
168
|
* The props used for each slot inside the Popper.
|
|
160
169
|
* @default {}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
3
|
return _extends({
|
|
4
|
-
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
5
4
|
color: colors[seriesIndex % colors.length]
|
|
6
|
-
}, seriesData
|
|
5
|
+
}, seriesData, {
|
|
6
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`
|
|
7
|
+
});
|
|
7
8
|
};
|
|
8
9
|
export default getSeriesWithDefaultValues;
|
|
@@ -3,11 +3,13 @@ import seriesProcessor from "./seriesProcessor.js";
|
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
import tooltipGetter from "./tooltip.js";
|
|
5
5
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
6
|
+
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
6
7
|
export const seriesConfig = {
|
|
7
8
|
seriesProcessor,
|
|
8
9
|
colorProcessor: getColor,
|
|
9
10
|
legendGetter: () => [],
|
|
10
11
|
tooltipGetter,
|
|
12
|
+
tooltipItemPositionGetter,
|
|
11
13
|
xExtremumGetter: getBaseExtremum,
|
|
12
14
|
yExtremumGetter: getBaseExtremum,
|
|
13
15
|
getSeriesWithDefaultValues
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isBandScaleConfig } from '@mui/x-charts/internals';
|
|
2
|
+
const tooltipItemPositionGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
series,
|
|
5
|
+
identifier,
|
|
6
|
+
axesConfig,
|
|
7
|
+
placement
|
|
8
|
+
} = params;
|
|
9
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const itemSeries = series.heatmap?.series[identifier.seriesId];
|
|
13
|
+
if (itemSeries == null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (axesConfig.x === undefined || axesConfig.y === undefined || !isBandScaleConfig(axesConfig.x) || !isBandScaleConfig(axesConfig.y)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const [xIndex, yIndex] = itemSeries.data[identifier.dataIndex];
|
|
20
|
+
const x = axesConfig.x.scale(axesConfig.x.scale.domain()[xIndex]);
|
|
21
|
+
const y = axesConfig.y.scale(axesConfig.y.scale.domain()[yIndex]);
|
|
22
|
+
if (x === undefined || y === undefined) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const width = axesConfig.x.scale.bandwidth();
|
|
26
|
+
const height = axesConfig.y.scale.bandwidth();
|
|
27
|
+
switch (placement) {
|
|
28
|
+
case 'bottom':
|
|
29
|
+
return {
|
|
30
|
+
x: x + width / 2,
|
|
31
|
+
y: y + height
|
|
32
|
+
};
|
|
33
|
+
case 'left':
|
|
34
|
+
return {
|
|
35
|
+
x,
|
|
36
|
+
y: y + height / 2
|
|
37
|
+
};
|
|
38
|
+
case 'right':
|
|
39
|
+
return {
|
|
40
|
+
x: x + width,
|
|
41
|
+
y: y + height / 2
|
|
42
|
+
};
|
|
43
|
+
case 'top':
|
|
44
|
+
default:
|
|
45
|
+
return {
|
|
46
|
+
x: x + width / 2,
|
|
47
|
+
y
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export default tooltipItemPositionGetter;
|