Deploy Shareable Data Applications on Kyso with Bokeh

#Deploy-Shareable-Data-Applications-on-Kyso-with-Bokeh

Or simply click on this link: https://live-aymycm9bst-8000.cloud.kyso.io/

This is a quick guide on how you can now create, deploy and share live dashboards and data apps on Kyso. Bokeh is an interactive visualization library for Python that enables beautiful and meaningful visual presentation of data in modern web browsers. With Bokeh, you can quickly and easily create interactive plots, dashboards, and data applications, without writing any JavaScript.

For the purpose of this quickfire guide I have simply taken some examples from bokeh's Github repository - some of which you can also see on bokeh's app demos.

Quick Start - IMDB Movie Exploration

#Quick-Start---IMDB-Movie-Exploration

If you'd prefer to get started yourself quickly, simply fork this study & open in a workspace. Click on the + sign in the top left-corner of Jupyterlab and open a new terminal. From the terminal, cd into the app directory and run the following command:

bokeh serve --show movies --port 8000 --allow-websocket-origin=*

Open the workspace url in another tab as follows:

So, to be clear - copy your workspace url in your browser, open up a new tab and paste in the url. Remove the lab? and append -8000 to the workspace id number, before .cloud.kyso.io

The following app should be running in your new tab:

Loading output library...

Above you are serving the movies application on port 8000 and enabling all websocket connections to your deployed app.

Note that you can only share deployed applications on port 8000, Kyso's default public port. Private apps can be served on ports 8001 through 8005.

Note that I am running bokeh serve on an entire directory - when done this way bokeh will expect a main.py file. You can alternatively cd into a sub-directory and run the command on an individual file.

View the above app running live at https://live-aymycm9bst-8000.cloud.kyso.io/movies

Getting started with more examples

#Getting-started-with-more-examples

If you are unfamiliar with Bokeh, there are some great examples with getting set up in bokeh's documentation, and I've also published a beginner's guide to bokeh. This is the link to bokeh's documentation on running a bokeh server

And here you'll find cool examples of bokeh's demo applications, which you can deploy and share on Kyso.

To get started with bokeh's many examples, open up a workspace on Kyso and, from the terminal, run:

cd into the examples directory. You can then run mutiple apps at once or an individual app.

bokeh serve --show "app_name" "app_name" "app_name" --port 8000 --allow-websocket-origin=*

This will set-up a Bokeh server and open the application in your browser. In the future we will have a button in Jupyterlab on Kyso to launch your app on a specified port. For now, follow the steps shown above under the Quick Start

  • My workspace is running at https://live-aymycm9bst.cloud.kyso.io/lab?
  • I've launched an app on port 8000.
  • In a separate tab I can go to https://live-aymycm9bst-8000.cloud.kyso.io/, where my app will be running. The individual apps are showcased below.

1. Gapminder

#1.-Gapminder

In Hans Rosling's

iconic TED Talk
he shows us that many advances have been made since the 60s, when our notions of development were established. The engaging infographic illustrates how our ongoing perceptions of a "first world" and a "third world" are wrong, and that the world has become a spectrum of developing countries.

Loading output library...

2. Global Population

#2.-Global-Population

This is a cool interactive data app that breaks down different populations by age and gender.

Loading output library...

3. Open High-Low Close App

#3.-Open-High-Low-Close-App

A streaming, updating OHLC chart from simulated market data.

Loading output library...

4. Exporting CSV Files

#4.-Exporting-CSV-Files

A cool app to query a data table and save the results to a CSV file.

Loading output library...

5. Spectrogram

#5.-Spectrogram

A live audio spectrogram.

Loading output library...

6. Sine Waves

#6.-Sine-Waves

An interactive function explorer with slider widgets for a sine curve.

Loading output library...

7. Visualising Weather for Airlines

#7.-Visualising-Weather-for-Airlines

An app that records and plots the temperatures for Austin, Boston and Seattle.

Loading output library...

8. Fourier Series

#8.-Fourier-Series

A streaming, updating representation of Fourier Series, a way to represent a function as the sum of simple sine waves.

Loading output library...

There is another awesome example of a bokeh dashboard by Will Koehrsen here: https://data-apps-bphdkrcy0d-8000.cloud.kyso.io/bokeh_app