How to limit the number of tooltips for overlapping data points in the bokeh?

I am writing a round chart for Bokeh that displays tooltips using the built-in hover tool. I work with a large number of points that overlap in some places, often causing several tooltips at once.

hover = HoverTool( tooltips=""" <div> <div> <span style="font-size: 10px;">@names</span><br /> <span style="font-size: 10px;">@dates</span><br /> <span style="font-size: 10px; color: #696;">@x, @y</span> </div> </div> """, point_policy='snap_to_data' ) TOOLS = ["resize, crosshair, pan, wheel_zoom, box_zoom, reset", hover] # Initialize the graph p = figure(tools=TOOLS, webgl=True, x_range=(-bound, bound), y_range=(0, bound), lod_timeout=1000, lod_factor = 10, lod_interval = 300, lod_threshold=10) 

Displaying too many prompts immediately slows down the application and starts off-screen. Is it possible to limit the number of tooltips.

+5
source share

Source: https://habr.com/ru/post/1262953/


All Articles