Bret Victor is a genius. His recent CUSEC 2012 talk, Inventing on Principle, is one of the best talks I've ever seen. If you watch only one talk this year, make sure it's this one.

I was blown away by his 'live coding' idea, but couldn't find any actual live examples, so I put together a quick demo using d3 and Ace. I 100% totally based it on Bret's idea - down to the clever book styling. Imitation is the sincerest... etc etc.

The default code is Mike Bostock's beautiful chord diagram, tweaked to fit the Twilight theme. And remember, click the pulsing red numbers and hold down the alt key!

I put together a more polished version of my previous work on mapping poverty by county, adding a bit more interactivity including a sparkline showing historical poverty rate change. The continuous scale does a great job of highlighting spatial patterns.

Data classification is a critical component of choropleths. The number of classes and our choice of classification system can turn the same data into seemingly different maps. I'll illustrate with a number of examples - of maps, of course. We'll look at total percentage of people living in poverty by county (data courtesy of the U.S. Census Bureau).

Let's start with equal intervals. In this classification system, the entire range of values is divided equally into the desired number of intervals.

Now let's switch to quantiles. Here, each class is of equal size - each class has the same number of values.

4 quantiles (also known as quartiles):

Finally we'll look at k-means clusters. This classification system creates classes of values such that the sum of the squared distance from each value to the center of its respective class is minimized.

If you're still reading, my apologies if you've had enough blue maps for a day. Now, which one do you prefer? Remember, they all show the same data - the only change is the way the data is broken up into classes. I chose equal intervals, quantiles and k-means clustering because they're fairly popular classification systems amongst cartographers.

I have one more map to show you:

There is no grouping of values here. Instead, a continuous input domain (the data points, ranging from 0% to 62%) is mapped to a continuous output range (in this case, a color map of bluish hue). This is also equivalent to choosing equal intervals and increasing the number of classes to infinity.

I prefer this type of classification system *for this particular data set* - we have many data points (3,143 counties), most of them exhibiting regular spatial patterns. However, if you have a small number of data points, need a print-friendly map, or are concerned about accessibility, you're probably better off choosing a map with fewer number of classes, ideally between 4 and 7.