This repo contains 3 builds of a Plotly app in R for quantifying covid-related mortality.
It also contains a Dockerfile for deploying local and remote environments.
These apps parse a large csv (~50MB) from the CDC: https://data.cdc.gov/NCHS/Weekly-counts-of-death-by-jurisdiction-and-cause-o/u6jv-9ijr/
- sample.R displays weekly mortality by for one cause, state, and year
- sample_withloop.R -- by multiple years for one cause and state
- sample_loop_plus_selector.R -- by multiple years with state, cause, & count type selectors
Fork the rice-crc/plotly_visualization_workshop repository on GitHub.
Clone the fork locally. Substitute your GitHub username.
git clone https://github.com/<username>/plotly_visualization_workshop
cd plotly_visualization_workshopBuild the Plotly Docker image.
docker build -t workshop .Use a container to test the default sample.R script.
docker run --rm -p 8050:8050 workshopView running apps by opening a browser window and visiting http://0.0.0.0:8050/.
Stop and remove containers by hitting ctrl-c on the command line.
Use containers to test the additional R scripts.
docker run --rm -p 8050:8050 workshop sample_withloop.R
docker run --rm -p 8050:8050 workshop sample_loop_plus_selector.RCreate a new app in Heroku. Substitute a unique string in the app name.
heroku create --stack container viz-workshop-<unique>Push the code to the Heroku app and deploy.
git push heroku mainAfter making code changes, test the app locally by following the "Local Deployment" section above.
When ready, commit and push the changes to your GitHub fork.
git add .
git commit -m "<description of changes>"
git pushDeploy the new code to your Heroku app.
git push heroku mainRemove the local Docker image.
docker image rm workshopRemove the Heroku app.
heroku apps:destroy viz-workshop-<unique>