Skip to content

[Lens] Fix metric color assignment when breakdown and a max dimension are defined#238901

Merged
dej611 merged 4 commits intoelastic:mainfrom
dej611:fix/238885
Oct 16, 2025
Merged

[Lens] Fix metric color assignment when breakdown and a max dimension are defined#238901
dej611 merged 4 commits intoelastic:mainfrom
dej611:fix/238885

Conversation

@dej611
Copy link
Contributor

@dej611 dej611 commented Oct 14, 2025

Summary

Fixes #238885

This PR revisits the getDataBoundsForPalette function implementation to boost its performance and fix a falsy check based on rowNumber.

@dej611 dej611 requested a review from a team as a code owner October 14, 2025 14:05
@dej611 dej611 added release_note:fix Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// Feature:Lens backport:version Backport to applied version labels v9.2.0 v9.3.0 v9.1.6 v8.19.6 labels Oct 14, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
expressionMetricVis 16.5KB 16.5KB -21.0B

History

Copy link
Contributor

@mariairiartef mariairiartef left a comment

Choose a reason for hiding this comment

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

LGTM

@dej611 dej611 merged commit b05f445 into elastic:main Oct 16, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/18557470799

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 16, 2025
… are defined (elastic#238901)

## Summary

Fixes elastic#238885

This PR revisits the `getDataBoundsForPalette` function implementation
to boost its performance and fix a falsy check based on `rowNumber`.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit b05f445)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 16, 2025
… are defined (elastic#238901)

## Summary

Fixes elastic#238885

This PR revisits the `getDataBoundsForPalette` function implementation
to boost its performance and fix a falsy check based on `rowNumber`.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit b05f445)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 16, 2025
… are defined (elastic#238901)

## Summary

Fixes elastic#238885

This PR revisits the `getDataBoundsForPalette` function implementation
to boost its performance and fix a falsy check based on `rowNumber`.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit b05f445)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 16, 2025
…ension are defined (#238901) (#239295)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Lens] Fix metric color assignment when breakdown and a max dimension
are defined (#238901)](#238901)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-16T09:56:43Z","message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.19.6"],"title":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined","number":238901,"url":"https://github.com/elastic/kibana/pull/238901","mergeCommit":{"message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.19"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/238901","number":238901,"mergeCommit":{"message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Oct 16, 2025
…mension are defined (#238901) (#239294)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Lens] Fix metric color assignment when breakdown and a max dimension
are defined (#238901)](#238901)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-16T09:56:43Z","message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.19.6"],"title":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined","number":238901,"url":"https://github.com/elastic/kibana/pull/238901","mergeCommit":{"message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.19"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/238901","number":238901,"mergeCommit":{"message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Oct 16, 2025
…ension are defined (#238901) (#239296)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Lens] Fix metric color assignment when breakdown and a max dimension
are defined (#238901)](#238901)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-16T09:56:43Z","message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:version","v9.2.0","v9.3.0","v9.1.6","v8.19.6"],"title":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined","number":238901,"url":"https://github.com/elastic/kibana/pull/238901","mergeCommit":{"message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223"}},"sourceBranch":"main","suggestedTargetBranches":["9.2","9.1","8.19"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/238901","number":238901,"mergeCommit":{"message":"[Lens]
Fix metric color assignment when breakdown and a max dimension are
defined (#238901)\n\n## Summary\n\nFixes #238885 \n\nThis PR revisits
the `getDataBoundsForPalette` function implementation\nto boost its
performance and fix a falsy check based on `rowNumber`.\n\n- [x] [Unit
or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"b05f445ce7e4bb6deead5cbac4aa57931b884223"}},{"branch":"9.1","label":"v9.1.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Oct 23, 2025
… are defined (elastic#238901)

## Summary

Fixes elastic#238885 

This PR revisits the `getDataBoundsForPalette` function implementation
to boost its performance and fix a falsy check based on `rowNumber`.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Oct 27, 2025
… are defined (elastic#238901)

## Summary

Fixes elastic#238885 

This PR revisits the `getDataBoundsForPalette` function implementation
to boost its performance and fix a falsy check based on `rowNumber`.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Lens release_note:fix Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.6 v9.1.6 v9.2.0 v9.3.0

5 participants