-
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] In table visualization, users can transpose rows into columns #69450
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
If we implement this as two separate dimension groups of the table visualization, it's very hard to configure the aggregation nesting order because there's not unified list off all bucket aggregations to reorder (e.g. if there are two row dimensions and two column dimensions, they could be ordered column1,row1,column2,row2, but that's not visible in the UI). There are a bunch of ways to address this, but after syncing with @timroes and @MichaelMarcialis I think the best approach is to enforce an aggregation order of always prioritizing the row dimensions over the column dimensions, without any way to mix them (e.g. it will always be row1,row2,column1,column2 - the user can reorder the rows and the columns individually, but not mix them). This is less flexible than allowing all combinations, but IMHO the reduced flexibility is worth the simplified user interaction. To allow this, we probably need some changes in how visualization and datasource interact to ensure two groups of buckets in all cases. |
@flash1293 I agree that we should aim for a limited user experience to make it easier to understand. I like part of your proposal, but there is part of it that has confused me. I'm confused about the "row" vs "column" language and I think it's important that we clarify this. There are three words that we could use to describe the existing behavior of tables in Lens:
So I have two questions about this:
It might help to see any sketches of the UI that you've talked about. |
@flash1293 That clarifies what you were thinking, thanks! That UI looks pretty similar to what I would expect as well. My biggest priority is to optimize the defaults for 80% of the most common use cases, and I don't think that the defaults you've suggested are doing that. These are two of the most common queries we have, and they wouldn't display nicely with the defaults you've shown:
For both of these examples I would want to transpose the first aggregation, since it has fewer unique values than the second aggregation. But what if the user is in the 20% case, where the first aggregation shows 100 values, and the second aggregation has 7 values? I think we should support the most common case and the less common. Assuming that we share an understanding of these queriees, I would want these features:
Putting this together, here's an example of the kind of table UI that I am imagining. I think it would handle the default case better, and is also more flexible: |
After giving it a bit more thought I think you are right and nesting row agg within column aggs is a better default. @MichaelMarcialis and me discussed a way to flip the nesting as well, I wonder whether we can split this part out and see how common that need is in real-world use cases. IMHO a fixed nesting already provides a lot of value and might be an easier to manage first iteration. |
Is there a way to see more than top 5 values in lens. I am trying to form a table with all the client ips and the number of requests from each ip, as of now it only gives me the ips that have most number of requests. Can I control this through any setting? |
@nushrivastava If you click the dimension in the config panel to the right, you can change the number of top values. This kind of question is better suited for the forum (https://discuss.elastic.co/), if you have follow-up questions please post them there. |
Lens users currently define their aggregations in a column-oriented way. Users should be able to select any of their bucketed columns to be transposed for display purposes- this can be used to make the display more dense. This will be most clear with some examples.
Here is a relatively small table with 2 buckets and 2 metrics. Because there are 2 buckets, the user can choose the following transpose options:
No transposing
The original data:
Transpose the first column
Transpose the second column
Transpose first and second columns
Implementation note
I propose that we implement this in visualization options for the table visualization, not as a feature of the Lens datasource or Lens editor. The main reason is that we don't need this for other visualizations, since the visual encoding would be the same.
One requirement that we need to keep is the behavior of applying a filter based on a table cell. The semantics of this should be the same, even though the table cells will be presented in a new order.
Also, as you can see in the example above, not every transposed table is as dense as others: it's possible that we can recommend the "densest" display of the table by applying some heuristics, such as "suggest that users transpose the column with the lowest expected cardinality"- this will usually not be the date histogram column, but might be the Terms aggregation.
The text was updated successfully, but these errors were encountered: