@mui/x-charts 7.6.2 → 7.7.1
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.ts +1 -1
- package/BarChart/BarChart.js +21 -104
- package/BarChart/BarLabel/BarLabelPlot.d.ts +0 -3
- package/BarChart/BarLabel/BarLabelPlot.js +1 -24
- package/BarChart/BarPlot.js +2 -2
- package/BarChart/checkScaleErrors.d.ts +5 -9
- package/BarChart/types.d.ts +2 -2
- package/BarChart/useBarChartProps.d.ts +102 -0
- package/BarChart/useBarChartProps.js +143 -0
- package/CHANGELOG.md +163 -0
- package/ChartContainer/ChartContainer.d.ts +4 -4
- package/ChartContainer/ChartContainer.js +64 -31
- package/ChartContainer/useChartContainerHooks.d.ts +11 -0
- package/ChartContainer/useChartContainerHooks.js +34 -0
- package/ChartContainer/usePluginsMerge.d.ts +1 -2
- package/ChartsAxis/ChartsAxis.js +2 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
- package/ChartsGrid/ChartsGrid.js +2 -2
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/ChartsOverlay/index.d.ts +1 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +3 -5
- package/ChartsReferenceLine/ChartsYReferenceLine.js +3 -5
- package/ChartsText/ChartsText.js +1 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.js +8 -14
- package/ChartsTooltip/ChartsItemTooltipContent.js +8 -18
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -3
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +2 -2
- package/ChartsYAxis/ChartsYAxis.js +2 -2
- package/LineChart/AreaPlot.js +2 -2
- package/LineChart/LineChart.d.ts +2 -2
- package/LineChart/LineChart.js +25 -107
- package/LineChart/LineHighlightPlot.js +2 -2
- package/LineChart/LinePlot.js +2 -2
- package/LineChart/MarkPlot.js +2 -2
- package/LineChart/useLineChartProps.d.ts +117 -0
- package/LineChart/useLineChartProps.js +152 -0
- package/PieChart/PieChart.d.ts +2 -2
- package/PieChart/PieChart.js +1 -1
- package/ResponsiveChartContainer/ResizableContainer.d.ts +10 -0
- package/ResponsiveChartContainer/ResizableContainer.js +32 -0
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +25 -22
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterChart.js +21 -76
- package/ScatterChart/ScatterPlot.js +2 -2
- package/ScatterChart/useScatterChartProps.d.ts +86 -0
- package/ScatterChart/useScatterChartProps.js +116 -0
- package/SparkLineChart/SparkLineChart.d.ts +8 -3
- package/SparkLineChart/SparkLineChart.js +57 -1
- package/context/CartesianProvider/CartesianContext.d.ts +25 -0
- package/context/CartesianProvider/CartesianContext.js +21 -0
- package/context/CartesianProvider/CartesianProvider.d.ts +34 -0
- package/context/CartesianProvider/CartesianProvider.js +44 -0
- package/context/CartesianProvider/computeValue.d.ts +19 -0
- package/context/CartesianProvider/computeValue.js +89 -0
- package/context/CartesianProvider/getAxisExtremum.d.ts +4 -0
- package/context/CartesianProvider/getAxisExtremum.js +28 -0
- package/context/CartesianProvider/index.d.ts +9 -0
- package/context/CartesianProvider/index.js +51 -0
- package/context/CartesianProvider/normalizeAxis.d.ts +5 -0
- package/context/CartesianProvider/normalizeAxis.js +23 -0
- package/context/CartesianProvider/useCartesianContext.d.ts +2 -0
- package/context/CartesianProvider/useCartesianContext.js +17 -0
- package/context/ColorProvider.d.ts +12 -0
- package/context/ColorProvider.js +25 -0
- package/esm/BarChart/BarChart.js +21 -104
- package/esm/BarChart/BarLabel/BarLabelPlot.js +0 -23
- package/esm/BarChart/BarPlot.js +2 -2
- package/esm/BarChart/useBarChartProps.js +136 -0
- package/esm/ChartContainer/ChartContainer.js +65 -32
- package/esm/ChartContainer/useChartContainerHooks.js +24 -0
- package/esm/ChartsAxis/ChartsAxis.js +2 -2
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
- package/esm/ChartsGrid/ChartsGrid.js +2 -2
- package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +3 -5
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +3 -5
- package/esm/ChartsText/ChartsText.js +1 -3
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -14
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +8 -18
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -3
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/esm/ChartsXAxis/ChartsXAxis.js +2 -2
- package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
- package/esm/LineChart/AreaPlot.js +2 -2
- package/esm/LineChart/LineChart.js +25 -107
- package/esm/LineChart/LineHighlightPlot.js +2 -2
- package/esm/LineChart/LinePlot.js +2 -2
- package/esm/LineChart/MarkPlot.js +2 -2
- package/esm/LineChart/useLineChartProps.js +144 -0
- package/esm/PieChart/PieChart.js +1 -1
- package/esm/ResponsiveChartContainer/ResizableContainer.js +26 -0
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +24 -21
- package/esm/ScatterChart/ScatterChart.js +21 -76
- package/esm/ScatterChart/ScatterPlot.js +2 -2
- package/esm/ScatterChart/useScatterChartProps.js +108 -0
- package/esm/SparkLineChart/SparkLineChart.js +57 -1
- package/esm/context/CartesianProvider/CartesianContext.js +13 -0
- package/esm/context/CartesianProvider/CartesianProvider.js +37 -0
- package/esm/context/CartesianProvider/computeValue.js +82 -0
- package/esm/context/CartesianProvider/getAxisExtremum.js +21 -0
- package/esm/context/CartesianProvider/index.js +10 -0
- package/esm/context/CartesianProvider/normalizeAxis.js +15 -0
- package/esm/context/CartesianProvider/useCartesianContext.js +8 -0
- package/esm/context/ColorProvider.js +16 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useAxisEvents.js +2 -2
- package/esm/hooks/useColor.js +9 -0
- package/esm/hooks/useColorScale.js +27 -0
- package/esm/hooks/useReducedMotion.js +7 -0
- package/esm/hooks/useScale.js +3 -4
- package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -2
- package/esm/internals/index.js +31 -1
- package/esm/internals/warning.js +13 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/hooks/useAxisEvents.js +2 -2
- package/hooks/useColor.d.ts +4 -0
- package/hooks/useColor.js +17 -0
- package/hooks/useColorScale.d.ts +4 -0
- package/hooks/useColorScale.js +37 -0
- package/hooks/useDrawingArea.d.ts +2 -8
- package/hooks/useReducedMotion.js +7 -0
- package/hooks/useScale.js +3 -6
- package/index.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -2
- package/internals/defaultizeColor.d.ts +8 -8
- package/internals/index.d.ts +22 -0
- package/internals/index.js +231 -0
- package/internals/warning.d.ts +1 -0
- package/internals/warning.js +19 -0
- package/models/axis.d.ts +1 -2
- package/models/plugin.d.ts +4 -1
- package/modern/BarChart/BarChart.js +21 -104
- package/modern/BarChart/BarLabel/BarLabelPlot.js +0 -23
- package/modern/BarChart/BarPlot.js +2 -2
- package/modern/BarChart/useBarChartProps.js +136 -0
- package/modern/ChartContainer/ChartContainer.js +65 -32
- package/modern/ChartContainer/useChartContainerHooks.js +24 -0
- package/modern/ChartsAxis/ChartsAxis.js +2 -2
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
- package/modern/ChartsGrid/ChartsGrid.js +2 -2
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +3 -5
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +3 -5
- package/modern/ChartsText/ChartsText.js +1 -3
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -14
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +8 -18
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -3
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -2
- package/modern/ChartsXAxis/ChartsXAxis.js +2 -2
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
- package/modern/LineChart/AreaPlot.js +2 -2
- package/modern/LineChart/LineChart.js +25 -107
- package/modern/LineChart/LineHighlightPlot.js +2 -2
- package/modern/LineChart/LinePlot.js +2 -2
- package/modern/LineChart/MarkPlot.js +2 -2
- package/modern/LineChart/useLineChartProps.js +144 -0
- package/modern/PieChart/PieChart.js +1 -1
- package/modern/ResponsiveChartContainer/ResizableContainer.js +26 -0
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +24 -21
- package/modern/ScatterChart/ScatterChart.js +21 -76
- package/modern/ScatterChart/ScatterPlot.js +2 -2
- package/modern/ScatterChart/useScatterChartProps.js +108 -0
- package/modern/SparkLineChart/SparkLineChart.js +57 -1
- package/modern/context/CartesianProvider/CartesianContext.js +13 -0
- package/modern/context/CartesianProvider/CartesianProvider.js +37 -0
- package/modern/context/CartesianProvider/computeValue.js +82 -0
- package/modern/context/CartesianProvider/getAxisExtremum.js +21 -0
- package/modern/context/CartesianProvider/index.js +10 -0
- package/modern/context/CartesianProvider/normalizeAxis.js +15 -0
- package/modern/context/CartesianProvider/useCartesianContext.js +8 -0
- package/modern/context/ColorProvider.js +16 -0
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/useAxisEvents.js +2 -2
- package/modern/hooks/useColor.js +9 -0
- package/modern/hooks/useColorScale.js +27 -0
- package/modern/hooks/useReducedMotion.js +7 -0
- package/modern/hooks/useScale.js +3 -4
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -2
- package/modern/internals/index.js +31 -1
- package/modern/internals/warning.js +13 -0
- package/package.json +4 -4
- package/themeAugmentation/components.d.ts +12 -12
- package/context/CartesianContextProvider.d.ts +0 -53
- package/context/CartesianContextProvider.js +0 -233
- package/esm/context/CartesianContextProvider.js +0 -224
- package/esm/internals/colorGetter.js +0 -22
- package/internals/colorGetter.d.ts +0 -7
- package/internals/colorGetter.js +0 -29
- package/modern/context/CartesianContextProvider.js +0 -224
- package/modern/internals/colorGetter.js +0 -22
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useXColorScale = useXColorScale;
|
|
7
|
+
exports.useYColorScale = useYColorScale;
|
|
8
|
+
exports.useZColorScale = useZColorScale;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _CartesianProvider = require("../context/CartesianProvider");
|
|
11
|
+
var _ZAxisContextProvider = require("../context/ZAxisContextProvider");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function useXColorScale(identifier) {
|
|
15
|
+
const {
|
|
16
|
+
xAxis,
|
|
17
|
+
xAxisIds
|
|
18
|
+
} = (0, _CartesianProvider.useCartesianContext)();
|
|
19
|
+
const id = typeof identifier === 'string' ? identifier : xAxisIds[identifier ?? 0];
|
|
20
|
+
return xAxis[id].colorScale;
|
|
21
|
+
}
|
|
22
|
+
function useYColorScale(identifier) {
|
|
23
|
+
const {
|
|
24
|
+
yAxis,
|
|
25
|
+
yAxisIds
|
|
26
|
+
} = (0, _CartesianProvider.useCartesianContext)();
|
|
27
|
+
const id = typeof identifier === 'string' ? identifier : yAxisIds[identifier ?? 0];
|
|
28
|
+
return yAxis[id].colorScale;
|
|
29
|
+
}
|
|
30
|
+
function useZColorScale(identifier) {
|
|
31
|
+
const {
|
|
32
|
+
zAxis,
|
|
33
|
+
zAxisIds
|
|
34
|
+
} = React.useContext(_ZAxisContextProvider.ZAxisContext);
|
|
35
|
+
const id = typeof identifier === 'string' ? identifier : zAxisIds[identifier ?? 0];
|
|
36
|
+
return zAxis[id]?.colorScale;
|
|
37
|
+
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
top: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
bottom: number;
|
|
7
|
-
right: number;
|
|
8
|
-
};
|
|
1
|
+
import { DrawingArea } from '../context/DrawingProvider';
|
|
2
|
+
export declare function useDrawingArea(): DrawingArea;
|
|
@@ -16,6 +16,13 @@ const useReducedMotion = () => {
|
|
|
16
16
|
// Taken from: https://github.com/pmndrs/react-spring/blob/02ec877bbfab0df46da0e4a47d5f68d3e731206a/packages/shared/src/hooks/useReducedMotion.ts#L13
|
|
17
17
|
|
|
18
18
|
(0, _web.useIsomorphicLayoutEffect)(() => {
|
|
19
|
+
if (!window.matchMedia) {
|
|
20
|
+
// skip animation in environments where `window.matchMedia` would not be available (i.e. test/jsdom)
|
|
21
|
+
_web.Globals.assign({
|
|
22
|
+
skipAnimation: true
|
|
23
|
+
});
|
|
24
|
+
return () => {};
|
|
25
|
+
}
|
|
19
26
|
const mql = window.matchMedia('(prefers-reduced-motion)');
|
|
20
27
|
const handleMediaChange = e => {
|
|
21
28
|
_web.Globals.assign({
|
package/hooks/useScale.js
CHANGED
|
@@ -6,11 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getValueToPositionMapper = getValueToPositionMapper;
|
|
7
7
|
exports.useXScale = useXScale;
|
|
8
8
|
exports.useYScale = useYScale;
|
|
9
|
-
var
|
|
10
|
-
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
9
|
+
var _CartesianProvider = require("../context/CartesianProvider");
|
|
11
10
|
var _isBandScale = require("../internals/isBandScale");
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
11
|
/**
|
|
15
12
|
* For a given scale return a function that map value to their position.
|
|
16
13
|
* Useful when dealing with specific scale such as band.
|
|
@@ -27,7 +24,7 @@ function useXScale(identifier) {
|
|
|
27
24
|
const {
|
|
28
25
|
xAxis,
|
|
29
26
|
xAxisIds
|
|
30
|
-
} =
|
|
27
|
+
} = (0, _CartesianProvider.useCartesianContext)();
|
|
31
28
|
const id = typeof identifier === 'string' ? identifier : xAxisIds[identifier ?? 0];
|
|
32
29
|
return xAxis[id].scale;
|
|
33
30
|
}
|
|
@@ -35,7 +32,7 @@ function useYScale(identifier) {
|
|
|
35
32
|
const {
|
|
36
33
|
yAxis,
|
|
37
34
|
yAxisIds
|
|
38
|
-
} =
|
|
35
|
+
} = (0, _CartesianProvider.useCartesianContext)();
|
|
39
36
|
const id = typeof identifier === 'string' ? identifier : yAxisIds[identifier ?? 0];
|
|
40
37
|
return yAxis[id].scale;
|
|
41
38
|
}
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { AxisId } from '../../../models/axis';
|
|
3
|
+
export declare function useChartGradient(): (axisId: AxisId, direction: 'x' | 'y') => string;
|
|
3
4
|
export declare function ChartsAxesGradients(): React.JSX.Element;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ChartsAxesGradients = ChartsAxesGradients;
|
|
8
8
|
exports.useChartGradient = useChartGradient;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var
|
|
10
|
+
var _CartesianProvider = require("../../../context/CartesianProvider");
|
|
11
11
|
var _DrawingProvider = require("../../../context/DrawingProvider");
|
|
12
12
|
var _hooks = require("../../../hooks");
|
|
13
13
|
var _ChartsPiecewiseGradient = _interopRequireDefault(require("./ChartsPiecewiseGradient"));
|
|
@@ -38,7 +38,7 @@ function ChartsAxesGradients() {
|
|
|
38
38
|
xAxis,
|
|
39
39
|
yAxisIds,
|
|
40
40
|
yAxis
|
|
41
|
-
} =
|
|
41
|
+
} = (0, _CartesianProvider.useCartesianContext)();
|
|
42
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("defs", {
|
|
43
43
|
children: [yAxisIds.filter(axisId => yAxis[axisId].colorMap !== undefined).map(axisId => {
|
|
44
44
|
const gradientId = getGradientId(axisId, 'y');
|
|
@@ -39,9 +39,9 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
39
39
|
arcLabelRadius?: number | undefined;
|
|
40
40
|
color?: string | undefined;
|
|
41
41
|
} | undefined;
|
|
42
|
-
id?: import("
|
|
42
|
+
id?: import(".").SeriesId | undefined;
|
|
43
43
|
color?: string | undefined;
|
|
44
|
-
valueFormatter?: import("
|
|
44
|
+
valueFormatter?: import(".").SeriesValueFormatter<import(".").MakeOptional<import("../models/seriesType").PieValueType, "id">> | undefined;
|
|
45
45
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
46
46
|
} | {
|
|
47
47
|
type: "bar";
|
|
@@ -50,9 +50,9 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
50
50
|
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
51
51
|
layout?: "horizontal" | "vertical" | undefined;
|
|
52
52
|
stackOffset?: import("..").StackOffsetType | undefined;
|
|
53
|
-
id?: import("
|
|
53
|
+
id?: import(".").SeriesId | undefined;
|
|
54
54
|
color: string;
|
|
55
|
-
valueFormatter?: import("
|
|
55
|
+
valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
|
|
56
56
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
57
57
|
xAxisKey?: string | undefined;
|
|
58
58
|
yAxisKey?: string | undefined;
|
|
@@ -70,9 +70,9 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
70
70
|
disableHighlight?: boolean | undefined;
|
|
71
71
|
connectNulls?: boolean | undefined;
|
|
72
72
|
stackOffset?: import("..").StackOffsetType | undefined;
|
|
73
|
-
id?: import("
|
|
73
|
+
id?: import(".").SeriesId | undefined;
|
|
74
74
|
color: string;
|
|
75
|
-
valueFormatter?: import("
|
|
75
|
+
valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
|
|
76
76
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
77
77
|
xAxisKey?: string | undefined;
|
|
78
78
|
yAxisKey?: string | undefined;
|
|
@@ -84,9 +84,9 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
|
|
|
84
84
|
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
85
85
|
disableHover?: boolean | undefined;
|
|
86
86
|
zAxisKey?: string | undefined;
|
|
87
|
-
id?: import("
|
|
87
|
+
id?: import(".").SeriesId | undefined;
|
|
88
88
|
color: string;
|
|
89
|
-
valueFormatter?: import("
|
|
89
|
+
valueFormatter?: import(".").SeriesValueFormatter<import("../models/seriesType").ScatterValueType> | undefined;
|
|
90
90
|
highlightScope?: Partial<import("..").HighlightScope> | undefined;
|
|
91
91
|
xAxisKey?: string | undefined;
|
|
92
92
|
yAxisKey?: string | undefined;
|
package/internals/index.d.ts
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
+
export * from './components/ChartsAxesGradients';
|
|
2
|
+
export * from '../ResponsiveChartContainer/useChartContainerDimensions';
|
|
3
|
+
export * from '../ResponsiveChartContainer/ResizableContainer';
|
|
4
|
+
export { useReducedMotion } from '../hooks/useReducedMotion';
|
|
5
|
+
export { useSeries } from '../hooks/useSeries';
|
|
6
|
+
export { useChartContainerHooks } from '../ChartContainer/useChartContainerHooks';
|
|
7
|
+
export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
|
|
8
|
+
export { useLineChartProps } from '../LineChart/useLineChartProps';
|
|
9
|
+
export { useBarChartProps } from '../BarChart/useBarChartProps';
|
|
10
|
+
export * from './defaultizeValueFormatter';
|
|
1
11
|
export * from './configInit';
|
|
12
|
+
export * from '../context/CartesianProvider';
|
|
13
|
+
export * from '../context/DrawingProvider';
|
|
14
|
+
export * from '../context/ColorProvider';
|
|
15
|
+
export * from '../context/InteractionProvider';
|
|
16
|
+
export * from '../context/SeriesContextProvider';
|
|
17
|
+
export * from '../context/ZAxisContextProvider';
|
|
18
|
+
export type * from '../context/context.types';
|
|
19
|
+
export * from '../models/seriesType/config';
|
|
20
|
+
export * from '../models/seriesType/common';
|
|
21
|
+
export * from '../models/helpers';
|
|
22
|
+
export * from '../models/z-axis';
|
|
23
|
+
export * from '../models/axis';
|
package/internals/index.js
CHANGED
|
@@ -3,9 +3,108 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useReducedMotion: true,
|
|
8
|
+
useSeries: true,
|
|
9
|
+
useChartContainerHooks: true,
|
|
10
|
+
useScatterChartProps: true,
|
|
11
|
+
useLineChartProps: true,
|
|
12
|
+
useBarChartProps: true
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "useBarChartProps", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return _useBarChartProps.useBarChartProps;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "useChartContainerHooks", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _useChartContainerHooks.useChartContainerHooks;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "useLineChartProps", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return _useLineChartProps.useLineChartProps;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "useReducedMotion", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _useReducedMotion.useReducedMotion;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "useScatterChartProps", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _useScatterChartProps.useScatterChartProps;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "useSeries", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _useSeries.useSeries;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var _ChartsAxesGradients = require("./components/ChartsAxesGradients");
|
|
51
|
+
Object.keys(_ChartsAxesGradients).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
54
|
+
if (key in exports && exports[key] === _ChartsAxesGradients[key]) return;
|
|
55
|
+
Object.defineProperty(exports, key, {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return _ChartsAxesGradients[key];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
var _useChartContainerDimensions = require("../ResponsiveChartContainer/useChartContainerDimensions");
|
|
63
|
+
Object.keys(_useChartContainerDimensions).forEach(function (key) {
|
|
64
|
+
if (key === "default" || key === "__esModule") return;
|
|
65
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
66
|
+
if (key in exports && exports[key] === _useChartContainerDimensions[key]) return;
|
|
67
|
+
Object.defineProperty(exports, key, {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _useChartContainerDimensions[key];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
var _ResizableContainer = require("../ResponsiveChartContainer/ResizableContainer");
|
|
75
|
+
Object.keys(_ResizableContainer).forEach(function (key) {
|
|
76
|
+
if (key === "default" || key === "__esModule") return;
|
|
77
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
78
|
+
if (key in exports && exports[key] === _ResizableContainer[key]) return;
|
|
79
|
+
Object.defineProperty(exports, key, {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () {
|
|
82
|
+
return _ResizableContainer[key];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
var _useReducedMotion = require("../hooks/useReducedMotion");
|
|
87
|
+
var _useSeries = require("../hooks/useSeries");
|
|
88
|
+
var _useChartContainerHooks = require("../ChartContainer/useChartContainerHooks");
|
|
89
|
+
var _useScatterChartProps = require("../ScatterChart/useScatterChartProps");
|
|
90
|
+
var _useLineChartProps = require("../LineChart/useLineChartProps");
|
|
91
|
+
var _useBarChartProps = require("../BarChart/useBarChartProps");
|
|
92
|
+
var _defaultizeValueFormatter = require("./defaultizeValueFormatter");
|
|
93
|
+
Object.keys(_defaultizeValueFormatter).forEach(function (key) {
|
|
94
|
+
if (key === "default" || key === "__esModule") return;
|
|
95
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
96
|
+
if (key in exports && exports[key] === _defaultizeValueFormatter[key]) return;
|
|
97
|
+
Object.defineProperty(exports, key, {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () {
|
|
100
|
+
return _defaultizeValueFormatter[key];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
6
104
|
var _configInit = require("./configInit");
|
|
7
105
|
Object.keys(_configInit).forEach(function (key) {
|
|
8
106
|
if (key === "default" || key === "__esModule") return;
|
|
107
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
9
108
|
if (key in exports && exports[key] === _configInit[key]) return;
|
|
10
109
|
Object.defineProperty(exports, key, {
|
|
11
110
|
enumerable: true,
|
|
@@ -13,4 +112,136 @@ Object.keys(_configInit).forEach(function (key) {
|
|
|
13
112
|
return _configInit[key];
|
|
14
113
|
}
|
|
15
114
|
});
|
|
115
|
+
});
|
|
116
|
+
var _CartesianProvider = require("../context/CartesianProvider");
|
|
117
|
+
Object.keys(_CartesianProvider).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
120
|
+
if (key in exports && exports[key] === _CartesianProvider[key]) return;
|
|
121
|
+
Object.defineProperty(exports, key, {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () {
|
|
124
|
+
return _CartesianProvider[key];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
var _DrawingProvider = require("../context/DrawingProvider");
|
|
129
|
+
Object.keys(_DrawingProvider).forEach(function (key) {
|
|
130
|
+
if (key === "default" || key === "__esModule") return;
|
|
131
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
132
|
+
if (key in exports && exports[key] === _DrawingProvider[key]) return;
|
|
133
|
+
Object.defineProperty(exports, key, {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function () {
|
|
136
|
+
return _DrawingProvider[key];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
var _ColorProvider = require("../context/ColorProvider");
|
|
141
|
+
Object.keys(_ColorProvider).forEach(function (key) {
|
|
142
|
+
if (key === "default" || key === "__esModule") return;
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
144
|
+
if (key in exports && exports[key] === _ColorProvider[key]) return;
|
|
145
|
+
Object.defineProperty(exports, key, {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return _ColorProvider[key];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
var _InteractionProvider = require("../context/InteractionProvider");
|
|
153
|
+
Object.keys(_InteractionProvider).forEach(function (key) {
|
|
154
|
+
if (key === "default" || key === "__esModule") return;
|
|
155
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
156
|
+
if (key in exports && exports[key] === _InteractionProvider[key]) return;
|
|
157
|
+
Object.defineProperty(exports, key, {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () {
|
|
160
|
+
return _InteractionProvider[key];
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
165
|
+
Object.keys(_SeriesContextProvider).forEach(function (key) {
|
|
166
|
+
if (key === "default" || key === "__esModule") return;
|
|
167
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
168
|
+
if (key in exports && exports[key] === _SeriesContextProvider[key]) return;
|
|
169
|
+
Object.defineProperty(exports, key, {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function () {
|
|
172
|
+
return _SeriesContextProvider[key];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
var _ZAxisContextProvider = require("../context/ZAxisContextProvider");
|
|
177
|
+
Object.keys(_ZAxisContextProvider).forEach(function (key) {
|
|
178
|
+
if (key === "default" || key === "__esModule") return;
|
|
179
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
180
|
+
if (key in exports && exports[key] === _ZAxisContextProvider[key]) return;
|
|
181
|
+
Object.defineProperty(exports, key, {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
get: function () {
|
|
184
|
+
return _ZAxisContextProvider[key];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
var _config = require("../models/seriesType/config");
|
|
189
|
+
Object.keys(_config).forEach(function (key) {
|
|
190
|
+
if (key === "default" || key === "__esModule") return;
|
|
191
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
192
|
+
if (key in exports && exports[key] === _config[key]) return;
|
|
193
|
+
Object.defineProperty(exports, key, {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
get: function () {
|
|
196
|
+
return _config[key];
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
var _common = require("../models/seriesType/common");
|
|
201
|
+
Object.keys(_common).forEach(function (key) {
|
|
202
|
+
if (key === "default" || key === "__esModule") return;
|
|
203
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
204
|
+
if (key in exports && exports[key] === _common[key]) return;
|
|
205
|
+
Object.defineProperty(exports, key, {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function () {
|
|
208
|
+
return _common[key];
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
var _helpers = require("../models/helpers");
|
|
213
|
+
Object.keys(_helpers).forEach(function (key) {
|
|
214
|
+
if (key === "default" || key === "__esModule") return;
|
|
215
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
216
|
+
if (key in exports && exports[key] === _helpers[key]) return;
|
|
217
|
+
Object.defineProperty(exports, key, {
|
|
218
|
+
enumerable: true,
|
|
219
|
+
get: function () {
|
|
220
|
+
return _helpers[key];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
var _zAxis = require("../models/z-axis");
|
|
225
|
+
Object.keys(_zAxis).forEach(function (key) {
|
|
226
|
+
if (key === "default" || key === "__esModule") return;
|
|
227
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
228
|
+
if (key in exports && exports[key] === _zAxis[key]) return;
|
|
229
|
+
Object.defineProperty(exports, key, {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function () {
|
|
232
|
+
return _zAxis[key];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
var _axis = require("../models/axis");
|
|
237
|
+
Object.keys(_axis).forEach(function (key) {
|
|
238
|
+
if (key === "default" || key === "__esModule") return;
|
|
239
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
240
|
+
if (key in exports && exports[key] === _axis[key]) return;
|
|
241
|
+
Object.defineProperty(exports, key, {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _axis[key];
|
|
245
|
+
}
|
|
246
|
+
});
|
|
16
247
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildWarning(message: (...args: any) => string, gravity?: 'warning' | 'error'): (...args: any) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildWarning = buildWarning;
|
|
7
|
+
function buildWarning(message, gravity = 'warning') {
|
|
8
|
+
let alreadyWarned = false;
|
|
9
|
+
return (...args) => {
|
|
10
|
+
if (!alreadyWarned) {
|
|
11
|
+
alreadyWarned = true;
|
|
12
|
+
if (gravity === 'error') {
|
|
13
|
+
console.error(message(...args));
|
|
14
|
+
} else {
|
|
15
|
+
console.warn(message(...args));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
package/models/axis.d.ts
CHANGED
|
@@ -182,7 +182,7 @@ export interface AxisScaleConfig {
|
|
|
182
182
|
colorMap?: ContinuousColorConfig | PiecewiseColorConfig;
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
interface AxisScaleComputedConfig {
|
|
185
|
+
export interface AxisScaleComputedConfig {
|
|
186
186
|
band: {
|
|
187
187
|
colorScale?: ScaleOrdinal<string | number | Date, string, string | null> | ScaleOrdinal<number, string, string | null> | ScaleSequential<string, string | null> | ScaleThreshold<number | Date, string | null>;
|
|
188
188
|
};
|
|
@@ -267,4 +267,3 @@ export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): s
|
|
|
267
267
|
export declare function isPointScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'point'> & {
|
|
268
268
|
scaleType: 'point';
|
|
269
269
|
};
|
|
270
|
-
export {};
|
package/models/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartSeriesType, ExtremumGetter, Formatter } from './seriesType/config';
|
|
1
|
+
import { CartesianChartSeriesType, ChartSeriesType, ExtremumGetter, Formatter } from './seriesType/config';
|
|
2
2
|
import { AxisDefaultized } from './axis';
|
|
3
3
|
import { DefaultizedSeriesType } from './seriesType';
|
|
4
4
|
import { ZAxisDefaultized } from './z-axis';
|
|
@@ -13,4 +13,7 @@ export type ChartsPluginType<T> = T extends ChartSeriesType ? {
|
|
|
13
13
|
xExtremumGetter?: ExtremumGetter<T>;
|
|
14
14
|
yExtremumGetter?: ExtremumGetter<T>;
|
|
15
15
|
} : never;
|
|
16
|
+
export type ExtremumGettersConfig<T extends ChartSeriesType = CartesianChartSeriesType> = {
|
|
17
|
+
[K in T]?: ExtremumGetter<K>;
|
|
18
|
+
};
|
|
16
19
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import useId from '@mui/utils/useId';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { BarPlot } from './BarPlot';
|
|
6
5
|
import { ResponsiveChartContainer } from '../ResponsiveChartContainer';
|
|
7
6
|
import { ChartsAxis } from '../ChartsAxis';
|
|
8
|
-
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
|
|
9
7
|
import { ChartsTooltip } from '../ChartsTooltip';
|
|
10
8
|
import { ChartsLegend } from '../ChartsLegend';
|
|
11
9
|
import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
|
|
@@ -13,6 +11,7 @@ import { ChartsClipPath } from '../ChartsClipPath';
|
|
|
13
11
|
import { ChartsGrid } from '../ChartsGrid';
|
|
14
12
|
import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
|
|
15
13
|
import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
|
|
14
|
+
import { useBarChartProps } from './useBarChartProps';
|
|
16
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
/**
|
|
18
17
|
* Demos:
|
|
@@ -27,108 +26,26 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
27
26
|
*/
|
|
28
27
|
const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
29
28
|
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onItemClick,
|
|
51
|
-
onAxisClick,
|
|
52
|
-
children,
|
|
53
|
-
slots,
|
|
54
|
-
slotProps,
|
|
55
|
-
loading,
|
|
56
|
-
barLabel,
|
|
57
|
-
highlightedItem,
|
|
58
|
-
onHighlightChange
|
|
59
|
-
} = props;
|
|
60
|
-
const id = useId();
|
|
61
|
-
const clipPathId = `${id}-clip-path`;
|
|
62
|
-
const hasHorizontalSeries = layout === 'horizontal' || layout === undefined && series.some(item => item.layout === 'horizontal');
|
|
63
|
-
const defaultAxisConfig = {
|
|
64
|
-
scaleType: 'band',
|
|
65
|
-
data: Array.from({
|
|
66
|
-
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
67
|
-
}, (_, index) => index)
|
|
68
|
-
};
|
|
69
|
-
const defaultizedAxisHighlight = _extends({}, hasHorizontalSeries ? {
|
|
70
|
-
y: 'band'
|
|
71
|
-
} : {
|
|
72
|
-
x: 'band'
|
|
73
|
-
}, axisHighlight);
|
|
74
|
-
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
|
|
75
|
-
ref: ref,
|
|
76
|
-
series: series.map(s => _extends({
|
|
77
|
-
type: 'bar'
|
|
78
|
-
}, s, {
|
|
79
|
-
layout: hasHorizontalSeries ? 'horizontal' : 'vertical'
|
|
80
|
-
})),
|
|
81
|
-
width: width,
|
|
82
|
-
height: height,
|
|
83
|
-
margin: margin,
|
|
84
|
-
xAxis: xAxis ?? (hasHorizontalSeries ? undefined : [_extends({
|
|
85
|
-
id: DEFAULT_X_AXIS_KEY
|
|
86
|
-
}, defaultAxisConfig)]),
|
|
87
|
-
yAxis: yAxis ?? (hasHorizontalSeries ? [_extends({
|
|
88
|
-
id: DEFAULT_Y_AXIS_KEY
|
|
89
|
-
}, defaultAxisConfig)] : undefined),
|
|
90
|
-
colors: colors,
|
|
91
|
-
dataset: dataset,
|
|
92
|
-
sx: sx,
|
|
93
|
-
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
94
|
-
highlightedItem: highlightedItem,
|
|
95
|
-
onHighlightChange: onHighlightChange,
|
|
96
|
-
children: [onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, {
|
|
97
|
-
onAxisClick: onAxisClick
|
|
98
|
-
}), grid && /*#__PURE__*/_jsx(ChartsGrid, {
|
|
99
|
-
vertical: grid.vertical,
|
|
100
|
-
horizontal: grid.horizontal
|
|
101
|
-
}), /*#__PURE__*/_jsxs("g", {
|
|
102
|
-
clipPath: `url(#${clipPathId})`,
|
|
103
|
-
children: [/*#__PURE__*/_jsx(BarPlot, {
|
|
104
|
-
slots: slots,
|
|
105
|
-
slotProps: slotProps,
|
|
106
|
-
skipAnimation: skipAnimation,
|
|
107
|
-
onItemClick: onItemClick,
|
|
108
|
-
borderRadius: borderRadius,
|
|
109
|
-
barLabel: barLabel
|
|
110
|
-
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
111
|
-
loading: loading,
|
|
112
|
-
slots: slots,
|
|
113
|
-
slotProps: slotProps
|
|
114
|
-
})]
|
|
115
|
-
}), /*#__PURE__*/_jsx(ChartsAxis, {
|
|
116
|
-
topAxis: topAxis,
|
|
117
|
-
leftAxis: leftAxis,
|
|
118
|
-
rightAxis: rightAxis,
|
|
119
|
-
bottomAxis: bottomAxis,
|
|
120
|
-
slots: slots,
|
|
121
|
-
slotProps: slotProps
|
|
122
|
-
}), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
|
|
123
|
-
slots: slots,
|
|
124
|
-
slotProps: slotProps
|
|
125
|
-
})), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, defaultizedAxisHighlight)), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
|
|
126
|
-
slots: slots,
|
|
127
|
-
slotProps: slotProps
|
|
128
|
-
})), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
129
|
-
id: clipPathId
|
|
130
|
-
}), children]
|
|
131
|
-
});
|
|
29
|
+
chartContainerProps,
|
|
30
|
+
barPlotProps,
|
|
31
|
+
axisClickHandlerProps,
|
|
32
|
+
gridProps,
|
|
33
|
+
clipPathProps,
|
|
34
|
+
clipPathGroupProps,
|
|
35
|
+
overlayProps,
|
|
36
|
+
chartsAxisProps,
|
|
37
|
+
axisHighlightProps,
|
|
38
|
+
legendProps,
|
|
39
|
+
tooltipProps,
|
|
40
|
+
children
|
|
41
|
+
} = useBarChartProps(props);
|
|
42
|
+
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({
|
|
43
|
+
ref: ref
|
|
44
|
+
}, chartContainerProps, {
|
|
45
|
+
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), props.grid && /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
46
|
+
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps))]
|
|
47
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
48
|
+
}));
|
|
132
49
|
});
|
|
133
50
|
process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
134
51
|
// ----------------------------- Warning --------------------------------
|