This is the code for Chapter 6, Figure 4 from D3.js in Action showing how to create a simple adjacency matrix from node and edge list formatted data.