Bokeh and Plotly integration is currently only available in Saturn Enterprise. Saturn Cloud is developed by some of the original Bokeh authors. Please reach out if you're interested in this.

Bokeh

Saturn supports Bokeh integration, in the notebook, running Bokeh server dashboards in JupyterHub, as well as publishing and deploying Bokeh server dashboards.

In the Notebook

Bokeh plots work out of the box in Jupyter notebook, as well Jupyter Lab. If you wish to embed a Bokeh server dashboard into the notebook , You need to pass the following function into the notebook_url parameter

def remote_jupyter_proxy_url(port):
    import os
    import urllib
    base_url = os.environ['SATURN_JUPYTER_BASE_URL']
    if port is None:
        return os.environ['SATURN_JUPYTER_BASE_DOMAIN']
    service_url_path = os.environ['JUPYTERHUB_SERVICE_PREFIX'] + 'proxy/%d' % port
    url = urllib.parse.urljoin(base_url, service_url_path)
    return url

show(modify_doc, notebook_url=remote_jupyter_proxy_url)
      

Running Bokeh Dashboards

Saturn supports running Bokeh server applications in the JupyterLab terminal. To start, please ensure that you've activated the proper python environment. Then you can start the Bokeh server as normal, for example:

bokeh serve crossfilter
      
The application should now be visible at http://community.jupyter.aws.saturncloud.io/user/hugo/myjupyter/proxy/5006/crossfilter . Please modify that url to match the url of your notebook server.

Deploying Bokeh Servers

Please click the link to Preview your published result on the Publishing page of your dashboard. If your Bokeh application is a script, please navigate to the script. If you've packaged the application as a directory, please navigate to the directory. In the drop down select bokeh. If you click Deploy the application will be deployed. It can take a few minutes to start, but after it's started, you can view it on the Deployments page of your dashboard.

Plotly

Saturn supports Plotly integration, in the notebook, running plotly dash applications in JupyterHub, as well as publishing and deploying plotly dash applications.

Running Dash Apps

Plotly should work out of the box in Jupyter, however a minor modification is required to view dash applications stated in the JupyterLab terminal. In the main of your dash app, you need to set routes_pathname_prefix and requests_pathmame_prefix

if __name__ == "__main__":
   import os
   prefix = os.environ.get('JUPYTERHUB_SERVICE_PREFIX')
   port = 8080
   if prefix:
       app.config.update({
           'routes_pathname_prefix': '/',
           'requests_pathname_prefix': prefix + "proxy/%s/" % port
       })
    app.run_server(port=port, debug=True, host='0.0.0.0')
    
The application should now be visible at http://community.jupyter.aws.saturncloud.io/user/hugo/myjupyter/proxy/8080/ . Please modify that url to match the url of your notebook server.

Deploying Plotly Dash Applications

We currently require that you setup your dash application to run on port 8080. Other than that, publishing and deploying Plotly Dash applications is very similar to publishing and deploying Bokeh dashboards. Please click the link to Preview your published result on the Publishing page of your dashboard. Navigate to the script of your Plotly dash app. In the drop down select http. If you click Deploy the application will be deployed. It can take a few minutes to start, but after it's started, you can view it on the Deployments page of your dashboard.