-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix(chartcuterie): Render other as gray when included in top-5 #29455
Conversation
- This fixes chart rendering when Other is a series which was appearing as just another series, instead of the specific gray we use in the UI - The backend handles series names overlapping with `Other` already, so we can easily just check that the series name is Other and update colours accordingly
[1615879620, [{"count": 2}]], | ||
], | ||
"order": 2, | ||
}, |
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.
🙏 Thank you for adding a test for it
@@ -169,7 +169,11 @@ discoverCharts.push({ | |||
} | |||
|
|||
const stats = Object.values(data.stats); | |||
const color = theme.charts.getColorPalette(stats.length - 2); | |||
const hasOther = Object.keys(data.stats).includes('Other'); | |||
const color = theme.charts.getColorPalette(stats.length - 2 - (hasOther ? 1 : 0)); |
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.
The way this getColorPalette thing works with the math is so confusing 😨
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.
Approved as long as the visual regression tests look good
Yeah, the diff looks good to me |
lgtm. Looks like acceptance tests are flaking |
as just another series, instead of the specific gray we use in the UI
Other
already, sowe can easily just check that the series name is Other and update
colours accordingly