Is it possible to limit glyph rendering in bokeh? The figure becomes really unresponsive after few thousand glyphs and I need to plot 100k-1M datapoints. There is no need to show all of them at once, like if one glyph overlaps with another at all, only one would be shown. And then when zoomed in the glyph(a circle in this case) that was really close to another would be shown. Also the tooltip is needed. I have two examples below, could someone also say why the example 2 takes much longer to render? as in the more glyphs there is in a figure the more time it takes to add one more.
I start this with
>bokeh serve .\example.py
example.py
#EXAMPLE1START---------------------------------------------------------
from bokeh.models.sources import ColumnDataSource
from bokeh.plotting import figure, curdoc
from bokeh.layouts import column
data = {'x_values':[],
'y_values':[]}
source = ColumnDataSource(data=data)
TOOLTIPS = [("index", "$index")]
p = figure(title="plot_test",tooltips=TOOLTIPS)
side = 10
for horizontal in range(side):
for vertical in range(side):
new_data = {'x_values':[horizontal],
'y_values':[vertical]}
source.stream(new_data)
p.circle(x='x_values',y='y_values',source=source,)
doc = curdoc()
doc.add_root(column(p))
#EXAMPLE1END---------------------------------------------------------
#EXAMPLE2START---------------------------------------------------------
# from bokeh.models.sources import ColumnDataSource
# from bokeh.plotting import figure, curdoc
# from bokeh.layouts import column
# TOOLTIPS = [("tooltip", "$x")]
# p = figure(title="plot_test",tooltips=TOOLTIPS)
# side = 100
# for horizontal in range(side):
# for vertical in range(side):
# p.circle(x=horizontal,y=vertical)
# doc = curdoc()
# doc.add_root(column(p))
#EXAMPLE2END---------------------------------------------------------

