I\'m trying to integrate a Bokeh \"autoloaded\" server into a Flask app where the set of data to load would be chosen by the user on another page.
The ID of this set
You can do it by appending to the src attribute of the <script>
tag returned from autoload_server
. Check out my function appendQuery
in the source for this question
def appendQuery( script , key , value) :
# Pass along the parameter as a query string to the script's src url: TODO this will formally be introduced in next release of Bokeh to avoid this hack
script_list = script.split("\n")
idxSrcAttr = 2
script_list[idxSrcAttr] = script_list[idxSrcAttr][:-1] + "&{}={}\"".format( key , value )
script = "\n".join(script_list)
return script
This is methodology is supposed to be formalized in an upcoming Bokeh release according to... https://github.com/bokeh/bokeh/issues/5992#issuecomment-287232101