Skip to content

Commit

Permalink
added in the stuff from previous design experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
dansinker committed Jun 7, 2012
1 parent a142cae commit a7d8be3
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added opennewsmini.fw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opennewsmini.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
268 changes: 268 additions & 0 deletions original_design.html
@@ -0,0 +1,268 @@
<!DOCTYPE html>
<html>
<head>
<title>Source | This is the Tagline - A project by Knight-Mozilla OpenNews</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
margin: 0;
}
#topbar {
position: fixed;
background-color: #e4e4e4;
height: 50px;
width: 100%;
margin-bottom: 50px;
top: 0px;
border-bottom: 1px solid #767676;
-moz-box-shadow: 0px 2px 4px #767676;
-webkit-box-shadow: 0px 2px 4px #767676;
box-shadow: 0px 2px 4px #767676;
}

#topbar #barstuff {
width: 800px;
height: 50px;
margin-right: auto;
margin-left: auto;
}

#topbar img.opennews {
padding-top:2px;
float: right;
}

#topbar img.sourcelogomin {
padding-top: 5px;
display: none;
}


header {
width: 800px;
margin-top: 100px;
margin-bottom: 50px;
margin-right: auto;
margin-left: auto;
}

article {
width: 800px;
margin-right: auto;
margin-left: auto;
font-family: Georgia;
font-size: 1.3em;
line-height: 1.8em;
}

h2 {
font-family: 'Open Sans', Helvetica, sans-serif;
font-weight: 400;
text-align: left;
margin-bottom: 20px;
color: #2e2e2d;
text-transform: uppercase;
font-size: 30px;
}

h3 {
font-family: 'Open Sans', Helvetica, sans-serif;
font-weight: 300;
text-align: left;
margin-bottom: 10px;
color: #2e2e2d;
text-transform: uppercase;
font-size: 24px;

}


h4 {
font-family: Georgia;
font-weight: normal;
font-size: 1.3em;
margin-top: 0px;
margin-bottom: 45px;
line-height: 1.2em;
color: rgba(250,121,7,0.94);
}

aside {
font-family: 'Open Sans', sans-serif;
font-weight: 300;
float: right;
width: 200px;
height: 100%;
padding-left: 30px;
font-size: .8em;
margin-top: 0px;
padding-top: 0px;
line-height: 1.1em;
}

aside #library{
margin-top: 50px;
}

aside #library ul {
list-style-type: square;
padding: 0;
margin-left: 20px;
}

aside #library li {
margin-bottom: 10px;
}

ul#nav {
margin-top: 12px;

margin-right: -12px;
float: right;
font-family: 'Open Sans', sans-serif;
font-weight: 300;
font-size: 16px;
text-transform: uppercase;
width: 300px;
text-shadow: 0px 1px 0px #f3f3f4;
}

#nav li {
margin-top: 15px;
display: inline;
}

#nav li a {
border-right: 1px solid #e4e4e4;
border-left: 1px solid #e4e4e4;
padding-top: 12px;
padding-bottom: 15px;
color: #333333;
text-decoration: none;
padding-right: 10px;
padding-left: 10px;

}

#nav li a:hover {
border-right: 1px solid #eeeeee;
border-left: 1px solid #eeeeee;
background-color: #c2c2c2;
}

img.opennews {
}

.fixed {
position: fixed;
top: 50px;
left: 600px;
}

.gist {
font-size: .7em;
line-height: 1.1em;
}

p.date {
margin-top: 10px;
}

p.byline {
font-weight: 400;
}
p.organization {
font-weight: 400;
margin-top: -10px;
}

footer {
width: 800px;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
}
</style>
</head>
<body>
<div id="topbar">
<div id="barstuff">
<a href="http://www.mozillaopennews.org"><img src="opennewsmini.png" class="opennews"></a>
<img src="sourcemin.png" class="sourcelogomin">
<ul id="nav">
<li><a href="http://www.nytimes.com">Projects</a>
<li><a href="http://www.nytimes.com">Community</a>
<li><a href="http://www.nytimes.com">Code</a>
</ul>
</div>
</div>
<header>
<img src="source_logo.png" class="biglogo">
</header>
<article>
<h2>Untangling a Web of FEC Data</h2>
<h4>The ProPublica News Apps Team explains how they built a 'Tangled Web' of election contribution data</h4>
<aside>
<p class="date">March 23, 2012</p>
<p class="byline">by Al Shaw</p>
<p class="organization">ProPublica</p>
<div id="library">
Code in this piece
<ul>
<li>tootsie roll bear
<li>Carrot cake bonbon donut
<li>gingerbread dessert caramels
</ul>
</div>

</aside>
<p>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.

<p>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.

<h3>Assembling the Data</h3>
<p>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.

<p>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.

<p>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.

<p>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.

<h3>Making the Graphic</h3>

<p>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.

<p>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:

<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/XxGPu/21/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

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

</article>

<footer>
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" /></a><br />
<p>Source is a project of Knight-Mozilla OpenNews.
</footer>
<script type="text/javascript">
$(document).ready(function () {
var top = $('.biglogo').offset().top - parseFloat($('.biglogo').css('margin-top').replace(/auto/, 0));
$(window).scroll(function (event) {
// what the y position of the scroll is
var y = $(this).scrollTop();

// whether that's below the form
if (y >= top) {
// if so, add the fixed class
$('.sourcelogomin').fadeIn('fast');
} else {
// otherwise remove it
$('.sourcelogomin').hide();
}
});
});
</script>
</body>
</html>
Binary file added source_logo.fw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source_mini.fw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source_mini.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sourcemin.fw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sourcemin.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a7d8be3

Please sign in to comment.