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

[Lens] Various fixes for Heatmap #172602

Merged
merged 24 commits into from
Dec 12, 2023
Merged

[Lens] Various fixes for Heatmap #172602

merged 24 commits into from
Dec 12, 2023

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Dec 5, 2023

Summary

Fixes #172433
Fixes #172574
Fixes #170240

For #172433 the bands values are now passing thru the value formatter to match users' expectations:

Screenshot 2023-12-05 at 16 52 39

When the default formatter is selected something complex happens there, which might look wrong but it is still respecting Kibana's advanced settings formatter pattern (in this example 0.[000]):

Screenshot 2023-12-05 at 16 52 57

As for #170240 the problem was due to an unnecessary safe guard which was forcing the first bucket to be 1 when it was open:

Screenshot 2023-12-05 at 16 52 11

As for #172574 I just fixed at root level the problem...

Checklist

@dej611 dej611 added release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens v8.12.0 labels Dec 5, 2023
@dej611 dej611 added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.13.0 and removed v8.12.0 labels Dec 7, 2023
@dej611 dej611 marked this pull request as ready for review December 7, 2023 13:21
@dej611 dej611 requested a review from a team as a code owner December 7, 2023 13:21
@dej611 dej611 requested a review from a team as a code owner December 7, 2023 13:21
@elasticmachine
Copy link
Contributor

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

@dej611 dej611 enabled auto-merge (squash) December 7, 2023 16:55
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

So it either me being super confused with this UI or this is weird

I have a percentile ranks. This is the visualization

image

I open the panel
image
image

I would expect that I will see the legend values on the percent tab no? It seems that they are on the number tab but even if this is the correct thing not all digits are shown.

The other 2 bugs have both been fixed 🎉

@dej611
Copy link
Contributor Author

dej611 commented Dec 11, 2023

I'm confused with your expectation. Let's start to say that the Percentage tab is already confusing to start with as a label.
Given that, when switching to it, what legend type would you expect in the heatmap?

@stratoula
Copy link
Contributor

I am trying to think as a user and honestly I am not sure what to expect, I just know that this is confusing. The values are rounded, I see percents in the legend, I would go to the percents ui, percents are not the same with the legend so I go to the numbers UI, I can understand that this is the correct tab but still the values are rounded. Do you find it easy? 😓

@dej611
Copy link
Contributor Author

dej611 commented Dec 11, 2023

I'll try to go one piece at the time here, to understand the concern.

The values are rounded

By default the field formatter is applied here, with some customization coming from the specific percentile rank operation (see below). As no custom formatter is specified, the field formatter with Kibana settings format is applied (3 digits after the , by default).

I see percents in the legend

This is something specific to percentile rank. Try to change to percentile and that is gone.

I would go to the percents ui, percents are not the same with the legend

Here's some confusion about the Percentile tab. I see that, but that's more a general discussion of the coloring panel. Each value in this panel maps has a relative mapping to the current active data, so 0 here can be 1, 100 or 1000 depending on the active data min value.

so I go to the numbers UI, I can understand that this is the correct tab but still the values are rounded. Do you find it easy? 😓

Also, here values by default are "rounded" on entrance, but kept in their original shape when edited (this prevents the UI to show values as 1.99999999 when coming from the percentage UI and automatically convert).

I'm testing on the local main and see the exact same behaviour there, with the legend being "capped" at 2 digits no matter what I write there - which is the bug I meant to solve here.

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Synced with Marco offline.

I am approving although the percentile ranks is super confusing. As a user I expect to see the same values of the legend to the color bands UI, otherwise is very difficult to make any change. But this is a problem of the UI and not this PR.

@drewdaemon
Copy link
Contributor

But this is a problem of the UI and not this PR.

Do you think we should create an issue for this @stratoula ?

@stratoula
Copy link
Contributor

@drewdaemon I think that we already have one regarding this confusing Ui but @markov00 keep me honest here.

@dej611 dej611 merged commit 9f4c220 into elastic:main Dec 12, 2023
36 checks passed
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
canvas 1013.9KB 1013.9KB +24.0B
dashboard 377.3KB 377.3KB +24.0B
discover 593.9KB 593.9KB +24.0B
expressionHeatmap 27.2KB 27.2KB -57.0B
lens 1.4MB 1.4MB +24.0B
presentationUtil 82.4KB 82.5KB +72.0B
total +111.0B

History

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

sorenlouv pushed a commit to sorenlouv/kibana that referenced this pull request Dec 12, 2023
## Summary

Fixes elastic#172433
Fixes elastic#172574
Fixes elastic#170240

For elastic#172433 the bands values are now passing thru the value formatter to
match users' expectations:

<img width="1227" alt="Screenshot 2023-12-05 at 16 52 39"
src="https://github.com/elastic/kibana/assets/924948/42d2c4ba-1b6b-4785-84e7-0ad73670ecdc">

When the default formatter is selected something complex happens there,
which might look wrong but it is still respecting Kibana's advanced
settings formatter pattern (in this example `0.[000]`):

<img width="1234" alt="Screenshot 2023-12-05 at 16 52 57"
src="https://github.com/elastic/kibana/assets/924948/7fe7dd1d-eff1-40fa-9e52-8a7ff20d0faf">

As for elastic#170240 the problem was due to an unnecessary safe guard which
was forcing the first bucket to be `1` when it was open:

<img width="1227" alt="Screenshot 2023-12-05 at 16 52 11"
src="https://github.com/elastic/kibana/assets/924948/a3ac437d-7b04-489d-b0fc-6c2b456971de">

As for elastic#172574 I just fixed at root level the problem...

### Checklist

- [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 9f4c220)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 12, 2023
## Summary

Fixes elastic#172433
Fixes elastic#172574
Fixes elastic#170240

For elastic#172433 the bands values are now passing thru the value formatter to
match users' expectations:

<img width="1227" alt="Screenshot 2023-12-05 at 16 52 39"
src="https://github.com/elastic/kibana/assets/924948/42d2c4ba-1b6b-4785-84e7-0ad73670ecdc">

When the default formatter is selected something complex happens there,
which might look wrong but it is still respecting Kibana's advanced
settings formatter pattern (in this example `0.[000]`):

<img width="1234" alt="Screenshot 2023-12-05 at 16 52 57"
src="https://github.com/elastic/kibana/assets/924948/7fe7dd1d-eff1-40fa-9e52-8a7ff20d0faf">

As for elastic#170240 the problem was due to an unnecessary safe guard which
was forcing the first bucket to be `1` when it was open:

<img width="1227" alt="Screenshot 2023-12-05 at 16 52 11"
src="https://github.com/elastic/kibana/assets/924948/a3ac437d-7b04-489d-b0fc-6c2b456971de">

As for elastic#172574 I just fixed at root level the problem...

### Checklist

- [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 9f4c220)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.12

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 Dec 12, 2023
# Backport

This will backport the following commits from `main` to `8.12`:
- [[Lens] Various fixes for Heatmap
(#172602)](#172602)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-12T09:23:24Z","message":"[Lens]
Various fixes for Heatmap (#172602)\n\n## Summary\r\n\r\nFixes
#172433\r\nFixes #172574\r\nFixes #170240\r\n\r\nFor #172433 the bands
values are now passing thru the value formatter to\r\nmatch users'
expectations:\r\n\r\n<img width=\"1227\" alt=\"Screenshot 2023-12-05 at
16 52
39\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/42d2c4ba-1b6b-4785-84e7-0ad73670ecdc\">\r\n\r\nWhen
the default formatter is selected something complex happens
there,\r\nwhich might look wrong but it is still respecting Kibana's
advanced\r\nsettings formatter pattern (in this example
`0.[000]`):\r\n\r\n<img width=\"1234\" alt=\"Screenshot 2023-12-05 at 16
52
57\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/7fe7dd1d-eff1-40fa-9e52-8a7ff20d0faf\">\r\n\r\nAs
for #170240 the problem was due to an unnecessary safe guard
which\r\nwas forcing the first bucket to be `1` when it was
open:\r\n\r\n<img width=\"1227\" alt=\"Screenshot 2023-12-05 at 16 52
11\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/a3ac437d-7b04-489d-b0fc-6c2b456971de\">\r\n\r\nAs
for #172574 I just fixed at root level the problem...\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9f4c220ad8599f4bd98e78d4e5abc9147cc5920f","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport:prev-minor","v8.13.0"],"number":172602,"url":"https://github.com/elastic/kibana/pull/172602","mergeCommit":{"message":"[Lens]
Various fixes for Heatmap (#172602)\n\n## Summary\r\n\r\nFixes
#172433\r\nFixes #172574\r\nFixes #170240\r\n\r\nFor #172433 the bands
values are now passing thru the value formatter to\r\nmatch users'
expectations:\r\n\r\n<img width=\"1227\" alt=\"Screenshot 2023-12-05 at
16 52
39\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/42d2c4ba-1b6b-4785-84e7-0ad73670ecdc\">\r\n\r\nWhen
the default formatter is selected something complex happens
there,\r\nwhich might look wrong but it is still respecting Kibana's
advanced\r\nsettings formatter pattern (in this example
`0.[000]`):\r\n\r\n<img width=\"1234\" alt=\"Screenshot 2023-12-05 at 16
52
57\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/7fe7dd1d-eff1-40fa-9e52-8a7ff20d0faf\">\r\n\r\nAs
for #170240 the problem was due to an unnecessary safe guard
which\r\nwas forcing the first bucket to be `1` when it was
open:\r\n\r\n<img width=\"1227\" alt=\"Screenshot 2023-12-05 at 16 52
11\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/a3ac437d-7b04-489d-b0fc-6c2b456971de\">\r\n\r\nAs
for #172574 I just fixed at root level the problem...\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9f4c220ad8599f4bd98e78d4e5abc9147cc5920f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172602","number":172602,"mergeCommit":{"message":"[Lens]
Various fixes for Heatmap (#172602)\n\n## Summary\r\n\r\nFixes
#172433\r\nFixes #172574\r\nFixes #170240\r\n\r\nFor #172433 the bands
values are now passing thru the value formatter to\r\nmatch users'
expectations:\r\n\r\n<img width=\"1227\" alt=\"Screenshot 2023-12-05 at
16 52
39\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/42d2c4ba-1b6b-4785-84e7-0ad73670ecdc\">\r\n\r\nWhen
the default formatter is selected something complex happens
there,\r\nwhich might look wrong but it is still respecting Kibana's
advanced\r\nsettings formatter pattern (in this example
`0.[000]`):\r\n\r\n<img width=\"1234\" alt=\"Screenshot 2023-12-05 at 16
52
57\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/7fe7dd1d-eff1-40fa-9e52-8a7ff20d0faf\">\r\n\r\nAs
for #170240 the problem was due to an unnecessary safe guard
which\r\nwas forcing the first bucket to be `1` when it was
open:\r\n\r\n<img width=\"1227\" alt=\"Screenshot 2023-12-05 at 16 52
11\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/a3ac437d-7b04-489d-b0fc-6c2b456971de\">\r\n\r\nAs
for #172574 I just fixed at root level the problem...\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9f4c220ad8599f4bd98e78d4e5abc9147cc5920f"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.12.0 v8.13.0
Projects
None yet
7 participants