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] Supports multi rows headers for the table visualization #127447

Merged
merged 8 commits into from
Mar 17, 2022

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Mar 10, 2022

Summary

Closes #122965

It adds an extra setting for enabling multi rows for the table header.
The user can select among:

  • single option (only 1 row)
  • auto (show everything)
  • custom (user sets the row lines)

It defaults to the single setting.
lens_multi_rows_header

Checklist

Delete any items that are not applicable to this PR.

@stratoula stratoula changed the title [Lens] Supports multi rows headers [Lens] Supports multi rows headers for the table visualization Mar 10, 2022
@stratoula stratoula added backport:skip This commit does not require backporting Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.2.0 labels Mar 10, 2022
@stratoula stratoula marked this pull request as ready for review March 10, 2022 13:53
@stratoula stratoula requested a review from a team as a code owner March 10, 2022 13:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@stratoula
Copy link
Contributor Author

@MichaelMarcialis as you will see in the description, I added another set of settings for the datatable that concern the header rows.

The lines per row setting appear when you hit custom (same as the row height). I am not very satisfied with the result . Do you have any idea on how we can group them better? Or maybe if we change the labels somehow? 🤔

image

@flash1293
Copy link
Contributor

FWIW I think it's an important case to have multi-line header without having multi line cells. There are quite some cases with long column names but small numeric values in the cells.

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

It seems like specific line count is not respected if there is no header with that height which is different than the data row height behavior:
Screenshot 2022-03-10 at 16 17 58

I see how this would be hard to fix, I don't think it's a blocker though, just something to point out.

LGTM otherwise, but I agree we can improve the look of the UI

@stratoula
Copy link
Contributor Author

stratoula commented Mar 10, 2022

@flash1293 yes I agree on having separate settings. I just don't like the UI and I wonder if we can improve it a bit. To be more clear where each 'lines per row' refer to.

About your other comment on the header height not respected if there is no header with that height, I was thinking that it has the same behavior with the legend lines. Maybe 20 lines max for the header is a big number though. We could change it in 5 max, does it sound better?

@MichaelMarcialis
Copy link
Contributor

MichaelMarcialis commented Mar 10, 2022

@MichaelMarcialis as you will see in the description, I added another set of settings for the datatable that concern the header rows.

The lines per row setting appear when you hit custom (same as the row height). I am not very satisfied with the result . Do you have any idea on how we can group them better? Or maybe if we change the labels somehow? 🤔

image

Hey, @stratoula! Good question. My first instinct would be to make the following changes:

  • Change the Row height label to be Cell row height.
  • Change the Header height label to be Header row height.
  • Rather than having the range sliders for header and cell row height appear within their own form row, can we migrate them to be within the header and cell row height form rows, but still positioned below their respective button group? The idea is to have the range sliders appear in the same position that you have them in currently, but as they would no longer be in their own form row, they wouldn't have their own separate label. Instead, they would appear to be an inset/nested part of the preceding button group.
  • Make the new header row height group (both button group and range slider) appear before the cell row height group.

Rough idea:

image

Let me know if that makes sense. Thanks!

@stratoula
Copy link
Contributor Author

I love it!

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

@stratoula
Copy link
Contributor Author

To wrap up:

  • I implemented @MichaelMarcialis 's suggestion (look much better now!)
  • I used emotion
  • I added a max of 5 lines per row for the header settings

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Tested locally with Safari and it works as expected.

The only bug I found is this edge case where the last two chars falls below the menu arrow, but that looks more a EUI bug rather than something we can address here:
Screenshot 2022-03-16 at 13 03 36

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 746 747 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
lens 343 345 +2

Async chunks

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

id before after diff
lens 1.1MB 1.1MB +1.0KB

Page load bundle

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

id before after diff
lens 43.0KB 43.1KB +91.0B
Unknown metric groups

API count

id before after diff
lens 395 397 +2

History

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

@stratoula stratoula merged commit 4e63701 into elastic:main Mar 17, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens][Visualize] Allow multi-line headers in table
7 participants