Journalism in the Public Interest


The ProPublica Nerd Blog

Untangling a Web of FEC Data


Our Tangled Web graphic shows the 200 biggest recipients of expenditure money from the five major presidential campaigns (Gingrich, Obama, Paul, Romney and Santorum), as well as from major super PACs, from around the middle of 2011 through February, 2012.

Campaign finance reporters Kim Barker and Justin Elliott dug into the top 200 recipients and assembled detailed descriptions most of them. Some of the companies receiving money from campaigns and committees incorporated shortly before this election cycle and are described here in detail for the first time. The graphic also shows examples of campaigns and super PACs sharing consultants, which as the New York Times detailed last month can raise questions about improper coordination.

Assembling the Data

To assemble the data, we used the New York Times’ Campaign Finance API to grab ID numbers for FEC filings. From there, we grabbed the filings thesmelves by passing each of the filing IDs to FECh, a handy Ruby gem also written by the Times. Then we filtered out ones marked as amendments or as quarterly, year-end or monthly aggregations.

Using Google Refine, a tool for cleaning messy data, we clustered recipient organization names and merged ones that differed slightly; for example, we merged together payments marked “Google” and “Google Inc.” We then selected the top 200 recipients across all of the committees and campaigns we are tracking.

We also needed to filter out line items that contained a back_reference_tran_id_number which are simply the itemization details of another expenditure we’ve already counted, like credit card payments.

This is obviously very complicated stuff and we did have a hiccup: the first version of the graphic, which was live on our site for a few minutes, didn’t filter out some filings that were superceded by amendments. We also hadn’t taken out backreferenced transactions. Because of that, our numbers were much larger than they should have been. To get it right, we ended up running every step of our methodology by the FEC.

Making the Graphic

The graphic itself is called a Sankey diagram. They’re designed to show both flow direction and rate. The most famous Sankey diagram is probably Minard’s map of Napoleon’s 1812 Russia campaign, one of visualization expert Edward Tufte’s favorite graphics.

To make the diagram, we wrote scripts to output the top 200 recipients, as well as the campaigns and committees into a huge JSON hash. Using jQuery, we created divs on each side of the graph with heights proportional to each committee’s share of all the money that went to a given payee. To create the flow lines, we used Raphael.js, a library that makes it easy to draw vector graphics on web pages. In Raphael, we drew lines with the thickness of each committee-payee div connecting them by their ids. To create the nice quadratic bezier curve, we used a little code from Tom Counsell’s Sankey library. Basically, instead of drawing lines directly from one side to the other, we curved them by a specific ratio to give it the snake-like look typical of the Sankey diagram. Here’s how that looks and works:

Special thanks to Derek Willis at the Times and Paul Clark at the FEC for helping us interpret the filing data.

Your graph shows great promise.  Clearly understand the premise, but I am not making much sense of it for computer/technical reasons.  Recognized it immediately as a Sankey and thought of Napoleon but in this case I can see either the left or right side of the equasion on my monitor but not the two at the same time.  Also, I don’t seem to be able to scale it down to show the whole thing (both sides) on my monitor.  The content, however, is terribly important and will answer many questions for an educated audience that seeks to determine stock and flow on political funding matters.  It is a jewel.  Do whatever you have to to refine and rescale this graph and keep it updated.

One of the highly important article is this one but I can only see a part of it. I am traveling outside of North-America and the relying on mobile Internet device. I’m wondering why there is no data, no graph, no detailed information the article must have in it.
The way American politics was being done up until now, there is not much difference what is going on in the development countries and the Third world.
In Bangladesh, local and international businessmen with billions of dollars run the game of election and puppet heads of the government.
Those super idiot, money hungry group of politicians and businessmen decide the financial future of Bangladeshi hard-working people, not the public of Bangladesh.

There is not much difference between Bangladesh and USA in terms of election process for the next government.
It is now possible, instead of going to the polling station, voters can cast their votes without costing any money almost by using hand-held cell phone devices.
Note: Even the poorest hard-working guy in the world can afford a cell phone these days.

This is a great visualization! I was looking through the list of top recipients across the political spectrum and I was surprised to see American Express up there. Any insight into why that company would be in a list mostly dominated by marketers and publicists?

re. AMEX: looks like transaction fees?

Fabulous integration; kudos.

Let’s help them in thorough overhauling!

Commenting is not available in this section entry.