GithubHelp home page GithubHelp logo

earthlinginteractive / election-vr Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 16.04 MB

A WebVR data visualization of the popular vote for US president

Home Page: https://electionvr.earthlinglabs.com/

License: MIT License

JavaScript 73.66% HTML 13.67% Shell 11.17% sed 0.71% Dockerfile 0.80%
webvr data-visualization election-results aframe

election-vr's Introduction

ElectionVR: Mapping the popular vote for US President in VR

ElectionVR is an experiment in using virtual reality to give people a more intuitive and nuanced view of election data. It allows you to walk around a map of the United States and explore the data for the last four presidential elections, showing the number and percentage of votes that each of the major candidates received in each state. You’ll be able to see that in 2016 more 1 million people in the democratic stronghold of Massachusetts voted for Donald Trump and that almost 4 million people in Texas voted for Hillary Clinton, a state which no Democrat has won since 1976. You’ll also see the surprisingly strong showing of third-party candidates, such as Gary Johnson and Evan McMullin, especially as compared to previous elections.

To explore these stories and more, go to: https://electionvr.earthlinglabs.com/

Election VR

The visualization is built in WebVR so it can be viewed using the HTC Vive, Oculus Rift, Google Cardboard, or a Desktop browser. The Vive and the Rift support controller-based interactions to move and scale the map.

About the data

The data subdirectory contains the source data files used in the visualization.

The election data were downloaded from the Federal Election Commission website and processed using the data/build-election-data-files.sh script.

The map data were downloaded from census.gov and processed using the data/build-map-files.sh script.

The FIPS code to state data is also from census.gov: http://www2.census.gov/geo/docs/reference/state.txt

These scripts provide a reproducible way to download and process the data files into the versions in src/assets that are used directly in the visualization. Note that the scripts must be run from within the data subdirectory. They also require several globally installed npm packages. See the header of each file for details.

Finally, per the instructions on census.gov, I must state that "This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau."

Developing

Pre-requisites

Running the project locally

When making changes to this project, it's easiest to run it locally using the webpack dev server:

npm install
npm start

Releasing

This project follows a Git Flow style convention with changes being merged from a feature branch through to the master branch.

[feature branch] --> test --> stage --> master

The stage and master branches use Docker and the Earthling deployment pipeline V2. You can test the Docker deploy locally by running:

docker-compose up --build

and then navigating to http://localhost:8080/

Deployment is handled by GitLab CI/CD. To deploy, you'll need an EI Platform GitLab account with access and then set up a remote:

git remote add gitlab ssh://[email protected]:2222/EarthlingInteractive/APP/election-vr.git

Test environment

The test branch gets deployed to GitHub pages: https://earthlinginteractive.github.io/election-vr/

To release new changes:

npm run deploy

Stage environment

The stage branch gets deployed to https://electionvr.ei-app.com/

To release new changes, merge them into the stage branch, push to GitHub, and then push to GitLab:

git push origin stage
git push gitlab stage

Production environment

The master (production) branch gets deployed to https://electionvr.earthlinglabs.com/

To release new changes, merge them into the master branch, push to GitHub, and then push to GitLab:

git push origin master
git push gitlab master

Thanks

  • To John Samuelson, Adam Simcock, Don Smith, Jared Chapiewsky, AJ Wortley, Linda Brudz, and Jake Brudz for their feedback, testing, and support
  • To Earthling Interactive for their sponsorship
  • To Kevin Ngo, Diego Marcos, Don McCurdy and many others at Mozilla and the community for creating the A-Frame WebVR framework
  • To Matthias Treitler for his aframe-geojson-component which provided inspiration and a starting point for how to display maps in VR
  • To Will Murphy for his super hands component which provides progressive support and gestures for different types of controllers
  • To Mike Bostock for creating d3.js and for his excellent series of articles on command line cartography

Credits

Created by Steve Brudz with support and sponsorship from Earthling Interactive

Earthling Interactive

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.