bokeh.application.handlers.code#
Provide a Bokeh Application Handler to build up documents by compiling and executing Python source code.
This Handler is used by the Bokeh server command line tool to build applications that run off scripts and notebooks.
def make_doc(doc: Document):
# do work to modify the document, add plots, widgets, etc.
return doc
app = Application(FunctionHandler(make_doc))
server = Server({'/bkapp': app}, io_loop=IOLoop.current())
server.start()
- class CodeHandler(*, source: str, filename: str | PathLike[str], argv: list[str] = [], package: ModuleType | None = None)[source]#
Run source code which modifies a Document
- __init__(*, source: str, filename: str | PathLike[str], argv: list[str] = [], package: ModuleType | None = None) None [source]#
- modify_document(doc: Document) None [source]#
Run Bokeh application code to update a
Document
- Parameters:
doc (Document) – a
Document
to update