Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Jan 24, 2024
2 parents 6981290 + c002d6e commit e18a29d
Show file tree
Hide file tree
Showing 62 changed files with 995 additions and 980 deletions.
8 changes: 8 additions & 0 deletions docs/data/charts-component-api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const apiPages: MuiPage[] = [
pathname: '/x/api/charts/bar-plot',
title: 'BarPlot',
},
{
pathname: '/x/api/charts/chart-container',
title: 'ChartContainer',
},
{
pathname: '/x/api/charts/charts-axis',
title: 'ChartsAxis',
Expand Down Expand Up @@ -125,6 +129,10 @@ const apiPages: MuiPage[] = [
pathname: '/x/api/charts/pie-plot',
title: 'PiePlot',
},
{
pathname: '/x/api/charts/responsive-chart-container',
title: 'ResponsiveChartContainer',
},
{
pathname: '/x/api/charts/scatter',
title: 'Scatter',
Expand Down
1 change: 1 addition & 0 deletions docs/data/charts/composition/composition.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: React Chart composition
githubLabel: 'component: charts'
components: ChartContainer, ResponsiveChartContainer
packageName: '@mui/x-charts'
---

Expand Down
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/chart-container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';
import ApiPage from 'docs/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './chart-container.json';

export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}

Page.getInitialProps = () => {
const req = require.context(
'docsx/translations/api-docs/charts/chart-container',
false,
/\.\/chart-container.*.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
46 changes: 46 additions & 0 deletions docs/pages/x/api/charts/chart-container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"props": {
"height": { "type": { "name": "number" }, "required": true },
"series": {
"type": { "name": "arrayOf", "description": "Array&lt;object&gt;" },
"required": true
},
"width": { "type": { "name": "number" }, "required": true },
"colors": {
"type": { "name": "union", "description": "Array&lt;string&gt;<br>&#124;&nbsp;func" },
"default": "blueberryTwilightPalette"
},
"dataset": { "type": { "name": "arrayOf", "description": "Array&lt;object&gt;" } },
"disableAxisListener": { "type": { "name": "bool" }, "default": "false" },
"margin": {
"type": {
"name": "shape",
"description": "{ bottom?: number, left?: number, right?: number, top?: number }"
},
"default": "object Depends on the charts type."
},
"xAxis": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ axisId?: string, classes?: object, data?: array, dataKey?: string, disableLine?: bool, disableTicks?: bool, fill?: string, hideTooltip?: bool, id?: string, label?: string, labelFontSize?: number, labelStyle?: object, max?: Date<br>&#124;&nbsp;number, min?: Date<br>&#124;&nbsp;number, position?: 'bottom'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top', scaleType?: 'band'<br>&#124;&nbsp;'linear'<br>&#124;&nbsp;'log'<br>&#124;&nbsp;'point'<br>&#124;&nbsp;'pow'<br>&#124;&nbsp;'sqrt'<br>&#124;&nbsp;'time'<br>&#124;&nbsp;'utc', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto'<br>&#124;&nbsp;array<br>&#124;&nbsp;func, tickLabelInterval?: 'auto'<br>&#124;&nbsp;func, tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickSize?: number, valueFormatter?: func }&gt;"
}
},
"yAxis": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ axisId?: string, classes?: object, data?: array, dataKey?: string, disableLine?: bool, disableTicks?: bool, fill?: string, hideTooltip?: bool, id?: string, label?: string, labelFontSize?: number, labelStyle?: object, max?: Date<br>&#124;&nbsp;number, min?: Date<br>&#124;&nbsp;number, position?: 'bottom'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top', scaleType?: 'band'<br>&#124;&nbsp;'linear'<br>&#124;&nbsp;'log'<br>&#124;&nbsp;'point'<br>&#124;&nbsp;'pow'<br>&#124;&nbsp;'sqrt'<br>&#124;&nbsp;'time'<br>&#124;&nbsp;'utc', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto'<br>&#124;&nbsp;array<br>&#124;&nbsp;func, tickLabelInterval?: 'auto'<br>&#124;&nbsp;func, tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickSize?: number, valueFormatter?: func }&gt;"
}
}
},
"name": "ChartContainer",
"imports": [
"import { ChartContainer } from '@mui/x-charts/ChartContainer';",
"import { ChartContainer } from '@mui/x-charts';"
],
"classes": [],
"muiName": "MuiChartContainer",
"filename": "/packages/x-charts/src/ChartContainer/ChartContainer.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/x/react-charts/composition/\">Chart composition</a></li></ul>",
"cssComponent": false
}
13 changes: 2 additions & 11 deletions docs/pages/x/api/charts/default-charts-axis-tooltip-content.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"props": {
"axis": {
"type": {
"name": "shape",
"description": "{ axisId?: string, classes?: object, data?: array, dataKey?: string, disableLine?: bool, disableTicks?: bool, fill?: string, hideTooltip?: bool, id: string, label?: string, labelFontSize?: number, labelStyle?: object, max?: Date<br>&#124;&nbsp;number, min?: Date<br>&#124;&nbsp;number, position?: 'bottom'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top', scale: func, scaleType: 'time', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto'<br>&#124;&nbsp;array<br>&#124;&nbsp;func, tickLabelInterval?: 'auto'<br>&#124;&nbsp;func, tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber: number, tickSize?: number, valueFormatter?: func }"
},
"required": true
},
"axis": { "type": { "name": "object" }, "required": true },
"axisData": {
"type": {
"name": "shape",
Expand All @@ -21,10 +15,7 @@
"additionalInfo": { "cssApi": true }
},
"series": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ area?: bool, color: string, connectNulls?: bool, curve?: 'catmullRom'<br>&#124;&nbsp;'linear'<br>&#124;&nbsp;'monotoneX'<br>&#124;&nbsp;'monotoneY'<br>&#124;&nbsp;'natural'<br>&#124;&nbsp;'step'<br>&#124;&nbsp;'stepAfter'<br>&#124;&nbsp;'stepBefore', data: Array&lt;number&gt;, dataKey?: string, disableHighlight?: bool, highlightScope?: { faded?: 'global'<br>&#124;&nbsp;'none'<br>&#124;&nbsp;'series', highlighted?: 'item'<br>&#124;&nbsp;'none'<br>&#124;&nbsp;'series' }, id: string, label?: string, showMark?: func<br>&#124;&nbsp;bool, stack?: string, stackOffset?: 'diverging'<br>&#124;&nbsp;'expand'<br>&#124;&nbsp;'none'<br>&#124;&nbsp;'silhouette'<br>&#124;&nbsp;'wiggle', stackOrder?: 'appearance'<br>&#124;&nbsp;'ascending'<br>&#124;&nbsp;'descending'<br>&#124;&nbsp;'insideOut'<br>&#124;&nbsp;'none'<br>&#124;&nbsp;'reverse', type: 'line', valueFormatter: func, xAxisKey?: string, yAxisKey?: string }&gt;"
},
"type": { "name": "arrayOf", "description": "Array&lt;object&gt;" },
"required": true
},
"dataIndex": { "type": { "name": "number" } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
},
"required": true
},
"series": {
"type": {
"name": "shape",
"description": "{ color?: string, data: Array&lt;number&gt;, highlightScope?: { faded?: 'global'<br>&#124;&nbsp;'none'<br>&#124;&nbsp;'series', highlighted?: 'item'<br>&#124;&nbsp;'none'<br>&#124;&nbsp;'series' }, id: string, type: 'bar'<br>&#124;&nbsp;'line'<br>&#124;&nbsp;'pie'<br>&#124;&nbsp;'scatter', valueFormatter: func }"
},
"required": true
}
"series": { "type": { "name": "object" }, "required": true }
},
"name": "DefaultChartsItemTooltipContent",
"imports": [
Expand Down
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/responsive-chart-container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react';
import ApiPage from 'docs/src/modules/components/ApiPage';
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
import jsonPageContent from './responsive-chart-container.json';

export default function Page(props) {
const { descriptions, pageContent } = props;
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
}

Page.getInitialProps = () => {
const req = require.context(
'docsx/translations/api-docs/charts/responsive-chart-container',
false,
/\.\/responsive-chart-container.*.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
46 changes: 46 additions & 0 deletions docs/pages/x/api/charts/responsive-chart-container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"props": {
"series": {
"type": { "name": "arrayOf", "description": "Array&lt;object&gt;" },
"required": true
},
"colors": {
"type": { "name": "union", "description": "Array&lt;string&gt;<br>&#124;&nbsp;func" },
"default": "blueberryTwilightPalette"
},
"dataset": { "type": { "name": "arrayOf", "description": "Array&lt;object&gt;" } },
"disableAxisListener": { "type": { "name": "bool" }, "default": "false" },
"height": { "type": { "name": "number" }, "default": "undefined" },
"margin": {
"type": {
"name": "shape",
"description": "{ bottom?: number, left?: number, right?: number, top?: number }"
},
"default": "object Depends on the charts type."
},
"width": { "type": { "name": "number" }, "default": "undefined" },
"xAxis": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ axisId?: string, classes?: object, data?: array, dataKey?: string, disableLine?: bool, disableTicks?: bool, fill?: string, hideTooltip?: bool, id?: string, label?: string, labelFontSize?: number, labelStyle?: object, max?: Date<br>&#124;&nbsp;number, min?: Date<br>&#124;&nbsp;number, position?: 'bottom'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top', scaleType?: 'band'<br>&#124;&nbsp;'linear'<br>&#124;&nbsp;'log'<br>&#124;&nbsp;'point'<br>&#124;&nbsp;'pow'<br>&#124;&nbsp;'sqrt'<br>&#124;&nbsp;'time'<br>&#124;&nbsp;'utc', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto'<br>&#124;&nbsp;array<br>&#124;&nbsp;func, tickLabelInterval?: 'auto'<br>&#124;&nbsp;func, tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickSize?: number, valueFormatter?: func }&gt;"
}
},
"yAxis": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ axisId?: string, classes?: object, data?: array, dataKey?: string, disableLine?: bool, disableTicks?: bool, fill?: string, hideTooltip?: bool, id?: string, label?: string, labelFontSize?: number, labelStyle?: object, max?: Date<br>&#124;&nbsp;number, min?: Date<br>&#124;&nbsp;number, position?: 'bottom'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top', scaleType?: 'band'<br>&#124;&nbsp;'linear'<br>&#124;&nbsp;'log'<br>&#124;&nbsp;'point'<br>&#124;&nbsp;'pow'<br>&#124;&nbsp;'sqrt'<br>&#124;&nbsp;'time'<br>&#124;&nbsp;'utc', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto'<br>&#124;&nbsp;array<br>&#124;&nbsp;func, tickLabelInterval?: 'auto'<br>&#124;&nbsp;func, tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickSize?: number, valueFormatter?: func }&gt;"
}
}
},
"name": "ResponsiveChartContainer",
"imports": [
"import { ResponsiveChartContainer } from '@mui/x-charts/ResponsiveChartContainer';",
"import { ResponsiveChartContainer } from '@mui/x-charts';"
],
"classes": [],
"muiName": "MuiResponsiveChartContainer",
"filename": "/packages/x-charts/src/ResponsiveChartContainer/ResponsiveChartContainer.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/x/react-charts/composition/\">Chart composition</a></li></ul>",
"cssComponent": false
}
7 changes: 1 addition & 6 deletions docs/pages/x/api/data-grid/data-grid-premium.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,7 @@
"paginationModel": {
"type": { "name": "shape", "description": "{ page: number, pageSize: number }" }
},
"pinnedColumns": {
"type": {
"name": "shape",
"description": "{ left?: Array&lt;string&gt;, right?: Array&lt;string&gt; }"
}
},
"pinnedColumns": { "type": { "name": "object" } },
"pinnedRows": {
"type": {
"name": "shape",
Expand Down
7 changes: 1 addition & 6 deletions docs/pages/x/api/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,7 @@
"paginationModel": {
"type": { "name": "shape", "description": "{ page: number, pageSize: number }" }
},
"pinnedColumns": {
"type": {
"name": "shape",
"description": "{ left?: Array&lt;string&gt;, right?: Array&lt;string&gt; }"
}
},
"pinnedColumns": { "type": { "name": "object" } },
"pinnedRows": {
"type": {
"name": "shape",
Expand Down
3 changes: 3 additions & 0 deletions docs/scripts/generateProptypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ async function generateProptypes(project: XTypeScriptProject, sourceFile: string
'column',
'groupingColDef',
'rowNode',
'pinnedColumns',
'localeText',
'columnGroupingModel',
'unstableFieldRef',
'unstableStartFieldRef',
'unstableEndFieldRef',
'series',
'axis',
];
if (propsToNotResolve.includes(name)) {
return false;
Expand Down
8 changes: 4 additions & 4 deletions docs/translations/api-docs/charts/bar-chart/bar-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
},
"classDescriptions": {},
"slotDescriptions": {
"axisContent": "",
"axisLabel": "",
"axisLine": "",
"axisTick": "",
"axisTickLabel": "",
"axisLabel": "",
"bar": "",
"itemContent": "",
"legend": "",
"popper": "",
"axisContent": "",
"itemContent": ""
"popper": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"componentDescription": "",
"propDescriptions": {
"colors": { "description": "Color palette used to colorize multiple series." },
"dataset": {
"description": "An array of objects that can be used to populate series and axes data using their <code>dataKey</code> property."
},
"disableAxisListener": {
"description": "If <code>true</code>, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance."
},
"height": { "description": "The height of the chart in px." },
"margin": {
"description": "The margin between the SVG and the drawing area. It&#39;s used for leaving some space for extra information such as the x- and y-axis or legend. Accepts an object with the optional properties: <code>top</code>, <code>bottom</code>, <code>left</code>, and <code>right</code>."
},
"series": {
"description": "The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it."
},
"width": { "description": "The width of the chart in px." },
"xAxis": {
"description": "The configuration of the x-axes. If not provided, a default axis config is used with id set to <code>DEFAULT_X_AXIS_KEY</code>."
},
"yAxis": {
"description": "The configuration of the y-axes. If not provided, a default axis config is used with id set to <code>DEFAULT_Y_AXIS_KEY</code>."
}
},
"classDescriptions": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"nodeName": "the valueCell element"
}
},
"slotDescriptions": { "popper": "", "axisContent": "", "itemContent": "" }
"slotDescriptions": { "axisContent": "", "itemContent": "", "popper": "" }
}
14 changes: 7 additions & 7 deletions docs/translations/api-docs/charts/line-chart/line-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@
},
"classDescriptions": {},
"slotDescriptions": {
"area": "",
"axisContent": "",
"axisLabel": "",
"axisLine": "",
"axisTick": "",
"axisTickLabel": "",
"axisLabel": "",
"area": "",
"itemContent": "",
"legend": "",
"line": "",
"mark": "",
"lineHighlight": "",
"legend": "",
"popper": "",
"axisContent": "",
"itemContent": ""
"mark": "",
"popper": ""
}
}
10 changes: 5 additions & 5 deletions docs/translations/api-docs/charts/pie-chart/pie-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
},
"classDescriptions": {},
"slotDescriptions": {
"axisContent": "",
"axisLabel": "",
"axisLine": "",
"axisTick": "",
"axisTickLabel": "",
"axisLabel": "",
"itemContent": "",
"legend": "",
"pieArc": "",
"pieArcLabel": "",
"legend": "",
"popper": "",
"axisContent": "",
"itemContent": ""
"popper": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"componentDescription": "",
"propDescriptions": {
"colors": { "description": "Color palette used to colorize multiple series." },
"dataset": {
"description": "An array of objects that can be used to populate series and axes data using their <code>dataKey</code> property."
},
"disableAxisListener": {
"description": "If <code>true</code>, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance."
},
"height": {
"description": "The height of the chart in px. If not defined, it takes the height of the parent element."
},
"margin": {
"description": "The margin between the SVG and the drawing area. It&#39;s used for leaving some space for extra information such as the x- and y-axis or legend. Accepts an object with the optional properties: <code>top</code>, <code>bottom</code>, <code>left</code>, and <code>right</code>."
},
"series": {
"description": "The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it."
},
"width": {
"description": "The width of the chart in px. If not defined, it takes the width of the parent element."
},
"xAxis": {
"description": "The configuration of the x-axes. If not provided, a default axis config is used with id set to <code>DEFAULT_X_AXIS_KEY</code>."
},
"yAxis": {
"description": "The configuration of the y-axes. If not provided, a default axis config is used with id set to <code>DEFAULT_Y_AXIS_KEY</code>."
}
},
"classDescriptions": {}
}
Loading

0 comments on commit e18a29d

Please sign in to comment.