Code Monkey home page Code Monkey logo

practical-js-data-viz's Introduction

##Practical data viz in JavaScript

Let's make an interactive bar chart using JavaScript

####First things first

  • Highcharts (lots of parameters to make minor changes)
  • Google Charts (robust but constantly changing)
  • D3 (steep learning curve)

So why JavaScript? Actually, it’s jQuery, a JavaScript library with simpler syntax and less code than plain ol' JavaScript

Hosted jQuery: http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js

jQuery

$(‘body’) .css (‘background’, ‘red’); 

JavaScript

Function changeBackground(color) {
}
Document.body.style.background = color;
}
Onload = "changeBackground('red');"

####Let's get crackin'

A pollster administered an online survey and collected 19,999 sets of responses to eight questions. Participants were assigned to one of seven groups and could answer 1, 2, or 0 (No Response) to each question. 

The goal: Design a chart to allow readers to compare all groups’ responses of 1 or 2 to all eight questions

The finished product

First taught at NICAR 2016, Denver by Dana Amihere

practical-js-data-viz's People

Contributors

write-this-way avatar

Stargazers

 avatar Arielle Martinez avatar Ricardo Alanis avatar Haoyun avatar Malik Singleton avatar Jin Wu avatar Tom Meagher avatar Madi Alexander avatar Aaron Weiss avatar

Watchers

James Cloos avatar  avatar Penelope Eaton  avatar

Forkers

mapuchila

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.