I take what I said back. In order to use the function(d) in d3, the data may actually have to be read as a JSON array first.