Visualizing Swiss politicians on Twitter using D3.js
I’ve recently been playing with D3.js, mainly for my side-project, SoMePolis, which investigates social media usage by Swiss MPs.
Our first infographic (German, but English-speakers should still be fine looking at it; find the French version here) details the membership of tweeting MPs to a range of classes in the dimensions “political party”, “sex”, “chamber”, “status in parliament”, “age” and “year of account creation”.
The visualization, called Par(allel)Sets, thus allows you to explore a six-dimensional attribute space with relative ease. All the dimensions can be (vertically) re-ordered using drag-and-drop.
Similarly, the classes on each dimension can be (horizontally) re-ordered using either drag-and-drop, alphabetic sorting or sorting according to class size (in terms of number of politicians in each class). The latter two support ascending and descending sorting.
Distilling insight from the graphic is facilitated by informative captions that show when you hover over a class or a portion of the coloured bands.
The adaptation of the D3.js code was actually not as much work as making the graphic in an iframe work seamlessly within our WordPress template and compiling a concise introduction video using in-browser screencasting tool Screenr (thumbs up!) and YouTube annotations (thumbs down).