I have a problem with bokeh and Tornado.
I am using Tornado as my webserver (I cannot use the bokeh embedded server). One of my pages creates a websocket connection and is supposed to receive dynamically generated bokeh graphs from the server.
I generate the graph with the following code:
from bokeh.plotting import figure
from bokeh.embed import components
plot = figure()
plot.circle([1,2], [3,4])
script, div = components(plot)
then I send the script and div to the listening websocket (this is done in my tornado websocket handler):
write_message(div+script)
The client has a div with id = 'wsResponse' in which I want to insert the result:
document.getElementById("wsResponse").innerHTML = data;
Where data is the previously generated div and script, sent to the websocket.
The problem is that nothing is rendered, as the script is indeed javascript code and cannot be inserted by the innerHTML directive.
Any workaround please?