@mui/x-charts 9.0.2 → 9.0.3
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/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +8 -8
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +8 -8
- package/CHANGELOG.md +136 -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 +7 -4
- package/ChartsTooltip/useAxesTooltip.mjs +8 -5
- 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/seriesConfig/curveEvaluation.js +24 -19
- package/LineChart/seriesConfig/curveEvaluation.mjs +24 -19
- package/LineChart/seriesConfig/getItemAtPosition.js +14 -3
- package/LineChart/seriesConfig/getItemAtPosition.mjs +14 -3
- 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/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.mts +2 -2
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
- 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/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/index.d.mts +5 -1
- package/internals/index.d.ts +5 -1
- package/internals/index.js +47 -2
- package/internals/index.mjs +5 -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/useChartPolarAxis/computeAxisValue.d.mts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +23 -13
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +23 -13
- 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 +161 -133
package/internals/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -25,7 +26,8 @@ var _exportNames = {
|
|
|
25
26
|
getBandSize: true,
|
|
26
27
|
useChartsTooltipUtilityClasses: true,
|
|
27
28
|
getChartsTooltipUtilityClass: true,
|
|
28
|
-
getAxisExtrema: true
|
|
29
|
+
getAxisExtrema: true,
|
|
30
|
+
getLineItemAtPosition: true
|
|
29
31
|
};
|
|
30
32
|
Object.defineProperty(exports, "checkBarChartScaleErrors", {
|
|
31
33
|
enumerable: true,
|
|
@@ -69,6 +71,12 @@ Object.defineProperty(exports, "getChartsTooltipUtilityClass", {
|
|
|
69
71
|
return _chartsTooltipClasses.getChartsTooltipUtilityClass;
|
|
70
72
|
}
|
|
71
73
|
});
|
|
74
|
+
Object.defineProperty(exports, "getLineItemAtPosition", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () {
|
|
77
|
+
return _getItemAtPosition.default;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
72
80
|
Object.defineProperty(exports, "getSeriesColorFn", {
|
|
73
81
|
enumerable: true,
|
|
74
82
|
get: function () {
|
|
@@ -266,6 +274,18 @@ Object.keys(_useChartsDataProviderProps).forEach(function (key) {
|
|
|
266
274
|
}
|
|
267
275
|
});
|
|
268
276
|
});
|
|
277
|
+
var _useChartsRadialDataProviderProps = require("../ChartsRadialDataProvider/useChartsRadialDataProviderProps");
|
|
278
|
+
Object.keys(_useChartsRadialDataProviderProps).forEach(function (key) {
|
|
279
|
+
if (key === "default" || key === "__esModule") return;
|
|
280
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
281
|
+
if (key in exports && exports[key] === _useChartsRadialDataProviderProps[key]) return;
|
|
282
|
+
Object.defineProperty(exports, key, {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function () {
|
|
285
|
+
return _useChartsRadialDataProviderProps[key];
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
});
|
|
269
289
|
var _seriesSelectorOfType = require("./seriesSelectorOfType");
|
|
270
290
|
Object.keys(_seriesSelectorOfType).forEach(function (key) {
|
|
271
291
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -852,6 +872,30 @@ Object.keys(_common).forEach(function (key) {
|
|
|
852
872
|
}
|
|
853
873
|
});
|
|
854
874
|
});
|
|
875
|
+
var _line = require("../models/seriesType/line");
|
|
876
|
+
Object.keys(_line).forEach(function (key) {
|
|
877
|
+
if (key === "default" || key === "__esModule") return;
|
|
878
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
879
|
+
if (key in exports && exports[key] === _line[key]) return;
|
|
880
|
+
Object.defineProperty(exports, key, {
|
|
881
|
+
enumerable: true,
|
|
882
|
+
get: function () {
|
|
883
|
+
return _line[key];
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
});
|
|
887
|
+
var _bar = require("../models/seriesType/bar");
|
|
888
|
+
Object.keys(_bar).forEach(function (key) {
|
|
889
|
+
if (key === "default" || key === "__esModule") return;
|
|
890
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
891
|
+
if (key in exports && exports[key] === _bar[key]) return;
|
|
892
|
+
Object.defineProperty(exports, key, {
|
|
893
|
+
enumerable: true,
|
|
894
|
+
get: function () {
|
|
895
|
+
return _bar[key];
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
});
|
|
855
899
|
var _zAxis = require("../models/z-axis");
|
|
856
900
|
Object.keys(_zAxis).forEach(function (key) {
|
|
857
901
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -971,4 +1015,5 @@ Object.keys(_identifierCleaner).forEach(function (key) {
|
|
|
971
1015
|
return _identifierCleaner[key];
|
|
972
1016
|
}
|
|
973
1017
|
});
|
|
974
|
-
});
|
|
1018
|
+
});
|
|
1019
|
+
var _getItemAtPosition = _interopRequireDefault(require("../LineChart/seriesConfig/getItemAtPosition"));
|
package/internals/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ export { processBarDataForPlot } from "../BarChart/useBarPlotData.mjs";
|
|
|
20
20
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.mjs";
|
|
21
21
|
export * from "../ChartsContainer/useChartsContainerProps.mjs";
|
|
22
22
|
export * from "../ChartsDataProvider/useChartsDataProviderProps.mjs";
|
|
23
|
+
export * from "../ChartsRadialDataProvider/useChartsRadialDataProviderProps.mjs";
|
|
23
24
|
export * from "./seriesSelectorOfType.mjs";
|
|
24
25
|
export { useSkipAnimation } from "../hooks/useSkipAnimation.mjs";
|
|
25
26
|
export { useRegisterPointerInteractions } from "./plugins/featurePlugins/shared/useRegisterPointerInteractions.mjs";
|
|
@@ -88,6 +89,8 @@ export * from "../context/ChartsSlotsContext.mjs";
|
|
|
88
89
|
// series configuration
|
|
89
90
|
export * from "../models/seriesType/config.mjs";
|
|
90
91
|
export * from "../models/seriesType/common.mjs";
|
|
92
|
+
export * from "../models/seriesType/line.mjs";
|
|
93
|
+
export * from "../models/seriesType/bar.mjs";
|
|
91
94
|
export * from "../models/z-axis.mjs";
|
|
92
95
|
export * from "../models/axis.mjs";
|
|
93
96
|
export * from "../models/seriesType/composition.mjs";
|
|
@@ -97,4 +100,5 @@ export * from "./createSvgIcon.mjs";
|
|
|
97
100
|
export * from "./constants.mjs";
|
|
98
101
|
export * from "./scales/index.mjs";
|
|
99
102
|
export * from "./identifierSerializer.mjs";
|
|
100
|
-
export * from "./identifierCleaner.mjs";
|
|
103
|
+
export * from "./identifierCleaner.mjs";
|
|
104
|
+
export { default as getLineItemAtPosition } from "../LineChart/seriesConfig/getItemAtPosition.mjs";
|
package/internals/isPolar.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { type PolarChartSeriesType } from "../models/seriesType/config.mjs";
|
|
2
|
-
export declare function isPolarSeriesType(seriesType: string): seriesType is PolarChartSeriesType;
|
|
1
|
+
import { type ChartSeriesType, type ChartSeriesDefaultized, type PolarChartSeriesType } from "../models/seriesType/config.mjs";
|
|
2
|
+
export declare function isPolarSeriesType(seriesType: string): seriesType is PolarChartSeriesType;
|
|
3
|
+
export declare function isPolarSeries(series: ChartSeriesDefaultized<ChartSeriesType>): series is ChartSeriesDefaultized<PolarChartSeriesType>;
|
package/internals/isPolar.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { type PolarChartSeriesType } from "../models/seriesType/config.js";
|
|
2
|
-
export declare function isPolarSeriesType(seriesType: string): seriesType is PolarChartSeriesType;
|
|
1
|
+
import { type ChartSeriesType, type ChartSeriesDefaultized, type PolarChartSeriesType } from "../models/seriesType/config.js";
|
|
2
|
+
export declare function isPolarSeriesType(seriesType: string): seriesType is PolarChartSeriesType;
|
|
3
|
+
export declare function isPolarSeries(series: ChartSeriesDefaultized<ChartSeriesType>): series is ChartSeriesDefaultized<PolarChartSeriesType>;
|
package/internals/isPolar.js
CHANGED
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.isPolarSeries = isPolarSeries;
|
|
6
7
|
exports.isPolarSeriesType = isPolarSeriesType;
|
|
7
8
|
var _configInit = require("./configInit");
|
|
8
9
|
function isPolarSeriesType(seriesType) {
|
|
9
10
|
return _configInit.polarSeriesTypes.getTypes().has(seriesType);
|
|
11
|
+
}
|
|
12
|
+
function isPolarSeries(series) {
|
|
13
|
+
return isPolarSeriesType(series.type);
|
|
10
14
|
}
|
package/internals/isPolar.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComputedXAxis, ComputedYAxis } from "../../../../../models/axis.mjs";
|
|
1
|
+
import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedAxis, ComputedXAxis, ComputedYAxis, ScaleName } from "../../../../../models/axis.mjs";
|
|
2
2
|
import type { DefaultizedSeriesType } from "../../../../../models/seriesType/index.mjs";
|
|
3
3
|
import type { ZAxisDefaultized } from "../../../../../models/z-axis.mjs";
|
|
4
4
|
import type { ChartSeriesType } from "../../../../../models/seriesType/config.mjs";
|
|
@@ -7,13 +7,12 @@ import type { ChartSeriesType } from "../../../../../models/seriesType/config.mj
|
|
|
7
7
|
* If dataIndex is not defined, it falls back to the series color when defined.
|
|
8
8
|
*/
|
|
9
9
|
export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : (dataIndex?: number) => string;
|
|
10
|
+
export type ColorProcessor<SeriesType extends ChartSeriesType> = (series: DefaultizedSeriesType<SeriesType>,
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* If dataIndex is not defined, it falls back to the series color.
|
|
13
|
-
* @param {DefaultizedSeriesType<SeriesType>} series - The series configuration.
|
|
14
|
-
* @param {ComputedXAxis | undefined} xAxis - The computed x-axis configuration.
|
|
15
|
-
* @param {ComputedYAxis | undefined} yAxis - The computed y-axis configuration.
|
|
16
|
-
* @param {ZAxisDefaultized | undefined} zAxis - The defaulted z-axis configuration.
|
|
17
|
-
* @returns {ColorGetter<SeriesType>} A function that takes a data index and returns a color string.
|
|
12
|
+
* Either the x-axis or rotation-axis, depending on the coordinate system.
|
|
18
13
|
*/
|
|
19
|
-
|
|
14
|
+
mainAxis?: ComputedXAxis | ComputedAxis<ScaleName, any, ChartsRotationAxisProps>,
|
|
15
|
+
/**
|
|
16
|
+
* Either the y-axis or radius-axis, depending on the coordinate system.
|
|
17
|
+
*/
|
|
18
|
+
secondaryAxis?: ComputedYAxis | ComputedAxis<ScaleName, any, ChartsRadiusAxisProps>, zAxis?: ZAxisDefaultized) => ColorGetter<SeriesType>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComputedXAxis, ComputedYAxis } from "../../../../../models/axis.js";
|
|
1
|
+
import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedAxis, ComputedXAxis, ComputedYAxis, ScaleName } from "../../../../../models/axis.js";
|
|
2
2
|
import type { DefaultizedSeriesType } from "../../../../../models/seriesType/index.js";
|
|
3
3
|
import type { ZAxisDefaultized } from "../../../../../models/z-axis.js";
|
|
4
4
|
import type { ChartSeriesType } from "../../../../../models/seriesType/config.js";
|
|
@@ -7,13 +7,12 @@ import type { ChartSeriesType } from "../../../../../models/seriesType/config.js
|
|
|
7
7
|
* If dataIndex is not defined, it falls back to the series color when defined.
|
|
8
8
|
*/
|
|
9
9
|
export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : (dataIndex?: number) => string;
|
|
10
|
+
export type ColorProcessor<SeriesType extends ChartSeriesType> = (series: DefaultizedSeriesType<SeriesType>,
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* If dataIndex is not defined, it falls back to the series color.
|
|
13
|
-
* @param {DefaultizedSeriesType<SeriesType>} series - The series configuration.
|
|
14
|
-
* @param {ComputedXAxis | undefined} xAxis - The computed x-axis configuration.
|
|
15
|
-
* @param {ComputedYAxis | undefined} yAxis - The computed y-axis configuration.
|
|
16
|
-
* @param {ZAxisDefaultized | undefined} zAxis - The defaulted z-axis configuration.
|
|
17
|
-
* @returns {ColorGetter<SeriesType>} A function that takes a data index and returns a color string.
|
|
12
|
+
* Either the x-axis or rotation-axis, depending on the coordinate system.
|
|
18
13
|
*/
|
|
19
|
-
|
|
14
|
+
mainAxis?: ComputedXAxis | ComputedAxis<ScaleName, any, ChartsRotationAxisProps>,
|
|
15
|
+
/**
|
|
16
|
+
* Either the y-axis or radius-axis, depending on the coordinate system.
|
|
17
|
+
*/
|
|
18
|
+
secondaryAxis?: ComputedYAxis | ComputedAxis<ScaleName, any, ChartsRadiusAxisProps>, zAxis?: ZAxisDefaultized) => ColorGetter<SeriesType>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AxisConfig, ScaleName } from "../../../../models/index.mjs";
|
|
2
2
|
import { type ChartsAxisProps, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type PolarAxisDefaultized, type AxisId } from "../../../../models/axis.mjs";
|
|
3
3
|
import { type ChartSeriesType } from "../../../../models/seriesType/config.mjs";
|
|
4
4
|
import type { ChartDrawingArea } from "../../../../hooks/index.mjs";
|
|
5
5
|
import { type ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
6
6
|
import { type ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.mjs";
|
|
7
|
+
import { type ComputedAxisConfig } from "../useChartCartesianAxis/index.mjs";
|
|
7
8
|
export type DefaultizedAxisConfig<AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
8
9
|
[axisId: AxisId]: PolarAxisDefaultized<ScaleName, any, AxisProps>;
|
|
9
10
|
};
|
|
10
11
|
export type ComputeResult<T extends ChartsAxisProps> = {
|
|
11
|
-
axis:
|
|
12
|
+
axis: ComputedAxisConfig<T>;
|
|
12
13
|
axisIds: string[];
|
|
13
14
|
};
|
|
14
15
|
type ComputeCommonParams<SeriesType extends ChartSeriesType = ChartSeriesType> = {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AxisConfig, ScaleName } from "../../../../models/index.js";
|
|
2
2
|
import { type ChartsAxisProps, type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type PolarAxisDefaultized, type AxisId } from "../../../../models/axis.js";
|
|
3
3
|
import { type ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
4
4
|
import type { ChartDrawingArea } from "../../../../hooks/index.js";
|
|
5
5
|
import { type ChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.js";
|
|
6
6
|
import { type ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
7
|
+
import { type ComputedAxisConfig } from "../useChartCartesianAxis/index.js";
|
|
7
8
|
export type DefaultizedAxisConfig<AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
8
9
|
[axisId: AxisId]: PolarAxisDefaultized<ScaleName, any, AxisProps>;
|
|
9
10
|
};
|
|
10
11
|
export type ComputeResult<T extends ChartsAxisProps> = {
|
|
11
|
-
axis:
|
|
12
|
+
axis: ComputedAxisConfig<T>;
|
|
12
13
|
axisIds: string[];
|
|
13
14
|
};
|
|
14
15
|
type ComputeCommonParams<SeriesType extends ChartSeriesType = ChartSeriesType> = {
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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']);
|