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] Propagate the axis scale to the valueFormatter #16555

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented Feb 12, 2025

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.

@mui-bot
Copy link

mui-bot commented Feb 12, 2025

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

Updated pages:

Generated by 🚫 dangerJS against de8c1d8

@alexfauquette alexfauquette added the component: charts This is the name of the generic UI component, not the React module! label Feb 13, 2025
@alexfauquette alexfauquette changed the title Clean TS#16350 [charts] Propagate the axis scale to the valueFormatter Feb 13, 2025
@alexfauquette alexfauquette marked this pull request as ready for review February 13, 2025 08:35
Copy link

codspeed-hq bot commented Feb 13, 2025

CodSpeed Performance Report

Merging #16555 will not alter performance

Comparing alexfauquette:provide-scale (de8c1d8) with master (6f095be)

Summary

✅ 6 untouched benchmarks

Comment on lines +38 to +43
const d3Text = (
context.scale as ScaleLogarithmic<number, number, never>
).tickFormat(
30,
'e',
)(f);
Copy link
Member

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

@alexfauquette alexfauquette merged commit 2fc4f2d into mui:master Feb 13, 2025
19 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] tickerNumber doesn't work along with valueFormatter
4 participants