
I am interested in smooth transitions of data points along a path when animating / changing frames of a scatter plots via a slider. I saw a few open GH issues on smooth animations, so I understand that the functionality is not available in Bokeh via the Python interface. However, since there was a few years since the latest update in those issues, I am wondering if there is any recent workaround that could provide this functionality?
Below is a sample scatter plot, where I would like to smoothly animate transitions between frames.
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Slider
from bokeh.layouts import layout
from bokeh.io import curdoc
values_over_time = {'x': [1], 'y': [1]}
src = ColumnDataSource(values_over_time)
p = figure(x_range=(0, 5), y_range=(0, 5))
p.circle('x', 'y', source=src, size=20)
def scatter_update(attr, old, new):
src.data = {'x': [new], 'y': [new]}
slider = Slider(start=1, end=4, step=1, value=1, title="Frame")
slider.on_change('value', scatter_update)
doc = curdoc()
curdoc().add_root(layout([[slider], [p]]))
In addition to looking nice, I think smooth transitions are useful for visually linking data points between frames (possibly also achievable via a faint background line). In the example above, I could just increase the resolution of the slider, but in my actual data this is not possible since frames are far apart. The amount of data I am interested in plotting is hundreds of dots and a few tens of frames.
I realize that this transition behavior is possible in plotly and I might end up using that instead, but would like to know if it is at all possible in Bokeh first. One of the GH issues mentioned Coffee script and I guess that this behavior might possibly be achieved via custom JS? I don’t have experience in either but would be ready to try some things out if it is possible to received a few pointers of where to start. I appreciate any tips for how to get started with this, or letting me know that it is not possible to achieve currently.


