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] When a string or number field begins dragging, query its cardinality and use it for suggestions #74260

Open
Tracked by #167089
wylieconlon opened this issue Aug 4, 2020 · 1 comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@wylieconlon
Copy link
Contributor

This is a potential improvement to the UX of Lens, assuming that we can overcome the potential UX decrease from making a network request during a drag interaction. Tactics for keeping both a snappy feel and improved suggestions are described later, but first a description of the improvement:

When a user clicks the field preview for a number in Lens, we make two sequential requests:

  1. We load the min and max values of the number, as well as the top 10 most frequent values
  2. After loading the min and max, we request a number histogram with the top 10 bins

Then the client determines whether to show a histogram or top 10 values. This is the same decision that suggestions should be making. If the top 10 values are 90% or more of the total values, then we show the top 10 and indicate that there are "other values." If the top 10 values are <90%, then a histogram is shown.

In rough terms, we determine whether the field has high or low cardinality and use it when making the suggestion.

There are two user flows that I would imagine:

  1. The user drags a low-cardinality number field, such as day_of_week. Instead of suggesting "Average day_of_week", we should suggest "Top 10 day_of_week"
  2. The user drags a high-cardinality string field, and instead of only showing the Top 5, we might show the top 100 in a table form.

Both of these flows indicate that we are building "smarter" suggestions out of a simple additional request.

Keeping it fast

It's always a bad practice to make network requests during a fast user interaction, such as while typing. There are some workarounds from simple to complex:

  1. The simplest workaround is to prevent users from dropping until we have calculated the suggestion. It's probably a worse UX, but it would be predictable.
  2. Instead of preventing the user from dropping, we could allow them to drop and then calculate additional suggestions which are shown in the bottom menu. I'm not sure this will be obvious enough to users.
  3. We could go back to the original Lens design which included a "suggestion modal." When the user drags a field, we could ask them to pick from several possible charts based on the field. Because this interaction happens in a modal, we could continue calculating and show a loading spinner on the modal.
@wylieconlon wylieconlon added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Aug 4, 2020
@elasticmachine
Copy link
Contributor

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

@flash1293 flash1293 added the enhancement New value added to drive a business result label Aug 6, 2020
@stratoula stratoula added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label Sep 6, 2023
@timductive timductive added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Apr 3, 2024
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 impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

7 participants