Hi there!
It pains me to bring up these export_png-related issues... but here I go again. This time it is an error that shows up when using export_png() and show() together:
...but in 1.0.0, it throws the following error for the line show(doc_layout): RuntimeError: Models must be owned by only a single document, HelpTool(id='1026', ...) is already in a doc
Using show(fig) instead of show(doc_layout) works, as well (but that is not really a workaround).
Using export_pngaftershow works, too. This could be a workaround in most use cases, but is quite inconvenient in mine.
Many thanks for the 1.0 release, anyway. I read about it in the change log, and it really feels like the export function is now faster for multiple exports!
The text was updated successfully, but these errors were encountered:
diff --git a/bokeh/embed/util.py b/bokeh/embed/util.py
index 36333a39c..e0c610f03 100644
--- a/bokeh/embed/util.py
+++ b/bokeh/embed/util.py
@@ -113,7 +113,7 @@ def OutputDocumentFor(objs, apply_theme=None, always_new=False):
def finish(): pass
- docs = set(x.document for x in objs)
+ docs = _compute_current_docs(objs)
# handle a single shared document, or missing document
if len(docs) == 1:
@@ -317,6 +317,14 @@ be used. For more information on building and running Bokeh applications, see:
http://bokeh.pydata.org/en/latest/docs/user_guide/server.html
"""
+def _compute_current_docs(objs):
+ docs = set()
+ for obj in objs:
+ docs.add(obj.document)
+ for ref in obj.references():
+ docs.add(ref.document)
+ return docs
+
def _create_temp_doc(models):
doc = Document()
for m in models:
I will submit a PR once I have time to figure out some tests.
Hi there!
It pains me to bring up these export_png-related issues... but here I go again. This time it is an error that shows up when using
export_png()
andshow()
together:In 0.13.0, the following works just fine:
...but in 1.0.0, it throws the following error for the line
show(doc_layout)
:RuntimeError: Models must be owned by only a single document, HelpTool(id='1026', ...) is already in a doc
Some observations:
export_png
orshow
works.show(fig)
instead ofshow(doc_layout)
works, as well (but that is not really a workaround).export_png
aftershow
works, too. This could be a workaround in most use cases, but is quite inconvenient in mine.Many thanks for the 1.0 release, anyway. I read about it in the change log, and it really feels like the export function is now faster for multiple exports!
The text was updated successfully, but these errors were encountered: