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

Allow tooltip option for max number of items #872

Closed
Tracked by #615
nickofthyme opened this issue Oct 16, 2020 · 4 comments
Closed
Tracked by #615

Allow tooltip option for max number of items #872

nickofthyme opened this issue Oct 16, 2020 · 4 comments
Labels
enhancement New feature or request :tooltip Related to hover tooltip

Comments

@nickofthyme
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
In TSVB in kibana there is an option to limit the tooltip items only to the focused items. There should be an option to specify the max number of items in the tooltip.

image

Describe the solution you'd like
This solution would add a new option to the TooltipProps to enable this feature and optionally set the max limit.

export type TooltipProps = TooltipPortalSettings<'chart'> & {
  // Other type props
  // ...

  limitCount?: boolean | number;
};

Then internally elastic charts uses this limitCount prop to either set a default limit (i.e. 10) or use the passed limit value.

The way this would work for a limit of 10, if there are 10 series on the tooltip, but only 2 are highlighted, the tooltip is shown with all 10 series. If another index has 12 series on the tooltip, but only 2 are highlighted, it will only show the highlighted count of 2.

This should not effect the type of the tooltip.

This could possibly cause confusion if somehow the limit is less than the number of highlighted values which would then show more series in the tooltip than the limitCount.

Describe alternatives you've considered
Using a toggle between TooltipType.Follow and TooltipType.VerticalCursor to achieve this effect.

https://github.com/elastic/kibana/blob/7e47e3935ea58cc69f566b8970f8f503e3fcbe36/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js#L139-L143

Additional context
Related to tooltip redesign #615

cc: @markov00 @timroes

@nickofthyme nickofthyme added enhancement New feature or request :tooltip Related to hover tooltip labels Oct 16, 2020
@markov00
Copy link
Member

What we want to do in the case where the highlighted/hovered points are more than the limitCount?
In the situation where we have a lot of series and on some points most their point positions are very close to each other, what are we going to show? the full list, a limited set?
I think we should also find a way to handle that situation with something like a scrolling tooltip or, as already requested in #815, with a sticky tooltip where the user can easily scroll it if necessary.
Another option can be the list of the 5 or X first values + a specification similar to: ...and other 3 series with the same value, press 's' to show them or something similar, where the user can "paginate" through the tooltip item list

@nickofthyme
Copy link
Collaborator Author

What we want to do in the case where the highlighted/hovered points are more than the limitCount?
In the situation where we have a lot of series and on some points most their point positions are very close to each other, what are we going to show? the full list, a limited set?

I would say show the full list. Another option could be to only show the closest values to the cursor, but this would require this issue 👉 #835.

To your other point, I agree, a more advanced interaction with the tooltip like scrolling or keyboard shortcuts would be a great improvement. How we do this is hard and would be nice to get the design teams' input

@markov00 markov00 mentioned this issue Dec 2, 2020
18 tasks
@nickofthyme nickofthyme added this to the Kibana 7.12 milestone Jan 20, 2021
@markov00 markov00 removed this from the Kibana 7.12 milestone May 26, 2021
@markov00
Copy link
Member

Closing this as this is now available in the Tooltip spec under maxTooltipItems and maxVisibleTooltipItems.
@nickofthyme Please reopen this if I'm missing something. We can probably update TSVB and remove such option, but since is in maintenance mode we can just skip it

@nickofthyme
Copy link
Collaborator Author

Yup good call, I think the latest changes cover this request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :tooltip Related to hover tooltip
Projects
None yet
Development

No branches or pull requests

2 participants