From 16252256a59ff3c318a384202e2a00a9601ec45e Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Tue, 12 May 2015 13:06:51 -0400 Subject: Make posts page show only an excerpt, correct datetime --- ...015-03-29-visualizing-congress-with-d3.markdown | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to '_posts/2015-03-29-visualizing-congress-with-d3.markdown') diff --git a/_posts/2015-03-29-visualizing-congress-with-d3.markdown b/_posts/2015-03-29-visualizing-congress-with-d3.markdown index efde0b0..e27377d 100644 --- a/_posts/2015-03-29-visualizing-congress-with-d3.markdown +++ b/_posts/2015-03-29-visualizing-congress-with-d3.markdown @@ -6,22 +6,26 @@ category: writing date: 2015-03-29 00:00:00 --- - +
+ +
I've been wanting to learn [D3.js](http://d3js.org/) for a while now, so I decided to create some visualizations of the United States Congress, inspired by Neil deGrasse Tyson:
- -
-
+ What profession do all of these senators and congressmen have? + Law, law, law, law, business man, law, law, law...
+ Where are the scientists? Where are the engineers? Where's the rest of... life?
+ + It wasn't hard to find some [open-source Congress data](https://github.com/unitedstates/congress-legislators), and converting the [YAML](https://github.com/unitedstates/congress-legislators/blob/master/legislators-current.yaml) to [JSON](/assets/data/legislators-current.json) was [practically a one-liner in Ruby](https://gist.github.com/benburwell/20e76f70645c8003b088#file-yaml-to-json-rb). Armed with my trusty JSON data, I set off to learn the basics of D3. Conveniently, D3 packages some of the base functionality that we often turn to jQuery for, eliminating the need to include yet another library. Using CSS selectors to query the DOM, adding nodes and attributes, and fetching JSON data are just a few such functions. -- cgit v1.2.3