Giter Club home page Giter Club logo

plotly_visualization_workshop's Introduction

Dockerized Covid Dash in R

Table of Contents

Getting Started

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.

Data and Apps

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

Requirements

Fork and Clone the Project

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_workshop

Return to Top

Local Deployment

Build the Plotly Docker image.

docker build -t workshop .

Use a container to test the default sample.R script.

docker run --rm -p 8050:8050 workshop

View 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.R

Return to Top

Remote Deployment

Create 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 main

Return to Top

Making Code Changes

After 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 push

Deploy the new code to your Heroku app.

git push heroku main

Return to Top

Cleanup

Remove the local Docker image.

docker image rm workshop

Remove the Heroku app.

heroku apps:destroy viz-workshop-<unique>

Return to Top

plotly_visualization_workshop's People

Contributors

derekjkeller avatar johnmulligan avatar nsapoval avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.