Down-sampling 100k points to 1k in Bokeh Server

My initial dataset has 100k points. When I plot them all, the points overlap with each other and when hovered over, the HoverToool shows details about multiple points (all the points stacked in that position) at once

How to set the lod_factor, lod_threshold, lod_interval and lod_timeout values to show 1k random points and then increase the number of points shown gradually as zoomed in? If not, is there any other way?

The LOD settings are not for that purpose. They only control an automatic downsampling that occurs while and interactive event is in-flight. E.g. the number of points can be reduced while a zoom is occurring. This feature only exists for that purpose (i.e. to make interactive events more responsive).

I don’t have any complete example to point you to. Your best best is probably to create a CustomJSFilter that does the downsampling based on the current range. Or range update callbacks that configure the indices on an IndexFilter perhaps.

I am using this code to downsample my hover tooltip

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.