Skip to content

Commit

Permalink
Run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Feb 8, 2024
1 parent b631eb9 commit 821beba
Show file tree
Hide file tree
Showing 10 changed files with 465 additions and 1 deletion.
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 @@ -93,6 +93,14 @@ const apiPages: MuiPage[] = [
pathname: '/x/api/charts/default-charts-legend',
title: 'DefaultChartsLegend',
},
{
pathname: '/x/api/charts/gauge',
title: 'Gauge',
},
{
pathname: '/x/api/charts/gauge-container',
title: 'GaugeContainer',
},
{
pathname: '/x/api/charts/line-chart',
title: 'LineChart',
Expand Down
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/gauge-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 './gauge-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/gauge-container',
false,
/\.\/gauge-container.*.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
41 changes: 41 additions & 0 deletions docs/pages/x/api/charts/gauge-container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"props": {
"cornerRadius": { "type": { "name": "number" }, "default": "'50%'" },
"cx": { "type": { "name": "union", "description": "number<br>&#124;&nbsp;string" } },
"cy": { "type": { "name": "union", "description": "number<br>&#124;&nbsp;string" } },
"disableAxisListener": { "type": { "name": "bool" }, "default": "false" },
"endAngle": { "type": { "name": "number" }, "default": "360" },
"height": { "type": { "name": "number" }, "default": "undefined" },
"innerRadius": {
"type": { "name": "union", "description": "number<br>&#124;&nbsp;string" },
"default": "'80%'"
},
"margin": {
"type": {
"name": "shape",
"description": "{ bottom?: number, left?: number, right?: number, top?: number }"
},
"default": "object Depends on the charts type."
},
"outerRadius": {
"type": { "name": "union", "description": "number<br>&#124;&nbsp;string" },
"default": "'100%'"
},
"startAngle": { "type": { "name": "number" }, "default": "0" },
"value": { "type": { "name": "number" } },
"valueMax": { "type": { "name": "number" }, "default": "100" },
"valueMin": { "type": { "name": "number" }, "default": "0" },
"width": { "type": { "name": "number" }, "default": "undefined" }
},
"name": "GaugeContainer",
"imports": [
"import { GaugeContainer } from '@mui/x-charts/Gauge';",
"import { GaugeContainer } from '@mui/x-charts';"
],
"classes": [],
"muiName": "MuiGaugeContainer",
"filename": "/packages/x-charts/src/Gauge/GaugeContainer.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/x/react-charts/gauge/\">Charts - Gauge</a></li></ul>",
"cssComponent": false
}
23 changes: 23 additions & 0 deletions docs/pages/x/api/charts/gauge.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 './gauge.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/gauge',
false,
/\.\/gauge.*.json$/,
);
const descriptions = mapApiPageTranslations(req);

return {
descriptions,
pageContent: jsonPageContent,
};
};
60 changes: 60 additions & 0 deletions docs/pages/x/api/charts/gauge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"props": {
"cornerRadius": { "type": { "name": "number" }, "default": "'50%'" },
"cx": { "type": { "name": "union", "description": "number<br>&#124;&nbsp;string" } },
"cy": { "type": { "name": "union", "description": "number<br>&#124;&nbsp;string" } },
"disableAxisListener": { "type": { "name": "bool" }, "default": "false" },
"endAngle": { "type": { "name": "number" }, "default": "360" },
"height": { "type": { "name": "number" }, "default": "undefined" },
"innerRadius": {
"type": { "name": "union", "description": "number<br>&#124;&nbsp;string" },
"default": "'80%'"
},
"margin": {
"type": {
"name": "shape",
"description": "{ bottom?: number, left?: number, right?: number, top?: number }"
},
"default": "object Depends on the charts type."
},
"outerRadius": {
"type": { "name": "union", "description": "number<br>&#124;&nbsp;string" },
"default": "'100%'"
},
"startAngle": { "type": { "name": "number" }, "default": "0" },
"value": { "type": { "name": "number" } },
"valueMax": { "type": { "name": "number" }, "default": "100" },
"valueMin": { "type": { "name": "number" }, "default": "0" },
"width": { "type": { "name": "number" }, "default": "undefined" }
},
"name": "Gauge",
"imports": [
"import { Gauge } from '@mui/x-charts/Gauge';",
"import { Gauge } from '@mui/x-charts';"
],
"classes": [
{
"key": "referenceArc",
"className": "MuiGauge-referenceArc",
"description": "Styles applied to the arc diplaying the range of available values.",
"isGlobal": false
},
{
"key": "root",
"className": "MuiGauge-root",
"description": "Styles applied to the root element.",
"isGlobal": false
},
{
"key": "valueArc",
"className": "MuiGauge-valueArc",
"description": "Styles applied to the arc diplaying the value.",
"isGlobal": false
}
],
"muiName": "MuiGauge",
"filename": "/packages/x-charts/src/Gauge/Gauge.tsx",
"inheritance": null,
"demos": "<ul><li><a href=\"/x/react-charts/gauge/\">Charts - Gauge</a></li></ul>",
"cssComponent": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"componentDescription": "",
"propDescriptions": {
"cornerRadius": {
"description": "The radius applied to arc corners (similar to border radius)."
},
"cx": {
"description": "The x coordinate of the pie center. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the width the drawing area."
},
"cy": {
"description": "The y coordinate of the pie center. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the height the drawing area."
},
"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."
},
"endAngle": { "description": "The end angle (deg)." },
"height": {
"description": "The height of the chart in px. If not defined, it takes the height of the parent element."
},
"innerRadius": {
"description": "The radius between circle center and the begining of the arc. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the maximal radius that fit into the drawing area."
},
"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>."
},
"outerRadius": {
"description": "The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the maximal radius that fit into the drawing area."
},
"startAngle": { "description": "The start angle (deg)." },
"value": {
"description": "The value of the gauge. Set to <code>null</code> if no value to display."
},
"valueMax": { "description": "The maximal value of the gauge." },
"valueMin": { "description": "The minimal value of the gauge." },
"width": {
"description": "The width of the chart in px. If not defined, it takes the width of the parent element."
}
},
"classDescriptions": {}
}
50 changes: 50 additions & 0 deletions docs/translations/api-docs/charts/gauge/gauge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"componentDescription": "",
"propDescriptions": {
"cornerRadius": {
"description": "The radius applied to arc corners (similar to border radius)."
},
"cx": {
"description": "The x coordinate of the pie center. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the width the drawing area."
},
"cy": {
"description": "The y coordinate of the pie center. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the height the drawing area."
},
"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."
},
"endAngle": { "description": "The end angle (deg)." },
"height": {
"description": "The height of the chart in px. If not defined, it takes the height of the parent element."
},
"innerRadius": {
"description": "The radius between circle center and the begining of the arc. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the maximal radius that fit into the drawing area."
},
"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>."
},
"outerRadius": {
"description": "The radius between circle center and the end of the arc. Can be a number (in px) or a string with a percentage such as &#39;50%&#39;. The &#39;100%&#39; is the maximal radius that fit into the drawing area."
},
"startAngle": { "description": "The start angle (deg)." },
"value": {
"description": "The value of the gauge. Set to <code>null</code> if no value to display."
},
"valueMax": { "description": "The maximal value of the gauge." },
"valueMin": { "description": "The minimal value of the gauge." },
"width": {
"description": "The width of the chart in px. If not defined, it takes the width of the parent element."
}
},
"classDescriptions": {
"referenceArc": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the arc diplaying the range of available values"
},
"root": { "description": "Styles applied to the root element." },
"valueArc": {
"description": "Styles applied to {{nodeName}}.",
"nodeName": "the arc diplaying the value"
}
}
}
107 changes: 107 additions & 0 deletions packages/x-charts/src/Gauge/Gauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,111 @@ function Gauge(props: GaugeProps) {
);
}

Gauge.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
children: PropTypes.node,
classes: PropTypes.object,
className: PropTypes.string,
/**
* The radius applied to arc corners (similar to border radius).
* @default '50%'
*/
cornerRadius: PropTypes.number,
/**
* The x coordinate of the pie center.
* Can be a number (in px) or a string with a percentage such as '50%'.
* The '100%' is the width the drawing area.
*/
cx: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* The y coordinate of the pie center.
* Can be a number (in px) or a string with a percentage such as '50%'.
* The '100%' is the height the drawing area.
*/
cy: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
desc: PropTypes.string,
/**
* If `true`, the charts will not listen to the mouse move event.
* It might break interactive features, but will improve performance.
* @default false
*/
disableAxisListener: PropTypes.bool,
/**
* The end angle (deg).
* @default 360
*/
endAngle: PropTypes.number,
/**
* The height of the chart in px. If not defined, it takes the height of the parent element.
* @default undefined
*/
height: PropTypes.number,
/**
* The radius between circle center and the begining of the arc.
* Can be a number (in px) or a string with a percentage such as '50%'.
* The '100%' is the maximal radius that fit into the drawing area.
* @default '80%'
*/
innerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* The margin between the SVG and the drawing area.
* It'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: `top`, `bottom`, `left`, and `right`.
* @default object Depends on the charts type.
*/
margin: PropTypes.shape({
bottom: PropTypes.number,
left: PropTypes.number,
right: PropTypes.number,
top: PropTypes.number,
}),
/**
* The radius between circle center and the end of the arc.
* Can be a number (in px) or a string with a percentage such as '50%'.
* The '100%' is the maximal radius that fit into the drawing area.
* @default '100%'
*/
outerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/**
* The start angle (deg).
* @default 0
*/
startAngle: PropTypes.number,
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
title: PropTypes.string,
/**
* The value of the gauge.
* Set to `null` if no value to display.
*/
value: PropTypes.number,
/**
* The maximal value of the gauge.
* @default 100
*/
valueMax: PropTypes.number,
/**
* The minimal value of the gauge.
* @default 0
*/
valueMin: PropTypes.number,
viewBox: PropTypes.shape({
height: PropTypes.number,
width: PropTypes.number,
x: PropTypes.number,
y: PropTypes.number,
}),
/**
* The width of the chart in px. If not defined, it takes the width of the parent element.
* @default undefined
*/
width: PropTypes.number,
} as any;

export { Gauge };
Loading

0 comments on commit 821beba

Please sign in to comment.