UCL / HHyeast-server

0 stars 0 forks source link

Show loading... indicators while waiting for Bokeh #16

Open jonc125 opened 6 years ago

ilectra commented 6 years ago

How would you do that?

jonc125 commented 6 years ago

I'm not 100% sure, because I don't know quite how Bokeh interacts with the server and hence where you can hook in. I'd need to poke around a bit!

One option is to have a paragraph in your template shown by default:

<p id='loading_message'>Loading result visualisations...</p>

and some Javascript code that either polls for a Bokeh div appearing, or (if Bokeh provides an event it can listen to) gets triggered by Bokeh, and calls $('#loading_message').hide() (using jQuery for convenience). I have similar snippets in the Farid app that I could base something on.

jonc125 commented 6 years ago

You might be able to put the loading message inside <div class="bk-root"> and have Bokeh automatically replace it when it renders; I'd need to test if this works.

rando128 commented 6 years ago

Currently adding <div class="bk-root"> in the template doesn't work as Bokeh adds another bk-root div instead of filling the existing one.

Is there any existing JS callback that Bokeh can fire so we can remove a loading div programatically?

jonc125 commented 6 years ago

Pity :(