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] Export more utils #12744

Merged
merged 3 commits into from Apr 15, 2024
Merged

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented Apr 11, 2024

Fix #12702

I'm adding:

  • useSvgRef to let user access the SVG component easily from custom sub components
  • unstable_useSeries to get access to the series after all the internal transformation. This is marked as unstable because I'm not sure the series processing will stay stable, so it might be modified
  • getPieCoordinates to let user compute like we do the basic information about the pie rendering base on the chart state.
  • useChartId that get the chart id. It's a unique id generated to identify the chart when there are multiple ones in a same page

I also modify the codebase to use those hooks

@alexfauquette alexfauquette added the component: charts This is the name of the generic UI component, not the React module! label Apr 11, 2024
@mui-bot
Copy link

mui-bot commented Apr 11, 2024

Deploy preview: https://deploy-preview-12744--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 6ddb4f1

Copy link
Member

@JCQuintas JCQuintas left a comment

Choose a reason for hiding this comment

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

Should we document these changes?

@alexfauquette
Copy link
Member Author

Should we document these changes?

I was thinking about adding those tools on demand, and in a few months creating a docs page about how to create your own sub-components, because documenting each hook independently does not make that much sense

@alexfauquette alexfauquette merged commit 978d544 into mui:master Apr 15, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[charts] How do I create a draggable Pie Chart?
3 participants