base example from http://bost.ocks.org/mike/bar/3/