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
Click to filter values in Discover doc table and Visualize data table #9989
Conversation
src/ui/public/directives/rows.js
Outdated
></span> | ||
</span> | ||
</td>` | ||
); |
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.
Could you move this into its own template file?
src/ui/public/directives/rows.js
Outdated
if ($(event.target).is('a')) return; // Don't add filter if a link was clicked | ||
clickHandler({ point: { aggConfigResult: aggConfigResult } }); | ||
clickHandler({ point: { aggConfigResult: aggConfigResult }, negate: negate }); |
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.
The style guide suggests using the property value shorthand syntax (simply negate
instead of negate: negate
).
This is awsome @Bargs, thanks! Two minor inconsistencies between discover and the data table - whole row in data table is highlighted on mouseover and magnifying glass shown at the top of the row. |
Thanks for the input @jimmyjones2! The cell/row highlighting was an existing style of the data table. Perhaps you're right we should remove it now. What do you think @cjcenizal? Could you provide a screenshot of the positioning inconsistency you mentioned? From what I could tell the doc table also put the magnifying icon at the top of the row but I may have missed something. |
@Bargs Sorry I wasn't very clear - in the header of the data table there is a magnifying glass as a cue for filtering, but not in the doc table. |
This looks good from a UX perspective, except for one weird thing I found. If I tried to filter on a value, sometimes it tried to apply a filter for every value in the row, instead of just the value of the cell I clicked on. When this happened, it prompted me to verify that I want to filter. If I selected a different cell, this behavior didn't occur, and instead the filter was applied for just the cell I clicked on. From a UX perspective, I couldn't figure out why this was happening. Any idea what's going on here? |
formatted: _displayField(row, column, true) | ||
formatted: _displayField(row, column, true), | ||
filterable: isFilterable, | ||
column: column |
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 can also just be column
, similar to @lukasolson's comment.
@cjcenizal this is the way the current filtering works in the data table ¯_(ツ)_/¯ |
use hover to highlight whole row then ? |
@ppisljar I'm open to trying that out. What do you think the biggest benefit(s) of that is for the user? |
with multiple columns its hard to see which value matches to the row you are looking to, highlighting the row makes it obvious. |
@lukasolson @cjcenizal @ppisljar Just pushed some updates:
Please take another look. |
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.
LGTM!
jenkins, test this |
Hmm, how complicated would it be to centralize this logic into a directive and re-use it in both places? That way we wouldn't have the HTML duplicated in two different places... What do you think? |
@lukasolson I think a bit of it could be DRYed up, but not a ton. The way the filters are built is quite different in each context, so it would really just be the html that gets de-duplicated. I don't mind doing it, but I also know @ppisljar is working on some major changes to the data table so it might be best to avoid sharing this logic for now. |
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.
LGTM
…elastic#9989) Adds + and - icons on hover in the doc table and data table, allowing users to drill down with more options and fewer clicks. Previously in the doc table a user had to expand the row in order to filter on a document value. In the data table a user could filter simply by clicking a cell, but there was no way to create a negative filter. This commit brings feature parity between the data table and doc table.
…#9989) (#10123) Adds + and - icons on hover in the doc table and data table, allowing users to drill down with more options and fewer clicks. Previously in the doc table a user had to expand the row in order to filter on a document value. In the data table a user could filter simply by clicking a cell, but there was no way to create a negative filter. This commit brings feature parity between the data table and doc table.
@@ -128,7 +147,7 @@ module.directive('kbnTableRow', function ($compile) { | |||
// rebuild cells since we modified the children | |||
$cells = $el.children(); | |||
|
|||
if (i === 0 && !reuse) { | |||
if (!reuse) { | |||
$toggleScope = $scope.$new(); | |||
$compile($target)($toggleScope); |
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.
@Bargs : Sorry for the late and random comment, but doesn't this $compile($target)($toggleScope);
on all "newHtmls" elements for each row introduce some performance degradation when showing many rows ?
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.
@marenas I haven't personally seen any slowdown with this change. The template for each cell is pretty minimal.
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.
makes sense, thanks !
Fixes #3432
Replaces #5344
This PR extends the filter icons implemented in #5344 to the data table visualization.