mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.55k stars 1.33k forks source link

[charts] Introduce the plugin system #15513

Open alexfauquette opened 2 days ago

alexfauquette commented 2 days ago

This PR brings all the typing and pipeline to support plugins in the ChartProvider.

For now the hooks only replace 2 features:

Chart state

The main idea is to have in a provider multiple ref you can ask to interact/render the chart

Typing

The plugin types work as follows:

  1. You define the UseChartXxxSignature which defines the state, the interface, ...
  2. You can then use ChartState<[UseChartInteractionSignature, ...]> and it provide a type that merge the instance, and the store of the plugin signatures you listed
mui-bot commented 2 days ago

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

Generated by :no_entry_sign: dangerJS against 925b4e11c6b65489cb24343ee89b559464b4d1b8

codspeed-hq[bot] commented 1 day ago

CodSpeed Performance Report

Merging #15513 will improve performances by 9.78%

Comparing alexfauquette:pluggins (925b4e1) with master (cac5df0)

Summary

⚡ 1 improvements
✅ 5 untouched benchmarks

Benchmarks breakdown

Benchmark master alexfauquette:pluggins Change
ScatterChartPro with big data amount 195.3 ms 177.9 ms +9.78%
github-actions[bot] commented 4 hours ago

This pull request has conflicts, please resolve those before we can evaluate the pull request.