That is because my friend, the example you've posted uses d3.v2
whereas in your fiddle you are using d3.v3
.
Here's the updated fiddle with working example using d3.v2
.
In case you are interested: Implementation of the layout
function is different in v2
and v3
. And, since you were using v3
, the children elements of the json objects were not getting parsed and only the top level children were being rendered.
Also, since the data has been hard-coded within the file, this should now also work when you directly open it in chrome via file://
protocol.