This is the code for Chapter 5, Figure 30 from D3.js in Action used to create a word cloud with semantically meaningfully word color and rotation using d3.layout.cloud() (a layout created by Jason Davies that does not come in core D3).