@mui/x-charts 8.9.0 → 8.9.2
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 +94 -1
- package/BarChart/BarClipPath.d.ts +17 -12
- package/BarChart/BarClipPath.js +70 -57
- package/BarChart/BarPlot.js +4 -0
- package/BarChart/seriesConfig/extremums.js +2 -3
- package/BarChart/useBarChartProps.d.ts +1 -1
- package/CHANGELOG.md +124 -0
- package/ChartContainer/ChartContainer.js +141 -0
- package/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.d.ts +13 -4
- package/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.js +33 -7
- package/LineChart/LineChart.js +94 -1
- package/LineChart/seriesConfig/extremums.js +2 -3
- package/LineChart/useLineChartProps.d.ts +1 -1
- package/PieChart/PieChart.js +1 -1
- package/RadarChart/RadarChart.d.ts +1 -1
- package/RadarChart/RadarChart.js +1 -1
- package/RadarChart/useRadarChartProps.d.ts +1 -1
- package/ScatterChart/ScatterChart.js +94 -1
- package/ScatterChart/seriesConfig/extremums.js +50 -23
- package/ScatterChart/useScatterChartProps.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +93 -0
- package/esm/BarChart/BarChart.js +94 -1
- package/esm/BarChart/BarClipPath.d.ts +17 -12
- package/esm/BarChart/BarClipPath.js +69 -55
- package/esm/BarChart/BarPlot.js +4 -0
- package/esm/BarChart/seriesConfig/extremums.js +2 -3
- package/esm/BarChart/useBarChartProps.d.ts +1 -1
- package/esm/ChartContainer/ChartContainer.js +141 -0
- package/esm/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.d.ts +13 -4
- package/esm/{internals/components/ChartsWrapper → ChartsWrapper}/ChartsWrapper.js +31 -6
- package/esm/LineChart/LineChart.js +94 -1
- package/esm/LineChart/seriesConfig/extremums.js +2 -3
- package/esm/LineChart/useLineChartProps.d.ts +1 -1
- package/esm/PieChart/PieChart.js +1 -1
- package/esm/RadarChart/RadarChart.d.ts +1 -1
- package/esm/RadarChart/RadarChart.js +1 -1
- package/esm/RadarChart/useRadarChartProps.d.ts +1 -1
- package/esm/ScatterChart/ScatterChart.js +94 -1
- package/esm/ScatterChart/seriesConfig/extremums.js +50 -23
- package/esm/ScatterChart/useScatterChartProps.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +93 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +6 -2
- package/esm/internals/findMinMax.d.ts +1 -0
- package/esm/internals/findMinMax.js +13 -0
- package/esm/internals/getScale.js +3 -0
- package/esm/internals/index.d.ts +1 -1
- package/esm/internals/index.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -1
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +17 -12
- package/esm/internals/symlogScale.d.ts +2 -0
- package/esm/internals/symlogScale.js +94 -0
- package/esm/models/axis.d.ts +20 -4
- package/esm/models/axis.js +3 -0
- package/index.d.ts +2 -1
- package/index.js +13 -1
- package/internals/findMinMax.d.ts +1 -0
- package/internals/findMinMax.js +19 -0
- package/internals/getScale.js +3 -0
- package/internals/index.d.ts +1 -1
- package/internals/index.js +12 -12
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +3 -0
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +17 -12
- package/internals/symlogScale.d.ts +2 -0
- package/internals/symlogScale.js +100 -0
- package/models/axis.d.ts +20 -4
- package/models/axis.js +4 -0
- package/package.json +5 -6
- package/BarChart/getRadius.d.ts +0 -20
- package/BarChart/getRadius.js +0 -37
- package/esm/BarChart/getRadius.d.ts +0 -20
- package/esm/BarChart/getRadius.js +0 -30
- /package/{esm/internals/components/ChartsWrapper → ChartsWrapper}/index.d.ts +0 -0
- /package/{internals/components/ChartsWrapper → ChartsWrapper}/index.js +0 -0
- /package/{internals/components → esm}/ChartsWrapper/index.d.ts +0 -0
- /package/esm/{internals/components/ChartsWrapper → ChartsWrapper}/index.js +0 -0
package/BarChart/BarChart.js
CHANGED
|
@@ -23,7 +23,7 @@ var _useBarChartProps = require("./useBarChartProps");
|
|
|
23
23
|
var _ChartDataProvider = require("../ChartDataProvider");
|
|
24
24
|
var _ChartsSurface = require("../ChartsSurface");
|
|
25
25
|
var _useChartContainerProps = require("../ChartContainer/useChartContainerProps");
|
|
26
|
-
var _ChartsWrapper = require("../
|
|
26
|
+
var _ChartsWrapper = require("../ChartsWrapper");
|
|
27
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
28
|
/**
|
|
29
29
|
* Demos:
|
|
@@ -395,6 +395,53 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
395
395
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
396
396
|
tickSize: _propTypes.default.number,
|
|
397
397
|
valueFormatter: _propTypes.default.func
|
|
398
|
+
}), _propTypes.default.shape({
|
|
399
|
+
axis: _propTypes.default.oneOf(['x']),
|
|
400
|
+
classes: _propTypes.default.object,
|
|
401
|
+
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
402
|
+
color: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func]).isRequired,
|
|
403
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
404
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
405
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
406
|
+
}), _propTypes.default.shape({
|
|
407
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
408
|
+
thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
|
|
409
|
+
type: _propTypes.default.oneOf(['piecewise']).isRequired
|
|
410
|
+
})]),
|
|
411
|
+
constant: _propTypes.default.number,
|
|
412
|
+
data: _propTypes.default.array,
|
|
413
|
+
dataKey: _propTypes.default.string,
|
|
414
|
+
disableLine: _propTypes.default.bool,
|
|
415
|
+
disableTicks: _propTypes.default.bool,
|
|
416
|
+
domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
|
|
417
|
+
fill: _propTypes.default.string,
|
|
418
|
+
height: _propTypes.default.number,
|
|
419
|
+
hideTooltip: _propTypes.default.bool,
|
|
420
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
421
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
422
|
+
label: _propTypes.default.string,
|
|
423
|
+
labelStyle: _propTypes.default.object,
|
|
424
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
425
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
426
|
+
offset: _propTypes.default.number,
|
|
427
|
+
position: _propTypes.default.oneOf(['bottom', 'none', 'top']),
|
|
428
|
+
reverse: _propTypes.default.bool,
|
|
429
|
+
scaleType: _propTypes.default.oneOf(['symlog']),
|
|
430
|
+
slotProps: _propTypes.default.object,
|
|
431
|
+
slots: _propTypes.default.object,
|
|
432
|
+
stroke: _propTypes.default.string,
|
|
433
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
434
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
435
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
436
|
+
tickLabelMinGap: _propTypes.default.number,
|
|
437
|
+
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
438
|
+
tickLabelStyle: _propTypes.default.object,
|
|
439
|
+
tickMaxStep: _propTypes.default.number,
|
|
440
|
+
tickMinStep: _propTypes.default.number,
|
|
441
|
+
tickNumber: _propTypes.default.number,
|
|
442
|
+
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
443
|
+
tickSize: _propTypes.default.number,
|
|
444
|
+
valueFormatter: _propTypes.default.func
|
|
398
445
|
}), _propTypes.default.shape({
|
|
399
446
|
axis: _propTypes.default.oneOf(['x']),
|
|
400
447
|
classes: _propTypes.default.object,
|
|
@@ -778,6 +825,52 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
778
825
|
tickSize: _propTypes.default.number,
|
|
779
826
|
valueFormatter: _propTypes.default.func,
|
|
780
827
|
width: _propTypes.default.number
|
|
828
|
+
}), _propTypes.default.shape({
|
|
829
|
+
axis: _propTypes.default.oneOf(['y']),
|
|
830
|
+
classes: _propTypes.default.object,
|
|
831
|
+
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
832
|
+
color: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func]).isRequired,
|
|
833
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
834
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
835
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
836
|
+
}), _propTypes.default.shape({
|
|
837
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
838
|
+
thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
|
|
839
|
+
type: _propTypes.default.oneOf(['piecewise']).isRequired
|
|
840
|
+
})]),
|
|
841
|
+
constant: _propTypes.default.number,
|
|
842
|
+
data: _propTypes.default.array,
|
|
843
|
+
dataKey: _propTypes.default.string,
|
|
844
|
+
disableLine: _propTypes.default.bool,
|
|
845
|
+
disableTicks: _propTypes.default.bool,
|
|
846
|
+
domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
|
|
847
|
+
fill: _propTypes.default.string,
|
|
848
|
+
hideTooltip: _propTypes.default.bool,
|
|
849
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
850
|
+
ignoreTooltip: _propTypes.default.bool,
|
|
851
|
+
label: _propTypes.default.string,
|
|
852
|
+
labelStyle: _propTypes.default.object,
|
|
853
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
854
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
855
|
+
offset: _propTypes.default.number,
|
|
856
|
+
position: _propTypes.default.oneOf(['left', 'none', 'right']),
|
|
857
|
+
reverse: _propTypes.default.bool,
|
|
858
|
+
scaleType: _propTypes.default.oneOf(['symlog']),
|
|
859
|
+
slotProps: _propTypes.default.object,
|
|
860
|
+
slots: _propTypes.default.object,
|
|
861
|
+
stroke: _propTypes.default.string,
|
|
862
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
863
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
864
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
865
|
+
tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
|
|
866
|
+
tickLabelStyle: _propTypes.default.object,
|
|
867
|
+
tickMaxStep: _propTypes.default.number,
|
|
868
|
+
tickMinStep: _propTypes.default.number,
|
|
869
|
+
tickNumber: _propTypes.default.number,
|
|
870
|
+
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
871
|
+
tickSize: _propTypes.default.number,
|
|
872
|
+
valueFormatter: _propTypes.default.func,
|
|
873
|
+
width: _propTypes.default.number
|
|
781
874
|
}), _propTypes.default.shape({
|
|
782
875
|
axis: _propTypes.default.oneOf(['y']),
|
|
783
876
|
classes: _propTypes.default.object,
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
interface UseAnimateBarClipPathParams {
|
|
3
|
+
ref?: React.Ref<SVGPathElement>;
|
|
4
|
+
layout: 'vertical' | 'horizontal';
|
|
5
|
+
hasNegative: boolean;
|
|
6
|
+
hasPositive: boolean;
|
|
7
|
+
xOrigin: number;
|
|
8
|
+
yOrigin: number;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
5
13
|
borderRadius: number;
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
type UseAnimateBarClipRectReturn = {
|
|
9
|
-
ref: React.Ref<SVGRectElement>;
|
|
10
|
-
style: React.CSSProperties;
|
|
11
|
-
} & Pick<BarClipRectProps, 'x' | 'y' | 'width' | 'height'>;
|
|
12
|
-
export declare function useAnimateBarClipRect(props: UseAnimateBarClipRectParams): UseAnimateBarClipRectReturn;
|
|
13
|
-
interface BarClipRectProps extends Pick<BarClipPathProps, 'x' | 'y' | 'width' | 'height' | 'skipAnimation'> {
|
|
14
|
-
ownerState: GetRadiusData;
|
|
14
|
+
skipAnimation: boolean;
|
|
15
15
|
}
|
|
16
|
+
export declare function useAnimateBarClipPath(props: UseAnimateBarClipPathParams): import("../index.js").UseAnimateReturn<SVGPathElement, {
|
|
17
|
+
d: string | undefined;
|
|
18
|
+
}>;
|
|
16
19
|
export interface BarClipPathProps {
|
|
17
20
|
maskId: string;
|
|
18
21
|
borderRadius?: number;
|
|
@@ -21,6 +24,8 @@ export interface BarClipPathProps {
|
|
|
21
24
|
layout?: 'vertical' | 'horizontal';
|
|
22
25
|
x: number;
|
|
23
26
|
y: number;
|
|
27
|
+
xOrigin: number;
|
|
28
|
+
yOrigin: number;
|
|
24
29
|
width: number;
|
|
25
30
|
height: number;
|
|
26
31
|
skipAnimation: boolean;
|
package/BarChart/BarClipPath.js
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
5
|
Object.defineProperty(exports, "__esModule", {
|
|
7
6
|
value: true
|
|
8
7
|
});
|
|
9
8
|
exports.BarClipPath = BarClipPath;
|
|
10
|
-
exports.
|
|
11
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
exports.useAnimateBarClipPath = useAnimateBarClipPath;
|
|
13
10
|
var React = _interopRequireWildcard(require("react"));
|
|
14
11
|
var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
|
|
15
12
|
var _animation = require("../hooks/animation");
|
|
16
|
-
var _getRadius = require("./getRadius");
|
|
17
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
|
|
19
|
-
function buildClipPath(size, borderRadius, ownerState) {
|
|
20
|
-
const radiusData = (0, _extends2.default)({}, ownerState, {
|
|
21
|
-
borderRadius
|
|
22
|
-
});
|
|
23
|
-
const topLeft = Math.min(size, (0, _getRadius.getRadius)('top-left', radiusData));
|
|
24
|
-
const topRight = Math.min(size, (0, _getRadius.getRadius)('top-right', radiusData));
|
|
25
|
-
const bottomRight = Math.min(size, (0, _getRadius.getRadius)('bottom-right', radiusData));
|
|
26
|
-
const bottomLeft = Math.min(size, (0, _getRadius.getRadius)('bottom-left', radiusData));
|
|
27
|
-
return `inset(0px round ${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px)`;
|
|
28
|
-
}
|
|
29
|
-
function barClipRectPropsInterpolator(from, to) {
|
|
14
|
+
function barClipPathPropsInterpolator(from, to) {
|
|
30
15
|
const interpolateX = (0, _d3Interpolate.interpolateNumber)(from.x, to.x);
|
|
31
16
|
const interpolateY = (0, _d3Interpolate.interpolateNumber)(from.y, to.y);
|
|
32
17
|
const interpolateWidth = (0, _d3Interpolate.interpolateNumber)(from.width, to.width);
|
|
@@ -42,12 +27,12 @@ function barClipRectPropsInterpolator(from, to) {
|
|
|
42
27
|
};
|
|
43
28
|
};
|
|
44
29
|
}
|
|
45
|
-
function
|
|
30
|
+
function useAnimateBarClipPath(props) {
|
|
46
31
|
const initialProps = {
|
|
47
|
-
x: props.x,
|
|
48
|
-
y: props.
|
|
49
|
-
width: props.
|
|
50
|
-
height: props.
|
|
32
|
+
x: props.layout === 'vertical' ? props.x : props.xOrigin,
|
|
33
|
+
y: props.layout === 'vertical' ? props.yOrigin : props.y,
|
|
34
|
+
width: props.layout === 'vertical' ? props.width : 0,
|
|
35
|
+
height: props.layout === 'vertical' ? 0 : props.height,
|
|
51
36
|
borderRadius: props.borderRadius
|
|
52
37
|
};
|
|
53
38
|
return (0, _animation.useAnimate)({
|
|
@@ -57,59 +42,87 @@ function useAnimateBarClipRect(props) {
|
|
|
57
42
|
height: props.height,
|
|
58
43
|
borderRadius: props.borderRadius
|
|
59
44
|
}, {
|
|
60
|
-
createInterpolator:
|
|
45
|
+
createInterpolator: barClipPathPropsInterpolator,
|
|
61
46
|
transformProps: p => ({
|
|
62
|
-
|
|
63
|
-
y: p.y,
|
|
64
|
-
width: p.width,
|
|
65
|
-
height: p.height,
|
|
66
|
-
style: {
|
|
67
|
-
clipPath: buildClipPath(props.ownerState.layout === 'vertical' ? p.height : p.width, p.borderRadius, props.ownerState)
|
|
68
|
-
}
|
|
47
|
+
d: generateClipPath(props.hasNegative, props.hasPositive, props.layout, p.x, p.y, p.width, p.height, props.xOrigin, props.yOrigin, p.borderRadius)
|
|
69
48
|
}),
|
|
70
|
-
applyProps(element,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
49
|
+
applyProps(element, {
|
|
50
|
+
d
|
|
51
|
+
}) {
|
|
52
|
+
if (d) {
|
|
53
|
+
element.setAttribute('d', d);
|
|
54
|
+
}
|
|
76
55
|
},
|
|
77
56
|
initialProps,
|
|
78
57
|
skip: props.skipAnimation,
|
|
79
58
|
ref: props.ref
|
|
80
59
|
});
|
|
81
60
|
}
|
|
82
|
-
function BarClipRect(props) {
|
|
83
|
-
const animatedProps = useAnimateBarClipRect((0, _extends2.default)({}, props, {
|
|
84
|
-
borderRadius: props.ownerState.borderRadius ?? 0
|
|
85
|
-
}));
|
|
86
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", (0, _extends2.default)({}, animatedProps));
|
|
87
|
-
}
|
|
88
61
|
/**
|
|
89
62
|
* @ignore - internal component.
|
|
90
63
|
*/
|
|
91
64
|
function BarClipPath(props) {
|
|
92
65
|
const {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
66
|
+
maskId,
|
|
67
|
+
x,
|
|
68
|
+
y,
|
|
69
|
+
width,
|
|
70
|
+
height,
|
|
71
|
+
skipAnimation
|
|
72
|
+
} = props;
|
|
73
|
+
const {
|
|
74
|
+
ref,
|
|
75
|
+
d
|
|
76
|
+
} = useAnimateBarClipPath({
|
|
77
|
+
layout: props.layout ?? 'vertical',
|
|
78
|
+
hasNegative: props.hasNegative,
|
|
79
|
+
hasPositive: props.hasPositive,
|
|
80
|
+
xOrigin: props.xOrigin,
|
|
81
|
+
yOrigin: props.yOrigin,
|
|
82
|
+
x,
|
|
83
|
+
y,
|
|
84
|
+
width,
|
|
85
|
+
height,
|
|
86
|
+
borderRadius: props.borderRadius ?? 0,
|
|
87
|
+
skipAnimation
|
|
88
|
+
});
|
|
101
89
|
if (!props.borderRadius || props.borderRadius <= 0) {
|
|
102
90
|
return null;
|
|
103
91
|
}
|
|
104
92
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("clipPath", {
|
|
105
93
|
id: maskId,
|
|
106
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
y: y,
|
|
110
|
-
width: width,
|
|
111
|
-
height: height,
|
|
112
|
-
skipAnimation: skipAnimation
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
95
|
+
ref: ref,
|
|
96
|
+
d: d
|
|
113
97
|
})
|
|
114
98
|
});
|
|
99
|
+
}
|
|
100
|
+
function generateClipPath(hasNegative, hasPositive, layout, x, y, width, height, xOrigin, yOrigin, borderRadius) {
|
|
101
|
+
if (layout === 'vertical') {
|
|
102
|
+
if (hasPositive && hasNegative) {
|
|
103
|
+
const bR = Math.min(borderRadius, width / 2, height / 2);
|
|
104
|
+
return `M${x},${y + height / 2} v${-(height / 2 - bR)} a${bR},${bR} 0 0 1 ${bR},${-bR} h${width - bR * 2} a${bR},${bR} 0 0 1 ${bR},${bR} v${height - 2 * bR} a${bR},${bR} 0 0 1 ${-bR},${bR} h${-(width - bR * 2)} a${bR},${bR} 0 0 1 ${-bR},${-bR} v${-(height / 2 - bR)}`;
|
|
105
|
+
}
|
|
106
|
+
const bR = Math.min(borderRadius, width / 2);
|
|
107
|
+
if (hasPositive) {
|
|
108
|
+
return `M${x},${Math.max(yOrigin, y + bR)} v${Math.min(0, -(yOrigin - y - bR))} a${bR},${bR} 0 0 1 ${bR},${-bR} h${width - bR * 2} a${bR},${bR} 0 0 1 ${bR},${bR} v${Math.max(0, yOrigin - y - bR)} Z`;
|
|
109
|
+
}
|
|
110
|
+
if (hasNegative) {
|
|
111
|
+
return `M${x},${Math.min(yOrigin, y + height - bR)} v${Math.max(0, height - bR)} a${bR},${bR} 0 0 0 ${bR},${bR} h${width - bR * 2} a${bR},${bR} 0 0 0 ${bR},${-bR} v${-Math.max(0, height - bR)} Z`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (layout === 'horizontal') {
|
|
115
|
+
if (hasPositive && hasNegative) {
|
|
116
|
+
const bR = Math.min(borderRadius, width / 2, height / 2);
|
|
117
|
+
return `M${x + width / 2},${y} h${width / 2 - bR} a${bR},${bR} 0 0 1 ${bR},${bR} v${height - bR * 2} a${bR},${bR} 0 0 1 ${-bR},${bR} h${-(width - 2 * bR)} a${bR},${bR} 0 0 1 ${-bR},${-bR} v${-(height - bR * 2)} a${bR},${bR} 0 0 1 ${bR},${-bR} h${width / 2 - bR}`;
|
|
118
|
+
}
|
|
119
|
+
const bR = Math.min(borderRadius, height / 2);
|
|
120
|
+
if (hasPositive) {
|
|
121
|
+
return `M${Math.min(xOrigin, x - bR)},${y} h${width} a${bR},${bR} 0 0 1 ${bR},${bR} v${height - bR * 2} a${bR},${bR} 0 0 1 ${-bR},${bR} h${-width} Z`;
|
|
122
|
+
}
|
|
123
|
+
if (hasNegative) {
|
|
124
|
+
return `M${Math.max(xOrigin, x + width + bR)},${y} h${-width} a${bR},${bR} 0 0 0 ${-bR},${bR} v${height - bR * 2} a${bR},${bR} 0 0 0 ${bR},${bR} h${width} Z`;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return undefined;
|
|
115
128
|
}
|
package/BarChart/BarPlot.js
CHANGED
|
@@ -71,6 +71,8 @@ function BarPlot(props) {
|
|
|
71
71
|
id,
|
|
72
72
|
x,
|
|
73
73
|
y,
|
|
74
|
+
xOrigin,
|
|
75
|
+
yOrigin,
|
|
74
76
|
width,
|
|
75
77
|
height,
|
|
76
78
|
hasPositive,
|
|
@@ -85,6 +87,8 @@ function BarPlot(props) {
|
|
|
85
87
|
layout: layout,
|
|
86
88
|
x: x,
|
|
87
89
|
y: y,
|
|
90
|
+
xOrigin: xOrigin,
|
|
91
|
+
yOrigin: yOrigin,
|
|
88
92
|
width: width,
|
|
89
93
|
height: height,
|
|
90
94
|
skipAnimation: skipAnimation ?? false
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getExtremumY = exports.getExtremumX = void 0;
|
|
7
|
+
var _findMinMax = require("../../internals/findMinMax");
|
|
7
8
|
const createResult = (data, direction) => {
|
|
8
9
|
if (direction === 'x') {
|
|
9
10
|
return {
|
|
@@ -30,9 +31,7 @@ const getBaseExtremum = params => {
|
|
|
30
31
|
x: null,
|
|
31
32
|
y: null
|
|
32
33
|
}, i)) : axis.data;
|
|
33
|
-
|
|
34
|
-
const maxX = Math.max(...(data ?? []));
|
|
35
|
-
return [minX, maxX];
|
|
34
|
+
return (0, _findMinMax.findMinMax)(data ?? []);
|
|
36
35
|
};
|
|
37
36
|
const getValueExtremum = direction => params => {
|
|
38
37
|
const {
|
|
@@ -8,7 +8,7 @@ import { ChartsOverlayProps } from "../ChartsOverlay/index.js";
|
|
|
8
8
|
import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
9
9
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
10
10
|
import { ChartsLegendSlotExtension } from "../ChartsLegend/index.js";
|
|
11
|
-
import type { ChartsWrapperProps } from "../
|
|
11
|
+
import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
12
12
|
import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
|
|
13
13
|
/**
|
|
14
14
|
* A helper function that extracts BarChartProps from the input props
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,130 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.9.2
|
|
9
|
+
|
|
10
|
+
_Jul 31, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 23 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🌎 Improve French (fr-FR), Hebrew (he-IL) and Polish (pl-PL) locales on the Data Grid
|
|
15
|
+
- 🌎 Improve Korean (ko-KR) locale on the Date and Time Pickers
|
|
16
|
+
- 📈 Add symlog scale to charts
|
|
17
|
+
- 📊 Fix bar border radius on Firefox
|
|
18
|
+
- 🐞 Bugfixes
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
22
|
+
@AmrElnaggar99, @atlanteh, @ddolcimascolo, @Jiseoup, @leonaha5, @noherczeg, @sai6855
|
|
23
|
+
|
|
24
|
+
The following are all team members who have contributed to this release:
|
|
25
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @bharatkashyap, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @mapache-salvaje, @MBilalShafi, @rita-codes, @romgrk, @siriwatknp
|
|
26
|
+
|
|
27
|
+
### Data Grid
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid@8.9.2`
|
|
30
|
+
|
|
31
|
+
- [DataGrid] Add debounce for columns panel search (#18719) @noherczeg
|
|
32
|
+
- [DataGrid] Extract virtualization engine (#18275) @romgrk
|
|
33
|
+
- [DataGrid] Improve types in `<GridEditSingleSelect />` (#18184) @sai6855
|
|
34
|
+
- [l10n] Improve French (fr-FR) locale (#18905) @ddolcimascolo
|
|
35
|
+
- [l10n] Improve Hebrew (he-IL) locale (#18665) @atlanteh
|
|
36
|
+
- [l10n] Improve Polish (pl-PL) locale (#18068) @leonaha5
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-pro@8.9.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid@8.9.2`, plus:
|
|
41
|
+
|
|
42
|
+
- [DataGridPro] Fix duplicate nested rows for dynamically updated row IDs (#18526) @MBilalShafi
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-data-grid-premium@8.9.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-data-grid-pro@8.9.2`, plus:
|
|
47
|
+
|
|
48
|
+
- [DataGridPremium] Add `privateMode` to AI assistant prompt resolver (#18759) @bharatkashyap
|
|
49
|
+
- [DataGridPremium] Fix empty nested group values caused by main criterial `valueFormatter()` (#18916) @cherniavskii
|
|
50
|
+
- [DataGridPremium] Sidebar content and state is managed the same way as for preference panel (#18741) @arminmeh
|
|
51
|
+
- [DataGridPremium] Make `api` param for the aggregation function optional (#18984) @arminmeh
|
|
52
|
+
|
|
53
|
+
### Date and Time Pickers
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-date-pickers@8.9.2`
|
|
56
|
+
|
|
57
|
+
- [l10n] Improve Korean (ko-KR) locale (#18664) @Jiseoup
|
|
58
|
+
- [pickers] Fix popper click-away behavior (#18804) @LukasTy
|
|
59
|
+
- [pickers] Fix usage not in main document (#18944) @LukasTy
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-pickers-pro@8.9.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
62
|
+
|
|
63
|
+
Same changes as in `@mui/x-date-pickers@8.9.2`.
|
|
64
|
+
|
|
65
|
+
### Charts
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts@8.9.2`
|
|
68
|
+
|
|
69
|
+
- [charts] Add symlog scale to charts (#18729) @bernardobelchior
|
|
70
|
+
- [charts] Fix bar border radius on Firefox (#18824) @bernardobelchior
|
|
71
|
+
- [charts] Fix crash when rendering large scatter dataset (#18845) @bernardobelchior
|
|
72
|
+
- [charts] Remove unnecessary type assertion in tooltip `valueFormatter()` (#18877) @sai6855
|
|
73
|
+
- [charts] Export `ChartsWrapper` from `'./ChartsWrapper'` rather than `'./internals'` (#18966) @JCQuintas
|
|
74
|
+
|
|
75
|
+
#### `@mui/x-charts-pro@8.9.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
76
|
+
|
|
77
|
+
Same changes as in `@mui/x-charts@8.9.2`, plus:
|
|
78
|
+
|
|
79
|
+
- [charts-pro] Fix voronoi interaction with zoom (#18950) @alexfauquette
|
|
80
|
+
- [charts-pro] Hide toolbar by default when exporting (#18764) @bernardobelchior
|
|
81
|
+
|
|
82
|
+
### Codemod
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-codemod@8.9.2`
|
|
85
|
+
|
|
86
|
+
Internal changes.
|
|
87
|
+
|
|
88
|
+
### Docs
|
|
89
|
+
|
|
90
|
+
- [docs] Add Data Grid demo pages (#18180) @KenanYusuf
|
|
91
|
+
- [docs] Copyedit the Charts Overview page (#18840) @mapache-salvaje
|
|
92
|
+
- [docs] Fix incorrect parameter name in pickers "Custom components" page from `variant` to `pickerVariant` (#18919) @AmrElnaggar99
|
|
93
|
+
|
|
94
|
+
### Miscellaneous
|
|
95
|
+
|
|
96
|
+
- [code-infra] Auto-generate deep exports to prevent asymmetric exports (#18917) @JCQuintas
|
|
97
|
+
- [docs-infra] Turn on "Edit in Chat" for X docs (#18869) @siriwatknp
|
|
98
|
+
- [infra] Add specific bundle size tracking (#18884) @Janpot
|
|
99
|
+
- [infra] Fix markdown formatting in llms generation (#18914) @Janpot
|
|
100
|
+
- [infra] Use CI action from mui-public (#18709) @brijeshb42
|
|
101
|
+
|
|
102
|
+
## 8.9.1
|
|
103
|
+
|
|
104
|
+
_Jul 21, 2025_
|
|
105
|
+
|
|
106
|
+
We'd like to extend a big thank you to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
107
|
+
|
|
108
|
+
🐞 Fix package publish issue
|
|
109
|
+
|
|
110
|
+
The following are all team members who have contributed to this release:
|
|
111
|
+
@KenanYusuf, @MBilalShafi
|
|
112
|
+
|
|
113
|
+
### Data Grid
|
|
114
|
+
|
|
115
|
+
#### `@mui/x-data-grid@8.9.1`
|
|
116
|
+
|
|
117
|
+
- [DataGrid] Move conditional list view column logic into `gridVisibleColumnDefinitionsSelector` (#18724) @KenanYusuf
|
|
118
|
+
- [DataGrid] Fix row selection "exclude" model inconsistency (#18844) @MBilalShafi
|
|
119
|
+
|
|
120
|
+
#### `@mui/x-data-grid-pro@8.9.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
121
|
+
|
|
122
|
+
Same changes as in `@mui/x-data-grid@8.9.1`.
|
|
123
|
+
|
|
124
|
+
#### `@mui/x-data-grid-premium@8.9.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
125
|
+
|
|
126
|
+
Same changes as in `@mui/x-data-grid-pro@8.9.1`.
|
|
127
|
+
|
|
128
|
+
### Core
|
|
129
|
+
|
|
130
|
+
- [core] Follow yml syntax convention @oliviertassinari
|
|
131
|
+
|
|
8
132
|
## 8.9.0
|
|
9
133
|
|
|
10
134
|
_Jul 17, 2025_
|