bokeh.core.templates¶
Provide Jinja2 templates used by Bokeh to embed Bokeh models (e.g. plots, widgets, layouts) 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.Parameters: - elementid (str) – the unique id for the script tag
- js_urls (list) – URLs of JS files making up Bokeh library
- css_urls (list) – CSS urls to inject
-
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.
Parameters:
-
DOC_JS
= <Template 'doc_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.
Parameters:
-
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