Giter Site home page Giter Site logo

giacomomigliore / ga2020_scrollytellingarticle_youtrend Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 82.57 MB

In this repo is the code to extract, transform, load and visualize the data and the code to design the article

HTML 12.72% JavaScript 58.16% CSS 3.69% Jupyter Notebook 25.44%

ga2020_scrollytellingarticle_youtrend's Introduction

alt text

GA2020_ScrollytellingArticle_YouTrend

Table of contents

General info

This is a scrollytelling article created for YouTrend. The content presents what people need to know before the 2021 Senate Goergia runoffs. The article is entirely created with html and javascript. The data displayed on the maps and charts has been either downloaded manually or scratched with python, it has then been cleant with python and uploaded in a csv file on github, to be finally connected with the webpage.The article was published at this link.

Built with

Project is created with:

Project files

Python

Python has been used to scrap data online and clean them. The resulting .csv files are joined with the geodata (maps) or are used to create d3 visualization.

File name Description
Download_Data_Precinct.ipynb Scrap the precinct level results from each county webpage with selenium
Data_transformation_Precinct.ipynb Clean precinct level data and save them in csv format
Data_transformation_Counties.ipynb Clean county level data and save them in csv format
Data_transformation_Early_voting.ipynb Clean data from vote registers (4 mio records) and save in csv the number of votes casted each day before elecyion day

Javascript

The map, visualizations and article body are created with Javascript and html.

File name Description
Index.html The main file. The body is made up by 3 divs and the javascript code to create the rest of the article
contenuto.js In this file there is the article text and the settings of all chapters (paragraphs)
mapHandling.js In this file the map and its layers are created
senate_viz.js The visualization of the senate before the runoff
barChart.js The barcharts of the two results of the November 3 elections
barChartLegenda.js The barchart that works as a legend for the map comparing results of Biden and Ossoff
finanziamenti.js The amount of dollars spent written in a big, green text
lineChart.js The linechart comparing early votes before November 3, 2020 and January 5, 2021

Prerequisites

  • To run this page locally, you need to create a Mapbox access token by creating an account on Mapbox.com.
  • To run the Python code to download and clean the necessary data, be sure to use the correct full paths when writing or reading files.

Acknowledgments

d3 Visualizations

The following visualization are included in the article:

  • Senate members before Georgia runoff alt text
  • November 3 results
    alt text
  • Legend to map comparing number of votes received by Biden and by Ossoff on November 3 alt text
  • Dollars spent between November 3 and January 5 alt text
  • Comparison between November 3 early votes (dashed line) and January 5 early votes (black line) alt text

Mobile Support

All maps and visualization are responsive. User experience on mobile is comparable with user experience on Desktop. alt text

License

This project is licensed under the GNU GPLv3 License.

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.