autoload_static returns a tuple with two items, only one of which you need to template into your document. Here is the reference page for autoload_static:
But to elaborate further, it returns a two things tuple (code, tag) The "code" portion is all the js code that describes your plot. You need to save this code in a .js file accessible at the path you pass in to autoload_static. For example:
(code, tag) = autoload_static(p, CDN, 'static/js/myplot.js')
if you look at the value of tag, it is something like:
In : print(tag)
*This* is what you need to template into your Jinja template. Wherever you put this script, it will be replaced by the plot. Notice the "src" attribute of the <script> tag is exactly the path passed in to autoload_static above. You need to save the value of "code" (which is too long to include here) to a file at "static/js/myplot.js" (you need to give the *full* path to a .js file to autoload_static)
Let us know if we can help further,
On Aug 14, 2014, at 10:24 AM, Paulo Nuin <[email protected]> wrote:
I used to have an embedded snippet in a html page generated by a Flask app using this syntax:
snippet = embed.autoload_static(curplor(), server=False, embed_base_url='http://192.168.1.72:5003/static/js/',
but with new versions all my attempts to actually have the same result failed. My latest try was:
snippet = autoload_static(curplot(), CDN, './static/js')
I looked at the documentation but there's not much there that can help me.
Thanks in advance
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/9bd2ded6-892d-4ee1-8f03-113ddc137c8f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.