Loading spinner while bokeh loads multiselect tools

Hi,

I cant seem to get a loading spinner to work in my standalone html file. I have uploaded 70MB of data to the html file and the user can select data by using the multiselect tools. It takes a few seconds before the data is plotted and I would like a loading spinner to show up while its loading the data.

I followed this tutorial:

And tried adding it several places in the html tool to see how I can get it working (see red circles in first plot). It is doing what I would like it to do when I put the div id = “loader” before the last script tag. But the spinner is just constantly spinnng in the middle of the screen. Anyone have an idea how I can get it to just spin when its loading data?

Spinning in the middle of the screen (but doing it all the time…):