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

[FIX] scatterplot: limit number of points displayed in tooltip #2980

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

astaric
Copy link
Member

@astaric astaric commented Mar 28, 2018

Issue

Fixes #2979

Description of changes

Display a shorter message in the tooltip when there are too many points under the mouse cursor.

Includes
  • Code changes
  • Tests
  • Documentation

@astaric astaric added this to the 3.12 milestone Mar 28, 2018
@astaric astaric changed the title scatterplot: limit number of points displayed in tooltip [FIX] scatterplot: limit number of points displayed in tooltip Mar 28, 2018
@codecov-io
Copy link

codecov-io commented Mar 28, 2018

Codecov Report

Merging #2980 into master will decrease coverage by <.01%.
The diff coverage is 75%.

@@            Coverage Diff             @@
##           master    #2980      +/-   ##
==========================================
- Coverage   81.85%   81.85%   -0.01%     
==========================================
  Files         329      329              
  Lines       56781    56784       +3     
==========================================
+ Hits        46480    46482       +2     
- Misses      10301    10302       +1

if len(points) > MAX_POINTS_IN_TOOLTIP:
text = "{} instances<hr/>{}<hr/>...".format(
len(points),
"<hr/>".join(point_data(point) for point in points[:5])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the difference between the constant MAX_POINTS_IN_TOOLTIP above and the hard-coded 5 here intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Displaying 20 points is ugly, but might be desired in some cases. When there are more, 5 are shown as a teaser. IMHO the tooltip looks much nicer this way :)

@lanzagar lanzagar merged commit bcedaa3 into biolab:master Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants