-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[charts][do not merge] Document how plugins can be used #19343
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
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-19343--material-ui-x.netlify.app/ Updated pages: Bundle size report
|
CodSpeed Performance ReportMerging #19343 will not alter performanceComparing Summary
|
``` | ||
|
||
:::info | ||
The code defines `noAxis` for the x and y-axes to override the default axes created by the `<ChartDataProvider />`. | ||
This ensures that the pie is centered. | ||
The `<ChartDataProvider />` get a prop [`plugins`](/x/react-charts/plugins). |
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.
The `<ChartDataProvider />` get a prop [`plugins`](/x/react-charts/plugins). | |
The `<ChartDataProvider />` accepts a [`plugins`](/x/react-charts/plugins) prop. |
|
||
# Charts - Plugins | ||
|
||
<p class="description">The library relies on two system to perform data processing: the plugins and the series config.</p> |
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.
<p class="description">The library relies on two system to perform data processing: the plugins and the series config.</p> | |
<p class="description">The library relies on two systems to perform data processing: the plugins and the series config.</p> |
Those information are for advanced use-cases. | ||
The large majority of charts should not require touching either to the plugins or the series configuration. |
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.
Those information are for advanced use-cases. | |
The large majority of charts should not require touching either to the plugins or the series configuration. | |
This information is for advanced use-cases. | |
Most charts should not require changes to either the plugins or the series configuration. |
|
||
## Plugins | ||
|
||
Plugins are function used to add features to the chart. |
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.
Plugins are function used to add features to the chart. | |
Plugins are functions used to add features to the chart. |
## Plugins | ||
|
||
Plugins are function used to add features to the chart. | ||
They can process data, add internal state, and listen to some event. |
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.
They can process data, add internal state, and listen to some event. | |
They can process data, add internal state, or listen to events. |
Plugins can be passed to the `<ChartContainer />` or the `<ChartDataProvider />` with the `plugins` props. | ||
|
||
:::info | ||
Notice that `myChartPlugins` is defined of the component. |
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.
Notice that `myChartPlugins` is defined of the component. | |
Notice that `myChartPlugins` is defined outside of the component. |
|
||
You can import plugins individually from `@mui/x-charts/plugins`. | ||
|
||
When creating your custom array of plugins, be aware that some plugins have |
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.
When creating your custom array of plugins, be aware that some plugins have | |
When creating your custom array of plugins, be aware that some plugins have dependencies. |
### Custom plugins | ||
|
||
We discourage you from creating custom plugins. | ||
To simplify further development, we consider their implementation as internal, allowing ourself to break their interfaces to add or improve features. |
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.
This paragraph doesn't make a lot of sense to me, what do we consider internal? Why are plugins discouraged?
Maybe put it in a warn
block?
### Custom plugins | |
We discourage you from creating custom plugins. | |
To simplify further development, we consider their implementation as internal, allowing ourself to break their interfaces to add or improve features. | |
### Custom plugins | |
:::warn | |
Creating custom plugins is not encouraged. | |
::: | |
The plugin's internal implementation is not considered stable. | |
It can break at any time without a breaking change. |
Fix #18538
This is the documentation PR for