@mui/x-charts 6.0.0-alpha.10 → 6.0.0-alpha.12
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/BarElement.d.ts +1 -1
- package/CHANGELOG.md +162 -1
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsSurface.d.ts +1 -1
- package/ChartsSurface.js +2 -2
- package/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
- package/ChartsTooltip/ChartsTooltip.js +4 -4
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
- package/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/MarkElement.js +1 -1
- package/PieChart/PieArc.js +1 -1
- package/PieChart/PieArcLabel.js +1 -1
- package/README.md +3 -9
- package/ResponsiveChartContainer/index.js +1 -1
- package/SparkLineChart/SparkLineChart.js +5 -2
- package/context/CartesianContextProvider.js +4 -2
- package/esm/ChartsLegend/ChartsLegend.js +1 -1
- package/esm/ChartsSurface.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
- package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
- package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/esm/LineChart/MarkElement.js +1 -1
- package/esm/PieChart/PieArc.js +1 -1
- package/esm/PieChart/PieArcLabel.js +1 -1
- package/esm/ResponsiveChartContainer/index.js +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +5 -2
- package/esm/context/CartesianContextProvider.js +5 -3
- package/esm/internals/components/AxisSharedComponents.js +4 -4
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.js +4 -4
- package/legacy/ChartsLegend/ChartsLegend.js +1 -1
- package/legacy/ChartsSurface.js +1 -1
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
- package/legacy/ChartsTooltip/ChartsTooltip.js +2 -2
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
- package/legacy/LineChart/MarkElement.js +1 -1
- package/legacy/PieChart/PieArc.js +1 -1
- package/legacy/PieChart/PieArcLabel.js +1 -1
- package/legacy/ResponsiveChartContainer/index.js +1 -1
- package/legacy/SparkLineChart/SparkLineChart.js +5 -2
- package/legacy/context/CartesianContextProvider.js +5 -3
- package/legacy/index.js +1 -1
- package/legacy/internals/components/AxisSharedComponents.js +4 -4
- package/models/axis.d.ts +2 -2
- package/modern/ChartsLegend/ChartsLegend.js +1 -1
- package/modern/ChartsSurface.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
- package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/modern/LineChart/MarkElement.js +1 -1
- package/modern/PieChart/PieArc.js +1 -1
- package/modern/PieChart/PieArcLabel.js +1 -1
- package/modern/ResponsiveChartContainer/index.js +1 -1
- package/modern/SparkLineChart/SparkLineChart.js +5 -2
- package/modern/context/CartesianContextProvider.js +4 -2
- package/modern/index.js +1 -1
- package/modern/internals/components/AxisSharedComponents.js +4 -4
- package/package.json +2 -2
|
@@ -42,7 +42,7 @@ const useChartDimensions = (inWidth, inHeight) => {
|
|
|
42
42
|
let animationFrame;
|
|
43
43
|
const observer = new ResizeObserver(() => {
|
|
44
44
|
// See https://github.com/mui/mui-x/issues/8733
|
|
45
|
-
animationFrame =
|
|
45
|
+
animationFrame = requestAnimationFrame(() => {
|
|
46
46
|
computeSize();
|
|
47
47
|
});
|
|
48
48
|
});
|
|
@@ -58,7 +58,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
58
58
|
margin: margin,
|
|
59
59
|
xAxis: [_extends({
|
|
60
60
|
id: DEFAULT_X_AXIS_KEY,
|
|
61
|
-
scaleType: plotType === 'bar' ? 'band' : '
|
|
61
|
+
scaleType: plotType === 'bar' ? 'band' : 'point',
|
|
62
62
|
data: Array.from({
|
|
63
63
|
length: data.length
|
|
64
64
|
}, (_, index) => index),
|
|
@@ -69,7 +69,10 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
69
69
|
disableAxisListener: (!showTooltip || tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
70
70
|
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
71
71
|
slots: slots,
|
|
72
|
-
slotProps: slotProps
|
|
72
|
+
slotProps: slotProps,
|
|
73
|
+
sx: {
|
|
74
|
+
shapeRendering: 'auto'
|
|
75
|
+
}
|
|
73
76
|
}), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
74
77
|
children: [/*#__PURE__*/_jsx(AreaPlot, {
|
|
75
78
|
slots: slots,
|
|
@@ -12,7 +12,8 @@ import { SeriesContext } from './SeriesContextProvider';
|
|
|
12
12
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
|
|
13
13
|
import { getTicksNumber } from '../hooks/useTicks';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
const DEFAULT_CATEGORY_GAP_RATIO = 0.
|
|
15
|
+
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
|
|
16
|
+
const DEFAULT_BAR_GAP_RATIO = 0.1;
|
|
16
17
|
|
|
17
18
|
// TODO: those might be better placed in a distinct file
|
|
18
19
|
const xExtremumGetters = {
|
|
@@ -102,9 +103,10 @@ function CartesianContextProvider({
|
|
|
102
103
|
const range = [drawingArea.left, drawingArea.left + drawingArea.width];
|
|
103
104
|
if (isBandScaleConfig(axis)) {
|
|
104
105
|
const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
|
|
106
|
+
const barGapRatio = axis.barGapRatio ?? DEFAULT_BAR_GAP_RATIO;
|
|
105
107
|
completedXAxis[axis.id] = _extends({
|
|
106
108
|
categoryGapRatio,
|
|
107
|
-
barGapRatio
|
|
109
|
+
barGapRatio
|
|
108
110
|
}, axis, {
|
|
109
111
|
scale: scaleBand(axis.data, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2),
|
|
110
112
|
ticksNumber: axis.data.length
|
package/modern/index.js
CHANGED
|
@@ -47,7 +47,7 @@ export const ChartsLine = styled('line', {
|
|
|
47
47
|
})(({
|
|
48
48
|
theme
|
|
49
49
|
}) => ({
|
|
50
|
-
stroke: theme.palette.text.primary,
|
|
50
|
+
stroke: (theme.vars || theme).palette.text.primary,
|
|
51
51
|
shapeRendering: 'crispEdges',
|
|
52
52
|
strokeWidth: 1
|
|
53
53
|
}));
|
|
@@ -58,7 +58,7 @@ export const ChartsTick = styled('line', {
|
|
|
58
58
|
})(({
|
|
59
59
|
theme
|
|
60
60
|
}) => ({
|
|
61
|
-
stroke: theme.palette.text.primary,
|
|
61
|
+
stroke: (theme.vars || theme).palette.text.primary,
|
|
62
62
|
shapeRendering: 'crispEdges'
|
|
63
63
|
}));
|
|
64
64
|
export const ChartsTickLabel = styled('text', {
|
|
@@ -68,7 +68,7 @@ export const ChartsTickLabel = styled('text', {
|
|
|
68
68
|
})(({
|
|
69
69
|
theme
|
|
70
70
|
}) => _extends({}, theme.typography.caption, {
|
|
71
|
-
fill: theme.palette.text.primary
|
|
71
|
+
fill: (theme.vars || theme).palette.text.primary
|
|
72
72
|
}));
|
|
73
73
|
export const ChartsLabel = styled('text', {
|
|
74
74
|
name: 'MuiChartsAxis',
|
|
@@ -77,5 +77,5 @@ export const ChartsLabel = styled('text', {
|
|
|
77
77
|
})(({
|
|
78
78
|
theme
|
|
79
79
|
}) => _extends({}, theme.typography.body1, {
|
|
80
|
-
fill: theme.palette.text.primary
|
|
80
|
+
fill: (theme.vars || theme).palette.text.primary
|
|
81
81
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.12",
|
|
4
4
|
"description": "The community edition of the charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.22.15",
|
|
31
|
-
"@mui/base": "^5.0.0-
|
|
31
|
+
"@mui/base": "^5.0.0-beta.14",
|
|
32
32
|
"clsx": "^2.0.0",
|
|
33
33
|
"d3-color": "^3.1.0",
|
|
34
34
|
"d3-scale": "^4.0.2",
|