-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Propagate the axis scale to the valueFormatter
#16555
Conversation
Deploy preview: https://deploy-preview-16555--material-ui-x.netlify.app/ Updated pages: |
valueFormatter
CodSpeed Performance ReportMerging #16555 will not alter performanceComparing Summary
|
const d3Text = ( | ||
context.scale as ScaleLogarithmic<number, number, never> | ||
).tickFormat( | ||
30, | ||
'e', | ||
)(f); |
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.
😭 I tried to fix this typing, but there are too many generics 😆
Technically it should be possible to use the correct type based on the scaleType: 'log'
. But due to how our generics are setup and the usage/initialization/direct-override of the types everywhere, typescript can't automatically deduce the types
Fix #16350
I did not propagate the scale to the legend formatter, because in such case, it's not clear is it's the axis scale, or the color-scale to pass. And not that much usefull.