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

Click event for points in close proximity #548

Closed
nickofthyme opened this issue Feb 11, 2020 · 4 comments
Closed

Click event for points in close proximity #548

nickofthyme opened this issue Feb 11, 2020 · 4 comments
Labels
discuss To be discussed enhancement New feature or request

Comments

@nickofthyme
Copy link
Collaborator

nickofthyme commented Feb 11, 2020

When starting to replace line charts in kibana, I noticed the selection of points that are in very close proximity to each other are ignored.

Kibana today

Notice how now matter where I hover the value is always the top-most value, unless the points far enough apart to warrant a distinction. This effectively makes it impossible for the user to filter on a point that is grouped very closely.

Screen Recording 2020-02-11 at 09 15 AM

Elastic charts

In Elastic charts, we show/return all points within a given threshold of the click coordinates, notice the selected series in the tooltip.
Screen Recording 2020-02-11 at 09 14 AM

The problem

The issue I am having is related to filtering from the click event. Elastic charts will send me an array of selected points. I could use this in the filter prompt to allow the user to select the undesirable options but enabling all filter would show no results. Ideally this would not be needed as it promotes a sad path. 😞 Ideally the selection is handled in elastic charts and shows only one point

image

The solution

After discussing with @markov00 he suggested there be a tooltip selection within elastic charts, whereby clicking near three points will have you select what series you want before emitting the event, with the one series.

I don't know how this will impact pie charts @monfera

I would love any ideas on how we could best handle this in elastic charts.

Marco and I discussed a different onSelect event to include multple items but I think that the click should be only a single point, where click and drag region would return all points/things within the selection.

Kibana cross issues

There doesn't appear to be a kibana issue for this after a cursory search.

cc. @elastic/kibana-design @timroes @AlonaNadler

@nickofthyme nickofthyme added enhancement New feature or request discuss To be discussed labels Feb 11, 2020
@cchaos
Copy link
Contributor

cchaos commented Feb 13, 2020

I could use this in the filter prompt to allow the user to [de]select the undesirable options but enabling all filter would show no results. Ideally this would not be needed as it promotes a sad path. 😞 Ideally the selection is handled in elastic charts and shows only one point

Is there no way to use the same prompt but have the selections default to none selected?

suggested there be a tooltip selection within elastic charts, whereby clicking near three points will have you select what series you want before emitting the event

I would worry about introducing this as a UI in charts. You'll start getting into issues with trying to theme this or make this UI compatible with the consumer's styleguide (as we see a lot with external libraries like the one maps uses). It just takes a lot of effort (even if you're using EUI).

I truly think that the Charts library should be as UI agnostic as possible and just treat it as a computing and chart rendering agent. It's ok to send back the entire list of "close" points / undeterminable clicks and have the consumer figure out how they want to handle this. With front-end techs these days they can just build a re-usable method for handling multiple vs singular points.


Another option I thought of is re-using the tooltip. If consumers only want a single point passed back to them, they could tell the chart to allow "affixing" the tooltip when the user clicks on a point. This will then allow the exact point in the tooltip to be clickable and sent back to the consumer.

@AlonaNadler
Copy link

I might be missing something @nickofthyme

This effectively makes it impossible for the user to filter on a point that is grouped very closely.

Kibana anyway not filtering based on a point selection. Both in TSVB and Visualize filter when brushing the charts.
The problem in Visualize is to see the value that is behind since the tooltip doesn't appear which is fixed by Elastic chart tooltip

Adding new interactivity to charts is in the form of point selection is not a priority to me

@markov00
Copy link
Member

From the last weekly elastic-chart: the current Kibana behaviour is to apply a filter using the X axis value, so independently on how many series are in the proximity of the current mouse position, we just filter the X value of that point

@nickofthyme
Copy link
Collaborator Author

Created #562 as future enhancement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss To be discussed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants