bokeh.core.templates¶
Provide Jinja2 templates used by Bokeh to embed Bokeh models (e.g. plots, widgets, layouts) in various ways.
-
bokeh.core.templates.AUTOLOAD_JS= <Template 'autoload_js.js'>¶ Renders JavaScript code for “autoloading”.
The code automatically and asynchronously loads BokehJS (if necessary) and then replaces the AUTOLOAD_TAG
<script>tag that calls it with the rendered model.Parameters:
-
bokeh.core.templates.AUTOLOAD_NB_JS= <Template 'autoload_nb_js.js'>¶
-
bokeh.core.templates.AUTOLOAD_TAG= <Template 'autoload_tag.html'>¶ Renders
<script>tags that automatically load BokehJS (if necessary) and then renders a Bokeh model or document. The document may be specified as either an embedded doc ID or a server session ID. If a specific model ID is not specified, the entire document will be rendered.Parameters: Note
This script injects a
<div>in place, so must be placed under<body>.
-
bokeh.core.templates.CSS_RESOURCES= <Template 'css_resources.html'>¶ Renders HTML that loads Bokeh CSS according to the configuration in a Resources object.
Parameters: - css_files (list[str]) – a list of URIs for CSS files to include
- css_raw (list[str]) – a list of raw CSS snippets to put between
<style>tags
-
bokeh.core.templates.DOC_JS= <Template 'doc_js.js'>¶
-
bokeh.core.templates.FILE= <Template 'file.html'>¶ Renders Bokeh models into a basic .html file.
Parameters: Users can customize the file output by providing their own Jinja2 template that accepts these same parameters.
-
bokeh.core.templates.JS_RESOURCES= <Template 'js_resources.html'>¶ Renders HTML that loads BokehJS JavaScript code and CSS according to the configuration in a Resources object.
Parameters: - js_files (list[str]) – a list of URIs for JS files to include
- js_raw (list[str]) – a list of raw JS snippets to put between
<style>tags
-
bokeh.core.templates.NOTEBOOK_LOAD= <Template 'notebook_load.html'>¶ Renders HTML for loading BokehJS JavaScript code and CSS into a Jupyter Notebook according to a Resources object.
Parameters: - plot_resources (str) – typically the output of RESOURCES
- verbose (bool) – whether to display verbose info about BokehJS configuration, etc
- bokeh_version (str) – the current version of Bokeh
- js_info (str) – information about the location, version, etc. of BokehJS code
- css_info (str) – information about the location, version, etc. of BokehJS css
- warnings (list[str]) – a list of warnings to display to user
-
bokeh.core.templates.NOTEBOOK_DIV= <Template 'notebook_div.html'>¶ Renders a
divto display a Bokeh model into a Jupyter Notebook.Parameters: