Visualize Parks and Racial Distribution in NYC with Dash

Using multiple callback inputs to produce dynamic Dash apps

Justin Morgan Williams
9 min readAug 6, 2023
Photo by Eric Prouzet on Unsplash

Background

I had envisioned a Dash app where one could hover over a choropleth map and trigger changes in the the dashboard, however, I also wanted a dropdown selector, that would trigger the same response. Essentially, I wanted to create an output, that had multiple inputs, and I needed to specify which input fired, to elicit the correct output response. I wasn’t able to get this to work with basic callback features. This took endless trial and era to complete (the documentation for advanced callback features isn’t that explicit), so I figured I would dedicate a blog to this app, with multiple input advanced callbacks being the focal point.

Data

I wanted to show proportion of parks within each NYC Community District Tabulation Area (CDTA), juxtaposed against racial distribution. The intention was to be exploratory in nature, allowing one to view the different demographics in each CDTA, and parks.

Parks

The Parks Properties dataset identifies property managed partially or solely by NYC Parks. We download the shapefile directly to our notebook as a GeoDataFrame with GeoPandas. Then, convert the coordinate…

--

--

Justin Morgan Williams

Data scientist passionate about the intersectionality of sustainability and data.