You can't read a file without specifying a correct path to your file system or to an external resource.

That means that you have to swap this line:

d3.json("/data/", function(error, graph) {

With something like:

d3.json("./data.json", function(error, graph) {


d3.json("", function(error, graph) {

Also, make sure you are running a local server on your machine otherwise that call will fail.

Related Query