This is the code for Chapter 6, Figure 8 from D3.js in Action showing how to create a force-directed network using d3.layout.force() as well as SVG markers for arrowheads.