This is the code for Chapter 2, Figure 17 from D3.js in Action that creates rectangles with height based on the data bound to the selection. Rectangles are scaled to fit the small drawing area by utilizing d3.scale.linear().
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js