Bokeh HoverTool performance on many points selected by mouse
See original GitHub issueHello,
I noticed a performance issue when dealing with many points being selected, intentionally or accidentally, by hovertool mouse. In my original use case I had a categorical x-axis with a jitter. Some categories had more or less scatter then others and at the default view those closely clustered points tended to show a noticeable performance degradation compared to other areas of my plot with only a few overlapping points.
The code example below replicates the performance issues when hovering over the cluster of points in chrome using Bokeh 0.12.9
output_file("Bokeh_hover_issue.html")
_tools_to_show = 'box_zoom,pan,save,hover,resize,reset,tap,wheel_zoom'
n=1000
source = ColumnDataSource({'x':[1]+[2 for i in range(n)],
'y':[1]+[2 for i in range(n)],
'c':['string' for _ in range(n+1)] })
p = figure(plot_width=300, plot_height=300, tools=_tools_to_show,
title="Hover tool tip slow down on multiple points")
p.circle(x=jitter('x', width=0.05),
y=jitter('y', width=0.05),
source=source, alpha=0.3,size=12)
hover = p.select(dict(type=HoverTool))
hover.tooltips=[('c',"@c")]
save(p)
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Configuring plot tools — Bokeh 2.4.3 Documentation
The tap selection tool allows you to select single points by clicking the left mouse button, or tapping with a finger. After a...
Read more >Bokeh hovertools which run arbitrary python code
Namely: Is it possible for hover tools to run python code on the fly, such that they can display plots of the data...
Read more >Interactive Data Visualization with Bokeh - Trenton McKinney
You will create your first plots, learn about different data formats Bokeh understands, and make visual customizations for selections and mouse hovering.
Read more >The HoverTool | Python - DataCamp
Here is an example of The HoverTool: . ... Interactive Data Visualization with Bokeh. George Boorman. Core Curriculum Manager, DataCamp ...
Read more >bokeh - Water Programming: A Collaborative Research Blog
from bokeh.models.tools import HoverTool #for importing the hover tool ... the same points will be selected in the other views.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you use the bokeh server you can do that with a custom template.
myapp/main.py
myapp/templates/index.html
myapp/templates/styles.css
If you save a static html file you can just add the style tag to the file yourself.
#9087 is a dupe of this / how this will be handled, but more current, so closing this.