JupyterHub
HomeServicesDocumentationBlog
1.0.0
1.0.0
  • Introduction
  • Determine Your Workflow
  • About Jupyter Notebooks
  • About JupyterHub
  • Computing Policies
  • ❓Help and Support
    • Getting Support
    • FAQ
    • Known Issues/Bugs
    • Instructor's Checklist
    • Additional Resources
  • Getting Started
    • Sign In
    • Import Notebooks
    • Launch a Notebook
    • Launch a Terminal Session
  • Using Your Hub
    • Interface Overview
    • Creating a New Blank Notebook
    • Managing Active Notebooks
    • Shutting Down Server
  • Content Sync via Link
    • Link generation
  • CONTENT SYNC VIA GIT
    • Git Overview
    • Create GitHub Account
    • Set Up Git in JupyterHub
    • Downloading Content
    • Saving and Uploading Content
    • GIT Cheatsheet
  • Github Classroom (Student Guide)
    • Getting Started
    • Getting and Uploading Assignments
  • GitHub Classroom (Instructor Guide)
    • Overview
    • Getting Started
    • Distributing Homework
    • Distributing Lectures
    • Learning Management Systems
  • ADVANCED TOPICS
    • Package Installation
    • Accessing Classic Notebook
    • Slideshow Plugin
    • VSCode
    • SQLite
    • RStudio and Shiny
    • Dash
  • Reproducibility
    • Replicating the Environment
    • Using Docker
Powered by GitBook
On this page
Export as PDF
  1. ADVANCED TOPICS

Dash

JupyterLab Dash extension (only available by request)

Dash is a powerful web based visualization tool for Python. By default, it runs a server on localhost so you can view dashboards on a web browser.

To use Dash inside of Jupyter Lab, you should use the appViewermethod from jupyterhub_dash. This will open a tab in Jupyter Lab instead of serving the app to localhost. See example below:

import jupyterlab_dash
import dash
import dash_html_components as html
import dash_core_components as dcc

viewer = jupyterlab_dash.AppViewer()

app = dash.Dash(__name__)

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),

    html.Div(children='''
        Dash: A web application framework for Python.
    '''),

    dcc.Graph(
        id='example-graph',
        figure={
            'data': [
                {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
                {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
            ],
            'layout': {
                'title': 'Dash Data Visualization'
            }
        }
    )
])

viewer.show(app)
PreviousRStudio and ShinyNextReplicating the Environment

Last updated 5 years ago