Search code examples
javascriptpythonbokeh

Add animation (slower, smoother change) on Bokeh chart data changes


Is there a way (built-in or quick workaround) to make bokeh charts' data change more smoothly? I am streaming some data in a Bokeh dashboard, the data changes drastically from time to time, and I would like to allow a few seconds for the chart data to update (imagine a bar chart), like an animation ...

How can I achieve this? Any hint would be useful.

P.S. I am using Bokeh server and am already customizing my template (html, css, js)


Solution

  • There are two ways to animate things with Bokeh right now:

    • Animate manually by changing the data slightly at short intervals. Pro: pretty easy to implement. Con: a lot of data churning, especially given that you're using a server
    • Create custom glyphs that support such animation. Pros and cons are the opposite. You can check out this example to get an idea of how it might be done