Skip to content
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] Create combined histogram/range aggregation for numbers #59424

Closed
timroes opened this issue Mar 5, 2020 · 16 comments · Fixed by #76121
Closed

[Lens] Create combined histogram/range aggregation for numbers #59424

timroes opened this issue Mar 5, 2020 · 16 comments · Fixed by #76121
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Project:LensDefault Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@timroes
Copy link
Contributor

timroes commented Mar 5, 2020

Lens should support histogram and range aggregations. Those two aggregations should ideally be combined into one UI, since from a user perspective they are kind of doing the same, with the minor difference of having a "fixed interval" or "manual defined intervals". Thus I would suggest that we combine histogram and range aggregations under one "lens aggregation" with just different options.

Screenshot 2020-08-17 at 16 39 57

Screenshot 2020-08-17 at 16 40 02

Screenshot 2020-08-17 at 16 40 07

@timroes timroes added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Mar 5, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon
Copy link
Contributor

I don't think we've decided yet how to implement numeric histograms. The least controversial way is to get users to manually select their interval. I remember having discussed the concept of automatic intervals, but the concept got a lot of pushback in those discussions with the Elasticsearch team. If it isn't done in Elasticsearch, it might be able to be done in Esaggs- but this would require coordination with app arch and Elasticsearch.

@flash1293
Copy link
Contributor

I think you are right @wylieconlon , but as it is a little more delicate to implement this right from the technical side, I would like to split it out into a separate issue and keep this one focused on what we can achieve with the current upstream feature set. Manual intervals will already be incredibly helpful and are possible with little effort, that's why IMHO we shouldn't tie it to a new feature which requires coordination across multiple teams and is relatively unclear at the moment.

Still definitely something we should continue to look into.

@wylieconlon
Copy link
Contributor

@flash1293 I think we're saying the same thing: I am in favor of manually defined intervals because it's unambiguous.

@wylieconlon
Copy link
Contributor

One of the important elements to consider when building intervals for histograms and ranges is whether there is rollup support for the interval. For rollups V1, we should restrict users. The implementation for rollups V2 is not yet defined.

@wylieconlon wylieconlon changed the title [Lens] Create combined histogram/range aggregation [Lens] Create combined histogram/range aggregation for numbers Aug 17, 2020
@flash1293 flash1293 assigned flash1293 and dej611 and unassigned flash1293 Aug 20, 2020
@flash1293
Copy link
Contributor

@timroes Could you link the issue for auto interval histogram here as well to keep track?

@dej611
Copy link
Contributor

dej611 commented Aug 25, 2020

The auto interval issue should be this #75438

@wylieconlon
Copy link
Contributor

@cchaos Do you have an updated design for the histogram form? This form looks like it's missing some of the features that
we are expecting to have in the short term.

Screenshot 2020-08-17 at 16 39 57

Specifically, this form is in the mode of "user types an interval", which is a separate mode from "auto interval with maximum number of buckets". Basically, here are the options as we would have them:

Auto mode:

  • User is defining the maximum # of buckets

User-defined mode:

  • User is defining the minimum interval between buckets, as a number

@wylieconlon
Copy link
Contributor

@cchaos you can look at the form we implemented for Visualize here: #76001

@cchaos
Copy link
Contributor

cchaos commented Sep 2, 2020

Thanks for directing me to that PR. It made it a bit clearer what the functionality and options are. I definitely think there is a way to simplify the form versus having disabled inputs.

All mock copy subject to change/review from Alona/docs

For example, in the "Auto" mode for the whole interval granularity, we have a simple on/off switch and show the input (similar to the PR)

Screen Shot 2020-09-02 at 11 29 05 AM

But when Auto mode is turned off, the input gets swapped out for the actual minimum interval value.

Screen Shot 2020-09-02 at 11 29 28 AM

But no matter which "mode" they're in, they still have the option to completely customize the intervals which would swap out the entire form for the custom mode.

Screen Shot 2020-09-02 at 11 34 03 AM

@dej611
Copy link
Contributor

dej611 commented Sep 2, 2020

@cchaos your mock seems reasonable to me.
There's one more feature, which is not exposed on the #76001 PR, which is the Max Bars, that could be enabled when in Auto Interval mode: it is the opposite of Min interval where the user decide how many bar to show (hence the interval is automatically computed).

But when Auto mode is turned off, the input gets swapped out for the actual minimum interval value.

Mind that there's a maximal amount of bars which can be shown.

@wylieconlon
Copy link
Contributor

wylieconlon commented Sep 2, 2020

Agreed, this looks reasonable @cchaos. Instead of max interval it should say max bars, like @dej611 commented. I could imagine that instead of typing the number, we could offer an EuiRange slider because the maximum is configured across Kibana. With no customization, we would prevent users from getting more than 100 bars.

@cchaos
Copy link
Contributor

cchaos commented Sep 2, 2020

Ok, so I'm interpreting this as Max intervals (bars) when in auto mode is actually set to 100. Let's just display that instead of "Auto". Since we're expressly saying this is Maximum not the current display. Otherwise it's not really possible to have a range slider with an "Auto" option without having to create yet another toggle which I'd really like to avoid.

The reason I removed the word "bars" was to make it more scalable for other chart types. It'd be great to find a generic term to fit all chart types. cc @AlonaNadler for wording.

Here's a gif of the newest interaction. Again the Figma prototype will always have the latest.

Screen Recording 2020-09-02 at 01 32 33 PM

@dej611
Copy link
Contributor

dej611 commented Sep 3, 2020

Ok, so I'm interpreting this as Max intervals (bars) when in auto mode is actually set to 100.

I am a bit confused about that naming: Min interval value and Max intervals (bars) are not super clear to me.
Maybe something like Number of intervals may be more direct and apply for other chart types as well?

As for the input, why not just use a regular Number Field as for the Min interval one?

@cchaos
Copy link
Contributor

cchaos commented Sep 3, 2020

Well are you setting an explicit number or are you setting minimums and maximums while the chart display may change the actual number of intervals or interval values? We should be explicit for setting expectations on what the input will be setting.

The input with the range dropdown is also a number input. It just gives users a quick way to slide up/down without having to arrow down or type.

@dej611
Copy link
Contributor

dej611 commented Sep 3, 2020

When in auto mode there are now two possible scenarios:

  • Just auto mode interval is sent to the server => a "magic" number of bars/ranges are returned in the data.
  • auto mode and a maxBars number are sent to the server => the server will try to respect this maxBars number and workout the right interval to satisfy it.

Here #76121 it is possible to play with the feature when in Auto mode (I'm working to get the "magic" value from the server right now in place of 100).

We've been talking about the 100 number by default, but this is a global Kibana configuration setting which sets the maximum number of bars in a chart.

Note: I've updated the algorithm above based on my new understanding of the auto algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Project:LensDefault Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants