Search⌘ K
AI Features

Using Jupyter Notebooks to Run Dash Apps

Explore the process of running Dash applications directly inside Jupyter Notebooks with the JupyterDash package. Understand how to instantiate apps, run them inline or in separate windows, and use notebooks for interactive development and debugging. Gain skills to isolate features for better management and create simple interactive components like dropdowns connected to outputs.

Running Dash apps on Jupyter

With a change to imports and a minor change to app instantiation, we can easily start to run our apps within Jupyter Notebook environments. The package that makes this possible is jupyter_dash. Essentially, the difference is that we import the JupyterDash object (instead of importing Dash), and app instantiation occurs by calling this object, as follows:

from jupyter_dash import JupyterDash
app = JupyterDash(__name__)

One of the advantages of running apps in a notebook environment is that it is less tedious to make small changes, iterate them, and see results. Working with an integrated development environment (IDE), the command line, and the browser, we need to constantly shift between them, while in a notebook environment, everything is in one place. This makes introducing simple changes and testing them easier. It can make our notebooks far more powerful and interesting as well.

The jupyter_dash package also provides an additional option while running the app in which we can determine whether we want to run the app in one of these three modes:

  • external: In a separate browser window, exactly as
...