All Projects → rapidsai → plotly-dash-rapids-census-demo

rapidsai / plotly-dash-rapids-census-demo

Licence: other
No description, website, or topics provided.

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
CSS
56736 projects

Plotly-Dash + RAPIDS | Census 2020 Visualization

pr1

Charts

  1. Map chart shows the total population points for chosen view and selected area
  2. Top counties bar show the top 15 counties for chosen view and selected area
  3. Bottom counties bar show the bottom 15 counties for chosen view and selected area
  4. Race Distribution shows distribution of individual races across blocks for chosen view and selected area

Cross-filtering is enabled to link all the four charts using box-select tool

Data-Selection Views

The demo consists of six views and all views are calculated at a block level

  • Total Population view shows total Census 2020 population.
  • Migrating In view shows net inward decennial migration.
  • Stationary view shows population that were stationary.
  • Migrating Out view shows net outward decennial migration.
  • Net Migration view shows total decennial migration. Points are colored into three categories - migrating in, stationary, migrating out
  • Population with Race shows total Census 2020 population colored into seven race categories - White alone, African American alone, American Indian alone, Asian alone, Native Hawaiian alone, Other Race alone, Two or More races.

Installation and Run Steps

Base Layer Setup

The visualization uses a Mapbox base layer that requires an access token. Create one for free here on mapbox. Go to the demo root directory's plotly_demo folder and create a token file named .mapbox_token. Copy your token contents into the file.

NOTE: Installation may fail without the token.

Data

There is 1 main dataset:

For more information on how the Census 2020 and 2010 Migration data was prepared to show individual points, refer to the /data_prep_total_population folder.

Conda Env

Verify the following arguments in the environment.yml match your system(easy way to check nvidia-smi):

cudatoolkit: Version used is 11.5

# setup conda environment
conda env create --name plotly_env --file environment.yml
source activate plotly_env

# run and access single GPU version
cd plotly_demo
python app.py

# run and access multi GPU version
cd plotly_demo
python dask_app.py

Dependencies

  • python=3.9
  • cudatoolkit=11.5
  • rapids=22.08
  • dash=2.5.1
  • jupyterlab=3.4.3
  • dash-html-components=2.0.0
  • dash-core-components=2.0.0
  • dash-daq=0.5.0
  • dash_bootstrap_components=1.2.0

FAQ and Known Issues

What hardware do I need to run this locally? To run you need an NVIDIA GPU with at least 24GB of memory, at least 32GB of system memory, and a Linux OS as defined in the RAPIDS requirements.

How did you compute migration? Migration was computed by comparing the block level population for census 2010 and 2020

How did you compare population having block level boundary changes? Relationship Files provides the 2010 Census Tabulation Block to 2020 Census Tabulation Block Relationship Files. Block relationships may be one-to-one, many-to-one, one-to-many, or many-to-many. Population count was computed in proportion to take into account the division and collation of blocks across 2010 and 2020.

How did you determine race? Race for stationary and inward migration individuals was randomly assigned within a block but they add up accurately at the block level. However, due to how data is anonymized, race for outward migration population could not be calculated.

How did you get individual point locations? The population density points are randomly placed within a census block and associated to match distribution counts at a census block level.

How are the population and distributions filtered? Use the box select tool icon for the map or click and drag for the bar charts.

Why is the population data from 2010 and 2020? Only census data is recorded on a block level, which provides the highest resolution population distributions available. For more details on census boundaries refer to the TIGERweb app.

The dashboard stop responding or the chart data disappeared! This is likely caused by an Out of Memory Error and the application must be restarted.

How do I request a feature or report a bug? Create an Issue and we will get to it asap.

Acknowledgments and Data Sources

  • 2020 Population Census and 2010 Population Census to compute Migration Dataset, used with permission from IPUMS NHGIS, University of Minnesota, www.nhgis.org ( not for redistribution ).
  • Base map layer provided by Mapbox.
  • Dashboard developed with Plotly Dash.
  • Geospatial point rendering developed with Datashader.
  • GPU toggle accelerated with RAPIDS cudf and cupy, CPU toggle with pandas.
  • For source code and data workflow, visit our GitHub.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].