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

[Maps] Fix legend icon color for custom categorial palettes #67141

Merged
merged 4 commits into from
May 26, 2020

Conversation

nreese
Copy link
Contributor

@nreese nreese commented May 20, 2020

Fixes #67047

The problem exists in https://github.com/elastic/kibana/blob/master/x-pack/plugins/maps/public/classes/styles/vector/components/legend/extract_color_from_style_property.js#L28. The logic pulls the first color from the color ramp but is pulling customColorPalette[0].colorCategory instead of customColorPalette[0].color.

@nreese nreese requested a review from kindsun May 20, 2020 21:10
@nreese nreese requested a review from a team as a code owner May 20, 2020 21:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

if (dynamicOptions.type === COLOR_MAP_TYPE.CATEGORICAL) {
if (dynamicOptions.useCustomColorPalette) {
return dynamicOptions.customColorPalette && dynamicOptions.customColorPalette.length
? dynamicOptions.customColorPalette[0].color
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git diffs are not very good, but this is the line that fixed the problem. Added typing so errors like this would be caught. Change file to TS flagged customColorPalette[0].colorCategory

@nreese
Copy link
Contributor Author

nreese commented May 21, 2020

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented May 21, 2020

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented May 25, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@kindsun kindsun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 🙏 . lgtm!

  • code review

@nreese nreese merged commit c9c37f7 into elastic:master May 26, 2020
nreese added a commit to nreese/kibana that referenced this pull request May 26, 2020
…67141)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
nreese added a commit that referenced this pull request May 26, 2020
…67338)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] Layer legend color remains black when grouping by strings
4 participants