Skip to content
Advertisement

Bokeh dashboard: any way to save user selections for page reloads?

I have a Bokeh dashboard where the user can select a bunch of inputs using CheckboxGroup and Select type of selectors, e.g.:

 category_select =  Select(value='produce', options=['produce', 'grocery','clothes','shoes'])

The dashboard is supposed to show near-real-time data though, so it reloads every 10-15 minutes, and all user selections (such as “shoes” above, for example) of course vanish when the page reloads, which is annoying for the user as they have to start over. Is there any way to persist the values of all their selections from one reload to the next?

I’ve tried using localStorage within the template/index.html file, but I only know how to use localStorgage when I can refer to a document’s html elements by name or id, and I don’t know how to get the names or id’s of all the Bokeh elements. For example, for that ‘category_select’ selector above, I have no idea how to “wrap” it into some kind of < something id = "something" > category_select </something> type of syntax.

Help would be appreciated!

Advertisement

Answer

Instead of entirely reloading the page, I would try streaming the data through a periodic callback in the bokeh document that runs every 10-15 minutes as needed. This way bokeh automatically handles the task of remembering all of your user’s selections. Streaming also has the advantage that it doesn’t reload the entire data set but just appends the latest data.

6 People found this is helpful
Advertisement