s

Notes from the Dash Python User Guide



Based on the tutorial and docs at https://dash.plotly.com/

There is a comprehensive Dash Python User Guide at https://dash.plotly.com/ that introduces Dash, has a gallery of open-source app examples and links to the tutorial. There is also an overview and links to the open-source component libraries as well as more advanced material.

Dash uses Flask for the backend and Plotly for producing plots. It also uses React for handling all components. A Dash app is rendered as a single-page React app.

Installation

Install and upgrade dash libraries with pip.

pip install dash in the terminal. This will include the three component libraries that make up the core of Dash

  1. dash_html_components
  2. dash_core_components
  3. dash_table

as well as the plotly graphing library.

You can also use Jupyter notebook or JupyterLab as the development environment by installing jupyter-dash.

pip install jupyter-dash in the terminal

It is recommended to install pandas as it is required by Plotly Express.

pip install pandas

To write and run Dash apps using Jupyter make the following changes to an app:

  • Replace import dash with from jupyter_dash import JupyterDash at the import sections at the top of the app.
  • Replace app = dash.Dash(__name__ with app = JupyterDash(__name__).
  • Set the mode to 'inline', 'external' or 'jupyterlab'.

User_guide screenshot

Tech used:
  • Python
  • HTML