I am trying to follow the various instructions (e.g. How to convert to D3's JSON format?) to create a collapsible tree with D3.js.
Here is what I have done so far: http://jsfiddle.net/L3phF/6/
I have a problem when using nest()
as console.log(nest)
shows me only an empty object, but I cannot find the error.
var raw = d3.select("#csvdata").text();
var parsed = d3.csv.parse(raw);
// d3.select("#parsed").text(raw);
// d3.select("#parsed").text(JSON.stringify(parsed));
var data = JSON.stringify(parsed);
var nest = d3.nest()
.key(function(d) { return d.subgroup; })
.key(function(d) { return d.division; })
.key(function(d) { return d.product; })
.entries(data);
console.log(nest);
I appreciate any help!