There are certainly ways to do this on the client side with CustomJSTransform, etc. but if the goal is to not send the data in the first place, then you should cut the data down first on the python side. Something like:
In [1]: import numpy as np
In [2]: x = np.arange(10)
In [3]: y = np.zeros_like(x)
In [4]: y[1] = 1; y[4:7] = 1
In [5]: x
Out[5]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
In [6]: y
Out[6]: array([0, 1, 0, 0, 1, 1, 1, 0, 0, 0])
x axis is Timestamp. eg. T1, T2, -> T20
y axis is a Stat Value eg. .. .. .. 10 20 30
.. indicates that there is no value for the stat for that timestamp.
The line is plotted using this call:
figure.line (x_axis, this_bucket_plot, legend=bucket, alpha=0.5,
color=this_color, line_width=3)
x_axis is an array of x axis datapoints
this_bucket_plot is an array of y axis datapoints.
Most of the datapoints in this_bucket_plot as intentionally set to 0 so that lenght of both arrays is same.
To save processing time, is there a way to indicate bokeh not to plot 0 values. Most of my data is sparse i.e. 0.