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

[charts] Fix export strategy #11235

Merged
merged 9 commits into from
Nov 30, 2023
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
13 changes: 13 additions & 0 deletions docs/data/charts-component-api-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@ export default [
{ pathname: '/x/api/charts/area-element', title: 'AreaElement' },
{ pathname: '/x/api/charts/area-plot', title: 'AreaPlot' },
{ pathname: '/x/api/charts/bar-chart', title: 'BarChart' },
{ pathname: '/x/api/charts/bar-element', title: 'BarElement' },
{ pathname: '/x/api/charts/bar-plot', title: 'BarPlot' },
{ pathname: '/x/api/charts/cartesian-context-provider', title: 'CartesianContextProvider' },
{ pathname: '/x/api/charts/charts-axis', title: 'ChartsAxis' },
{ pathname: '/x/api/charts/charts-axis-highlight', title: 'ChartsAxisHighlight' },
{ pathname: '/x/api/charts/charts-axis-tooltip-content', title: 'ChartsAxisTooltipContent' },
{ pathname: '/x/api/charts/charts-clip-path', title: 'ChartsClipPath' },
{ pathname: '/x/api/charts/charts-item-tooltip-content', title: 'ChartsItemTooltipContent' },
{ pathname: '/x/api/charts/charts-legend', title: 'ChartsLegend' },
{ pathname: '/x/api/charts/charts-reference-line', title: 'ChartsReferenceLine' },
{ pathname: '/x/api/charts/charts-tooltip', title: 'ChartsTooltip' },
{ pathname: '/x/api/charts/charts-x-axis', title: 'ChartsXAxis' },
{ pathname: '/x/api/charts/charts-y-axis', title: 'ChartsYAxis' },
{
pathname: '/x/api/charts/default-charts-axis-tooltip-content',
title: 'DefaultChartsAxisTooltipContent',
},
{
pathname: '/x/api/charts/default-charts-item-tooltip-content',
title: 'DefaultChartsItemTooltipContent',
},
{ pathname: '/x/api/charts/drawing-provider', title: 'DrawingProvider' },
{ pathname: '/x/api/charts/line-chart', title: 'LineChart' },
{ pathname: '/x/api/charts/line-element', title: 'LineElement' },
Expand All @@ -24,6 +35,8 @@ export default [
{ pathname: '/x/api/charts/mark-plot', title: 'MarkPlot' },
{ pathname: '/x/api/charts/pie-arc', title: 'PieArc' },
{ pathname: '/x/api/charts/pie-arc-label', title: 'PieArcLabel' },
{ pathname: '/x/api/charts/pie-arc-label-plot', title: 'PieArcLabelPlot' },
{ pathname: '/x/api/charts/pie-arc-plot', title: 'PieArcPlot' },
{ pathname: '/x/api/charts/pie-chart', title: 'PieChart' },
{ pathname: '/x/api/charts/pie-plot', title: 'PiePlot' },
{ pathname: '/x/api/charts/scatter', title: 'Scatter' },
Expand Down
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/bar-element.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 './bar-element.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',
false,
/\.\/bar-element(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
22 changes: 22 additions & 0 deletions docs/pages/x/api/charts/bar-element.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"props": {
"slotProps": { "type": { "name": "object" }, "default": "{}" },
"slots": { "type": { "name": "object" }, "default": "{}" }
},
"slots": [
{
"class": null,
"name": "bar",
"description": "The component that renders the root.",
"default": "BarElementPath"
}
],
"name": "BarElement",
"imports": [
"import { BarElement } from '@mui/x-charts/BarChart';",
"import { BarElement } from '@mui/x-charts';"
],
"styles": { "classes": ["root"], "globalClasses": {}, "name": "MuiBarElement" },
"filename": "/packages/x-charts/src/BarChart/BarElement.tsx",
"demos": "<ul></ul>"
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/charts-axis-tooltip-content.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 './charts-axis-tooltip-content.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',
false,
/\.\/charts-axis-tooltip-content(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
16 changes: 16 additions & 0 deletions docs/pages/x/api/charts/charts-axis-tooltip-content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"props": {},
"slots": [],
"name": "ChartsAxisTooltipContent",
"imports": [
"import { ChartsAxisTooltipContent } from '@mui/x-charts/ChartsTooltip';",
"import { ChartsAxisTooltipContent } from '@mui/x-charts';"
],
"styles": {
"classes": ["root", "table", "row", "cell", "mark", "markCell", "labelCell", "valueCell"],
"globalClasses": {},
"name": "MuiChartsAxisTooltipContent"
},
"filename": "/packages/x-charts/src/ChartsTooltip/ChartsAxisTooltipContent.tsx",
"demos": "<ul></ul>"
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/charts-item-tooltip-content.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 './charts-item-tooltip-content.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',
false,
/\.\/charts-item-tooltip-content(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
16 changes: 16 additions & 0 deletions docs/pages/x/api/charts/charts-item-tooltip-content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"props": {},
"slots": [],
"name": "ChartsItemTooltipContent",
"imports": [
"import { ChartsItemTooltipContent } from '@mui/x-charts/ChartsTooltip';",
"import { ChartsItemTooltipContent } from '@mui/x-charts';"
],
"styles": {
"classes": ["root", "table", "row", "cell", "mark", "markCell", "labelCell", "valueCell"],
"globalClasses": {},
"name": "MuiChartsItemTooltipContent"
},
"filename": "/packages/x-charts/src/ChartsTooltip/ChartsItemTooltipContent.tsx",
"demos": "<ul></ul>"
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/default-charts-axis-tooltip-content.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 './default-charts-axis-tooltip-content.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',
false,
/\.\/default-charts-axis-tooltip-content(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
45 changes: 45 additions & 0 deletions docs/pages/x/api/charts/default-charts-axis-tooltip-content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"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
},
"axisData": {
"type": {
"name": "shape",
"description": "{ x?: { index?: number, value: Date<br>&#124;&nbsp;number }, y?: { index?: number, value: Date<br>&#124;&nbsp;number } }"
},
"required": true
},
"axisValue": { "type": { "name": "any" }, "required": true },
"classes": {
"type": { "name": "object" },
"required": true,
"additionalInfo": { "cssApi": true }
},
"series": {
"type": {
"name": "arrayOf",
"description": "Array&lt;any<br>&#124;&nbsp;{ 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;"
},
"required": true
},
"dataIndex": { "type": { "name": "number" } }
},
"slots": [],
"name": "DefaultChartsAxisTooltipContent",
"imports": [
"import { DefaultChartsAxisTooltipContent } from '@mui/x-charts/ChartsTooltip';",
"import { DefaultChartsAxisTooltipContent } from '@mui/x-charts';"
],
"styles": {
"classes": ["root", "table", "row", "cell", "mark", "markCell", "labelCell", "valueCell"],
"globalClasses": {},
"name": "MuiDefaultChartsAxisTooltipContent"
},
"filename": "/packages/x-charts/src/ChartsTooltip/DefaultChartsAxisTooltipContent.tsx",
"demos": "<ul></ul>"
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/default-charts-item-tooltip-content.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 './default-charts-item-tooltip-content.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',
false,
/\.\/default-charts-item-tooltip-content(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
36 changes: 36 additions & 0 deletions docs/pages/x/api/charts/default-charts-item-tooltip-content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"props": {
"classes": {
"type": { "name": "object" },
"required": true,
"additionalInfo": { "cssApi": true }
},
"itemData": {
"type": {
"name": "shape",
"description": "{ dataIndex?: number, seriesId: string, type: 'bar'<br>&#124;&nbsp;'line'<br>&#124;&nbsp;'pie'<br>&#124;&nbsp;'scatter' }"
},
"required": true
},
"series": {
"type": {
"name": "shape",
"description": "{ color?: string, data: Array&lt;number&gt;<br>&#124;&nbsp;{ __@iterator@33399: func, __@unscopables@36265: { __@iterator@33399?: bool, __@unscopables@36265?: bool, at?: bool, concat?: bool, copyWithin?: bool, entries?: bool, every?: bool, fill?: bool, filter?: bool, find?: bool, findIndex?: bool, findLast?: bool, findLastIndex?: bool, flat?: bool, flatMap?: bool, forEach?: bool, includes?: bool, indexOf?: bool, join?: bool, keys?: bool, lastIndexOf?: bool, length?: bool, map?: bool, pop?: bool, push?: bool, reduce?: bool, reduceRight?: bool, reverse?: bool, shift?: bool, slice?: bool, some?: bool, sort?: bool, splice?: bool, toLocaleString?: bool, toReversed?: bool, toSorted?: bool, toSpliced?: bool, toString?: bool, unshift?: bool, values?: bool, with?: bool }, at: func, concat: func, copyWithin: func, entries: func, every: func, fill: func, filter: func, find: func, findIndex: func, findLast: func, findLastIndex: func, flat: func, flatMap: func, forEach: func, includes: func, indexOf: func, join: func, keys: func, lastIndexOf: func, length: number, map: func, pop: func, push: func, reduce: func, reduceRight: func, reverse: func, shift: func, slice: func, some: func, sort: func, splice: func, toLocaleString: func, toReversed: func, toSorted: func, toSpliced: func, toString: func, unshift: func, values: func, with: func }, 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
}
},
"slots": [],
"name": "DefaultChartsItemTooltipContent",
"imports": [
"import { DefaultChartsItemTooltipContent } from '@mui/x-charts/ChartsTooltip';",
"import { DefaultChartsItemTooltipContent } from '@mui/x-charts';"
],
"styles": {
"classes": ["root", "table", "row", "cell", "mark", "markCell", "labelCell", "valueCell"],
"globalClasses": {},
"name": "MuiDefaultChartsItemTooltipContent"
},
"filename": "/packages/x-charts/src/ChartsTooltip/DefaultChartsItemTooltipContent.tsx",
"demos": "<ul></ul>"
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/pie-arc-label-plot.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 './pie-arc-label-plot.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',
false,
/\.\/pie-arc-label-plot(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
43 changes: 43 additions & 0 deletions docs/pages/x/api/charts/pie-arc-label-plot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"props": {
"outerRadius": {
"type": { "name": "number" },
"default": "R_max The maximal radius that fit into the drawing area.",
"required": true
},
"arcLabel": {
"type": {
"name": "union",
"description": "'formattedValue'<br>&#124;&nbsp;'label'<br>&#124;&nbsp;'value'<br>&#124;&nbsp;func"
}
},
"arcLabelMinAngle": { "type": { "name": "number" } },
"cornerRadius": { "type": { "name": "number" }, "default": "0" },
"faded": {
"type": {
"name": "shape",
"description": "{ additionalRadius?: number, color?: string, cornerRadius?: number, innerRadius?: number, outerRadius?: number, paddingAngle?: number }"
}
},
"highlighted": {
"type": {
"name": "shape",
"description": "{ additionalRadius?: number, color?: string, cornerRadius?: number, innerRadius?: number, outerRadius?: number, paddingAngle?: number }"
}
},
"innerRadius": { "type": { "name": "number" }, "default": "0" },
"paddingAngle": { "type": { "name": "number" }, "default": "0" },
"skipAnimation": { "type": { "name": "bool" } },
"slotProps": { "type": { "name": "object" }, "default": "{}" },
"slots": { "type": { "name": "object" }, "default": "{}" }
},
"slots": [{ "class": null, "name": "pieArcLabel", "description": "" }],
"name": "PieArcLabelPlot",
"imports": [
"import { PieArcLabelPlot } from '@mui/x-charts/PieChart';",
"import { PieArcLabelPlot } from '@mui/x-charts';"
],
"styles": { "classes": [], "globalClasses": {}, "name": "MuiPieArcLabelPlot" },
"filename": "/packages/x-charts/src/PieChart/PieArcLabelPlot.tsx",
"demos": "<ul></ul>"
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/pie-arc-plot.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 './pie-arc-plot.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',
false,
/\.\/pie-arc-plot(-[a-z]{2})?\.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
Loading