-
Notifications
You must be signed in to change notification settings - Fork 16.5k
fix(controls): Only initialize categorical control on numeric x axis #37115
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
base: master
Are you sure you want to change the base?
Conversation
Code Review Agent Run #061fe7Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| if (!isNumericXAxis) { | ||
| return control.value; | ||
| } | ||
| return state?.form_data?.x_axis_sort !== undefined || control.value; |
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.
| return state?.form_data?.x_axis_sort !== undefined || control.value; | |
| return state?.form_data?.x_axis_sort ?? control.value; |
| description: t('Treat values as categorical.'), | ||
| initialValue: (control: ControlState, state: ControlPanelState | null) => | ||
| state?.form_data?.x_axis_sort !== undefined || control.value, | ||
| initialValue: (control: ControlState, state: ControlPanelState | null) => { |
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.
There is a little bit of business logic hidden here, maybe one of those cases where a comment could help
SUMMARY
Initializing the value of xAxisForceCategorical causes some charts to treat temporal axis as categorical. This is a defensive fix to adress that issue.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION