Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c212d4c

Browse files
committed
Suppress output warnings in bokeh example
1 parent c742f47 commit c212d4c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pyscriptjs/examples/bokeh_interactive.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1>Bokeh Example</h1>
3232

3333
from bokeh import __version__
3434
from bokeh.document import Document
35-
from bokeh.embed.util import OutputDocumentFor, standalone_docs_json
35+
from bokeh.embed.util import OutputDocumentFor, standalone_docs_json_and_render_items
3636
from bokeh.models import Slider, Div
3737
from bokeh.layouts import Row
3838
from bokeh.protocol.messages.patch_doc import process_document_events
@@ -48,12 +48,12 @@ <h1>Bokeh Example</h1>
4848

4949
row = Row(children=[p, div])
5050

51-
print("about to embed")
52-
5351
def doc_json(model, target):
5452
with OutputDocumentFor([model]) as doc:
5553
doc.title = ""
56-
docs_json = standalone_docs_json([model])
54+
docs_json, _ = standalone_docs_json_and_render_items(
55+
[model], suppress_callback_warning=True
56+
)
5757

5858
doc_json = list(docs_json.values())[0]
5959
root_id = doc_json['roots']['root_ids'][0]
@@ -87,7 +87,6 @@ <h1>Bokeh Example</h1>
8787
async def show(plot, target):
8888
pydoc, model_json = doc_json(plot, target)
8989
views = await Bokeh.embed.embed_item(JSON.parse(model_json))
90-
print("Done embedding...")
9190
jsdoc = views[0].model.document
9291
_link_docs(pydoc, jsdoc)
9392

0 commit comments

Comments
 (0)