-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Supports long legend values #107894
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
I am not so sure about the multiple options in the legend popover. What if the max lines would be raised up to 3 (instead of 1) and just make truncation work without an explicit input for the user? |
So if I understand correctly, you don't want to cover the "zero" case which actually allows the users to display all the legend content. I am not sure about it tbh. I think is most powerful that way but of course, @MichaelMarcialis is the best to decide here. The explanation tooltip seems a good idea to me :) |
The upper bound of the range input can be raised if 10 lines are not enough to cover the whole content of the legend entry, but honestly I do not think too many cases will happen because of that. |
@elasticmachine merge upstream |
cc @AlonaNadler |
LGTM thanks :) |
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.
This looks excellent, @stratoula! Well done. For your review, I've left two small text change comments.
Additionally, I have one question/request regarding the current handling of numbers greater than 5 in the maximum lines input. When typing a number greater than 5 and blurring the input, it currently triggers an error state. Instead, if a number greater than 5 is types, can we automatically change it to the highest supported line number (i.e. 5) on blur? That way it saves the user the trouble of correcting and also educates them what the highest value is.
Assuming you're able to address these, this PR looks good to me. Approving now so I don't hold you up.
x-pack/plugins/lens/public/shared_components/legend_settings_popover.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/shared_components/legend_settings_popover.tsx
Outdated
Show resolved
Hide resolved
Honestly, I'm a bit torn on this myself. I certainly appreciate the simplicity in what @dej611 is suggesting (i.e. truncation always on, with a single input to set the maximum lines). However, the version presented in this PR is more robust in that it supports a total disabling of truncation, which could potentially be helpful to users with odd edge cases (i.e. very lengthy labels). Assuming it wouldn't be a huge pain to change it in the future, I'm thinking it may be best to keep it as it is here for now and bring it up for discussion with @ghudgins when he returns. Thoughts? |
I agree with this plan Michael. I also discussed it with Alona - as Graham is out - and she agrees to also give this option to the users. Let's go with it (as this is also the solution that we agreed with Graham) and I can discuss it again with him when he is back. |
@elasticmachine merge upstream |
Sure, I addressed that. When the user types a number greater than 5 and less than 1 (i.e. 0) I automatically change the value to the limits |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
x-pack/plugins/lens/common/expressions/heatmap_chart/heatmap_legend.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/common/expressions/heatmap_chart/heatmap_legend.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/common/expressions/xy_chart/legend_config.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/heatmap_visualization/chart_component.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/shared_components/legend_settings_popover.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/shared_components/legend_settings_popover.tsx
Outdated
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.
Neither of my comments is blocking. I tested this feature on FF and works great!
💚 Build SucceededMetrics [docs]Async chunks
Unknown metric groupsAPI count
API count missing comments
History
To update your PR or re-run it, just comment with: |
* [Lens] Supports multilines legend * Add a truncate legends switch * Add more unit tests * Add tooltip condition * Adress PR comments * Apply PR comments Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Lens] Supports multilines legend * Add a truncate legends switch * Add more unit tests * Add tooltip condition * Adress PR comments * Apply PR comments Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Part of #41418
Checklist
Delete any items that are not applicable to this PR.