this is a great tutorial on d3 scales and how domain and range works: http://alignedleft.com/tutorials/d3/scales