bokeh.core.templates¶
Provide Jinja2 templates used by Bokeh to embed Bokeh documents and models in various ways.
-
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.
-
AUTOLOAD_NB_JS
= <Template 'autoload_nb_js.js'>¶
-
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>
.
-
CSS_RESOURCES
= <Template 'css_resources.html'>¶ Renders HTML that loads Bokeh CSS according to the configuration in a Resources object.
-
DOC_JS
= <Template 'doc_js.js'>¶
-
DOC_NB_JS
= <Template 'doc_nb_js.js'>¶
-
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.
-
JS_RESOURCES
= <Template 'js_resources.html'>¶ Renders HTML that loads BokehJS JavaScript code and CSS according to the configuration in a Resources object.
-
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
-
PLOT_DIV
= <Template 'plot_div.html'>¶ Renders a basic plot div, that can be used in conjunction with PLOT_JS.
- Parameters
elementid (str) – a unique identifier for the
<div>
a PLOT_JS template should be configured with the sameelementid
-
ROOT_DIV
= <Template 'root_div.html'>¶