I have created a Bokeh app and have it hosted using Heroku. The app is viewable here:
You’ll notice the load-time is fairly slow – this is the problem I am trying to solve.
One potential problem is that I am creating an individual columndatasource for each panel in the plot. I then update each columndatasource when a button widget is changed. Having a single large columndatasource and only creating it once may be faster…
However, another potential solution is this:
I currently have the “Jump to Year” drop-down menu widget set to only go back to 2010. My actual dataset goes back to 1974. I have reduced the years to improve the load speed… if I reduce the data to only one year (i.e. 2016 only), the load speed is reduced to ~3 seconds, which is tolerable.
My question is this:
What methods do I have available to complete an initial load of the Bokeh app with only the current single year loaded, and then load up data for the rest of the years back to 1974 as a secondary process while the user is viewing the initial page? Ideally, the app would update in the background after the initial load, adding years to the dropdown menu.
I have been reading about Lifecycle Hooks. I do have my application running in directory format, but I am unsure if these are really the methods I need, or how to proceed.
Any advice would be much appreciated!
I am programming exclusively in Python, using Pandas for my initial data read, defining variables, and creating a dataframe.