-
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] Transpose columns #89748
[Lens] Transpose columns #89748
Conversation
I kept it to a single width per metric to make it less surprising by avoiding hidden state - if I save the width per actual column, it’s possible this column disappears depending on the data. I imagine most people resize a column to fit it to their data, but if there’s a separate width per value of the split column dimension, that’s very hard to do. If the width is set to 140px for “css count of records”, and later on a dashboard a “html count of records” column appears, does it make sense to have it using the default width ? What do you think? And about the column hiding - I’m currently working on a filter menu which is more helpful here I think Eg you will be able to filter out css in the column popover which will effectively hide the column I think that’s more in line with how “hide” is intended to be used The reason to hide a metric is for example if a “top values” is sorted by it, but you don’t want to show it. That’s not the same as hiding a column based on the value of the split dimension, filters are a better tool for that My suggestion is basically keeping the current behavior for those two things. I agree with your other points, I will work on a fix them The changes about the slider for selecting the number of terms and moving the “advanced” popover I would like to split out into a separate PR because they will affect all visualizations as this part of the UI is not specific to tables |
Ah, I see your point about user-customized widths being lost as the data changes, when other columns come into replace previous ones. Using your example, let's assume "css count of records" is the first top value column, and is replaced by "html count of records" at a later time. Rather than attributing the column width state to "css count of records," can we not instead attribute that width state to the first top value column (regardless of what that column value is)? Doing so would prevent losing column width customizations and still meet with user expectations as to what will happen during the column resize interaction. Otherwise, if that's not possible or if it would be excessively difficult to achieve, I think your current solution could be a fine alternative. Would it be possible to highlight the other affected columns during the interaction so the user is aware that the width will be affected in those columns as well?
Thanks for that explanation. In that case, this makes sense to me. Perhaps it would be also useful to the user to indicate that a particular dimension item is hidden from the table in the layer panel view. For example, maybe we could prepend a Also, any chance we could just shorten the field label to be "Hide column"?
Sounds good. Let me know if you'd like me to open issues for those, if you haven't already. |
I thought about tying the width to the position instead of the value (1st column, 2st column of that type), and we can do that, but the following things prevented me from doing so:
In my mind (and I should have explained my reasoning better, sorry for that), the current status wins all things considered (complexity, common user intentions, surprising behavior). I don’t hold this opinion strongly though, so if you think the positional width per column is a better behavior considering these points, I’m happy to build that. Let me know what you think.
not without changes in EUI |
Summary
I think the current behavior, while the thing the user will expect the very first time, is still the best what we can do. See here for my reasoning #89748 (comment) If you disagree I'm happy to change this, but it will introduce new edge cases we will have to handle.
On a dashboard it's possible to configure a url drilldown which will add an "action" button for each row. The URL is built using the current row as context. I think it makes sense to offer the columns of the transposed table here
Done
Added a dividing character
Created a separate issue here: #93912
That was a bug, removed it
Both is possible
That was a bug as well
|
another case where I think changing all column widths at once is beneficial- if you do more than one column split, it’s very likely you will end up with a table using horizontal scroll. In this case data grid will give each column 100px. This is not enough for the full header in most cases. If we give each column their own width, the user would have to manually drag every column to the desired width (and the result would not be uniform, so it would be awkward looking). With the current implementation the user has just to resize the first column and the others will be “fixed” in the same way. In general I think there should be a “fit to data” mode, but that’s something for later down the road. |
@elasticmachine merge upstream |
True. You're starting to win me over to your current implementation. My biggest concern is just giving users appropriate visual/audible feedback to let them know that this column resize action is affecting multiple columns. I'd say for the purposes of this PR, let's keep the resizing of columns the way you have it. As for the visual/audible feedback, if it needs to be addressed on the EUI side for |
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.
Hey, @flash1293. Thanks for making those changes. I left a comment above about my suggestion for proceeding with the column resizing issue and a few comments below for some minor wording tweaks.
Additionally, I had two more questions/comments upon re-review of this PR:
Indicate when ordering is by grand total
Would it be possible to indicate when the "Rank by" fields are performing their ordering by a grand total of a metric? For example, if I'm in a row configuration for a table with one or more column splits, it could be helpful for a user to know that the ordering is being determined by the grand total of those columns. Here's an example shown in the design mockups:
Alternatives to the filter columns modal
Currently, when there is more than one split column dimension item, the user is presented with a modal when attempting to filter that column via the column popover menu. I understand the reason for doing so, as the concatenation of column headings into a single cell doesn't allow us to know exactly what dimension of the column the user wishes to filter by.
Regarding use of the modal component, I was thinking that it might be nice to keep the filtering experience contained within the column popover menu, if possible. For example, when the user clicks on filter action from the column popover menu, the options to pick which filters to apply replace the previous contents of the popover, keeping the experience contained in one location. Is that at all possible?
In any case (whether the above is possible or not), I suggest we change from the current usage of EuiSwitch
to EuiCheckboxGroup
, as toggling the switches doesn't perform an immediate action. Just let me know if design examples are needed.
x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datatable_visualization/components/dimension_editor.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datatable_visualization/components/columns.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Marcialis <[email protected]>
@elasticmachine merge upstream |
Let's discuss this in the issue I branched out for top values function changes. As this part of the UI is not specific to the data table, I'm hesitant with these changes because I'm not sure whether they still make sense in the rest of Lens - would people understand "grand total" ranking (we recently changed order to rank here) in an xy chart?
For a nice experience we would need to change the column actions popover from a list group to a full context menu, then we can have this kind of nested menu. However, it's difficult to achieve that in a fully integrated way because of the way filters work. It would be a bigger project involving the app arch team as well. The modal is a standard component which is used in a lot of places to apply multiple filters at once.
That's a good point. As this piece of UI is not tied to the datatable or Lens, but used in all of Kibana, I will open a separate issue. |
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.
return { | ||
...originalDatatableColumn, | ||
id: getTransposeId(uniqueValue, metricColumn.columnId), | ||
name: `${uniqueValue} ${TRANSPOSE_VISUAL_SEPARATOR} ${originalDatatableColumn.name}`, |
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.
I found that the column naming here was not meeting my expectations in two different directions.
-
For simple tables, I wanted to see a table with the unique value only. The metric name is not needed if there's only one metric, as long as the chart title conveys the meaning.
-
I also wanted to see tables with the operation name, like
Operation name > Unique value > Metric name
. This would add context.
For an extreme example of this, try creating a single-row chart with multiple split columns. You'll see how the column labels get confusing:
@elasticmachine merge upstream |
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.
Re-approved!
Thanks for the suggestions @wylieconlon - I think we can address those in a nice way once we introduce hierarchical column headers - it will make it much easier to put more and better information in there. I will open a separate issue to track this. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
Fixes #3613
Fixes #3620
Fixes #69450
Fixes #9585
Fixes #61489
Adds a way to split metric columns in a data table by one or multiple dimensions
Considerations