Skip to content

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

Merged
lanzagar merged 2 commits intobiolab:masterfrom
astaric:scatterplot-prune-tooltip
Mar 30, 2018
Merged

[FIX] scatterplot: limit number of points displayed in tooltip#2980
lanzagar merged 2 commits intobiolab:masterfrom
astaric:scatterplot-prune-tooltip

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