-
Notifications
You must be signed in to change notification settings - Fork 8.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
[Maps] Fix legend icon color for custom categorial palettes #67141
Conversation
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 |
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 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
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
Thanks for fixing this 🙏 . lgtm!
- code review
…67141) Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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 ofcustomColorPalette[0].color
.