-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[charts] Fix axis types not narrowing #17321
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] Fix axis types not narrowing #17321
Conversation
Thanks for adding a type label to the PR! 👍 |
Deploy preview: https://deploy-preview-17321--material-ui-x.netlify.app/ |
CodSpeed Performance ReportMerging #17321 will not alter performanceComparing Summary
|
@@ -56,7 +55,7 @@ function getCategoryAxisConfig( | |||
id: direction === 'x' ? DEFAULT_X_AXIS_KEY : DEFAULT_Y_AXIS_KEY, | |||
...categoryAxis, | |||
...(categoryAxis?.size ? { [isHorizontal ? 'height' : 'width']: categoryAxis.size } : {}), | |||
position: categoryAxis?.position ?? (categoryAxis?.categories ? side : 'none'), | |||
position: (categoryAxis?.position ?? (categoryAxis?.categories ? side : 'none')) as any, |
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.
This fixes a type error. I'm not sure how I could fix it otherwise. The cause seems to be that TS doesn't know which positions are valid depending on isHorizontal
.
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 pushed a fix. The issues seems to the categorical axis type that was not distributing the union.
937bdd2
to
b9bb170
Compare
…x into improve-axis-types
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.
👍
Fixes #10334.
Fixes axis type not narrowing when given a
scaleType
. Fix suggested by @alexfauquette here.