@mui/x-charts 9.0.4 → 9.1.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.d.mts +1 -2
- package/BarChart/BarChart.d.ts +1 -2
- package/BarChart/BarChart.js +2 -913
- package/BarChart/BarChart.mjs +2 -913
- package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.mjs +2 -0
- package/CHANGELOG.md +133 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +55 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +55 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.js +94 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.mjs +88 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +13 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +13 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.js +86 -0
- package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.mjs +80 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.mts +18 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.ts +18 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.js +26 -0
- package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.mjs +16 -0
- package/ChartsAxisHighlightValue/index.d.mts +1 -0
- package/ChartsAxisHighlightValue/index.d.ts +1 -0
- package/ChartsAxisHighlightValue/index.js +16 -0
- package/ChartsAxisHighlightValue/index.mjs +1 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.d.mts +14 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.d.ts +14 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.js +130 -0
- package/ChartsAxisHighlightValue/useAxisHighlightValue.mjs +124 -0
- package/ChartsContainer/ChartsContainer.js +4 -1431
- package/ChartsContainer/ChartsContainer.mjs +4 -1431
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +15 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +15 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.js +56 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.mjs +50 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.mts +6 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.ts +6 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.js +5 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.mjs +1 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.mts +11 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.ts +11 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.js +70 -0
- package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.mjs +64 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.js +87 -0
- package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.mjs +81 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +9 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.js +98 -0
- package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.mjs +92 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.mts +7 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.ts +7 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.js +14 -0
- package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.mjs +6 -0
- package/ChartsRadialAxisHighlight/index.d.mts +5 -0
- package/ChartsRadialAxisHighlight/index.d.ts +5 -0
- package/ChartsRadialAxisHighlight/index.js +47 -0
- package/ChartsRadialAxisHighlight/index.mjs +4 -0
- package/ChartsRadiusAxis/index.d.mts +3 -2
- package/ChartsRadiusAxis/index.d.ts +3 -2
- package/ChartsRadiusAxis/index.mjs +3 -1
- package/ChartsRotationAxis/index.d.mts +3 -2
- package/ChartsRotationAxis/index.d.ts +3 -2
- package/ChartsRotationAxis/index.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +162 -81
- package/ChartsXAxis/useAxisTicksProps.d.ts +162 -81
- package/ChartsYAxis/useAxisTicksProps.d.mts +162 -81
- package/ChartsYAxis/useAxisTicksProps.d.ts +162 -81
- package/LICENSE +2 -0
- package/LineChart/LineChart.js +2 -913
- package/LineChart/LineChart.mjs +2 -913
- package/LineChart/seriesConfig/curveEvaluation.d.mts +19 -1
- package/LineChart/seriesConfig/curveEvaluation.d.ts +19 -1
- package/LineChart/seriesConfig/curveEvaluation.js +132 -0
- package/LineChart/seriesConfig/curveEvaluation.mjs +131 -0
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +2 -1
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +2 -1
- package/LineChart/seriesConfig/seriesProcessor.js +4 -0
- package/LineChart/seriesConfig/seriesProcessor.mjs +4 -0
- package/LineChart/useAreaPlotData.js +4 -0
- package/LineChart/useAreaPlotData.mjs +4 -0
- package/LineChart/useLinePlotData.js +2 -0
- package/LineChart/useLinePlotData.mjs +2 -0
- package/LineChart/useMarkPlotData.js +2 -0
- package/LineChart/useMarkPlotData.mjs +2 -0
- package/ScatterChart/FocusedScatterMark.js +10 -24
- package/ScatterChart/FocusedScatterMark.mjs +10 -24
- package/ScatterChart/HighlightedScatterMark.d.mts +11 -0
- package/ScatterChart/HighlightedScatterMark.d.ts +11 -0
- package/ScatterChart/HighlightedScatterMark.js +68 -0
- package/ScatterChart/HighlightedScatterMark.mjs +62 -0
- package/ScatterChart/ScatterChart.d.mts +1 -2
- package/ScatterChart/ScatterChart.d.ts +1 -2
- package/ScatterChart/ScatterChart.js +2 -913
- package/ScatterChart/ScatterChart.mjs +2 -913
- package/ScatterChart/index.d.mts +1 -0
- package/ScatterChart/index.d.ts +1 -0
- package/ScatterChart/index.js +12 -0
- package/ScatterChart/index.mjs +1 -0
- package/ScatterChart/scatterClasses.d.mts +3 -1
- package/ScatterChart/scatterClasses.d.ts +3 -1
- package/ScatterChart/scatterClasses.js +3 -2
- package/ScatterChart/scatterClasses.mjs +3 -2
- package/ScatterChart/useScatterChartProps.js +3 -1
- package/ScatterChart/useScatterChartProps.mjs +3 -1
- package/ScatterChart/useScatterItemPosition.d.mts +16 -0
- package/ScatterChart/useScatterItemPosition.d.ts +16 -0
- package/ScatterChart/useScatterItemPosition.js +47 -0
- package/ScatterChart/useScatterItemPosition.mjs +41 -0
- package/SparkLineChart/SparkLineChart.js +2 -913
- package/SparkLineChart/SparkLineChart.mjs +2 -913
- package/hooks/useAxis.d.mts +3 -3
- package/hooks/useAxis.d.ts +3 -3
- package/hooks/useAxisSystem.d.mts +1 -1
- package/hooks/useAxisSystem.d.ts +1 -1
- package/hooks/useAxisSystem.js +1 -1
- package/hooks/useAxisSystem.mjs +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +25 -1
- package/index.mjs +3 -1
- package/internals/index.d.mts +5 -0
- package/internals/index.d.ts +5 -0
- package/internals/index.js +48 -0
- package/internals/index.mjs +5 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +4 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.mts +2 -2
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +4 -7
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +4 -7
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.mts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +20 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +20 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.mts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.js +12 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.mjs +2 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +1 -1
- package/models/axis.d.mts +28 -28
- package/models/axis.d.ts +28 -28
- package/models/axis.js +5 -1
- package/models/axis.mjs +5 -1
- package/models/seriesType/line.d.mts +6 -6
- package/models/seriesType/line.d.ts +6 -6
- package/package.json +31 -3
|
@@ -16,21 +16,37 @@ function getAxisIndex(axisConfig, pointerValue) {
|
|
|
16
16
|
const {
|
|
17
17
|
scale,
|
|
18
18
|
data: axisData,
|
|
19
|
-
reverse
|
|
19
|
+
reverse,
|
|
20
|
+
isFullCircle
|
|
20
21
|
} = axisConfig;
|
|
22
|
+
const [startAngle, endAngle] = scale.range();
|
|
23
|
+
const angleGap = (0, _clampAngle.clampAngleRad)(pointerValue - startAngle);
|
|
24
|
+
const maxAngleGap = (0, _clampAngle.clampAngleRad)(endAngle - startAngle);
|
|
25
|
+
if (!isFullCircle && angleGap > maxAngleGap) {
|
|
26
|
+
// If not a full circle we only consider pointer inside the rotation range.
|
|
27
|
+
return -1;
|
|
28
|
+
}
|
|
21
29
|
if (!(0, _scaleGuards.isOrdinalScale)(scale)) {
|
|
22
30
|
if (axisData === undefined) {
|
|
23
31
|
return -1;
|
|
24
32
|
}
|
|
25
|
-
const angle =
|
|
33
|
+
const angle = startAngle + (0, _clampAngle.clampAngleRad)(pointerValue - startAngle);
|
|
26
34
|
const valueAsNumber = (0, _getAsNumber.getAsNumber)(scale.invert(angle));
|
|
27
35
|
return (0, _findClosestIndex.findClosestIndex)(axisData, valueAsNumber);
|
|
28
36
|
}
|
|
29
37
|
if (!axisData) {
|
|
30
38
|
return -1;
|
|
31
39
|
}
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
let dataIndex;
|
|
41
|
+
if (scale.bandwidth() === 0) {
|
|
42
|
+
dataIndex = Math.floor((angleGap + scale.step() / 2) / scale.step());
|
|
43
|
+
if (isFullCircle) {
|
|
44
|
+
// To show dataIndex 0 when we are before the startAngle
|
|
45
|
+
dataIndex = dataIndex % axisData.length;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
dataIndex = Math.floor(angleGap / scale.step());
|
|
49
|
+
}
|
|
34
50
|
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
35
51
|
return -1;
|
|
36
52
|
}
|
|
@@ -11,21 +11,37 @@ export function getAxisIndex(axisConfig, pointerValue) {
|
|
|
11
11
|
const {
|
|
12
12
|
scale,
|
|
13
13
|
data: axisData,
|
|
14
|
-
reverse
|
|
14
|
+
reverse,
|
|
15
|
+
isFullCircle
|
|
15
16
|
} = axisConfig;
|
|
17
|
+
const [startAngle, endAngle] = scale.range();
|
|
18
|
+
const angleGap = clampAngleRad(pointerValue - startAngle);
|
|
19
|
+
const maxAngleGap = clampAngleRad(endAngle - startAngle);
|
|
20
|
+
if (!isFullCircle && angleGap > maxAngleGap) {
|
|
21
|
+
// If not a full circle we only consider pointer inside the rotation range.
|
|
22
|
+
return -1;
|
|
23
|
+
}
|
|
16
24
|
if (!isOrdinalScale(scale)) {
|
|
17
25
|
if (axisData === undefined) {
|
|
18
26
|
return -1;
|
|
19
27
|
}
|
|
20
|
-
const angle =
|
|
28
|
+
const angle = startAngle + clampAngleRad(pointerValue - startAngle);
|
|
21
29
|
const valueAsNumber = getAsNumber(scale.invert(angle));
|
|
22
30
|
return findClosestIndex(axisData, valueAsNumber);
|
|
23
31
|
}
|
|
24
32
|
if (!axisData) {
|
|
25
33
|
return -1;
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
let dataIndex;
|
|
36
|
+
if (scale.bandwidth() === 0) {
|
|
37
|
+
dataIndex = Math.floor((angleGap + scale.step() / 2) / scale.step());
|
|
38
|
+
if (isFullCircle) {
|
|
39
|
+
// To show dataIndex 0 when we are before the startAngle
|
|
40
|
+
dataIndex = dataIndex % axisData.length;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
dataIndex = Math.floor(angleGap / scale.step());
|
|
44
|
+
}
|
|
29
45
|
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
30
46
|
return -1;
|
|
31
47
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useChartPolarAxis } from "./useChartPolarAxis.mjs";
|
|
2
2
|
export type * from "./useChartPolarAxis.types.mjs";
|
|
3
|
-
export * from "./useChartPolarAxis.selectors.mjs";
|
|
3
|
+
export * from "./useChartPolarAxis.selectors.mjs";
|
|
4
|
+
export * from "./useChartPolarInteraction.selectors.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useChartPolarAxis } from "./useChartPolarAxis.js";
|
|
2
2
|
export type * from "./useChartPolarAxis.types.js";
|
|
3
|
-
export * from "./useChartPolarAxis.selectors.js";
|
|
3
|
+
export * from "./useChartPolarAxis.selectors.js";
|
|
4
|
+
export * from "./useChartPolarInteraction.selectors.js";
|
|
@@ -24,4 +24,16 @@ Object.keys(_useChartPolarAxis2).forEach(function (key) {
|
|
|
24
24
|
return _useChartPolarAxis2[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
+
});
|
|
28
|
+
var _useChartPolarInteraction = require("./useChartPolarInteraction.selectors");
|
|
29
|
+
Object.keys(_useChartPolarInteraction).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
32
|
+
if (key in exports && exports[key] === _useChartPolarInteraction[key]) return;
|
|
33
|
+
Object.defineProperty(exports, key, {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return _useChartPolarInteraction[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
27
39
|
});
|
package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts
CHANGED
|
@@ -2,15 +2,15 @@ import { type UseChartPolarAxisSignature } from "./useChartPolarAxis.types.mjs";
|
|
|
2
2
|
import { type ChartState } from "../../models/chart.mjs";
|
|
3
3
|
import type { ChartDrawingArea } from "../../../../hooks/useDrawingArea.mjs";
|
|
4
4
|
export declare const selectorChartPolarAxisState: (state: ChartState<[], [UseChartPolarAxisSignature]>) => {
|
|
5
|
-
rotation: import("../../../index.mjs").
|
|
6
|
-
radius: import("../../../index.mjs").
|
|
5
|
+
rotation: import("../../../index.mjs").PolarAxisConfig<import("../../../index.mjs").ScaleName, any, import("../../../index.mjs").ChartsRotationAxisProps>[];
|
|
6
|
+
radius: import("../../../index.mjs").PolarAxisConfig<import("../../../index.mjs").ScaleName, any, import("../../../index.mjs").ChartsRadiusAxisProps>[];
|
|
7
7
|
} | undefined;
|
|
8
8
|
export declare const selectorChartRawRotationAxis: (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("./useChartPolarAxis.types.mjs").UseChartPolarAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
10
|
-
}) => import("../../../index.mjs").
|
|
10
|
+
}) => import("../../../index.mjs").PolarAxisConfig<keyof import("../../../index.mjs").AxisScaleConfig, any, import("../../../index.mjs").ChartsRotationAxisProps>[] | undefined;
|
|
11
11
|
export declare const selectorChartRawRadiusAxis: (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("./useChartPolarAxis.types.mjs").UseChartPolarAxisState> & {
|
|
12
12
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
13
|
-
}) => import("../../../index.mjs").
|
|
13
|
+
}) => import("../../../index.mjs").PolarAxisConfig<keyof import("../../../index.mjs").AxisScaleConfig, any, import("../../../index.mjs").ChartsRadiusAxisProps>[] | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
16
16
|
*/
|
|
@@ -2,15 +2,15 @@ import { type UseChartPolarAxisSignature } from "./useChartPolarAxis.types.js";
|
|
|
2
2
|
import { type ChartState } from "../../models/chart.js";
|
|
3
3
|
import type { ChartDrawingArea } from "../../../../hooks/useDrawingArea.js";
|
|
4
4
|
export declare const selectorChartPolarAxisState: (state: ChartState<[], [UseChartPolarAxisSignature]>) => {
|
|
5
|
-
rotation: import("../../../index.js").
|
|
6
|
-
radius: import("../../../index.js").
|
|
5
|
+
rotation: import("../../../index.js").PolarAxisConfig<import("../../../index.js").ScaleName, any, import("../../../index.js").ChartsRotationAxisProps>[];
|
|
6
|
+
radius: import("../../../index.js").PolarAxisConfig<import("../../../index.js").ScaleName, any, import("../../../index.js").ChartsRadiusAxisProps>[];
|
|
7
7
|
} | undefined;
|
|
8
8
|
export declare const selectorChartRawRotationAxis: (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("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
|
-
}) => import("../../../index.js").
|
|
10
|
+
}) => import("../../../index.js").PolarAxisConfig<keyof import("../../../index.js").AxisScaleConfig, any, import("../../../index.js").ChartsRotationAxisProps>[] | undefined;
|
|
11
11
|
export declare const selectorChartRawRadiusAxis: (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("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
13
|
-
}) => import("../../../index.js").
|
|
13
|
+
}) => import("../../../index.js").PolarAxisConfig<keyof import("../../../index.js").AxisScaleConfig, any, import("../../../index.js").ChartsRadiusAxisProps>[] | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
16
16
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChartPluginSignature } from "../../models/index.mjs";
|
|
2
2
|
import { type ChartSeriesType, type DatasetType } from "../../../../models/seriesType/config.mjs";
|
|
3
|
-
import { type ScaleName, type
|
|
3
|
+
import { type ScaleName, type PolarAxisConfig, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type RadiusAxis, type RotationAxis, type ChartsAxisData } from "../../../../models/axis.mjs";
|
|
4
4
|
import { type UseChartSeriesSignature } from "../../corePlugins/useChartSeries/index.mjs";
|
|
5
5
|
import { type UseChartInteractionSignature } from "../useChartInteraction/index.mjs";
|
|
6
6
|
export interface UseChartPolarAxisInstance {
|
|
@@ -60,8 +60,8 @@ export interface UseChartPolarAxisParameters {
|
|
|
60
60
|
export type UseChartPolarAxisDefaultizedParameters = UseChartPolarAxisParameters & {};
|
|
61
61
|
export interface UseChartPolarAxisState {
|
|
62
62
|
polarAxis: {
|
|
63
|
-
rotation:
|
|
64
|
-
radius:
|
|
63
|
+
rotation: PolarAxisConfig<ScaleName, any, ChartsRotationAxisProps>[];
|
|
64
|
+
radius: PolarAxisConfig<ScaleName, any, ChartsRadiusAxisProps>[];
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
export type UseChartPolarAxisSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChartPluginSignature } from "../../models/index.js";
|
|
2
2
|
import { type ChartSeriesType, type DatasetType } from "../../../../models/seriesType/config.js";
|
|
3
|
-
import { type ScaleName, type
|
|
3
|
+
import { type ScaleName, type PolarAxisConfig, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type RadiusAxis, type RotationAxis, type ChartsAxisData } from "../../../../models/axis.js";
|
|
4
4
|
import { type UseChartSeriesSignature } from "../../corePlugins/useChartSeries/index.js";
|
|
5
5
|
import { type UseChartInteractionSignature } from "../useChartInteraction/index.js";
|
|
6
6
|
export interface UseChartPolarAxisInstance {
|
|
@@ -60,8 +60,8 @@ export interface UseChartPolarAxisParameters {
|
|
|
60
60
|
export type UseChartPolarAxisDefaultizedParameters = UseChartPolarAxisParameters & {};
|
|
61
61
|
export interface UseChartPolarAxisState {
|
|
62
62
|
polarAxis: {
|
|
63
|
-
rotation:
|
|
64
|
-
radius:
|
|
63
|
+
rotation: PolarAxisConfig<ScaleName, any, ChartsRotationAxisProps>[];
|
|
64
|
+
radius: PolarAxisConfig<ScaleName, any, ChartsRadiusAxisProps>[];
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
export type UseChartPolarAxisSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AxisItemIdentifier } from "../../../../models/axis.mjs";
|
|
2
2
|
export declare const selectorChartsInteractionRotationAxisIndex: (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> & {
|
|
3
3
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
4
4
|
}) => number | null;
|
package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AxisItemIdentifier } from "../../../../models/axis.js";
|
|
2
2
|
export declare const selectorChartsInteractionRotationAxisIndex: (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> & {
|
|
3
3
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
4
4
|
}) => number | null;
|
package/models/axis.d.mts
CHANGED
|
@@ -139,7 +139,7 @@ export interface ChartsXAxisProps extends ChartsAxisProps {
|
|
|
139
139
|
*/
|
|
140
140
|
tickLabelMinGap?: number;
|
|
141
141
|
}
|
|
142
|
-
type AxisSideConfig<AxisProps extends
|
|
142
|
+
type AxisSideConfig<AxisProps extends ChartsXAxisProps | ChartsYAxisProps> = {
|
|
143
143
|
/**
|
|
144
144
|
* Position of the axis.
|
|
145
145
|
*
|
|
@@ -149,36 +149,22 @@ type AxisSideConfig<AxisProps extends ChartsAxisProps> = AxisProps extends Chart
|
|
|
149
149
|
*
|
|
150
150
|
* The first axis in the list will always have a default position.
|
|
151
151
|
*/
|
|
152
|
-
position?: 'top' | 'bottom' | 'none';
|
|
152
|
+
position?: (AxisProps extends ChartsXAxisProps ? 'top' | 'bottom' : 'none') | (AxisProps extends ChartsYAxisProps ? 'left' | 'right' : 'none') | 'none';
|
|
153
153
|
/**
|
|
154
154
|
* The height of the axis.
|
|
155
155
|
* Set to `'auto'` to automatically calculate the height based on tick label measurements.
|
|
156
156
|
* @default 45 if an axis label is provided, 25 otherwise.
|
|
157
157
|
*/
|
|
158
|
-
height?: number | 'auto';
|
|
159
|
-
} : AxisProps extends ChartsYAxisProps ? {
|
|
160
|
-
/**
|
|
161
|
-
* Position of the axis.
|
|
162
|
-
*
|
|
163
|
-
* When set, the space for the axis is reserved, even if the axis is not displayed due to missing data.
|
|
164
|
-
*
|
|
165
|
-
* Set to 'none' to hide the axis.
|
|
166
|
-
*
|
|
167
|
-
* The first axis in the list will always have a default position.
|
|
168
|
-
*/
|
|
169
|
-
position?: 'left' | 'right' | 'none';
|
|
158
|
+
height?: AxisProps extends ChartsXAxisProps ? number | 'auto' : never;
|
|
170
159
|
/**
|
|
171
160
|
* The width of the axis.
|
|
172
161
|
* Set to `'auto'` to automatically calculate the width based on tick label measurements.
|
|
173
162
|
* @default 65 if an axis label is provided, 45 otherwise.
|
|
174
163
|
*/
|
|
175
|
-
width?: number | 'auto';
|
|
176
|
-
} : {
|
|
177
|
-
position?: 'top' | 'bottom' | 'left' | 'right' | 'none';
|
|
178
|
-
height?: number | 'auto';
|
|
179
|
-
width?: number | 'auto';
|
|
164
|
+
width?: AxisProps extends ChartsYAxisProps ? number | 'auto' : never;
|
|
180
165
|
};
|
|
181
166
|
export interface ChartsRotationAxisProps extends ChartsAxisProps {
|
|
167
|
+
axis?: 'rotation';
|
|
182
168
|
/**
|
|
183
169
|
* The start angle (in deg).
|
|
184
170
|
*/
|
|
@@ -193,6 +179,7 @@ export interface ChartsRotationAxisProps extends ChartsAxisProps {
|
|
|
193
179
|
labelGap?: number;
|
|
194
180
|
}
|
|
195
181
|
export interface ChartsRadiusAxisProps extends ChartsAxisProps {
|
|
182
|
+
axis?: 'radius';
|
|
196
183
|
/**
|
|
197
184
|
* The minimal radius.
|
|
198
185
|
*/
|
|
@@ -485,7 +472,10 @@ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
|
485
472
|
*/
|
|
486
473
|
ignoreTooltip?: boolean;
|
|
487
474
|
};
|
|
488
|
-
|
|
475
|
+
/**
|
|
476
|
+
* Use this type for advanced typing. For basic usage, use `RotationAxis` or `RadiusAxis`.
|
|
477
|
+
*/
|
|
478
|
+
export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
489
479
|
/**
|
|
490
480
|
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
491
481
|
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
@@ -493,11 +483,11 @@ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps
|
|
|
493
483
|
* @default 0
|
|
494
484
|
*/
|
|
495
485
|
offset?: number;
|
|
496
|
-
} & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisConfigExtension;
|
|
486
|
+
} & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams & AxisConfigExtension;
|
|
497
487
|
/**
|
|
498
|
-
* Use this type for advanced typing. For basic usage, use `XAxis
|
|
488
|
+
* Use this type for advanced typing. For basic usage, use `XAxis` or `YAxis`.
|
|
499
489
|
*/
|
|
500
|
-
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends
|
|
490
|
+
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsXAxisProps | ChartsYAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
|
|
501
491
|
/**
|
|
502
492
|
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
503
493
|
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
@@ -524,20 +514,30 @@ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps ext
|
|
|
524
514
|
triggerTooltip?: boolean;
|
|
525
515
|
/** @ignore - internal. True when a rotation axis covers a full circle. */
|
|
526
516
|
isFullCircle?: boolean;
|
|
527
|
-
} & (AxisProps extends ChartsXAxisProps ? AxisSideConfig<AxisProps> & {
|
|
517
|
+
} & AxisProps & (AxisProps extends ChartsXAxisProps ? AxisSideConfig<AxisProps> & {
|
|
528
518
|
height: number;
|
|
529
|
-
} : AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
|
|
519
|
+
} : {}) & (AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
|
|
530
520
|
width: number;
|
|
531
|
-
} :
|
|
521
|
+
} : {});
|
|
532
522
|
export type ComputedXAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsXAxisProps>;
|
|
533
523
|
export type ComputedYAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsYAxisProps>;
|
|
524
|
+
export declare function isBandScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'band'> & {
|
|
525
|
+
scaleType: 'band';
|
|
526
|
+
};
|
|
534
527
|
export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'band'> & {
|
|
535
528
|
scaleType: 'band';
|
|
536
529
|
};
|
|
530
|
+
export declare function isPointScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'point'> & {
|
|
531
|
+
scaleType: 'point';
|
|
532
|
+
};
|
|
537
533
|
export declare function isPointScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'point'> & {
|
|
538
534
|
scaleType: 'point';
|
|
539
535
|
};
|
|
536
|
+
export declare function isContinuousScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<ContinuousScaleName>;
|
|
540
537
|
export declare function isContinuousScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<ContinuousScaleName>;
|
|
538
|
+
export declare function isSymlogScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'symlog'> & {
|
|
539
|
+
scaleType: 'symlog';
|
|
540
|
+
};
|
|
541
541
|
export declare function isSymlogScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'symlog'> & {
|
|
542
542
|
scaleType: 'symlog';
|
|
543
543
|
};
|
|
@@ -575,8 +575,8 @@ export interface AxisItemIdentifier {
|
|
|
575
575
|
}
|
|
576
576
|
export type XAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsXAxisProps>, 'id'> : never;
|
|
577
577
|
export type YAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsYAxisProps>, 'id'> : never;
|
|
578
|
-
export type RotationAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<
|
|
579
|
-
export type RadiusAxis<S extends
|
|
578
|
+
export type RotationAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<PolarAxisConfig<S, V, ChartsRotationAxisProps>, 'id'> : never;
|
|
579
|
+
export type RadiusAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<PolarAxisConfig<S, V, ChartsRadiusAxisProps>, 'id'> : never;
|
|
580
580
|
/**
|
|
581
581
|
* The axis configuration with missing values filled with default values.
|
|
582
582
|
*/
|
package/models/axis.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export interface ChartsXAxisProps extends ChartsAxisProps {
|
|
|
139
139
|
*/
|
|
140
140
|
tickLabelMinGap?: number;
|
|
141
141
|
}
|
|
142
|
-
type AxisSideConfig<AxisProps extends
|
|
142
|
+
type AxisSideConfig<AxisProps extends ChartsXAxisProps | ChartsYAxisProps> = {
|
|
143
143
|
/**
|
|
144
144
|
* Position of the axis.
|
|
145
145
|
*
|
|
@@ -149,36 +149,22 @@ type AxisSideConfig<AxisProps extends ChartsAxisProps> = AxisProps extends Chart
|
|
|
149
149
|
*
|
|
150
150
|
* The first axis in the list will always have a default position.
|
|
151
151
|
*/
|
|
152
|
-
position?: 'top' | 'bottom' | 'none';
|
|
152
|
+
position?: (AxisProps extends ChartsXAxisProps ? 'top' | 'bottom' : 'none') | (AxisProps extends ChartsYAxisProps ? 'left' | 'right' : 'none') | 'none';
|
|
153
153
|
/**
|
|
154
154
|
* The height of the axis.
|
|
155
155
|
* Set to `'auto'` to automatically calculate the height based on tick label measurements.
|
|
156
156
|
* @default 45 if an axis label is provided, 25 otherwise.
|
|
157
157
|
*/
|
|
158
|
-
height?: number | 'auto';
|
|
159
|
-
} : AxisProps extends ChartsYAxisProps ? {
|
|
160
|
-
/**
|
|
161
|
-
* Position of the axis.
|
|
162
|
-
*
|
|
163
|
-
* When set, the space for the axis is reserved, even if the axis is not displayed due to missing data.
|
|
164
|
-
*
|
|
165
|
-
* Set to 'none' to hide the axis.
|
|
166
|
-
*
|
|
167
|
-
* The first axis in the list will always have a default position.
|
|
168
|
-
*/
|
|
169
|
-
position?: 'left' | 'right' | 'none';
|
|
158
|
+
height?: AxisProps extends ChartsXAxisProps ? number | 'auto' : never;
|
|
170
159
|
/**
|
|
171
160
|
* The width of the axis.
|
|
172
161
|
* Set to `'auto'` to automatically calculate the width based on tick label measurements.
|
|
173
162
|
* @default 65 if an axis label is provided, 45 otherwise.
|
|
174
163
|
*/
|
|
175
|
-
width?: number | 'auto';
|
|
176
|
-
} : {
|
|
177
|
-
position?: 'top' | 'bottom' | 'left' | 'right' | 'none';
|
|
178
|
-
height?: number | 'auto';
|
|
179
|
-
width?: number | 'auto';
|
|
164
|
+
width?: AxisProps extends ChartsYAxisProps ? number | 'auto' : never;
|
|
180
165
|
};
|
|
181
166
|
export interface ChartsRotationAxisProps extends ChartsAxisProps {
|
|
167
|
+
axis?: 'rotation';
|
|
182
168
|
/**
|
|
183
169
|
* The start angle (in deg).
|
|
184
170
|
*/
|
|
@@ -193,6 +179,7 @@ export interface ChartsRotationAxisProps extends ChartsAxisProps {
|
|
|
193
179
|
labelGap?: number;
|
|
194
180
|
}
|
|
195
181
|
export interface ChartsRadiusAxisProps extends ChartsAxisProps {
|
|
182
|
+
axis?: 'radius';
|
|
196
183
|
/**
|
|
197
184
|
* The minimal radius.
|
|
198
185
|
*/
|
|
@@ -485,7 +472,10 @@ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
|
485
472
|
*/
|
|
486
473
|
ignoreTooltip?: boolean;
|
|
487
474
|
};
|
|
488
|
-
|
|
475
|
+
/**
|
|
476
|
+
* Use this type for advanced typing. For basic usage, use `RotationAxis` or `RadiusAxis`.
|
|
477
|
+
*/
|
|
478
|
+
export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
489
479
|
/**
|
|
490
480
|
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
491
481
|
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
@@ -493,11 +483,11 @@ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps
|
|
|
493
483
|
* @default 0
|
|
494
484
|
*/
|
|
495
485
|
offset?: number;
|
|
496
|
-
} & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisConfigExtension;
|
|
486
|
+
} & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams & AxisConfigExtension;
|
|
497
487
|
/**
|
|
498
|
-
* Use this type for advanced typing. For basic usage, use `XAxis
|
|
488
|
+
* Use this type for advanced typing. For basic usage, use `XAxis` or `YAxis`.
|
|
499
489
|
*/
|
|
500
|
-
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends
|
|
490
|
+
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsXAxisProps | ChartsYAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
|
|
501
491
|
/**
|
|
502
492
|
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
503
493
|
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
@@ -524,20 +514,30 @@ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps ext
|
|
|
524
514
|
triggerTooltip?: boolean;
|
|
525
515
|
/** @ignore - internal. True when a rotation axis covers a full circle. */
|
|
526
516
|
isFullCircle?: boolean;
|
|
527
|
-
} & (AxisProps extends ChartsXAxisProps ? AxisSideConfig<AxisProps> & {
|
|
517
|
+
} & AxisProps & (AxisProps extends ChartsXAxisProps ? AxisSideConfig<AxisProps> & {
|
|
528
518
|
height: number;
|
|
529
|
-
} : AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
|
|
519
|
+
} : {}) & (AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
|
|
530
520
|
width: number;
|
|
531
|
-
} :
|
|
521
|
+
} : {});
|
|
532
522
|
export type ComputedXAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsXAxisProps>;
|
|
533
523
|
export type ComputedYAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsYAxisProps>;
|
|
524
|
+
export declare function isBandScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'band'> & {
|
|
525
|
+
scaleType: 'band';
|
|
526
|
+
};
|
|
534
527
|
export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'band'> & {
|
|
535
528
|
scaleType: 'band';
|
|
536
529
|
};
|
|
530
|
+
export declare function isPointScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'point'> & {
|
|
531
|
+
scaleType: 'point';
|
|
532
|
+
};
|
|
537
533
|
export declare function isPointScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'point'> & {
|
|
538
534
|
scaleType: 'point';
|
|
539
535
|
};
|
|
536
|
+
export declare function isContinuousScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<ContinuousScaleName>;
|
|
540
537
|
export declare function isContinuousScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<ContinuousScaleName>;
|
|
538
|
+
export declare function isSymlogScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'symlog'> & {
|
|
539
|
+
scaleType: 'symlog';
|
|
540
|
+
};
|
|
541
541
|
export declare function isSymlogScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'symlog'> & {
|
|
542
542
|
scaleType: 'symlog';
|
|
543
543
|
};
|
|
@@ -575,8 +575,8 @@ export interface AxisItemIdentifier {
|
|
|
575
575
|
}
|
|
576
576
|
export type XAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsXAxisProps>, 'id'> : never;
|
|
577
577
|
export type YAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsYAxisProps>, 'id'> : never;
|
|
578
|
-
export type RotationAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<
|
|
579
|
-
export type RadiusAxis<S extends
|
|
578
|
+
export type RotationAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<PolarAxisConfig<S, V, ChartsRotationAxisProps>, 'id'> : never;
|
|
579
|
+
export type RadiusAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<PolarAxisConfig<S, V, ChartsRadiusAxisProps>, 'id'> : never;
|
|
580
580
|
/**
|
|
581
581
|
* The axis configuration with missing values filled with default values.
|
|
582
582
|
*/
|
package/models/axis.js
CHANGED
|
@@ -17,7 +17,11 @@ exports.isSymlogScaleConfig = isSymlogScaleConfig;
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Use this type for advanced typing. For basic usage, use `
|
|
20
|
+
* Use this type for advanced typing. For basic usage, use `RotationAxis` or `RadiusAxis`.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Use this type for advanced typing. For basic usage, use `XAxis` or `YAxis`.
|
|
21
25
|
*/
|
|
22
26
|
|
|
23
27
|
function isBandScaleConfig(scaleConfig) {
|
package/models/axis.mjs
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Use this type for advanced typing. For basic usage, use `
|
|
11
|
+
* Use this type for advanced typing. For basic usage, use `RotationAxis` or `RadiusAxis`.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Use this type for advanced typing. For basic usage, use `XAxis` or `YAxis`.
|
|
12
16
|
*/
|
|
13
17
|
|
|
14
18
|
export function isBandScaleConfig(scaleConfig) {
|
|
@@ -54,12 +54,6 @@ export interface CommonLineSeriesType {
|
|
|
54
54
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
55
55
|
*/
|
|
56
56
|
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
57
|
-
/**
|
|
58
|
-
* The type of curve to use for the line.
|
|
59
|
-
* Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
60
|
-
* @default 'monotoneX'
|
|
61
|
-
*/
|
|
62
|
-
curve?: CurveType;
|
|
63
57
|
/**
|
|
64
58
|
* If `true`, step curve starts and end at the first and last point.
|
|
65
59
|
* By default the line is extended to fill the space before and after.
|
|
@@ -106,6 +100,12 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
|
|
|
106
100
|
* @default 'none'
|
|
107
101
|
*/
|
|
108
102
|
stackOffset?: StackOffsetType;
|
|
103
|
+
/**
|
|
104
|
+
* The type of curve to use for the line.
|
|
105
|
+
* Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
106
|
+
* @default 'monotoneX'
|
|
107
|
+
*/
|
|
108
|
+
curve?: CurveType;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
111
|
* An object that allows to identify a single line.
|
|
@@ -54,12 +54,6 @@ export interface CommonLineSeriesType {
|
|
|
54
54
|
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
55
55
|
*/
|
|
56
56
|
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
57
|
-
/**
|
|
58
|
-
* The type of curve to use for the line.
|
|
59
|
-
* Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
60
|
-
* @default 'monotoneX'
|
|
61
|
-
*/
|
|
62
|
-
curve?: CurveType;
|
|
63
57
|
/**
|
|
64
58
|
* If `true`, step curve starts and end at the first and last point.
|
|
65
59
|
* By default the line is extended to fill the space before and after.
|
|
@@ -106,6 +100,12 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
|
|
|
106
100
|
* @default 'none'
|
|
107
101
|
*/
|
|
108
102
|
stackOffset?: StackOffsetType;
|
|
103
|
+
/**
|
|
104
|
+
* The type of curve to use for the line.
|
|
105
|
+
* Read more about curves at [line interpolation](https://mui.com/x/react-charts/lines/#interpolation).
|
|
106
|
+
* @default 'monotoneX'
|
|
107
|
+
*/
|
|
108
|
+
curve?: CurveType;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
111
|
* An object that allows to identify a single line.
|