Week 14A: Dashboarding with Panel and the Holoviz Ecosystem

December 3, 2020

Housekeeping

Final project details: https://github.com/MUSA-550-Fall-2020/final-project

Last two classes!

Last week

Recap: Two key elements of Dash apps

More information: Dash user guide

Let's re-visit our shootings app in Dash from last week

From the Jupyter Terminal or the Terminal/Anaconda Prompt apps:

cd dash-altair
python dash_altair_shootings.py

Dash app

Note for Windows users

You will likely need to navigate to localhost:5000 instead of http://0.0.0.0:5000

Note: the web address http://0.0.0.0 is an alias for "localhost" — this means the web server is running locally on your computer.

Exercise: modifying your Dash shootings apps

Let's modify the Altair-based Dash app for the shootings data in Philadelphia to include a dropdown that allows the user to specify which race to show data for.

Steps

Solution

See this Dash app, which adds a dropdown element for race of the shooting victim.

One more Dash example: Dash + Folium

Dash app

From the Jupyter Terminal or the Termina/Anaconda Prompt apps:

cd dash-folium
python app.py

to start the example

Deploying a Dash app

Getting started

Launching your app on Heroku

Summary: web-based visualizations so far

Right now: Panel

The downside of these options

Goal: a Python-based solution with server support where visualizations from different libraries can interact with each other

Saving the best for last: Panel

A high-level dashboarding solution in Python

Very general too...

Crucial feature: supports live dashboarding code in a Jupyter notebook and deploying same code to a server

Only library to support entire data wrangling workflow in a Jupyter notebook

See Panel FAQ

Built on top of the HoloViz ecosystem

Also important: Panel provides only support for Datashader and visualizing large datasets

Today's Plan

We'll walk through two examples that can serve as reference/templates for the final project:

  1. Visualizing recent shootings in Philadelphia using Altair, Folium, and Holoviews
  2. Visualizing NYC taxi trips with Datashader and Altair

PyData talk in Dec 2019 from the creator of Panel:

https://www.youtube.com/watch?v=Ohr29FJjBi0

But first: an introduction to Python classes

Let's take a quick look at this nice tutorial