-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Document interfaces for charts #12656
Merged
alexfauquette
merged 11 commits into
mui:master
from
alexfauquette:chart-interface-generation
Apr 19, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f5aeb59
[docs-infra] Prepare the infra to extend interface docs to other libr…
alexfauquette 51f1494
generate charts interfaces
alexfauquette 20ff14c
Merge remote-tracking branch 'upstream/master' into chart-interface-g…
alexfauquette d31ff51
update charts
alexfauquette 76f6b14
link props description ot interfaces docs
alexfauquette 2821f6c
use links to simplify API pages
alexfauquette 9a341d7
add a description
alexfauquette 8dbf2c8
typo
alexfauquette ed013da
Merge remote-tracking branch 'upstream/master' into chart-interface-g…
alexfauquette 25f2d3b
docs:api
alexfauquette 07d07f1
trigger ci
alexfauquette File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; | ||
import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './axis-config.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return ( | ||
<InterfaceApiPage {...layoutConfig} descriptions={descriptions} pageContent={pageContent} /> | ||
); | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docsx/translations/api-docs/charts/', | ||
false, | ||
/\.\/axis-config.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "AxisConfig", | ||
"imports": ["import { AxisConfig } from '@mui/x-charts'"], | ||
"properties": { | ||
"id": { "type": { "description": "AxisId" }, "required": true }, | ||
"scaleType": { "type": { "description": "'linear'" }, "required": true }, | ||
"axisId": { "type": { "description": "AxisId" } }, | ||
"classes": { "type": { "description": "Partial<ChartsAxisClasses>" } }, | ||
"colorMap": { "type": { "description": "ContinuousColorConfig | PiecewiseColorConfig" } }, | ||
"data": { "type": { "description": "V[]" } }, | ||
"dataKey": { "type": { "description": "string" } }, | ||
"disableLine": { "type": { "description": "boolean" }, "default": "false" }, | ||
"disableTicks": { "type": { "description": "boolean" }, "default": "false" }, | ||
"fill": { "type": { "description": "string" }, "default": "'currentColor'" }, | ||
"hideTooltip": { "type": { "description": "boolean" } }, | ||
"label": { "type": { "description": "string" } }, | ||
"labelFontSize": { "type": { "description": "number" }, "default": "14" }, | ||
"labelStyle": { "type": { "description": "ChartsTextProps['style']" } }, | ||
"max": { "type": { "description": "number | Date" } }, | ||
"min": { "type": { "description": "number | Date" } }, | ||
"position": { "type": { "description": "'top' | 'bottom'" } }, | ||
"reverse": { "type": { "description": "boolean" } }, | ||
"slotProps": { | ||
"type": { "description": "Partial<ChartsAxisSlotProps>" }, | ||
"default": "{}" | ||
}, | ||
"slots": { "type": { "description": "Partial<ChartsAxisSlots>" }, "default": "{}" }, | ||
"stroke": { "type": { "description": "string" }, "default": "'currentColor'" }, | ||
"tickFontSize": { "type": { "description": "number" }, "default": "12" }, | ||
"tickInterval": { | ||
"type": { "description": "'auto' | ((value: any, index: number) => boolean) | any[]" }, | ||
"default": "'auto'" | ||
}, | ||
"tickLabelInterval": { | ||
"type": { "description": "'auto' | ((value: any, index: number) => boolean)" }, | ||
"default": "'auto'" | ||
}, | ||
"tickLabelPlacement": { "type": { "description": "'middle' | 'tick'" }, "default": "'middle'" }, | ||
"tickLabelStyle": { "type": { "description": "ChartsTextProps['style']" } }, | ||
"tickMaxStep": { "type": { "description": "number" } }, | ||
"tickMinStep": { "type": { "description": "number" } }, | ||
"tickNumber": { "type": { "description": "number" } }, | ||
"tickPlacement": { | ||
"type": { "description": "'start' | 'end' | 'middle' | 'extremities'" }, | ||
"default": "'extremities'" | ||
}, | ||
"tickSize": { "type": { "description": "number" }, "default": "6" }, | ||
"valueFormatter": { | ||
"type": { "description": "(value: V, context: AxisValueFormatterContext) => string" } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; | ||
import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './bar-series-type.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return ( | ||
<InterfaceApiPage {...layoutConfig} descriptions={descriptions} pageContent={pageContent} /> | ||
); | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docsx/translations/api-docs/charts/', | ||
false, | ||
/\.\/bar-series-type.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "BarSeriesType", | ||
"imports": ["import { BarSeriesType } from '@mui/x-charts'"], | ||
"properties": { | ||
"type": { "type": { "description": "'bar'" }, "required": true }, | ||
"color": { "type": { "description": "string" } }, | ||
"data": { "type": { "description": "(number | null)[]" } }, | ||
"dataKey": { "type": { "description": "string" } }, | ||
"highlightScope": { "type": { "description": "Partial<HighlightScope>" } }, | ||
"id": { "type": { "description": "SeriesId" } }, | ||
"label": { "type": { "description": "string" } }, | ||
"layout": { "type": { "description": "'horizontal' | 'vertical'" }, "default": "'vertical'" }, | ||
"stack": { "type": { "description": "string" } }, | ||
"stackOffset": { "type": { "description": "StackOffsetType" }, "default": "'diverging'" }, | ||
"stackOrder": { "type": { "description": "StackOrderType" }, "default": "'none'" }, | ||
"valueFormatter": { "type": { "description": "SeriesValueFormatter<TValue>" } }, | ||
"xAxisKey": { "type": { "description": "string" } }, | ||
"yAxisKey": { "type": { "description": "string" } } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import InterfaceApiPage from 'docsx/src/modules/components/InterfaceApiPage'; | ||
import layoutConfig from 'docsx/src/modules/utils/dataGridLayoutConfig'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './line-series-type.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return ( | ||
<InterfaceApiPage {...layoutConfig} descriptions={descriptions} pageContent={pageContent} /> | ||
); | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docsx/translations/api-docs/charts/', | ||
false, | ||
/\.\/line-series-type.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I move the "API group" after the "Common features" because it was hard to find