Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix interval drop-down for date histogram in discover #10384
When you first load discover for an index pattern with time-based events, you'll see a date histogram. Above the graph you'll see a link that shows you the selected interval (e.g. "12 hours"). When you click on the link, it turns into a drop-down that allows you to select a different interval.
Prior to this PR, the behavior was inconsistent. If you selected something other than "Auto", then the drop-down would persist. However, if you selected "Auto", it would disappear and turn into a link showing you what the automatically selected interval was. However, if you had already selected "Auto", then clicked on the interval (which would display the drop-down), then decided you wanted to keep "Auto", the only way to get back to showing the link with the interval would be to select a different interval and then select "Auto" again.
This PR changes this behavior so that the interval drop-down is always persistent, and doesn't switch from a link to a drop-down. In addition, if the selected interval results in having to scale the buckets, we show the scaled interval in a help text.
Looks like a great improvement! I had one small suggestion you could implement, if you wanted.
Nice work! I'm not sure if the yellow "info" icon with the tooltip is the best way to notify the user that their selected range has been adjusted. I think we should make this a bit more obvious. Can we add the text "Scaled to 5 seconds" to make it clear right away what the scale is? The tooltip is still useful, in case the user wants to know why.