-
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
Show/hide date histogram viz in Discover #17065
Show/hide date histogram viz in Discover #17065
Conversation
💔 Build Failed |
4fbb877
to
e5a13a9
Compare
💚 Build Succeeded |
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'm all for allowing the user the flexibility to remove the histogram, but I think a better way to do this that is more in line with how we are already doing things like this is similar to how you can collapse the sidebar and hide the fields list:
Long term, we'd like the ability for Discover to be more customizable and allow any of the components to be removed and others to be added. I think what I've explained above is a better short-term solution than adding an advanced setting that we will likely remove in the future.
Thanks for the feedback @lukasolson. I considered your suggestion as well and I'm ++ for it. It definitely feels more "natural" as a user (than having to edit an Advanced Setting, which would also have the effect of being applicable to all users on that Kibana instance). There's just one UX issue that I couldn't reason out which is why I went the Advanced Setting route: if we introduce a toggle in the Discover UI itself, where would you store its state? Would it be per user session (i.e. using something like I'm also completely okay just abandoning this PR altogether if there's a longer-term plan for Discover that would make this functionality moot. |
Do we have a good sense of why people are requesting this feature? I know some folks want to get rid of it because the date histogram can be slow, but the ES team is working on this. Is there any other reason why an admin would want to disable the histogram on a system wide level? If some folks simply find the histogram annoying and want to regain the real estate it takes up, I think localstorage would be fine, similar to the left nav's collapse/expand. |
Hello. Please expose this ability by an URL parameter. That is enough for me |
Based on the above feedback (thanks for giving it!) and chatting with @Bargs off-PR, I'm thinking of changing this PR to:
|
I just did a little experiment to try to achieve this without any code changes. I just created a similar index pattern for my logstash data but selected |
…very The option is named `discover:showDateHistogramVisualization`. It is a boolean option that defaults to `true`. Setting it to `false` removes the `aggs` part of the `_msearch` request that is made by Discover and hides the time chart panel in Discover.
e5a13a9
to
9d5aea8
Compare
💔 Build Failed |
@lukasolson @Bargs @gsemet I've updated this PR per #17065 (comment): The gif doesn't show it but if you pull down this PR and try it out yourself you'll see that Once ya'll are happy with the implementation, I'll add functional tests to this PR. |
Looks amazing :) |
💔 Build Failed |
@snide Any feedback here on the UI? |
It's fine. I can clean it up separately. But for now it's similar and works! |
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.
Noticed some funky behavior...
- Hide the viz
- Refresh
- Try to show the viz (it only shows part of it)
Also, I was thinking, with this change we would have three different portions of the UI you can show/hide: The global nav, which is stored in local storage (kibana.isGlobalNavOpen
), show/hide the viz, which is stored in the app state, and show/hide the field list, which isn't stored anywhere. Not sure how we should reconcile this, but wanted to open the dialog.
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'll leave my general feedback here: Personally I think it'd be nice if showViz
were stored in local storage because every time you load up discover, you're going to get that viz at first until you hide it, which might be okay but I wonder if some people just don't ever want to see it there and will be annoyed that they have to hide it every time they reload discover, or load a new saved search, etc.
That being said, what we've got here is definitely an improvement and I don't want to block it from moving forward, and we can have the discussion at a later time.
@lukasolson the reason this ended up as a URL parameter was because @gsemet requested it. But your point about the initial state of Discover is a good one. @gsemet, would it work for you if we stored the state in local storage instead of the URL? |
💔 Build Failed |
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.
One largish question: If the visualization is hidden, should we remove the agg from the search request? Some users definitely want to get rid of the date histogram because it can slow Discover down. It would complicate the code slightly because we'd need to re-fetch when the viz is made visible, but it might be worth it to improve the user experience.
@@ -139,6 +146,13 @@ <h2>Searching</h2> | |||
style="height: 200px" | |||
> | |||
</visualization> | |||
|
|||
<div> | |||
<center class="small"> |
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.
center
is a deprecated html tag. I'm guessing you're using it because it's already used in the vis header. Since it's only used in those two places, I think it's worth fixing. It looks like they both only contain inline elements, so you should be able to just change it to a div and add text-align:center;
@@ -292,6 +293,8 @@ function discoverController( | |||
$state.save(); | |||
}); | |||
|
|||
$scope.$watch('state.isVisualizationVisible', $state.save.bind($state)); |
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.
Couldn't this go in the showVis
and hideVis
methods? Then we wouldn't have to create an additional watch.
Yup, this is worth doing. I'll look into it. |
@ycombinator - FF for 6.3.2 is tomorrow ( July 17) and this has been labelled for 6.3.2 ...Do you think we should remove the label and assign appropriately? Thanks. |
This PR doesn't contain code necessary for it to run on CI with Jenkins pipelines, please merge the base branch in before removing the |
💚 Build Succeeded |
@ycombinator if I open Discover and initially have the histogram, then I click to hide it. I would assume this would NOT re-query at this time because it's not going to change the data the user sees? And of course going the other way to WOULD re-query automatically. |
@LeeDr I'm honestly not sure any more. This PR is over 18 months old. I'm tempted to just close it unmerged and let someone better-versed than me in the Kibana codebase today find a solution. Thoughts? |
Closing for inactivity. |
Resolves #6164.
This PR introduces an Advanced Settings option to show/hide the date histogram visualization in Discover.
The option is named
discover:showDateHistogramVisualization
. It is a boolean option that defaults totrue
. Setting it tofalse
removes theaggs
part of the_msearch
request that is made by Discover and hides the time chart panel in Discover.Default behavior
When
discover:showDateHistogramVisualization
is set totrue
._msearch
request containsaggs
and the visualization is shown in Discover.Disabled behavior
When
discover:showDateHistogramVisualization
is set tofalse
._msearch
request does not containaggs
and the visualization is not shown in Discover.