It’s that time of year when we’re inundated by campaign ads not only for major offices but also for state propositions and measures. Here in California there are 17 propositions on the November ballot. On Friday, October 14 the Sacramento Bee ran a data tracker article showing the top donors for and against these propositions. I really appreciate the research and analysis that went into that piece, but as I was analyzing it myself it occurred to me that this would be another well-suited application of a Sankey diagram. These diagrams are typically used to show flow like the Sacramento City Budget flow I created last year. What’s more, with simple datasets like those in the SacBee article, it’s very easy to create one of these with an online tool I talk about later. Here’s an example, that shows the flow of donor money for Proposition 56 that would increase the state tax on tobacco products by $2.
California Proposition 56 Donation Flow
(Hover your mouse over the vertical bars for a few seconds and you’ll get a tooltip showing the $ amounts.)
Looking at this visual representation of donor flow it’s very striking to see the differences in donations for an against a particular proposition.
Here’s another, this one on Proposition 61 which would impose price controls on state drug purchases.
California Proposition 61 Donation Flow
To make it even more interesting you could combine several or all of the propositions into a single flow diagram to visually compare the amounts being donated for each proposition. Here’s an example with just four of the ballot measures together.
California Propositions 56, 61, 63, 64 Donations Flow
How to easily create a donor flow diagram
As I mentioned earlier, it’s actually pretty easy to create all of these flow diagrams with an online tool once you have the data. The first trick is to get your data into a spreadsheet in the right format. Here’s an example of my spreadsheet data for the first flow diagram.
And here’s an example using the data for the four propositions combined.
Once you have the data in a spreadsheet like this, then it’s time to turn to an online tool to easily create the diagram. My online tool of choice for creating quick and easy Sankey diagrams is RAW from Density Design. Just select your data in your spreadsheet, copy, then go to the the RAW website and paste in your data. Once you’ve pasted in your data, RAW lets you select one of several diagrams to create. The default is called an Alluvial Diagram which is just another name for a Sankey Diagram.
Next, scroll down the page to Map Your Dimensions and drag green tabs representing each column name of the data into the corresponding wells as shown in the screen shot below.
Next, customize the width and height of your diagram. You can also do some customization of node width, sort by, and color scale. Once you have it the way you like, scroll down a little further and choose how you’d like to download the diagram. The simplest way to download it to just download the image as a .png file. If you’d like to make more modifications than RAW allows to you can download the SVG file and open that with Adobe Illustrator and edit to your heart’s content. If you’d like the semi-interactive version like what I have in this article you can copy the embed code and paste it into an html file. Here’s a tip though, if you have a WordPress site and just paste that embed code into the text version of your WordPress editor you’ll lose it if you then to go the visual editor in WordPress. A workaround that I’ve used here is to just paste the embed code into its own html file, upload that, then embed an iFrame of the html file into your WordPress post.