@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.
Files changed (64) hide show
  1. package/BarChart/BarElement.d.ts +1 -1
  2. package/CHANGELOG.md +162 -1
  3. package/ChartsLegend/ChartsLegend.js +1 -1
  4. package/ChartsSurface.d.ts +1 -1
  5. package/ChartsSurface.js +2 -2
  6. package/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
  7. package/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
  8. package/ChartsTooltip/ChartsTooltip.js +4 -4
  9. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
  10. package/ChartsTooltip/ChartsTooltipTable.js +17 -10
  11. package/LineChart/AreaElement.d.ts +1 -1
  12. package/LineChart/LineElement.d.ts +1 -1
  13. package/LineChart/MarkElement.js +1 -1
  14. package/PieChart/PieArc.js +1 -1
  15. package/PieChart/PieArcLabel.js +1 -1
  16. package/README.md +3 -9
  17. package/ResponsiveChartContainer/index.js +1 -1
  18. package/SparkLineChart/SparkLineChart.js +5 -2
  19. package/context/CartesianContextProvider.js +4 -2
  20. package/esm/ChartsLegend/ChartsLegend.js +1 -1
  21. package/esm/ChartsSurface.js +1 -1
  22. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
  23. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
  24. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  25. package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
  26. package/esm/LineChart/MarkElement.js +1 -1
  27. package/esm/PieChart/PieArc.js +1 -1
  28. package/esm/PieChart/PieArcLabel.js +1 -1
  29. package/esm/ResponsiveChartContainer/index.js +1 -1
  30. package/esm/SparkLineChart/SparkLineChart.js +5 -2
  31. package/esm/context/CartesianContextProvider.js +5 -3
  32. package/esm/internals/components/AxisSharedComponents.js +4 -4
  33. package/index.js +1 -1
  34. package/internals/components/AxisSharedComponents.js +4 -4
  35. package/legacy/ChartsLegend/ChartsLegend.js +1 -1
  36. package/legacy/ChartsSurface.js +1 -1
  37. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
  38. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
  39. package/legacy/ChartsTooltip/ChartsTooltip.js +2 -2
  40. package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
  41. package/legacy/LineChart/MarkElement.js +1 -1
  42. package/legacy/PieChart/PieArc.js +1 -1
  43. package/legacy/PieChart/PieArcLabel.js +1 -1
  44. package/legacy/ResponsiveChartContainer/index.js +1 -1
  45. package/legacy/SparkLineChart/SparkLineChart.js +5 -2
  46. package/legacy/context/CartesianContextProvider.js +5 -3
  47. package/legacy/index.js +1 -1
  48. package/legacy/internals/components/AxisSharedComponents.js +4 -4
  49. package/models/axis.d.ts +2 -2
  50. package/modern/ChartsLegend/ChartsLegend.js +1 -1
  51. package/modern/ChartsSurface.js +1 -1
  52. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
  53. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
  54. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  55. package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
  56. package/modern/LineChart/MarkElement.js +1 -1
  57. package/modern/PieChart/PieArc.js +1 -1
  58. package/modern/PieChart/PieArcLabel.js +1 -1
  59. package/modern/ResponsiveChartContainer/index.js +1 -1
  60. package/modern/SparkLineChart/SparkLineChart.js +5 -2
  61. package/modern/context/CartesianContextProvider.js +4 -2
  62. package/modern/index.js +1 -1
  63. package/modern/internals/components/AxisSharedComponents.js +4 -4
  64. package/package.json +2 -2
@@ -35,7 +35,7 @@ const PieArcRoot = styled('path', {
35
35
  ownerState,
36
36
  theme
37
37
  }) => ({
38
- stroke: theme.palette.background.paper,
38
+ stroke: (theme.vars || theme).palette.background.paper,
39
39
  strokeWidth: 1,
40
40
  strokeLinejoin: 'round',
41
41
  fill: ownerState.color,
@@ -34,7 +34,7 @@ const PieArcLabelRoot = styled('text', {
34
34
  })(({
35
35
  theme
36
36
  }) => ({
37
- fill: theme.palette.text.primary,
37
+ fill: (theme.vars || theme).palette.text.primary,
38
38
  textAnchor: 'middle'
39
39
  }));
40
40
  export default function PieArcLabel(props) {
@@ -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 = window.requestAnimationFrame(() => {
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' : 'linear',
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.1;
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: 0
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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v6.0.0-alpha.10
2
+ * @mui/x-charts v6.0.0-alpha.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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.10",
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-alpha.87",
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",