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.07k stars 1.26k forks source link

[charts] Allow to customize animation #13964

Open alexfauquette opened 1 month ago

alexfauquette commented 1 month ago

For now the animation speed is hardcoded. Would be nice to have a DX similar to Nivo:

A prop motionConfig which can contain the parameters of react-spring.

Storing this config in a context to share it accross all the components

Search keywords:

TheOneTheOnlyJJ commented 1 month ago

Would this allow for customisation similar to what's possible with chartist.js?

To be more specific, here are 2 examples:

  1. Data point animations
  2. Data axis animations

While being a much simpler library, the customisation options are among the greatest of any chart library out there. It would be a great addition to open up ours to such extensive customisation.

alexfauquette commented 1 month ago

The target of this issue was smaller. The react-spring has two parts for configuration.

  1. the speed configuration: choosing some parameter such as mass, friction, ... to indicate at which speed transition occures
  2. the state functions (from, leave, ̀enter, andupdate` ) defining what's the component style at different point of the transition

The issue was about giving access to a single configuration object for point 1. What you're proposing would require to modify the second point