Hi, I’m trying to use bokeh to display a exchange market depth plot (hence the variable names), which involves two patches of hundreds of points each plotted together on one plot.
The relevant code is shown below, and when viewed at the default zoom ranging, panning around produces noticeable lag. (note lod_threshold=None).
However, when scroll-zoomed out so that the entirety of both patches is visible, panning produces much less lag (an acceptable amount).
Is there a reason the different zoom levels produce differing amounts of lag?
I am already showing only a subset of the full data available.
I also don’t want to use lod_threshold, but also don’t see why it should help in this case.
import sys, math, json
from bokeh.plotting import figure
from bokeh.io import show
from bokeh.models import ColumnDataSource
fil = open(‘sampledata’, ‘r’)
b, s = json.loads(fil.read())
fil.close()
buys = ColumnDataSource(data=b)
sells = ColumnDataSource(data=s)
minx = buys.data[‘prices’][0] * 0.98 #default xrange of 2% on either side of the pricegap between buys and sells
maxx = sells.data[‘prices’][0] * 1.02
plot = figure(lod_threshold=None, x_range=(minx, maxx), y_range=(0, 400000), plot_width=1600)
plot.patch(‘prices’, ‘amounts’, source=buys, fill_color=’#00a000’, line_alpha=0)
plot.patch(‘prices’, ‘amounts’, source=sells, fill_color=’#a00000’, line_alpha=0)
show(plot)
``
The json file ‘sampledata’ is attached, along with the code as bokeh_speedtest.py
Python version is 3.6.1
Bokeh version is 0.12.13
Browser is Firefox (Quantum) 58.0.2 64bit on Windows 10
sampledata (88.1 KB)
bokeh_speedtest.py (608 Bytes)