Latest Fundraising in the Democratic VA05 House Race

Latest Fundraising in the Democratic VA05 House Race

Charts with updated FEC filing data for Virginia’s 5th house district Democrats.

Working With FEC Data in R

Working With FEC Data in R

With historic midterms coming up, there’s growing interest in campaign financing. With help from 18F, the FEC has been rolling out a new website and openFEC, an API that makes working with this data programatically a relative breeze!

Try Out COC Charts with the COCLIBRARY R Package

I decided to make an R package to facilitate the reuse of charts I make for the blog and am going to develop it out in the open. Since I’ve settled on a style guide, a custom charting library helps avoid hunting down old scripts and copy pasting code all the time. You are welcome to use it, though be warned it will be entirely unstable as I settle on what options to make available and it comes as is.

Intermediate Responsive Chart Method Using D3

Intermediate Responsive Chart Method Using D3

If you haven’t already read it, a better place to start might be the basic introduction to my responsive D3 code organization strategy. That one covers only how to code a responsive x-axis and introduces the “calc”, “update”, “draw”, and “resize” functions that I use to keep things straight in D3. This post extends that to a full chart and introduces a “load” function for bringing in data from a csv file.

Basic Responsive Chart Method Using D3

Basic Responsive Chart Method Using D3

Coming up with contingency plans for different display dimensions in D3 can get ugly. My recent charts all adjust for screen size, but they also have to handle different modes and view options as selected by users. I’ve quickly realized the advantages of using well-planned functions for almost everything including establishing scales, adding elements to the DOM, and modifying elements of the DOM.