middle of this page http://alignedleft.com/tutorials/d3/scales