-
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
[Lens] Fix partition chart color assignments #207178
[Lens] Fix partition chart color assignments #207178
Conversation
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Show resolved
Hide resolved
@nickofthyme |
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.
@kowalczyk-krzysztof This section of the code is the legacy palettes and there is a reason we want to get rid of it. So I just want to say it's not you it's the code!
I took a lot at the code and found a solution. I try to explain the parts below but if you could take a look, update the tests and test other edge cases you can find.
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Show resolved
Hide resolved
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Show resolved
Hide resolved
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Show resolved
Hide resolved
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Outdated
Show resolved
Hide resolved
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Outdated
Show resolved
Hide resolved
.../plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts
Show resolved
Hide resolved
@nickofthyme |
@nickofthyme I tried fixing the tests ( |
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.
Ok I took another look at the changes and found a few issues. I updated the tests and tweaked a few final things on the src file. Take a look and lmk what you think.
Ping me tomorrow if you'd like me to walk through the changes with you.
...gins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.test.ts
Show resolved
Hide resolved
...gins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.test.ts
Show resolved
Hide resolved
...gins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.test.ts
Show resolved
Hide resolved
...gins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.test.ts
Show resolved
Hide resolved
...gins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.test.ts
Outdated
Show resolved
Hide resolved
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/charts/public/services/palettes/palettes.tsx
Outdated
Show resolved
Hide resolved
...m/plugins/shared/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts
Show resolved
Hide resolved
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.
Changes LGTM
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.
Tested locally, it fixes the mentioned issues.LGTM
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Unknown metric groupsReferences to deprecated APIs
History
|
Starting backport for target branches: 9.0 |
Fixes the color assignment for partition charts consistent with the legend ordering. Aligns legacy and color mapping color logic. (cherry picked from commit 28dc0f6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `9.0`: - [[Lens] Fix partition chart color assignments (#207178)](#207178) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Krzysztof Kowalczyk","email":"krzysztof.kowalczyk@elastic.co"},"sourceCommit":{"committedDate":"2025-03-04T17:20:43Z","message":"[Lens] Fix partition chart color assignments (#207178)\n\nFixes the color assignment for partition charts consistent with the legend ordering. Aligns legacy and color mapping color logic.","sha":"28dc0f6ffcf82279dc3fcaee477b4727b8bbdd0a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Visualizations","release_note:skip","Feature:Lens","backport:prev-minor","v9.1.0"],"title":"[Lens] Fix partition chart color assignments","number":207178,"url":"https://github.com/elastic/kibana/pull/207178","mergeCommit":{"message":"[Lens] Fix partition chart color assignments (#207178)\n\nFixes the color assignment for partition charts consistent with the legend ordering. Aligns legacy and color mapping color logic.","sha":"28dc0f6ffcf82279dc3fcaee477b4727b8bbdd0a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207178","number":207178,"mergeCommit":{"message":"[Lens] Fix partition chart color assignments (#207178)\n\nFixes the color assignment for partition charts consistent with the legend ordering. Aligns legacy and color mapping color logic.","sha":"28dc0f6ffcf82279dc3fcaee477b4727b8bbdd0a"}}]}] BACKPORT--> Co-authored-by: Krzysztof Kowalczyk <krzysztof.kowalczyk@elastic.co>
Summary
This PR fixes the color assignment of all partition charts consistent with the legend ordering.
Fixes #202813
Fixes #202816