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

fix(chartcuterie): Render other as gray when included in top-5 #29455

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

wmak
Copy link
Member

@wmak wmak commented Oct 20, 2021

  • 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

- 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
@wmak wmak requested review from a team October 20, 2021 21:36
[1615879620, [{"count": 2}]],
],
"order": 2,
},
Copy link
Member

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));
Copy link
Member

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 😨

Copy link
Member

@evanpurkhiser evanpurkhiser left a 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

@wmak
Copy link
Member Author

wmak commented Oct 20, 2021

Yeah, the diff looks good to me

@evanpurkhiser
Copy link
Member

lgtm.

Looks like acceptance tests are flaking

@wmak wmak merged commit eefb842 into master Oct 20, 2021
@wmak wmak deleted the wmak/fix/chartcuterie-other branch October 20, 2021 22:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants