Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Web app with Bokeh plots in an offline mode? Where to dl Required Bokeh files

I have a web application with python controllers, where output plots are plotted by Bokeh. In my master template.html file I load bokeh-0.9.2.min.css and bokeh-0.9.2.min.js as shown below.

My question is "If I run my web app as a browser app in offline mode, Is it possible to download these two files into my static/jss folder and run it offline?"

<link rel="stylesheet" href="http://cdn.bokeh.org/bokeh/release/bokeh-0.9.2.min.css" type="text/css" />
<script type="text/javascript" src="http://cdn.bokeh.org/bokeh/release/bokeh-0.9.2.min.js"></script>
like image 554
Hamid K Avatar asked Oct 29 '15 18:10

Hamid K


People also ask

Does bokeh require Internet?

One requirement is the ability to operate in an offline environment. There will be no external internet connection available to the client.

How do you insert a bokeh plot?

You can achieve this with the server_document() function. This function accepts the URL to a Bokeh server application and returns a script that embeds a new session from that server every time the script executes. You can add this tag to an HTML page to include the Bokeh application at that point.

Is Bokeh a data visualization library?

Bokeh is a Python library for creating interactive visualizations for modern web browsers. It helps you build beautiful graphics, ranging from simple plots to complex dashboards with streaming datasets.

How do you add a bokeh chart in Python?

The easiest way to install Bokeh is to use conda . Conda is part of the Anaconda Python Distribution, which is designed with scientific and data analysis applications like Bokeh in mind. If you use Anaconda on your system, installing with conda is the recommended method. Otherwise, use pip .


1 Answers

For anyone who stumbles upon this question, there is now a convenient way to load the Bokeh JS and CSS files inline instead of via CDN. This can be done by setting the mode argument to inline in the io.output_file function:

output_file('plot.html', title='Bokeh Plot', autosave=False, mode='inline', root_dir=None)
like image 123
Spry Avatar answered Oct 04 '22 02:10

Spry