This is the code for Chapter 5, Figure 12 from D3.js in Action which creates a circle pack diagram using d3.layout.pack() where the leaf nodes have different sizes based on the .value() function of the layout.
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js