BTW I notice a comment on that docs link about things needing to be located under <head> which is certainly not true. I'm not sure where that warning came from. It might also be instructive to look at a working example, you can view the page source here to see autoload_static in actual use around like 190:
http://bokeh.pydata.org/en/latest/docs/gallery/sinerror.html
Thanks,
Bryan
···
On Apr 18, 2016, at 12:06 AM, Bryan Van de Ven <[email protected]> wrote:
Hi Sean,
Can you provide more information about how you are using the return values? FYI I am used to seeing the return values named more like:
js, tag = autoload_static(plot, CDN, "some/path/foo.js")
as described here:
http://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#static-data
Under that naming, "js" is code you need to save at your "script_path" and "tag" is an HTML script tag that will load that .js file.
Does the element ID attribute of the script tag match the element id that is in the actual script body that you save to "script_path"? It is located in the JS roughly here:
As you can see there also, that error is what is reported if the code tries to locate itself (using the matching elementid), but fails.
In one sense I don't think autoload_static gets alot of use, on the other hand, the entire docs site gallery is built off of it, so it does get exercised continuously, so hopefully we can get to the root of your issue quickly.
Thanks,
Bryan
On Apr 17, 2016, at 2:58 PM, [email protected] wrote:
I am trying to embed a bar chart in my Flask app:
plot = Bar(df, label=CatAttr(columns=, sort=False), values=y, title=title)
script_path = os.path.join('static', 'js', 'bokeh.js')
script, tag = autoload_static(plot, CDN, script_path)Usually this fails to load with the following browser error:
Bokeh: ERROR: autoload.js configured with elementid 'b5def586-251a-4c29-8a89-7efddc0d211a' but no matching script tag was found.
However, if I turn on developer tools in Chrome and reload the page, then the bokeh chart loads up without a problem. Note that I don't make changes to the code at all - only turn on DevTools and reload. Simply reloading the page does not cause the bokeh chart to load.
Secondly, the docs seem to imply that autoload_static() can take a list of plots (well, "models") but I can't seem to get this to work:
plot = Bar(df, label=CatAttr(columns=, sort=False), values=y, title=title)
script_path = os.path.join('static', 'js', 'bokeh.js')
script, tag = autoload_static([plot, plot, plot], CDN, script_path)I want to plot multiple bar plots (ultimately, with different data) but I don't have enough information to get the syntax right.
--
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/2ddddca9-15ba-4879-88aa-9204cb11340a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.