@mui/x-charts 9.10.1 → 9.11.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/BarChart/BarChart.js +4 -2
- package/BarChart/BarChart.mjs +4 -2
- package/BarChart/BarPlot.d.mts +3 -3
- package/BarChart/BarPlot.d.ts +3 -3
- package/BarChart/BarPlot.js +1 -1
- package/BarChart/BarPlot.mjs +1 -1
- package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -2
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -2
- package/BarChart/IndividualBarPlot.d.mts +2 -2
- package/BarChart/IndividualBarPlot.d.ts +2 -2
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +4 -4
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +4 -4
- package/BarChart/useRegisterItemClickHandlers.d.mts +2 -1
- package/BarChart/useRegisterItemClickHandlers.d.ts +2 -1
- package/BarChart/useRegisterItemClickHandlers.js +8 -0
- package/BarChart/useRegisterItemClickHandlers.mjs +8 -1
- package/CHANGELOG.md +118 -0
- package/ChartsContainer/ChartsContainer.js +4 -2
- package/ChartsContainer/ChartsContainer.mjs +4 -2
- package/ChartsDataProvider/ChartsDataProvider.js +3 -1
- package/ChartsDataProvider/ChartsDataProvider.mjs +3 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +3 -1
- package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +101 -101
- package/ChartsXAxis/useAxisTicksProps.d.ts +101 -101
- package/ChartsYAxis/useAxisTicksProps.d.mts +101 -101
- package/ChartsYAxis/useAxisTicksProps.d.ts +101 -101
- package/LineChart/AreaPlot.d.mts +3 -2
- package/LineChart/AreaPlot.d.ts +3 -2
- package/LineChart/AreaPlot.js +8 -2
- package/LineChart/AreaPlot.mjs +9 -3
- package/LineChart/LineChart.js +2 -1
- package/LineChart/LineChart.mjs +2 -1
- package/LineChart/LinePlot.d.mts +3 -2
- package/LineChart/LinePlot.d.ts +3 -2
- package/LineChart/LinePlot.js +2 -2
- package/LineChart/LinePlot.mjs +3 -3
- package/LineChart/MarkPlot.d.mts +5 -4
- package/LineChart/MarkPlot.d.ts +5 -4
- package/LineChart/MarkPlot.js +17 -8
- package/LineChart/MarkPlot.mjs +17 -8
- package/LineChart/useLineItemClickHandler.d.mts +25 -1
- package/LineChart/useLineItemClickHandler.d.ts +25 -1
- package/LineChart/useLineItemClickHandler.js +48 -1
- package/LineChart/useLineItemClickHandler.mjs +47 -1
- package/PieChart/PieArcPlot.d.mts +3 -2
- package/PieChart/PieArcPlot.d.ts +3 -2
- package/PieChart/PieArcPlot.js +16 -1
- package/PieChart/PieArcPlot.mjs +16 -1
- package/PieChart/PieChart.js +3 -1
- package/PieChart/PieChart.mjs +3 -1
- package/PieChart/PiePlot.js +1 -1
- package/PieChart/PiePlot.mjs +1 -1
- package/README.md +1 -11
- package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +1 -1
- package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +1 -1
- package/RadarChart/RadarChart.js +3 -1
- package/RadarChart/RadarChart.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +4 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +4 -1
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.mts +5 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +5 -4
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.d.mts +15 -0
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.d.ts +15 -0
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.js +32 -0
- package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.mjs +26 -0
- package/RadarChart/useRadarChartProps.js +5 -1
- package/RadarChart/useRadarChartProps.mjs +5 -1
- package/ScatterChart/Scatter.d.mts +3 -2
- package/ScatterChart/Scatter.d.ts +3 -2
- package/ScatterChart/Scatter.js +10 -1
- package/ScatterChart/Scatter.mjs +10 -1
- package/ScatterChart/ScatterChart.js +1 -0
- package/ScatterChart/ScatterChart.mjs +1 -0
- package/ScatterChart/async/ScatterAsync.js +9 -0
- package/ScatterChart/async/ScatterAsync.mjs +9 -0
- package/SparkLineChart/SparkLineChart.js +2 -1
- package/SparkLineChart/SparkLineChart.mjs +2 -1
- package/Toolbar/ToolbarButton.js +1 -1
- package/Toolbar/ToolbarButton.mjs +1 -1
- package/hooks/useFocusedItem.d.mts +1 -1
- package/hooks/useFocusedItem.d.ts +1 -1
- package/hooks/useItemHighlightStateGetter.d.mts +1 -1
- package/hooks/useItemHighlightStateGetter.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/createCommonKeyboardFocusHandler.d.mts +2 -2
- package/internals/createCommonKeyboardFocusHandler.d.ts +2 -2
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +8 -0
- package/internals/index.mjs +1 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +8 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +8 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +11 -3
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +11 -3
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +1 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.d.mts +12 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.d.ts +12 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.js +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.mjs +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +11 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +6 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.d.mts +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.d.ts +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.js +46 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.mjs +40 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +13 -31
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +13 -31
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +19 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +19 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +5 -3
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +5 -3
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.js +15 -0
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.mjs +14 -0
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.mts +5 -2
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +5 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +10 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.d.mts +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.d.ts +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.js +39 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.mjs +32 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -7
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs +47 -7
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.mts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +3 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs +2 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.mts +39 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +39 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.d.mts +27 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.d.ts +27 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.js +36 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.mjs +30 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +19 -20
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +19 -20
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -1
- package/internals/seriesSelectorOfType.d.mts +4 -4
- package/internals/seriesSelectorOfType.d.ts +4 -4
- package/internals/useRegisterItemActivation.d.mts +23 -0
- package/internals/useRegisterItemActivation.d.ts +23 -0
- package/internals/useRegisterItemActivation.js +53 -0
- package/internals/useRegisterItemActivation.mjs +46 -0
- package/models/axis.d.mts +1 -1
- package/models/axis.d.ts +1 -1
- package/models/events.d.mts +11 -0
- package/models/events.d.ts +11 -0
- package/models/events.js +5 -0
- package/models/events.mjs +1 -0
- package/models/index.d.mts +1 -0
- package/models/index.d.ts +1 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.mts +3 -4
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +3 -4
- package/moduleAugmentation/keyboardActivation.d.mts +7 -0
- package/moduleAugmentation/keyboardActivation.d.ts +7 -0
- package/moduleAugmentation/keyboardActivation.js +8 -0
- package/moduleAugmentation/keyboardActivation.mjs +2 -0
- package/package.json +18 -4
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const AXIS_CLICK_SERIES_TYPES = new Set(['bar', 'rangeBar', 'line']);
|
|
2
|
+
/**
|
|
3
|
+
* Builds the `onAxisClick` payload for a data index on a given axis.
|
|
4
|
+
* Returns `null` when the axis has no value at this index.
|
|
5
|
+
*/
|
|
6
|
+
export function getAxisClickPayload({
|
|
7
|
+
axisId,
|
|
8
|
+
dataIndex,
|
|
9
|
+
isXAxis,
|
|
10
|
+
axes,
|
|
11
|
+
processedSeries
|
|
12
|
+
}) {
|
|
13
|
+
const axisValue = axes[axisId]?.data?.[dataIndex];
|
|
14
|
+
if (axisValue === undefined) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const seriesValues = {};
|
|
18
|
+
Object.keys(processedSeries).filter(seriesType => AXIS_CLICK_SERIES_TYPES.has(seriesType)).forEach(seriesType => {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
const seriesTypeConfig = processedSeries[seriesType];
|
|
21
|
+
seriesTypeConfig?.seriesOrder.forEach(seriesId => {
|
|
22
|
+
const seriesItem = seriesTypeConfig.series[seriesId];
|
|
23
|
+
const providedXAxisId = seriesItem.xAxisId;
|
|
24
|
+
const providedYAxisId = seriesItem.yAxisId;
|
|
25
|
+
const axisKey = isXAxis ? providedXAxisId : providedYAxisId;
|
|
26
|
+
if (axisKey === undefined || axisKey === axisId) {
|
|
27
|
+
// @ts-ignore This is safe because users need to opt in to use range bar series.
|
|
28
|
+
// In that case, they should import the module augmentation from `x-charts-pro/moduleAugmentation/rangeBarOnClick`
|
|
29
|
+
// Which adds the proper type to the series data.
|
|
30
|
+
// TODO(v10): Remove this ts-ignore when we can make the breaking change to ChartsAxisData.
|
|
31
|
+
seriesValues[seriesId] = seriesItem.data[dataIndex];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
dataIndex,
|
|
37
|
+
axisValue,
|
|
38
|
+
seriesValues
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -22,7 +22,7 @@ var _getChartPoint = require("../../../getChartPoint");
|
|
|
22
22
|
var _useChartInteraction = require("../useChartInteraction");
|
|
23
23
|
var _useChartCartesianInteraction = require("./useChartCartesianInteraction.selectors");
|
|
24
24
|
var _checkHasInteractionPlugin = require("../useChartInteraction/checkHasInteractionPlugin");
|
|
25
|
-
|
|
25
|
+
var _getAxisClickPayload = require("./getAxisClickPayload");
|
|
26
26
|
const useChartCartesianAxis = ({
|
|
27
27
|
params,
|
|
28
28
|
store,
|
|
@@ -175,42 +175,24 @@ const useChartCartesianAxis = ({
|
|
|
175
175
|
return () => {};
|
|
176
176
|
}
|
|
177
177
|
const axisClickHandler = instance.addInteractionListener('tap', event => {
|
|
178
|
-
let dataIndex = null;
|
|
179
|
-
let isXAxis = false;
|
|
180
178
|
const svgPoint = (0, _getChartPoint.getChartPoint)(element, event.detail.srcEvent);
|
|
181
179
|
const xIndex = (0, _getAxisValue.getAxisIndex)(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
182
|
-
isXAxis = xIndex !== -1;
|
|
183
|
-
dataIndex = isXAxis ? xIndex : (0, _getAxisValue.getAxisIndex)(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
184
|
-
|
|
185
|
-
if (dataIndex == null || dataIndex === -1) {
|
|
180
|
+
const isXAxis = xIndex !== -1;
|
|
181
|
+
const dataIndex = isXAxis ? xIndex : (0, _getAxisValue.getAxisIndex)(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
182
|
+
if (dataIndex === -1) {
|
|
186
183
|
return;
|
|
187
184
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const axisValue = (isXAxis ? xAxisWithScale : yAxisWithScale)[USED_AXIS_ID].data[dataIndex];
|
|
191
|
-
const seriesValues = {};
|
|
192
|
-
Object.keys(processedSeries).filter(seriesType => AXIS_CLICK_SERIES_TYPES.has(seriesType)).forEach(seriesType => {
|
|
193
|
-
// @ts-ignore
|
|
194
|
-
const seriesTypeConfig = processedSeries[seriesType];
|
|
195
|
-
seriesTypeConfig?.seriesOrder.forEach(seriesId => {
|
|
196
|
-
const seriesItem = seriesTypeConfig.series[seriesId];
|
|
197
|
-
const providedXAxisId = seriesItem.xAxisId;
|
|
198
|
-
const providedYAxisId = seriesItem.yAxisId;
|
|
199
|
-
const axisKey = isXAxis ? providedXAxisId : providedYAxisId;
|
|
200
|
-
if (axisKey === undefined || axisKey === USED_AXIS_ID) {
|
|
201
|
-
// @ts-ignore This is safe because users need to opt in to use range bar series.
|
|
202
|
-
// In that case, they should import the module augmentation from `x-charts-pro/moduleAugmentation/rangeBarOnClick`
|
|
203
|
-
// Which adds the proper type to the series data.
|
|
204
|
-
// TODO(v9): Remove this ts-ignore when we can make the breaking change to ChartsAxisData.
|
|
205
|
-
seriesValues[seriesId] = seriesItem.data[dataIndex];
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
onAxisClick(event.detail.srcEvent, {
|
|
185
|
+
const payload = (0, _getAxisClickPayload.getAxisClickPayload)({
|
|
186
|
+
axisId: isXAxis ? xAxisIds[0] : yAxisIds[0],
|
|
210
187
|
dataIndex,
|
|
211
|
-
|
|
212
|
-
|
|
188
|
+
isXAxis,
|
|
189
|
+
axes: isXAxis ? xAxisWithScale : yAxisWithScale,
|
|
190
|
+
processedSeries
|
|
213
191
|
});
|
|
192
|
+
if (payload === null) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
onAxisClick(event.detail.srcEvent, payload);
|
|
214
196
|
});
|
|
215
197
|
return () => {
|
|
216
198
|
axisClickHandler.cleanup();
|
|
@@ -15,7 +15,7 @@ import { getChartPoint } from "../../../getChartPoint.mjs";
|
|
|
15
15
|
import { selectorChartsInteractionIsInitialized } from "../useChartInteraction/index.mjs";
|
|
16
16
|
import { selectorChartAxisInteraction } from "./useChartCartesianInteraction.selectors.mjs";
|
|
17
17
|
import { checkHasInteractionPlugin } from "../useChartInteraction/checkHasInteractionPlugin.mjs";
|
|
18
|
-
|
|
18
|
+
import { getAxisClickPayload } from "./getAxisClickPayload.mjs";
|
|
19
19
|
export const useChartCartesianAxis = ({
|
|
20
20
|
params,
|
|
21
21
|
store,
|
|
@@ -168,42 +168,24 @@ export const useChartCartesianAxis = ({
|
|
|
168
168
|
return () => {};
|
|
169
169
|
}
|
|
170
170
|
const axisClickHandler = instance.addInteractionListener('tap', event => {
|
|
171
|
-
let dataIndex = null;
|
|
172
|
-
let isXAxis = false;
|
|
173
171
|
const svgPoint = getChartPoint(element, event.detail.srcEvent);
|
|
174
172
|
const xIndex = getAxisIndex(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
175
|
-
isXAxis = xIndex !== -1;
|
|
176
|
-
dataIndex = isXAxis ? xIndex : getAxisIndex(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
177
|
-
|
|
178
|
-
if (dataIndex == null || dataIndex === -1) {
|
|
173
|
+
const isXAxis = xIndex !== -1;
|
|
174
|
+
const dataIndex = isXAxis ? xIndex : getAxisIndex(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
175
|
+
if (dataIndex === -1) {
|
|
179
176
|
return;
|
|
180
177
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const axisValue = (isXAxis ? xAxisWithScale : yAxisWithScale)[USED_AXIS_ID].data[dataIndex];
|
|
184
|
-
const seriesValues = {};
|
|
185
|
-
Object.keys(processedSeries).filter(seriesType => AXIS_CLICK_SERIES_TYPES.has(seriesType)).forEach(seriesType => {
|
|
186
|
-
// @ts-ignore
|
|
187
|
-
const seriesTypeConfig = processedSeries[seriesType];
|
|
188
|
-
seriesTypeConfig?.seriesOrder.forEach(seriesId => {
|
|
189
|
-
const seriesItem = seriesTypeConfig.series[seriesId];
|
|
190
|
-
const providedXAxisId = seriesItem.xAxisId;
|
|
191
|
-
const providedYAxisId = seriesItem.yAxisId;
|
|
192
|
-
const axisKey = isXAxis ? providedXAxisId : providedYAxisId;
|
|
193
|
-
if (axisKey === undefined || axisKey === USED_AXIS_ID) {
|
|
194
|
-
// @ts-ignore This is safe because users need to opt in to use range bar series.
|
|
195
|
-
// In that case, they should import the module augmentation from `x-charts-pro/moduleAugmentation/rangeBarOnClick`
|
|
196
|
-
// Which adds the proper type to the series data.
|
|
197
|
-
// TODO(v9): Remove this ts-ignore when we can make the breaking change to ChartsAxisData.
|
|
198
|
-
seriesValues[seriesId] = seriesItem.data[dataIndex];
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
onAxisClick(event.detail.srcEvent, {
|
|
178
|
+
const payload = getAxisClickPayload({
|
|
179
|
+
axisId: isXAxis ? xAxisIds[0] : yAxisIds[0],
|
|
203
180
|
dataIndex,
|
|
204
|
-
|
|
205
|
-
|
|
181
|
+
isXAxis,
|
|
182
|
+
axes: isXAxis ? xAxisWithScale : yAxisWithScale,
|
|
183
|
+
processedSeries
|
|
206
184
|
});
|
|
185
|
+
if (payload === null) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
onAxisClick(event.detail.srcEvent, payload);
|
|
207
189
|
});
|
|
208
190
|
return () => {
|
|
209
191
|
axisClickHandler.cleanup();
|
|
@@ -4,10 +4,10 @@ export declare const selectorChartPreviewXScales: (args_0: import("../../corePlu
|
|
|
4
4
|
}, axisId: AxisId) => Record<AxisId, D3Scale>;
|
|
5
5
|
export declare const selectorChartPreviewComputedXAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
6
6
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
7
|
-
}, axisId: AxisId) => import("./useChartCartesianAxis.types.mjs").ComputedAxisConfig<import("
|
|
7
|
+
}, axisId: AxisId) => import("./useChartCartesianAxis.types.mjs").ComputedAxisConfig<import("@mui/x-charts/models").ChartsXAxisProps>;
|
|
8
8
|
export declare const selectorChartPreviewYScales: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.mjs").UseChartCartesianAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
10
10
|
}, axisId: AxisId) => Record<AxisId, D3Scale>;
|
|
11
11
|
export declare const selectorChartPreviewComputedYAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
12
12
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
13
|
-
}, axisId: AxisId) => import("./useChartCartesianAxis.types.mjs").ComputedAxisConfig<import("
|
|
13
|
+
}, axisId: AxisId) => import("./useChartCartesianAxis.types.mjs").ComputedAxisConfig<import("@mui/x-charts/models").ChartsYAxisProps>;
|
|
@@ -4,10 +4,10 @@ export declare const selectorChartPreviewXScales: (args_0: import("../../corePlu
|
|
|
4
4
|
}, axisId: AxisId) => Record<AxisId, D3Scale>;
|
|
5
5
|
export declare const selectorChartPreviewComputedXAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
6
6
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
7
|
-
}, axisId: AxisId) => import("./useChartCartesianAxis.types.js").ComputedAxisConfig<import("
|
|
7
|
+
}, axisId: AxisId) => import("./useChartCartesianAxis.types.js").ComputedAxisConfig<import("@mui/x-charts/models").ChartsXAxisProps>;
|
|
8
8
|
export declare const selectorChartPreviewYScales: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
10
|
}, axisId: AxisId) => Record<AxisId, D3Scale>;
|
|
11
11
|
export declare const selectorChartPreviewComputedYAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
13
|
-
}, axisId: AxisId) => import("./useChartCartesianAxis.types.js").ComputedAxisConfig<import("
|
|
13
|
+
}, axisId: AxisId) => import("./useChartCartesianAxis.types.js").ComputedAxisConfig<import("@mui/x-charts/models").ChartsYAxisProps>;
|
|
@@ -68,13 +68,13 @@ export declare const selectorChartYScales: (args_0: import("../../corePlugins/us
|
|
|
68
68
|
*/
|
|
69
69
|
export declare const selectorChartXAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
70
70
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
71
|
-
}) => import("./computeAxisValue.mjs").ComputeResult<import("
|
|
71
|
+
}) => import("./computeAxisValue.mjs").ComputeResult<import("@mui/x-charts/models").ChartsXAxisProps>;
|
|
72
72
|
export declare const selectorChartYAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
73
73
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
74
|
-
}) => import("./computeAxisValue.mjs").ComputeResult<import("
|
|
74
|
+
}) => import("./computeAxisValue.mjs").ComputeResult<import("@mui/x-charts/models").ChartsYAxisProps>;
|
|
75
75
|
export declare const selectorChartAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<{}> & {
|
|
76
76
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
77
|
-
}, axisId: AxisId) => (Omit<Omit<DefaultedAxis<keyof import("../../../index.mjs").AxisScaleConfig, any, import("
|
|
77
|
+
}, axisId: AxisId) => (Omit<Omit<DefaultedAxis<keyof import("../../../index.mjs").AxisScaleConfig, any, import("@mui/x-charts/models").ChartsXAxisProps>, "scaleType">, "offset"> & Required<Pick<Omit<DefaultedAxis<keyof import("../../../index.mjs").AxisScaleConfig, any, import("@mui/x-charts/models").ChartsXAxisProps>, "scaleType">, "offset">> & (({
|
|
78
78
|
scaleType: 'log';
|
|
79
79
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
80
80
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
@@ -105,14 +105,14 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
105
105
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
106
106
|
} | ({
|
|
107
107
|
scaleType: 'point';
|
|
108
|
-
ordinalTimeTicks?: import("
|
|
108
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
109
109
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
110
110
|
toString(): string;
|
|
111
111
|
}>;
|
|
112
112
|
colorMap?: import("../../../../models/colorMapping.mjs").OrdinalColorConfig | import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
113
113
|
} & import("../../../index.mjs").AxisGroups) | ({
|
|
114
114
|
scaleType: 'band';
|
|
115
|
-
ordinalTimeTicks?: import("
|
|
115
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
116
116
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
117
117
|
toString(): string;
|
|
118
118
|
}>;
|
|
@@ -141,7 +141,7 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
141
141
|
tickNumber: number;
|
|
142
142
|
triggerTooltip?: boolean;
|
|
143
143
|
isFullCircle?: boolean;
|
|
144
|
-
} & import("
|
|
144
|
+
} & import("@mui/x-charts/models").ChartsXAxisProps & {
|
|
145
145
|
position?: "bottom" | "none" | "top" | undefined;
|
|
146
146
|
height?: number | "auto" | undefined;
|
|
147
147
|
width?: undefined;
|
|
@@ -150,14 +150,14 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
150
150
|
};
|
|
151
151
|
export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.mjs").UseChartCartesianAxisState> & {
|
|
152
152
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
153
|
-
}, axisId: AxisId) => DefaultedAxis<"band", any, import("
|
|
153
|
+
}, axisId: AxisId) => DefaultedAxis<"band", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"linear", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"log", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"point", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"pow", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"sqrt", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"symlog", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"time", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"utc", any, import("@mui/x-charts/models").ChartsXAxisProps> | ({
|
|
154
154
|
offset?: number;
|
|
155
155
|
} & {
|
|
156
156
|
id: AxisId;
|
|
157
157
|
data?: readonly any[] | undefined;
|
|
158
158
|
dataKey?: string;
|
|
159
159
|
valueGetter?: ((item: import("../../../index.mjs").DatasetElementType<unknown>) => any) | undefined;
|
|
160
|
-
valueFormatter?: (<TScaleName extends keyof import("../../../index.mjs").AxisScaleConfig>(value: any, context: import("
|
|
160
|
+
valueFormatter?: (<TScaleName extends keyof import("../../../index.mjs").AxisScaleConfig>(value: any, context: import("@mui/x-charts/models").AxisValueFormatterContext<TScaleName>) => string) | undefined;
|
|
161
161
|
hideTooltip?: boolean;
|
|
162
162
|
reverse?: boolean;
|
|
163
163
|
domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => {
|
|
@@ -166,7 +166,7 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
166
166
|
});
|
|
167
167
|
domainSeries?: 'all' | 'visible';
|
|
168
168
|
ignoreTooltip?: boolean;
|
|
169
|
-
} & Omit<Partial<import("
|
|
169
|
+
} & Omit<Partial<import("@mui/x-charts/models").ChartsYAxisProps>, "axisId"> & Partial<Omit<{
|
|
170
170
|
scaleType: 'log';
|
|
171
171
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
172
172
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
@@ -197,14 +197,14 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
197
197
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
198
198
|
} | ({
|
|
199
199
|
scaleType: 'point';
|
|
200
|
-
ordinalTimeTicks?: import("
|
|
200
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
201
201
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
202
202
|
toString(): string;
|
|
203
203
|
}>;
|
|
204
204
|
colorMap?: import("../../../../models/colorMapping.mjs").OrdinalColorConfig | import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
205
205
|
} & import("../../../index.mjs").AxisGroups) | ({
|
|
206
206
|
scaleType: 'band';
|
|
207
|
-
ordinalTimeTicks?: import("
|
|
207
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
208
208
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
209
209
|
toString(): string;
|
|
210
210
|
}>;
|
|
@@ -68,13 +68,13 @@ export declare const selectorChartYScales: (args_0: import("../../corePlugins/us
|
|
|
68
68
|
*/
|
|
69
69
|
export declare const selectorChartXAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
70
70
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
71
|
-
}) => import("./computeAxisValue.js").ComputeResult<import("
|
|
71
|
+
}) => import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts/models").ChartsXAxisProps>;
|
|
72
72
|
export declare const selectorChartYAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
73
73
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
74
|
-
}) => import("./computeAxisValue.js").ComputeResult<import("
|
|
74
|
+
}) => import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts/models").ChartsYAxisProps>;
|
|
75
75
|
export declare const selectorChartAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
76
76
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
77
|
-
}, axisId: AxisId) => (Omit<Omit<DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, import("
|
|
77
|
+
}, axisId: AxisId) => (Omit<Omit<DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, import("@mui/x-charts/models").ChartsXAxisProps>, "scaleType">, "offset"> & Required<Pick<Omit<DefaultedAxis<keyof import("../../../index.js").AxisScaleConfig, any, import("@mui/x-charts/models").ChartsXAxisProps>, "scaleType">, "offset">> & (({
|
|
78
78
|
scaleType: 'log';
|
|
79
79
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
80
80
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
@@ -105,14 +105,14 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
105
105
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
106
106
|
} | ({
|
|
107
107
|
scaleType: 'point';
|
|
108
|
-
ordinalTimeTicks?: import("
|
|
108
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
109
109
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
110
110
|
toString(): string;
|
|
111
111
|
}>;
|
|
112
112
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
113
113
|
} & import("../../../index.js").AxisGroups) | ({
|
|
114
114
|
scaleType: 'band';
|
|
115
|
-
ordinalTimeTicks?: import("
|
|
115
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
116
116
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
117
117
|
toString(): string;
|
|
118
118
|
}>;
|
|
@@ -141,7 +141,7 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
141
141
|
tickNumber: number;
|
|
142
142
|
triggerTooltip?: boolean;
|
|
143
143
|
isFullCircle?: boolean;
|
|
144
|
-
} & import("
|
|
144
|
+
} & import("@mui/x-charts/models").ChartsXAxisProps & {
|
|
145
145
|
position?: "bottom" | "none" | "top" | undefined;
|
|
146
146
|
height?: number | "auto" | undefined;
|
|
147
147
|
width?: undefined;
|
|
@@ -150,14 +150,14 @@ export declare const selectorChartAxis: (args_0: import("../../corePlugins/useCh
|
|
|
150
150
|
};
|
|
151
151
|
export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
152
152
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
153
|
-
}, axisId: AxisId) => DefaultedAxis<"band", any, import("
|
|
153
|
+
}, axisId: AxisId) => DefaultedAxis<"band", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"linear", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"log", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"point", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"pow", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"sqrt", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"symlog", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"time", any, import("@mui/x-charts/models").ChartsXAxisProps> | DefaultedAxis<"utc", any, import("@mui/x-charts/models").ChartsXAxisProps> | ({
|
|
154
154
|
offset?: number;
|
|
155
155
|
} & {
|
|
156
156
|
id: AxisId;
|
|
157
157
|
data?: readonly any[] | undefined;
|
|
158
158
|
dataKey?: string;
|
|
159
159
|
valueGetter?: ((item: import("../../../index.js").DatasetElementType<unknown>) => any) | undefined;
|
|
160
|
-
valueFormatter?: (<TScaleName extends keyof import("../../../index.js").AxisScaleConfig>(value: any, context: import("
|
|
160
|
+
valueFormatter?: (<TScaleName extends keyof import("../../../index.js").AxisScaleConfig>(value: any, context: import("@mui/x-charts/models").AxisValueFormatterContext<TScaleName>) => string) | undefined;
|
|
161
161
|
hideTooltip?: boolean;
|
|
162
162
|
reverse?: boolean;
|
|
163
163
|
domainLimit?: 'nice' | 'strict' | ((min: NumberValue, max: NumberValue) => {
|
|
@@ -166,7 +166,7 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
166
166
|
});
|
|
167
167
|
domainSeries?: 'all' | 'visible';
|
|
168
168
|
ignoreTooltip?: boolean;
|
|
169
|
-
} & Omit<Partial<import("
|
|
169
|
+
} & Omit<Partial<import("@mui/x-charts/models").ChartsYAxisProps>, "axisId"> & Partial<Omit<{
|
|
170
170
|
scaleType: 'log';
|
|
171
171
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleLogarithmic<number, number>;
|
|
172
172
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
@@ -197,14 +197,14 @@ export declare const selectorChartRawAxis: (args_0: import("../../corePlugins/us
|
|
|
197
197
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
198
198
|
} | ({
|
|
199
199
|
scaleType: 'point';
|
|
200
|
-
ordinalTimeTicks?: import("
|
|
200
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
201
201
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
202
202
|
toString(): string;
|
|
203
203
|
}>;
|
|
204
204
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
205
205
|
} & import("../../../index.js").AxisGroups) | ({
|
|
206
206
|
scaleType: 'band';
|
|
207
|
-
ordinalTimeTicks?: import("
|
|
207
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
208
208
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
209
209
|
toString(): string;
|
|
210
210
|
}>;
|
|
@@ -70,14 +70,14 @@ export declare const selectorChartsHighlightXAxis: (args_0: import("../../corePl
|
|
|
70
70
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
71
71
|
} | ({
|
|
72
72
|
scaleType: 'point';
|
|
73
|
-
ordinalTimeTicks?: import("
|
|
73
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
74
74
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
75
75
|
toString(): string;
|
|
76
76
|
}>;
|
|
77
77
|
colorMap?: import("../../../../models/colorMapping.mjs").OrdinalColorConfig | import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
78
78
|
} & import("../../../index.mjs").AxisGroups) | ({
|
|
79
79
|
scaleType: 'band';
|
|
80
|
-
ordinalTimeTicks?: import("
|
|
80
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
81
81
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
82
82
|
toString(): string;
|
|
83
83
|
}>;
|
|
@@ -148,14 +148,14 @@ export declare const selectorChartsHighlightYAxis: (args_0: import("../../corePl
|
|
|
148
148
|
colorMap?: import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
149
149
|
} | ({
|
|
150
150
|
scaleType: 'point';
|
|
151
|
-
ordinalTimeTicks?: import("
|
|
151
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
152
152
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
153
153
|
toString(): string;
|
|
154
154
|
}>;
|
|
155
155
|
colorMap?: import("../../../../models/colorMapping.mjs").OrdinalColorConfig | import("../../../../models/colorMapping.mjs").ContinuousColorConfig | import("../../../../models/colorMapping.mjs").PiecewiseColorConfig;
|
|
156
156
|
} & import("../../../index.mjs").AxisGroups) | ({
|
|
157
157
|
scaleType: 'band';
|
|
158
|
-
ordinalTimeTicks?: import("
|
|
158
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
159
159
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
160
160
|
toString(): string;
|
|
161
161
|
}>;
|
|
@@ -70,14 +70,14 @@ export declare const selectorChartsHighlightXAxis: (args_0: import("../../corePl
|
|
|
70
70
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
71
71
|
} | ({
|
|
72
72
|
scaleType: 'point';
|
|
73
|
-
ordinalTimeTicks?: import("
|
|
73
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
74
74
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
75
75
|
toString(): string;
|
|
76
76
|
}>;
|
|
77
77
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
78
78
|
} & import("../../../index.js").AxisGroups) | ({
|
|
79
79
|
scaleType: 'band';
|
|
80
|
-
ordinalTimeTicks?: import("
|
|
80
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
81
81
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
82
82
|
toString(): string;
|
|
83
83
|
}>;
|
|
@@ -148,14 +148,14 @@ export declare const selectorChartsHighlightYAxis: (args_0: import("../../corePl
|
|
|
148
148
|
colorMap?: import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
149
149
|
} | ({
|
|
150
150
|
scaleType: 'point';
|
|
151
|
-
ordinalTimeTicks?: import("
|
|
151
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
152
152
|
scale: import("@mui/x-charts-vendor/d3-scale").ScalePoint<{
|
|
153
153
|
toString(): string;
|
|
154
154
|
}>;
|
|
155
155
|
colorMap?: import("../../../../models/colorMapping.js").OrdinalColorConfig | import("../../../../models/colorMapping.js").ContinuousColorConfig | import("../../../../models/colorMapping.js").PiecewiseColorConfig;
|
|
156
156
|
} & import("../../../index.js").AxisGroups) | ({
|
|
157
157
|
scaleType: 'band';
|
|
158
|
-
ordinalTimeTicks?: import("
|
|
158
|
+
ordinalTimeTicks?: import("@mui/x-charts/models").OrdinalTimeTicks;
|
|
159
159
|
scale: import("@mui/x-charts-vendor/d3-scale").ScaleBand<{
|
|
160
160
|
toString(): string;
|
|
161
161
|
}>;
|
|
@@ -219,6 +219,25 @@ const useChartClosestPoint = ({
|
|
|
219
219
|
pressEndHandler.cleanup();
|
|
220
220
|
};
|
|
221
221
|
}, [chartsLayerContainerRef, yAxis, xAxis, resolvedHitAreaRadius, onItemClick, resolvedDisableHitArea, instance, seriesOrder, series, flatbushMap, defaultXAxisId, defaultYAxisId, store]);
|
|
222
|
+
React.useEffect(() => {
|
|
223
|
+
if (!onItemClick || !instance.registerItemActivationHandler) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
return instance.registerItemActivationHandler({
|
|
227
|
+
type: 'scatter'
|
|
228
|
+
}, (event, item) => {
|
|
229
|
+
if (item.type !== 'scatter') {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// The callback only describes the pointer event unless the user augments the types.
|
|
234
|
+
onItemClick(event, {
|
|
235
|
+
type: 'scatter',
|
|
236
|
+
seriesId: item.seriesId,
|
|
237
|
+
dataIndex: item.dataIndex
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
}, [instance, onItemClick]);
|
|
222
241
|
|
|
223
242
|
// Instance implementation
|
|
224
243
|
const enableVoronoiCallback = (0, _useEventCallback.default)(() => {
|
|
@@ -212,6 +212,25 @@ export const useChartClosestPoint = ({
|
|
|
212
212
|
pressEndHandler.cleanup();
|
|
213
213
|
};
|
|
214
214
|
}, [chartsLayerContainerRef, yAxis, xAxis, resolvedHitAreaRadius, onItemClick, resolvedDisableHitArea, instance, seriesOrder, series, flatbushMap, defaultXAxisId, defaultYAxisId, store]);
|
|
215
|
+
React.useEffect(() => {
|
|
216
|
+
if (!onItemClick || !instance.registerItemActivationHandler) {
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
return instance.registerItemActivationHandler({
|
|
220
|
+
type: 'scatter'
|
|
221
|
+
}, (event, item) => {
|
|
222
|
+
if (item.type !== 'scatter') {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// The callback only describes the pointer event unless the user augments the types.
|
|
227
|
+
onItemClick(event, {
|
|
228
|
+
type: 'scatter',
|
|
229
|
+
seriesId: item.seriesId,
|
|
230
|
+
dataIndex: item.dataIndex
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}, [instance, onItemClick]);
|
|
215
234
|
|
|
216
235
|
// Instance implementation
|
|
217
236
|
const enableVoronoiCallback = useEventCallback(() => {
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts
CHANGED
|
@@ -7,6 +7,8 @@ import type { UseChartHighlightSignature } from "../useChartHighlight/index.mjs"
|
|
|
7
7
|
import type { UseChartInteractionSignature } from "../useChartInteraction/index.mjs";
|
|
8
8
|
import type { UseChartTooltipSignature } from "../useChartTooltip/index.mjs";
|
|
9
9
|
import type { UseChartZAxisSignature } from "../useChartZAxis/index.mjs";
|
|
10
|
+
import type { UseChartKeyboardNavigationSignature } from "../useChartKeyboardNavigation/index.mjs";
|
|
11
|
+
import type { ChartsActivationEvent } from "../../../../models/events.mjs";
|
|
10
12
|
export interface UseChartVoronoiInstance {
|
|
11
13
|
/**
|
|
12
14
|
* Enable the voronoi computation.
|
|
@@ -40,10 +42,10 @@ export interface UseChartVoronoiParameters {
|
|
|
40
42
|
/**
|
|
41
43
|
* Callback fired when clicking close to an item.
|
|
42
44
|
* This is only available for scatter plot for now.
|
|
43
|
-
* @param {
|
|
45
|
+
* @param {ChartsActivationEvent} event Event caught at the svg level
|
|
44
46
|
* @param {ScatterItemIdentifier} scatterItemIdentifier Identify which item got clicked
|
|
45
47
|
*/
|
|
46
|
-
onItemClick?: (event:
|
|
48
|
+
onItemClick?: (event: ChartsActivationEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
47
49
|
}
|
|
48
50
|
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'hitAreaRadius' | 'disableHitArea' | 'onItemClick'>;
|
|
49
51
|
export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
@@ -52,5 +54,5 @@ export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = C
|
|
|
52
54
|
params: UseChartVoronoiParameters;
|
|
53
55
|
defaultizedParams: UseChartVoronoiDefaultizedParameters;
|
|
54
56
|
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
55
|
-
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature];
|
|
57
|
+
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature, UseChartKeyboardNavigationSignature];
|
|
56
58
|
}>;
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { UseChartHighlightSignature } from "../useChartHighlight/index.js";
|
|
|
7
7
|
import type { UseChartInteractionSignature } from "../useChartInteraction/index.js";
|
|
8
8
|
import type { UseChartTooltipSignature } from "../useChartTooltip/index.js";
|
|
9
9
|
import type { UseChartZAxisSignature } from "../useChartZAxis/index.js";
|
|
10
|
+
import type { UseChartKeyboardNavigationSignature } from "../useChartKeyboardNavigation/index.js";
|
|
11
|
+
import type { ChartsActivationEvent } from "../../../../models/events.js";
|
|
10
12
|
export interface UseChartVoronoiInstance {
|
|
11
13
|
/**
|
|
12
14
|
* Enable the voronoi computation.
|
|
@@ -40,10 +42,10 @@ export interface UseChartVoronoiParameters {
|
|
|
40
42
|
/**
|
|
41
43
|
* Callback fired when clicking close to an item.
|
|
42
44
|
* This is only available for scatter plot for now.
|
|
43
|
-
* @param {
|
|
45
|
+
* @param {ChartsActivationEvent} event Event caught at the svg level
|
|
44
46
|
* @param {ScatterItemIdentifier} scatterItemIdentifier Identify which item got clicked
|
|
45
47
|
*/
|
|
46
|
-
onItemClick?: (event:
|
|
48
|
+
onItemClick?: (event: ChartsActivationEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
47
49
|
}
|
|
48
50
|
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'hitAreaRadius' | 'disableHitArea' | 'onItemClick'>;
|
|
49
51
|
export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
@@ -52,5 +54,5 @@ export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = C
|
|
|
52
54
|
params: UseChartVoronoiParameters;
|
|
53
55
|
defaultizedParams: UseChartVoronoiDefaultizedParameters;
|
|
54
56
|
dependencies: [UseChartSeriesSignature, UseChartCartesianAxisSignature];
|
|
55
|
-
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature];
|
|
57
|
+
optionalDependencies: [UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartTooltipSignature, UseChartZAxisSignature, UseChartKeyboardNavigationSignature];
|
|
56
58
|
}>;
|