@mui/x-charts 9.0.2 → 9.0.4
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 +2 -1
- package/BarChart/BarChart.mjs +2 -1
- package/BarChart/BarPlot.js +2 -1
- package/BarChart/BarPlot.mjs +2 -1
- package/BarChart/FocusedBar.js +3 -0
- package/BarChart/FocusedBar.mjs +3 -0
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +8 -8
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +8 -8
- package/CHANGELOG.md +223 -0
- package/ChartsRadialGrid/ChartsRadialGrid.js +2 -0
- package/ChartsRadialGrid/ChartsRadialGrid.mjs +2 -0
- package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +1 -0
- package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +1 -0
- package/ChartsRadialGrid/ChartsRadiusGrid.js +1 -2
- package/ChartsRadialGrid/ChartsRadiusGrid.mjs +1 -2
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +48 -0
- package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +48 -0
- package/ChartsRadiusAxis/ChartsRadiusAxis.js +147 -0
- package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +141 -0
- package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.mts +6 -0
- package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.ts +6 -0
- package/ChartsRadiusAxis/chartsRadiusAxisClasses.js +30 -0
- package/ChartsRadiusAxis/chartsRadiusAxisClasses.mjs +17 -0
- package/ChartsRadiusAxis/createGetLabelTextAnchors.d.mts +10 -0
- package/ChartsRadiusAxis/createGetLabelTextAnchors.d.ts +10 -0
- package/ChartsRadiusAxis/createGetLabelTextAnchors.js +46 -0
- package/ChartsRadiusAxis/createGetLabelTextAnchors.mjs +39 -0
- package/ChartsRadiusAxis/getLabelTransform.d.mts +11 -0
- package/ChartsRadiusAxis/getLabelTransform.d.ts +11 -0
- package/ChartsRadiusAxis/getLabelTransform.js +37 -0
- package/ChartsRadiusAxis/getLabelTransform.mjs +31 -0
- package/ChartsRadiusAxis/index.d.mts +3 -0
- package/ChartsRadiusAxis/index.d.ts +3 -0
- package/ChartsRadiusAxis/index.js +19 -0
- package/ChartsRadiusAxis/index.mjs +2 -0
- package/ChartsRadiusAxis/sharedRadialAxisClasses.d.mts +21 -0
- package/ChartsRadiusAxis/sharedRadialAxisClasses.d.ts +21 -0
- package/ChartsRadiusAxis/sharedRadialAxisClasses.js +14 -0
- package/ChartsRadiusAxis/sharedRadialAxisClasses.mjs +6 -0
- package/ChartsRotationAxis/ChartsRotationAxis.d.mts +48 -0
- package/ChartsRotationAxis/ChartsRotationAxis.d.ts +48 -0
- package/ChartsRotationAxis/ChartsRotationAxis.js +141 -0
- package/ChartsRotationAxis/ChartsRotationAxis.mjs +135 -0
- package/ChartsRotationAxis/chartsRotationAxisClasses.d.mts +5 -0
- package/ChartsRotationAxis/chartsRotationAxisClasses.d.ts +5 -0
- package/ChartsRotationAxis/chartsRotationAxisClasses.js +29 -0
- package/ChartsRotationAxis/chartsRotationAxisClasses.mjs +16 -0
- package/ChartsRotationAxis/getLabelTransform.d.mts +11 -0
- package/ChartsRotationAxis/getLabelTransform.d.ts +11 -0
- package/ChartsRotationAxis/getLabelTransform.js +37 -0
- package/ChartsRotationAxis/getLabelTransform.mjs +31 -0
- package/ChartsRotationAxis/index.d.mts +2 -0
- package/ChartsRotationAxis/index.d.ts +2 -0
- package/ChartsRotationAxis/index.js +19 -0
- package/ChartsRotationAxis/index.mjs +2 -0
- package/ChartsTooltip/useAxesTooltip.js +18 -7
- package/ChartsTooltip/useAxesTooltip.mjs +19 -8
- package/ChartsTooltip/useItemTooltip.d.mts +1 -1
- package/ChartsTooltip/useItemTooltip.d.ts +1 -1
- package/ChartsTooltip/useItemTooltip.js +17 -2
- package/ChartsTooltip/useItemTooltip.mjs +18 -3
- package/ChartsXAxis/useAxisTicksProps.d.mts +245 -164
- package/ChartsXAxis/useAxisTicksProps.d.ts +245 -164
- package/ChartsYAxis/useAxisTicksProps.d.mts +245 -164
- package/ChartsYAxis/useAxisTicksProps.d.ts +245 -164
- package/LineChart/FocusedLineMark.js +3 -0
- package/LineChart/FocusedLineMark.mjs +3 -0
- package/LineChart/seriesConfig/curveEvaluation.js +24 -19
- package/LineChart/seriesConfig/curveEvaluation.mjs +24 -19
- package/LineChart/seriesConfig/getItemAtPosition.js +25 -37
- package/LineChart/seriesConfig/getItemAtPosition.mjs +24 -36
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +4 -6
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +4 -6
- package/LineChart/seriesConfig/seriesProcessor.d.mts +4 -2
- package/LineChart/seriesConfig/seriesProcessor.d.ts +4 -2
- package/LineChart/seriesConfig/seriesProcessor.js +2 -2
- package/LineChart/seriesConfig/seriesProcessor.mjs +2 -2
- package/PieChart/FocusedPieArc.js +3 -0
- package/PieChart/FocusedPieArc.mjs +3 -0
- package/RadarChart/FocusedRadarMark.js +3 -0
- package/RadarChart/FocusedRadarMark.mjs +3 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.mts +2 -2
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
- package/ScatterChart/FocusedScatterMark.js +3 -0
- package/ScatterChart/FocusedScatterMark.mjs +3 -0
- package/hooks/useAxis.d.mts +2 -2
- package/hooks/useAxis.d.ts +2 -2
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +22 -2
- package/index.mjs +3 -1
- package/internals/commonNextFocusItem.js +62 -8
- package/internals/commonNextFocusItem.mjs +62 -8
- package/internals/cubiqSolver.d.mts +5 -0
- package/internals/cubiqSolver.d.ts +5 -0
- package/internals/cubiqSolver.js +62 -0
- package/internals/cubiqSolver.mjs +56 -0
- package/internals/findClosestIndex.d.mts +5 -0
- package/internals/findClosestIndex.d.ts +5 -0
- package/internals/findClosestIndex.js +27 -0
- package/internals/findClosestIndex.mjs +22 -0
- package/internals/getAsNumber.d.mts +1 -0
- package/internals/getAsNumber.d.ts +1 -0
- package/internals/getAsNumber.js +9 -0
- package/internals/getAsNumber.mjs +3 -0
- package/internals/index.d.mts +6 -1
- package/internals/index.d.ts +6 -1
- package/internals/index.js +59 -2
- package/internals/index.mjs +6 -1
- package/internals/isPolar.d.mts +3 -2
- package/internals/isPolar.d.ts +3 -2
- package/internals/isPolar.js +4 -0
- package/internals/isPolar.mjs +3 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +8 -9
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +8 -9
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +4 -21
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.mjs +4 -21
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.mts +30 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.d.ts +30 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.js +57 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/findVisibleDataIndex.mjs +51 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.mjs +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +7 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.mjs +7 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +25 -14
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +25 -14
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +9 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +9 -3
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
- package/models/axis.d.mts +2 -0
- package/models/axis.d.ts +2 -0
- package/models/seriesType/bar.d.mts +12 -7
- package/models/seriesType/bar.d.ts +12 -7
- package/models/seriesType/common.d.mts +10 -0
- package/models/seriesType/common.d.ts +10 -0
- package/models/seriesType/composition.d.mts +3 -1
- package/models/seriesType/composition.d.ts +3 -1
- package/models/seriesType/composition.js +6 -2
- package/models/seriesType/composition.mjs +5 -1
- package/models/seriesType/index.d.mts +3 -3
- package/models/seriesType/index.d.ts +3 -3
- package/models/seriesType/index.js +0 -22
- package/models/seriesType/index.mjs +0 -2
- package/models/seriesType/line.d.mts +13 -8
- package/models/seriesType/line.d.ts +13 -8
- package/package.json +32 -4
|
@@ -15,21 +15,26 @@ var _getAxisExtremum = require("./getAxisExtremum");
|
|
|
15
15
|
var _angleConversion = require("../../../angleConversion");
|
|
16
16
|
var _getAxisTriggerTooltip = require("./getAxisTriggerTooltip");
|
|
17
17
|
var _scales = require("../../../scales");
|
|
18
|
+
var _epsilon = require("../../../../utils/epsilon");
|
|
18
19
|
function getRange(drawingArea, axisDirection, axis) {
|
|
19
20
|
if (axisDirection === 'rotation') {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return angles;
|
|
21
|
+
const angles = [(0, _angleConversion.deg2rad)(axis.startAngle, 0), (0, _angleConversion.deg2rad)(axis.endAngle, 2 * Math.PI)];
|
|
22
|
+
const diff = angles[1] - angles[0];
|
|
23
|
+
const isFullCircle = diff >= Math.PI * 2 - _epsilon.EPSILON;
|
|
24
|
+
if (axis.scaleType === 'point' && isFullCircle) {
|
|
25
|
+
// For point scale, remove a slice to avoid overlapping first and last points.
|
|
26
|
+
angles[1] -= diff / axis.data.length;
|
|
28
27
|
}
|
|
29
|
-
return
|
|
28
|
+
return {
|
|
29
|
+
range: angles,
|
|
30
|
+
isFullCircle
|
|
31
|
+
};
|
|
30
32
|
}
|
|
31
33
|
const availableRadius = Math.min(drawingArea.height, drawingArea.width) / 2;
|
|
32
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
range: [axis.minRadius ?? 0, axis.maxRadius ?? availableRadius],
|
|
36
|
+
isFullCircle: false
|
|
37
|
+
};
|
|
33
38
|
}
|
|
34
39
|
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
|
|
35
40
|
const DEFAULT_BAR_GAP_RATIO = 0.1;
|
|
@@ -50,7 +55,10 @@ function computeAxisValue({
|
|
|
50
55
|
const completeAxis = {};
|
|
51
56
|
allAxis.forEach((eachAxis, axisIndex) => {
|
|
52
57
|
const axis = eachAxis;
|
|
53
|
-
const
|
|
58
|
+
const {
|
|
59
|
+
range,
|
|
60
|
+
isFullCircle
|
|
61
|
+
} = getRange(drawingArea, axisDirection, axis);
|
|
54
62
|
const [minData, maxData] = (0, _getAxisExtremum.getAxisExtremum)(axis, axisDirection, seriesConfig, axisIndex, formattedSeries);
|
|
55
63
|
const triggerTooltip = !axis.ignoreTooltip && axisIdsTriggeringTooltip.has(axis.id);
|
|
56
64
|
const data = axis.data ?? [];
|
|
@@ -68,7 +76,8 @@ function computeAxisValue({
|
|
|
68
76
|
tickNumber: axis.data.length,
|
|
69
77
|
colorScale: axis.colorMap && (axis.colorMap.type === 'ordinal' ? (0, _colorScale.getOrdinalColorScale)((0, _extends2.default)({
|
|
70
78
|
values: axis.data
|
|
71
|
-
}, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap))
|
|
79
|
+
}, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap)),
|
|
80
|
+
isFullCircle
|
|
72
81
|
});
|
|
73
82
|
if ((0, _dateHelpers.isDateData)(axis.data)) {
|
|
74
83
|
const dateFormatter = (0, _dateHelpers.createDateFormatter)(axis.data, range, axis.tickNumber);
|
|
@@ -85,7 +94,8 @@ function computeAxisValue({
|
|
|
85
94
|
tickNumber: axis.data.length,
|
|
86
95
|
colorScale: axis.colorMap && (axis.colorMap.type === 'ordinal' ? (0, _colorScale.getOrdinalColorScale)((0, _extends2.default)({
|
|
87
96
|
values: axis.data
|
|
88
|
-
}, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap))
|
|
97
|
+
}, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap)),
|
|
98
|
+
isFullCircle
|
|
89
99
|
});
|
|
90
100
|
if ((0, _dateHelpers.isDateData)(axis.data)) {
|
|
91
101
|
const dateFormatter = (0, _dateHelpers.createDateFormatter)(axis.data, range, axis.tickNumber);
|
|
@@ -123,7 +133,8 @@ function computeAxisValue({
|
|
|
123
133
|
scaleType: scaleType,
|
|
124
134
|
scale: finalScale.domain(domain),
|
|
125
135
|
tickNumber,
|
|
126
|
-
colorScale: axis.colorMap && (0, _colorScale.getColorScale)(axis.colorMap)
|
|
136
|
+
colorScale: axis.colorMap && (0, _colorScale.getColorScale)(axis.colorMap),
|
|
137
|
+
isFullCircle
|
|
127
138
|
});
|
|
128
139
|
});
|
|
129
140
|
return {
|
|
@@ -8,21 +8,26 @@ import { getAxisExtremum } from "./getAxisExtremum.mjs";
|
|
|
8
8
|
import { deg2rad } from "../../../angleConversion.mjs";
|
|
9
9
|
import { getAxisTriggerTooltip } from "./getAxisTriggerTooltip.mjs";
|
|
10
10
|
import { scaleBand, scalePoint } from "../../../scales/index.mjs";
|
|
11
|
+
import { EPSILON } from "../../../../utils/epsilon.mjs";
|
|
11
12
|
function getRange(drawingArea, axisDirection, axis) {
|
|
12
13
|
if (axisDirection === 'rotation') {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
return angles;
|
|
14
|
+
const angles = [deg2rad(axis.startAngle, 0), deg2rad(axis.endAngle, 2 * Math.PI)];
|
|
15
|
+
const diff = angles[1] - angles[0];
|
|
16
|
+
const isFullCircle = diff >= Math.PI * 2 - EPSILON;
|
|
17
|
+
if (axis.scaleType === 'point' && isFullCircle) {
|
|
18
|
+
// For point scale, remove a slice to avoid overlapping first and last points.
|
|
19
|
+
angles[1] -= diff / axis.data.length;
|
|
21
20
|
}
|
|
22
|
-
return
|
|
21
|
+
return {
|
|
22
|
+
range: angles,
|
|
23
|
+
isFullCircle
|
|
24
|
+
};
|
|
23
25
|
}
|
|
24
26
|
const availableRadius = Math.min(drawingArea.height, drawingArea.width) / 2;
|
|
25
|
-
return
|
|
27
|
+
return {
|
|
28
|
+
range: [axis.minRadius ?? 0, axis.maxRadius ?? availableRadius],
|
|
29
|
+
isFullCircle: false
|
|
30
|
+
};
|
|
26
31
|
}
|
|
27
32
|
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
|
|
28
33
|
const DEFAULT_BAR_GAP_RATIO = 0.1;
|
|
@@ -43,7 +48,10 @@ export function computeAxisValue({
|
|
|
43
48
|
const completeAxis = {};
|
|
44
49
|
allAxis.forEach((eachAxis, axisIndex) => {
|
|
45
50
|
const axis = eachAxis;
|
|
46
|
-
const
|
|
51
|
+
const {
|
|
52
|
+
range,
|
|
53
|
+
isFullCircle
|
|
54
|
+
} = getRange(drawingArea, axisDirection, axis);
|
|
47
55
|
const [minData, maxData] = getAxisExtremum(axis, axisDirection, seriesConfig, axisIndex, formattedSeries);
|
|
48
56
|
const triggerTooltip = !axis.ignoreTooltip && axisIdsTriggeringTooltip.has(axis.id);
|
|
49
57
|
const data = axis.data ?? [];
|
|
@@ -61,7 +69,8 @@ export function computeAxisValue({
|
|
|
61
69
|
tickNumber: axis.data.length,
|
|
62
70
|
colorScale: axis.colorMap && (axis.colorMap.type === 'ordinal' ? getOrdinalColorScale(_extends({
|
|
63
71
|
values: axis.data
|
|
64
|
-
}, axis.colorMap)) : getColorScale(axis.colorMap))
|
|
72
|
+
}, axis.colorMap)) : getColorScale(axis.colorMap)),
|
|
73
|
+
isFullCircle
|
|
65
74
|
});
|
|
66
75
|
if (isDateData(axis.data)) {
|
|
67
76
|
const dateFormatter = createDateFormatter(axis.data, range, axis.tickNumber);
|
|
@@ -78,7 +87,8 @@ export function computeAxisValue({
|
|
|
78
87
|
tickNumber: axis.data.length,
|
|
79
88
|
colorScale: axis.colorMap && (axis.colorMap.type === 'ordinal' ? getOrdinalColorScale(_extends({
|
|
80
89
|
values: axis.data
|
|
81
|
-
}, axis.colorMap)) : getColorScale(axis.colorMap))
|
|
90
|
+
}, axis.colorMap)) : getColorScale(axis.colorMap)),
|
|
91
|
+
isFullCircle
|
|
82
92
|
});
|
|
83
93
|
if (isDateData(axis.data)) {
|
|
84
94
|
const dateFormatter = createDateFormatter(axis.data, range, axis.tickNumber);
|
|
@@ -116,7 +126,8 @@ export function computeAxisValue({
|
|
|
116
126
|
scaleType: scaleType,
|
|
117
127
|
scale: finalScale.domain(domain),
|
|
118
128
|
tickNumber,
|
|
119
|
-
colorScale: axis.colorMap && getColorScale(axis.colorMap)
|
|
129
|
+
colorScale: axis.colorMap && getColorScale(axis.colorMap),
|
|
130
|
+
isFullCircle
|
|
120
131
|
});
|
|
121
132
|
});
|
|
122
133
|
return {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.getAxisIndex = getAxisIndex;
|
|
8
|
-
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
9
7
|
var _scaleGuards = require("../../../scaleGuards");
|
|
8
|
+
var _getAsNumber = require("../../../getAsNumber");
|
|
9
|
+
var _findClosestIndex = require("../../../findClosestIndex");
|
|
10
10
|
var _clampAngle = require("../../../clampAngle");
|
|
11
11
|
/**
|
|
12
12
|
* For a pointer coordinate, this function returns the value and dataIndex associated.
|
|
@@ -19,12 +19,17 @@ function getAxisIndex(axisConfig, pointerValue) {
|
|
|
19
19
|
reverse
|
|
20
20
|
} = axisConfig;
|
|
21
21
|
if (!(0, _scaleGuards.isOrdinalScale)(scale)) {
|
|
22
|
-
|
|
22
|
+
if (axisData === undefined) {
|
|
23
|
+
return -1;
|
|
24
|
+
}
|
|
25
|
+
const angle = scale.range()[0] + (0, _clampAngle.clampAngleRad)(pointerValue - scale.range()[0]);
|
|
26
|
+
const valueAsNumber = (0, _getAsNumber.getAsNumber)(scale.invert(angle));
|
|
27
|
+
return (0, _findClosestIndex.findClosestIndex)(axisData, valueAsNumber);
|
|
23
28
|
}
|
|
24
29
|
if (!axisData) {
|
|
25
30
|
return -1;
|
|
26
31
|
}
|
|
27
|
-
const angleGap = (0, _clampAngle.clampAngleRad)(pointerValue -
|
|
32
|
+
const angleGap = (0, _clampAngle.clampAngleRad)(pointerValue - scale.range()[0]);
|
|
28
33
|
const dataIndex = scale.bandwidth() === 0 ? Math.floor((angleGap + scale.step() / 2) / scale.step()) % axisData.length : Math.floor(angleGap / scale.step());
|
|
29
34
|
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
30
35
|
return -1;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
2
1
|
import { isOrdinalScale } from "../../../scaleGuards.mjs";
|
|
2
|
+
import { getAsNumber } from "../../../getAsNumber.mjs";
|
|
3
|
+
import { findClosestIndex } from "../../../findClosestIndex.mjs";
|
|
3
4
|
import { clampAngleRad } from "../../../clampAngle.mjs";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -13,12 +14,17 @@ export function getAxisIndex(axisConfig, pointerValue) {
|
|
|
13
14
|
reverse
|
|
14
15
|
} = axisConfig;
|
|
15
16
|
if (!isOrdinalScale(scale)) {
|
|
16
|
-
|
|
17
|
+
if (axisData === undefined) {
|
|
18
|
+
return -1;
|
|
19
|
+
}
|
|
20
|
+
const angle = scale.range()[0] + clampAngleRad(pointerValue - scale.range()[0]);
|
|
21
|
+
const valueAsNumber = getAsNumber(scale.invert(angle));
|
|
22
|
+
return findClosestIndex(axisData, valueAsNumber);
|
|
17
23
|
}
|
|
18
24
|
if (!axisData) {
|
|
19
25
|
return -1;
|
|
20
26
|
}
|
|
21
|
-
const angleGap = clampAngleRad(pointerValue -
|
|
27
|
+
const angleGap = clampAngleRad(pointerValue - scale.range()[0]);
|
|
22
28
|
const dataIndex = scale.bandwidth() === 0 ? Math.floor((angleGap + scale.step() / 2) / scale.step()) % axisData.length : Math.floor(angleGap / scale.step());
|
|
23
29
|
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
24
30
|
return -1;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const selectorChartsTooltipPointerItem: (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("./useChartTooltip.types.mjs").UseChartTooltipState<keyof import("../../../index.mjs").ChartsSeriesConfig>> & {
|
|
2
2
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
3
|
-
}) => import("
|
|
3
|
+
}) => import("../../../index.mjs").LineItemIdentifier | import("../../../index.mjs").BarItemIdentifier | import("../../../../index.mjs").ScatterItemIdentifier | import("../../../../index.mjs").PieItemIdentifier | import("../../../../index.mjs").RadarItemIdentifier | null;
|
|
4
4
|
export declare const selectorChartsTooltipPointerItemIsDefined: (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("./useChartTooltip.types.mjs").UseChartTooltipState<keyof import("../../../index.mjs").ChartsSeriesConfig>> & {
|
|
5
5
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
6
6
|
}) => boolean;
|
|
7
7
|
export declare const selectorChartsTooltipItem: (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("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
8
8
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
9
|
-
}) => import("
|
|
9
|
+
}) => import("../../../index.mjs").LineItemIdentifier | import("../../../index.mjs").BarItemIdentifier | import("../../../../index.mjs").ScatterItemIdentifier | import("../../../../index.mjs").PieItemIdentifier | import("../../../../index.mjs").RadarItemIdentifier | null;
|
|
10
10
|
export declare const selectorChartsTooltipItemIsDefined: (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("../useChartInteraction/useChartInteraction.types.mjs").UseChartInteractionState> & {
|
|
11
11
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
12
12
|
}) => boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const selectorChartsTooltipPointerItem: (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("./useChartTooltip.types.js").UseChartTooltipState<keyof import("../../../index.js").ChartsSeriesConfig>> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
|
-
}) => import("
|
|
3
|
+
}) => import("../../../index.js").LineItemIdentifier | import("../../../index.js").BarItemIdentifier | import("../../../../index.js").ScatterItemIdentifier | import("../../../../index.js").PieItemIdentifier | import("../../../../index.js").RadarItemIdentifier | null;
|
|
4
4
|
export declare const selectorChartsTooltipPointerItemIsDefined: (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("./useChartTooltip.types.js").UseChartTooltipState<keyof import("../../../index.js").ChartsSeriesConfig>> & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
}) => boolean;
|
|
7
7
|
export declare const selectorChartsTooltipItem: (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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
8
8
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
9
|
-
}) => import("
|
|
9
|
+
}) => import("../../../index.js").LineItemIdentifier | import("../../../index.js").BarItemIdentifier | import("../../../../index.js").ScatterItemIdentifier | import("../../../../index.js").PieItemIdentifier | import("../../../../index.js").RadarItemIdentifier | null;
|
|
10
10
|
export declare const selectorChartsTooltipItemIsDefined: (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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
11
11
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
12
12
|
}) => boolean;
|
package/models/axis.d.mts
CHANGED
|
@@ -522,6 +522,8 @@ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps ext
|
|
|
522
522
|
* Indicate if the axis should be consider by a tooltip with `trigger='axis'`.
|
|
523
523
|
*/
|
|
524
524
|
triggerTooltip?: boolean;
|
|
525
|
+
/** @ignore - internal. True when a rotation axis covers a full circle. */
|
|
526
|
+
isFullCircle?: boolean;
|
|
525
527
|
} & (AxisProps extends ChartsXAxisProps ? AxisSideConfig<AxisProps> & {
|
|
526
528
|
height: number;
|
|
527
529
|
} : AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
|
package/models/axis.d.ts
CHANGED
|
@@ -522,6 +522,8 @@ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps ext
|
|
|
522
522
|
* Indicate if the axis should be consider by a tooltip with `trigger='axis'`.
|
|
523
523
|
*/
|
|
524
524
|
triggerTooltip?: boolean;
|
|
525
|
+
/** @ignore - internal. True when a rotation axis covers a full circle. */
|
|
526
|
+
isFullCircle?: boolean;
|
|
525
527
|
} & (AxisProps extends ChartsXAxisProps ? AxisSideConfig<AxisProps> & {
|
|
526
528
|
height: number;
|
|
527
529
|
} : AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
|
|
@@ -4,8 +4,10 @@ import { type CartesianSeriesType, type CommonSeriesType, type CommonDefaultized
|
|
|
4
4
|
import { type DatasetElementType } from "./config.mjs";
|
|
5
5
|
import { type BarItem, type BarLabelContext } from "../../BarChart/index.mjs";
|
|
6
6
|
export type BarValueType = number;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @internal The series type shared by the bar and radialBar charts
|
|
9
|
+
*/
|
|
10
|
+
export interface CommonBarSeriesType {
|
|
9
11
|
/**
|
|
10
12
|
* Data associated to each bar.
|
|
11
13
|
*/
|
|
@@ -31,11 +33,6 @@ export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'ba
|
|
|
31
33
|
* @default 'vertical'
|
|
32
34
|
*/
|
|
33
35
|
layout?: 'horizontal' | 'vertical';
|
|
34
|
-
/**
|
|
35
|
-
* Defines how stacked series handle negative values.
|
|
36
|
-
* @default 'diverging'
|
|
37
|
-
*/
|
|
38
|
-
stackOffset?: StackOffsetType;
|
|
39
36
|
/**
|
|
40
37
|
* If provided, the value will be used as the minimum size of the bar in pixels.
|
|
41
38
|
* This is useful to avoid bars with a size of 0.
|
|
@@ -54,6 +51,9 @@ export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'ba
|
|
|
54
51
|
* @returns {string} The formatted label.
|
|
55
52
|
*/
|
|
56
53
|
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
54
|
+
}
|
|
55
|
+
export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
|
|
56
|
+
type: 'bar';
|
|
57
57
|
/**
|
|
58
58
|
* The placement of the bar label. It accepts the following values:
|
|
59
59
|
* - 'center': the label is centered on the bar
|
|
@@ -61,6 +61,11 @@ export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'ba
|
|
|
61
61
|
* @default 'center'
|
|
62
62
|
*/
|
|
63
63
|
barLabelPlacement?: 'center' | 'outside';
|
|
64
|
+
/**
|
|
65
|
+
* Defines how stacked series handle negative values.
|
|
66
|
+
* @default 'diverging'
|
|
67
|
+
*/
|
|
68
|
+
stackOffset?: StackOffsetType;
|
|
64
69
|
}
|
|
65
70
|
/**
|
|
66
71
|
* An object that allows to identify a single bar.
|
|
@@ -4,8 +4,10 @@ import { type CartesianSeriesType, type CommonSeriesType, type CommonDefaultized
|
|
|
4
4
|
import { type DatasetElementType } from "./config.js";
|
|
5
5
|
import { type BarItem, type BarLabelContext } from "../../BarChart/index.js";
|
|
6
6
|
export type BarValueType = number;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @internal The series type shared by the bar and radialBar charts
|
|
9
|
+
*/
|
|
10
|
+
export interface CommonBarSeriesType {
|
|
9
11
|
/**
|
|
10
12
|
* Data associated to each bar.
|
|
11
13
|
*/
|
|
@@ -31,11 +33,6 @@ export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'ba
|
|
|
31
33
|
* @default 'vertical'
|
|
32
34
|
*/
|
|
33
35
|
layout?: 'horizontal' | 'vertical';
|
|
34
|
-
/**
|
|
35
|
-
* Defines how stacked series handle negative values.
|
|
36
|
-
* @default 'diverging'
|
|
37
|
-
*/
|
|
38
|
-
stackOffset?: StackOffsetType;
|
|
39
36
|
/**
|
|
40
37
|
* If provided, the value will be used as the minimum size of the bar in pixels.
|
|
41
38
|
* This is useful to avoid bars with a size of 0.
|
|
@@ -54,6 +51,9 @@ export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'ba
|
|
|
54
51
|
* @returns {string} The formatted label.
|
|
55
52
|
*/
|
|
56
53
|
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
54
|
+
}
|
|
55
|
+
export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'bar'>, CartesianSeriesType, StackableSeriesType, CommonBarSeriesType {
|
|
56
|
+
type: 'bar';
|
|
57
57
|
/**
|
|
58
58
|
* The placement of the bar label. It accepts the following values:
|
|
59
59
|
* - 'center': the label is centered on the bar
|
|
@@ -61,6 +61,11 @@ export interface BarSeriesType extends CommonSeriesType<BarValueType | null, 'ba
|
|
|
61
61
|
* @default 'center'
|
|
62
62
|
*/
|
|
63
63
|
barLabelPlacement?: 'center' | 'outside';
|
|
64
|
+
/**
|
|
65
|
+
* Defines how stacked series handle negative values.
|
|
66
|
+
* @default 'diverging'
|
|
67
|
+
*/
|
|
68
|
+
stackOffset?: StackOffsetType;
|
|
64
69
|
}
|
|
65
70
|
/**
|
|
66
71
|
* An object that allows to identify a single bar.
|
|
@@ -67,6 +67,16 @@ export type CartesianSeriesType = {
|
|
|
67
67
|
*/
|
|
68
68
|
yAxisId?: AxisId;
|
|
69
69
|
};
|
|
70
|
+
export type RadialSeriesType = {
|
|
71
|
+
/**
|
|
72
|
+
* The id of the rotation-axis used to render the series.
|
|
73
|
+
*/
|
|
74
|
+
rotationAxisId?: AxisId;
|
|
75
|
+
/**
|
|
76
|
+
* The id of the radius-axis used to render the series.
|
|
77
|
+
*/
|
|
78
|
+
radiusAxisId?: AxisId;
|
|
79
|
+
};
|
|
70
80
|
export type StackableSeriesType = {
|
|
71
81
|
/**
|
|
72
82
|
* The key that identifies the stacking group.
|
|
@@ -67,6 +67,16 @@ export type CartesianSeriesType = {
|
|
|
67
67
|
*/
|
|
68
68
|
yAxisId?: AxisId;
|
|
69
69
|
};
|
|
70
|
+
export type RadialSeriesType = {
|
|
71
|
+
/**
|
|
72
|
+
* The id of the rotation-axis used to render the series.
|
|
73
|
+
*/
|
|
74
|
+
rotationAxisId?: AxisId;
|
|
75
|
+
/**
|
|
76
|
+
* The id of the radius-axis used to render the series.
|
|
77
|
+
*/
|
|
78
|
+
radiusAxisId?: AxisId;
|
|
79
|
+
};
|
|
70
80
|
export type StackableSeriesType = {
|
|
71
81
|
/**
|
|
72
82
|
* The key that identifies the stacking group.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ChartSeriesType, ChartsSeriesConfig } from "./config.mjs";
|
|
2
2
|
export type ComposableCartesianChartSeriesType = 'bar' | 'line' | 'scatter' | (ChartsSeriesConfig['rangeBar'] extends undefined ? never : 'rangeBar') | (ChartsSeriesConfig['ohlc'] extends undefined ? never : 'ohlc');
|
|
3
3
|
export declare const composableCartesianSeriesTypes: Set<ComposableCartesianChartSeriesType>;
|
|
4
|
-
export type
|
|
4
|
+
export type ComposableRadialChartSeriesType = 'radialLine' | 'radialBar';
|
|
5
|
+
export declare const composableRadialSeriesTypes: Set<ComposableRadialChartSeriesType>;
|
|
6
|
+
export type ComposableChartSeriesType<SeriesType extends ChartSeriesType> = SeriesType extends ComposableCartesianChartSeriesType ? ComposableCartesianChartSeriesType : SeriesType extends ComposableRadialChartSeriesType ? ComposableRadialChartSeriesType : SeriesType;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ChartSeriesType, ChartsSeriesConfig } from "./config.js";
|
|
2
2
|
export type ComposableCartesianChartSeriesType = 'bar' | 'line' | 'scatter' | (ChartsSeriesConfig['rangeBar'] extends undefined ? never : 'rangeBar') | (ChartsSeriesConfig['ohlc'] extends undefined ? never : 'ohlc');
|
|
3
3
|
export declare const composableCartesianSeriesTypes: Set<ComposableCartesianChartSeriesType>;
|
|
4
|
-
export type
|
|
4
|
+
export type ComposableRadialChartSeriesType = 'radialLine' | 'radialBar';
|
|
5
|
+
export declare const composableRadialSeriesTypes: Set<ComposableRadialChartSeriesType>;
|
|
6
|
+
export type ComposableChartSeriesType<SeriesType extends ChartSeriesType> = SeriesType extends ComposableCartesianChartSeriesType ? ComposableCartesianChartSeriesType : SeriesType extends ComposableRadialChartSeriesType ? ComposableRadialChartSeriesType : SeriesType;
|
|
@@ -3,5 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.composableCartesianSeriesTypes = void 0;
|
|
7
|
-
const composableCartesianSeriesTypes = exports.composableCartesianSeriesTypes = new Set(['bar', 'line', 'scatter', 'rangeBar', 'ohlc']);
|
|
6
|
+
exports.composableRadialSeriesTypes = exports.composableCartesianSeriesTypes = void 0;
|
|
7
|
+
const composableCartesianSeriesTypes = exports.composableCartesianSeriesTypes = new Set(['bar', 'line', 'scatter', 'rangeBar', 'ohlc']);
|
|
8
|
+
|
|
9
|
+
// Idem for radial series
|
|
10
|
+
|
|
11
|
+
const composableRadialSeriesTypes = exports.composableRadialSeriesTypes = new Set(['radialLine', 'radialBar']);
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export const composableCartesianSeriesTypes = new Set(['bar', 'line', 'scatter', 'rangeBar', 'ohlc']);
|
|
1
|
+
export const composableCartesianSeriesTypes = new Set(['bar', 'line', 'scatter', 'rangeBar', 'ohlc']);
|
|
2
|
+
|
|
3
|
+
// Idem for radial series
|
|
4
|
+
|
|
5
|
+
export const composableRadialSeriesTypes = new Set(['radialLine', 'radialBar']);
|
|
@@ -10,11 +10,11 @@ export type SeriesItemIdentifierWithData<SeriesType extends ChartSeriesType> = S
|
|
|
10
10
|
*/
|
|
11
11
|
export type HighlightItemIdentifier<SeriesType extends ChartSeriesType> = SeriesType extends any ? DistributiveOmit<ChartsSeriesConfig[SeriesType]['highlightIdentifier'], 'type'> : never;
|
|
12
12
|
export type HighlightItemIdentifierWithType<SeriesType extends ChartSeriesType> = SeriesType extends any ? ChartsSeriesConfig[SeriesType]['highlightIdentifier'] : never;
|
|
13
|
-
export type FocusedItemIdentifier<SeriesType extends ChartSeriesType = ChartSeriesType> = SeriesType extends 'line' | 'radar' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'dataIndex'> : SeriesType extends 'heatmap' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'xIndex' | 'yIndex'> : ChartsSeriesConfig[SeriesType]['itemIdentifier'];
|
|
13
|
+
export type FocusedItemIdentifier<SeriesType extends ChartSeriesType = ChartSeriesType> = SeriesType extends 'line' | 'radar' | 'radialLine' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'dataIndex'> : SeriesType extends 'heatmap' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'xIndex' | 'yIndex'> : ChartsSeriesConfig[SeriesType]['itemIdentifier'];
|
|
14
14
|
export { type SeriesId } from "./common.mjs";
|
|
15
15
|
export type { CartesianChartSeriesType, StackableChartSeriesType } from "./config.mjs";
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type { ShowMarkParams, MarkShape, LineSeriesType, LineItemIdentifier, DefaultizedLineSeriesType } from "./line.mjs";
|
|
17
|
+
export type { BarValueType, BarSeriesType, BarItemIdentifier, DefaultizedBarSeriesType } from "./bar.mjs";
|
|
18
18
|
export * from "./scatter.mjs";
|
|
19
19
|
export * from "./pie.mjs";
|
|
20
20
|
export * from "./radar.mjs";
|
|
@@ -10,11 +10,11 @@ export type SeriesItemIdentifierWithData<SeriesType extends ChartSeriesType> = S
|
|
|
10
10
|
*/
|
|
11
11
|
export type HighlightItemIdentifier<SeriesType extends ChartSeriesType> = SeriesType extends any ? DistributiveOmit<ChartsSeriesConfig[SeriesType]['highlightIdentifier'], 'type'> : never;
|
|
12
12
|
export type HighlightItemIdentifierWithType<SeriesType extends ChartSeriesType> = SeriesType extends any ? ChartsSeriesConfig[SeriesType]['highlightIdentifier'] : never;
|
|
13
|
-
export type FocusedItemIdentifier<SeriesType extends ChartSeriesType = ChartSeriesType> = SeriesType extends 'line' | 'radar' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'dataIndex'> : SeriesType extends 'heatmap' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'xIndex' | 'yIndex'> : ChartsSeriesConfig[SeriesType]['itemIdentifier'];
|
|
13
|
+
export type FocusedItemIdentifier<SeriesType extends ChartSeriesType = ChartSeriesType> = SeriesType extends 'line' | 'radar' | 'radialLine' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'dataIndex'> : SeriesType extends 'heatmap' ? DefaultizedProps<ChartsSeriesConfig[SeriesType]['itemIdentifier'], 'xIndex' | 'yIndex'> : ChartsSeriesConfig[SeriesType]['itemIdentifier'];
|
|
14
14
|
export { type SeriesId } from "./common.js";
|
|
15
15
|
export type { CartesianChartSeriesType, StackableChartSeriesType } from "./config.js";
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type { ShowMarkParams, MarkShape, LineSeriesType, LineItemIdentifier, DefaultizedLineSeriesType } from "./line.js";
|
|
17
|
+
export type { BarValueType, BarSeriesType, BarItemIdentifier, DefaultizedBarSeriesType } from "./bar.js";
|
|
18
18
|
export * from "./scatter.js";
|
|
19
19
|
export * from "./pie.js";
|
|
20
20
|
export * from "./radar.js";
|
|
@@ -3,28 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _line = require("./line");
|
|
7
|
-
Object.keys(_line).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _line[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _line[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _bar = require("./bar");
|
|
18
|
-
Object.keys(_bar).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _bar[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _bar[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
6
|
var _scatter = require("./scatter");
|
|
29
7
|
Object.keys(_scatter).forEach(function (key) {
|
|
30
8
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DefaultizedProps } from '@mui/x-internals/types';
|
|
2
2
|
import type { StackOffsetType } from "../stacking.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, StackableSeriesType } from "./common.mjs";
|
|
4
4
|
import { type DatasetElementType } from "./config.mjs";
|
|
5
5
|
import { type CurveType } from "../curve.mjs";
|
|
6
6
|
export interface ShowMarkParams<AxisValue = number | Date> {
|
|
@@ -26,8 +26,10 @@ export interface ShowMarkParams<AxisValue = number | Date> {
|
|
|
26
26
|
value: number;
|
|
27
27
|
}
|
|
28
28
|
export type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* @internal The series type shared by the line and radialLine charts
|
|
31
|
+
*/
|
|
32
|
+
export interface CommonLineSeriesType {
|
|
31
33
|
/**
|
|
32
34
|
* Data associated to the line.
|
|
33
35
|
*/
|
|
@@ -86,11 +88,6 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
|
|
|
86
88
|
* @default false
|
|
87
89
|
*/
|
|
88
90
|
connectNulls?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Defines how stacked series handle negative values.
|
|
91
|
-
* @default 'none'
|
|
92
|
-
*/
|
|
93
|
-
stackOffset?: StackOffsetType;
|
|
94
91
|
/**
|
|
95
92
|
* The value of the line at the base of the series area.
|
|
96
93
|
*
|
|
@@ -102,6 +99,14 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
|
|
|
102
99
|
*/
|
|
103
100
|
baseline?: number | 'min' | 'max';
|
|
104
101
|
}
|
|
102
|
+
export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
|
|
103
|
+
type: 'line';
|
|
104
|
+
/**
|
|
105
|
+
* Defines how stacked series handle negative values.
|
|
106
|
+
* @default 'none'
|
|
107
|
+
*/
|
|
108
|
+
stackOffset?: StackOffsetType;
|
|
109
|
+
}
|
|
105
110
|
/**
|
|
106
111
|
* An object that allows to identify a single line.
|
|
107
112
|
* Used for item interaction
|