Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[charts] Export more utils#12744

Merged
alexfauquette merged 3 commits into
mui:masterfrom
alexfauquette:export-more-hooks
Apr 15, 2024
Merged

[charts] Export more utils#12744
alexfauquette merged 3 commits into
mui:masterfrom
alexfauquette:export-more-hooks

Conversation

@alexfauquette
Copy link
Copy Markdown
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 scope: charts Changes related to the charts. label Apr 11, 2024
@mui-bot
Copy link
Copy Markdown

mui-bot commented Apr 11, 2024

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

Generated by 🚫 dangerJS against 6ddb4f1

Comment thread packages/x-charts/src/hooks/useSeries.ts
Copy link
Copy Markdown
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
Copy Markdown
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 requested a review from JCQuintas April 12, 2024 14:06
@alexfauquette alexfauquette merged commit 978d544 into mui:master Apr 15, 2024
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: charts Changes related to the charts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants