Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix 404 links #15575

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/charts/heatmap/heatmap.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: React Heatmap chart
productId: x-charts
components: Heatmap, HeatmapPlot, DefaultHeatmapTooltip
components: Heatmap, HeatmapPlot, HeatmapTooltip
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct name

---

# Charts - Heatmap [<span class="plan-pro"></span>](/x/introduction/licensing/#pro-plan 'Pro plan')
Expand Down
5 changes: 5 additions & 0 deletions docs/data/chartsApiPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ const chartsApiPages: MuiPage[] = [
title: 'HeatmapPlot',
plan: 'pro',
},
{
pathname: '/x/api/charts/heatmap-tooltip',
title: 'HeatmapTooltip',
plan: 'pro',
},
{
pathname: '/x/api/charts/line-chart',
title: 'LineChart',
Expand Down
23 changes: 13 additions & 10 deletions docs/data/migration/migration-charts-v7/migration-charts-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ In `package.json`, change the version of the charts package to `next`.
```diff
-"@mui/x-charts": "^7.0.0",
+"@mui/x-charts": "next",

-"@mui/x-charts-pro": "^7.0.0",
+"@mui/x-charts-pro": "next",
```

Using `next` ensures that it will always use the latest v8 pre-release version, but you can also use a fixed version, like `8.0.0-alpha.0`.
Expand Down Expand Up @@ -85,8 +88,8 @@ The `legend` prop of charts single components has been removed.
To pass props to the legend, use the `slotProps.legend`.

```diff
- <PieChart legend={{ ... }} />
+ <PieChart slotProps={{ legend: { ... } }} />
-<PieChart legend={{ ... }} />
+<PieChart slotProps={{ legend: { ... } }} />
```

## Removing ResponsiveChartContainer ✅
Expand All @@ -95,16 +98,16 @@ The `ResponsiveChartContainer` has been removed.
You can now use `ChartContainer` as a responsive container which works now exactly the same way.

```diff
- import { ResponsiveChartContainer } from '@mui/x-charts/ResponsiveChartContainer';
- import { ResponsiveChartContainerPro } from '@mui/x-charts-pro/ResponsiveChartContainerPro';
+ import { ChartContainer } from '@mui/x-charts/ResponsiveChartContainer';
+ import { ChartContainerPro } from '@mui/x-charts-pro/ResponsiveChartContainerPro';
-import { ResponsiveChartContainer } from '@mui/x-charts/ResponsiveChartContainer';
-import { ResponsiveChartContainerPro } from '@mui/x-charts-pro/ResponsiveChartContainerPro';
+import { ChartContainer } from '@mui/x-charts/ResponsiveChartContainer';
+import { ChartContainerPro } from '@mui/x-charts-pro/ResponsiveChartContainerPro';

- <ResponsiveChartContainer>
+ <ChartContainer>
-<ResponsiveChartContainer>
+<ChartContainer>
<BarPlot />
- </ResponsiveChartContainer>
+ </ChartContainer>
-</ResponsiveChartContainer>
+</ChartContainer>
```

## New DOM structure for ChartContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ In `package.json`, change the version of the date pickers package to `^7.0.0`.
```diff
-"@mui/x-date-pickers": "^6.0.0",
+"@mui/x-date-pickers": "^7.0.0",

-"@mui/x-date-pickers-pro": "^6.0.0",
+"@mui/x-date-pickers-pro": "^7.0.0",
```

Since `v7` is a major release, it contains changes that affect the public API.
Expand Down
39 changes: 21 additions & 18 deletions docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ In `package.json`, change the version of the date pickers package to `next`.
```diff
-"@mui/x-date-pickers": "7.x.x",
+"@mui/x-date-pickers": "next",

-"@mui/x-date-pickers-pro": "7.x.x",
+"@mui/x-date-pickers-pro": "next",
```

Using `next` ensures that it will always use the latest v8 pre-release version, but you can also use a fixed version, like `8.0.0-alpha.0`.
Expand Down Expand Up @@ -352,34 +355,34 @@ The following variables were renamed to have a coherent `Picker` / `Pickers` pre
- `usePickersTranslations`

```diff
- import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
- import { usePickersTranslations } from '@mui/x-date-pickers';
- import { usePickersTranslations } from '@mui/x-date-pickers-pro';
-import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
-import { usePickersTranslations } from '@mui/x-date-pickers';
-import { usePickersTranslations } from '@mui/x-date-pickers-pro';
Comment on lines 357 to +360
Copy link
Member Author

@oliviertassinari oliviertassinari Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix git diff format

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to lint such cases to avoid introducing incorrect diffs in the first place? 🤔

Copy link
Member Author

@oliviertassinari oliviertassinari Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible yes. I did a first pass a long time ago https://github.com/mui/material-ui/blob/master/packages/markdownlint-rule-mui/git-diff.js. We could do another, I didn't think about this case.

We can simply make sure that each diff resets the spacing, in a way that there is is no visual spacing offsets, e.g.

-    foo() {}
-      bar;
+foo() {}
+  bar;

@samuelsycamore if you are looking for some small writing code + some algorithmic exercises, up for grab 😄. I can allocate time to review it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to an issue mui/mui-public#249.


+ import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
+ import { usePickerTranslations } from '@mui/x-date-pickers';
+ import { usePickerTranslations } from '@mui/x-date-pickers-pro';
+import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
+import { usePickerTranslations } from '@mui/x-date-pickers';
+import { usePickerTranslations } from '@mui/x-date-pickers-pro';

- const translations = usePickersTranslations();
+ const translations = usePickerTranslations();
-const translations = usePickersTranslations();
+const translations = usePickerTranslations();
```

- `usePickersContext`
- `usePickersContext`

```diff
- import { usePickersContext } from '@mui/x-date-pickers/hooks';
- import { usePickersContext } from '@mui/x-date-pickers';
- import { usePickersContext } from '@mui/x-date-pickers-pro';
-import { usePickersContext } from '@mui/x-date-pickers/hooks';
-import { usePickersContext } from '@mui/x-date-pickers';
-import { usePickersContext } from '@mui/x-date-pickers-pro';

+ import { usePickerContext } from '@mui/x-date-pickers/hooks';
+ import { usePickerContext } from '@mui/x-date-pickers';
+ import { usePickerContext } from '@mui/x-date-pickers-pro';
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
+import { usePickerContext } from '@mui/x-date-pickers';
+import { usePickerContext } from '@mui/x-date-pickers-pro';

- const pickersContext = usePickersContext();
+ const pickerContext = usePickerContext();
-const pickersContext = usePickersContext();
+const pickerContext = usePickerContext();
```

- `FieldValueType`
- `FieldValueType`

```diff
-import { FieldValueType } from '@mui/x-date-pickers/models';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ In `package.json`, change the version of the Tree View package to `next`.
```diff
-"@mui/x-tree-view": "7.x.x",
+"@mui/x-tree-view": "next",

-"@mui/x-tree-view-pro": "7.x.x",
+"@mui/x-tree-view-pro": "next",
```

Using `next` ensures that it will always use the latest v8 pre-release version, but you can also use a fixed version, like `8.0.0-alpha.0`.
Expand Down Expand Up @@ -128,7 +131,7 @@ This inconsistency has been solved, all the event manager now target the root of
-<SimpleTreeView>
+<SimpleTreeView onItemClick={handleItemClick}>
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
- <TreeItem onClick={handleItemClick}>
+ <TreeItem >
+ <TreeItem>
</SimpleTreeView>
```

Expand Down
1 change: 0 additions & 1 deletion docs/data/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ const pages: MuiPage[] = [
{ pathname: '/x/react-data-grid/export' },
{ pathname: '/x/react-data-grid/clipboard', title: 'Copy and paste' },
{ pathname: '/x/react-data-grid/scrolling' },

{
pathname: '/x/react-data-grid/list-view',
title: 'List view',
Expand Down
2 changes: 1 addition & 1 deletion docs/data/tree-view/getting-started/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
productId: x-tree-view
title: Tree View - Getting started
components: SimpleTreeView, RichTreeView, TreeItem, TreeView
components: SimpleTreeView, RichTreeView, TreeItem
packageName: '@mui/x-tree-view'
githubLabel: 'component: tree view'
waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/
Expand Down
4 changes: 4 additions & 0 deletions docs/data/treeViewApiPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ const treeViewApiPages: MuiPage[] = [
pathname: '/x/api/tree-view/tree-item-icon',
title: 'TreeItemIcon',
},
{
pathname: '/x/api/tree-view/tree-item-provider',
title: 'TreeItemProvider',
},
];
export default treeViewApiPages;
8 changes: 6 additions & 2 deletions docs/pages/x/api/charts/axis-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "AxisConfig",
"imports": ["import { AxisConfig } from '@mui/x-charts'"],
"imports": [
"import { AxisConfig } from '@mui/x-charts-pro'",
"import { AxisConfig } from '@mui/x-charts'"
],
"properties": {
"id": { "type": { "description": "AxisId" }, "required": true },
"scaleType": { "type": { "description": "'band'" }, "required": true },
Expand Down Expand Up @@ -32,6 +35,7 @@
},
"valueFormatter": {
"type": { "description": "(value: V, context: AxisValueFormatterContext) =&gt; string" }
}
},
"zoom": { "type": { "description": "boolean | ZoomOptions" }, "isProPlan": true }
}
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/charts/bar-series-type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "BarSeriesType",
"imports": ["import { BarSeriesType } from '@mui/x-charts'"],
"imports": [
"import { BarSeriesType } from '@mui/x-charts-pro'",
"import { BarSeriesType } from '@mui/x-charts'"
],
"properties": {
"type": { "type": { "description": "'bar'" }, "required": true },
"color": { "type": { "description": "string" } },
Expand Down
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/heatmap-tooltip.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 './heatmap-tooltip.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/heatmap-tooltip',
false,
/\.\/heatmap-tooltip.*.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
135 changes: 135 additions & 0 deletions docs/pages/x/api/charts/heatmap-tooltip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"props": {
"anchorEl": {
"type": {
"name": "union",
"description": "(props, propName) => {\n if (props[propName] == null) {\n return new Error(`Prop '${propName}' is required but wasn't specified`);\n }\n if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {\n return new Error(`Expected prop '${propName}' to be of type Element`);\n }\n return null;\n}<br>&#124;&nbsp;func<br>&#124;&nbsp;{ contextElement?: (props, propName) => {\n if (props[propName] == null) {\n return null;\n }\n if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {\n return new Error(`Expected prop '${propName}' to be of type Element`);\n }\n return null;\n}, getBoundingClientRect: func }"
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
}
},
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
"component": { "type": { "name": "elementType" } },
"components": {
"type": { "name": "shape", "description": "{ Root?: elementType }" },
"default": "{}"
},
"componentsProps": {
"type": { "name": "shape", "description": "{ root?: func<br>&#124;&nbsp;object }" },
"default": "{}"
},
"container": {
"type": {
"name": "union",
"description": "(props, propName) => {\n if (props[propName] == null) {\n return new Error(`Prop '${propName}' is required but wasn't specified`);\n }\n if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {\n return new Error(`Expected prop '${propName}' to be of type Element`);\n }\n return null;\n}<br>&#124;&nbsp;func"
}
},
"disablePortal": { "type": { "name": "bool" }, "default": "false" },
"keepMounted": { "type": { "name": "bool" }, "default": "false" },
"modifiers": {
"type": {
"name": "arrayOf",
"description": "Array&lt;{ data?: object, effect?: func, enabled?: bool, fn?: func, name?: any, options?: object, phase?: 'afterMain'<br>&#124;&nbsp;'afterRead'<br>&#124;&nbsp;'afterWrite'<br>&#124;&nbsp;'beforeMain'<br>&#124;&nbsp;'beforeRead'<br>&#124;&nbsp;'beforeWrite'<br>&#124;&nbsp;'main'<br>&#124;&nbsp;'read'<br>&#124;&nbsp;'write', requires?: Array&lt;string&gt;, requiresIfExists?: Array&lt;string&gt; }&gt;"
}
},
"open": { "type": { "name": "bool" } },
"placement": {
"type": {
"name": "enum",
"description": "'auto-end'<br>&#124;&nbsp;'auto-start'<br>&#124;&nbsp;'auto'<br>&#124;&nbsp;'bottom-end'<br>&#124;&nbsp;'bottom-start'<br>&#124;&nbsp;'bottom'<br>&#124;&nbsp;'left-end'<br>&#124;&nbsp;'left-start'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right-end'<br>&#124;&nbsp;'right-start'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top-end'<br>&#124;&nbsp;'top-start'<br>&#124;&nbsp;'top'"
},
"default": "'bottom'"
},
"popperOptions": {
"type": {
"name": "shape",
"description": "{ modifiers?: array, onFirstUpdate?: func, placement?: 'auto-end'<br>&#124;&nbsp;'auto-start'<br>&#124;&nbsp;'auto'<br>&#124;&nbsp;'bottom-end'<br>&#124;&nbsp;'bottom-start'<br>&#124;&nbsp;'bottom'<br>&#124;&nbsp;'left-end'<br>&#124;&nbsp;'left-start'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right-end'<br>&#124;&nbsp;'right-start'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top-end'<br>&#124;&nbsp;'top-start'<br>&#124;&nbsp;'top', strategy?: 'absolute'<br>&#124;&nbsp;'fixed' }"
},
"default": "{}"
},
"popperRef": {
"type": {
"name": "union",
"description": "func<br>&#124;&nbsp;{ current?: { destroy: func, forceUpdate: func, setOptions: func, state: { attributes: object, elements: object, modifiersData: object, options: object, orderedModifiers: Array&lt;object&gt;, placement: 'auto-end'<br>&#124;&nbsp;'auto-start'<br>&#124;&nbsp;'auto'<br>&#124;&nbsp;'bottom-end'<br>&#124;&nbsp;'bottom-start'<br>&#124;&nbsp;'bottom'<br>&#124;&nbsp;'left-end'<br>&#124;&nbsp;'left-start'<br>&#124;&nbsp;'left'<br>&#124;&nbsp;'right-end'<br>&#124;&nbsp;'right-start'<br>&#124;&nbsp;'right'<br>&#124;&nbsp;'top-end'<br>&#124;&nbsp;'top-start'<br>&#124;&nbsp;'top', rects: object, reset: bool, scrollParents: object, strategy: 'absolute'<br>&#124;&nbsp;'fixed', styles: object }, update: func } }"
}
},
"slotProps": { "type": { "name": "object" }, "default": "{}" },
"slots": {
"type": { "name": "object" },
"default": "{}",
"additionalInfo": { "slotsApi": true }
},
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
},
"additionalInfo": { "sx": true }
},
"transition": { "type": { "name": "bool" }, "default": "false" }
},
"name": "HeatmapTooltip",
"imports": [
"import { HeatmapTooltip } from '@mui/x-charts-pro/Heatmap';",
"import { HeatmapTooltip } from '@mui/x-charts-pro';"
],
"classes": [
{
"key": "cell",
"className": "MuiHeatmapTooltip-cell",
"description": "Styles applied to the cell element.",
"isGlobal": false
},
{
"key": "labelCell",
"className": "MuiHeatmapTooltip-labelCell",
"description": "Styles applied to the labelCell element.",
"isGlobal": false
},
{
"key": "mark",
"className": "MuiHeatmapTooltip-mark",
"description": "Styles applied to the mark element.",
"isGlobal": false
},
{
"key": "markCell",
"className": "MuiHeatmapTooltip-markCell",
"description": "Styles applied to the markCell element.",
"isGlobal": false
},
{
"key": "paper",
"className": "MuiHeatmapTooltip-paper",
"description": "Styles applied to the paper element.",
"isGlobal": false
},
{
"key": "root",
"className": "MuiHeatmapTooltip-root",
"description": "Styles applied to the root element.",
"isGlobal": false
},
{
"key": "row",
"className": "MuiHeatmapTooltip-row",
"description": "Styles applied to the row element.",
"isGlobal": false
},
{
"key": "table",
"className": "MuiHeatmapTooltip-table",
"description": "Styles applied to the table element.",
"isGlobal": false
},
{
"key": "valueCell",
"className": "MuiHeatmapTooltip-valueCell",
"description": "Styles applied to the valueCell element.",
"isGlobal": false
}
],
"muiName": "MuiHeatmapTooltip",
"filename": "/packages/x-charts-pro/src/Heatmap/HeatmapTooltip.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/x/react-charts/heatmap/\">Charts - Heatmap <a href=\"/x/introduction/licensing/#pro-plan\" title=\"Pro plan\"><span class=\"plan-pro\"></span></a></a></li></ul>",
"cssComponent": false
}
5 changes: 4 additions & 1 deletion docs/pages/x/api/charts/line-series-type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "LineSeriesType",
"imports": ["import { LineSeriesType } from '@mui/x-charts'"],
"imports": [
"import { LineSeriesType } from '@mui/x-charts-pro'",
"import { LineSeriesType } from '@mui/x-charts'"
],
"properties": {
"type": { "type": { "description": "'line'" }, "required": true },
"area": { "type": { "description": "boolean" } },
Expand Down
5 changes: 4 additions & 1 deletion docs/pages/x/api/charts/pie-series-type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "PieSeriesType",
"imports": ["import { PieSeriesType } from '@mui/x-charts'"],
"imports": [
"import { PieSeriesType } from '@mui/x-charts-pro'",
"import { PieSeriesType } from '@mui/x-charts'"
],
"properties": {
"data": { "type": { "description": "TData[]" }, "required": true },
"type": { "type": { "description": "'pie'" }, "required": true },
Expand Down
Loading