Can't seem to find the answer to this question.
Does d3.js need the data to be in a particular format. For example:
var dataset = {
"people": [
{
"name": "person1",
"projects": [
{
"name": "project1"
},
{
"name": "project3"
}
]
},
{
"name": "person2",
"projects": [
{
"name": "project1"
},
{
"name": "project2"
}
]
}
]
};
And then using this:
d3.select('body')
.selectAll('p')
.data(dataset)
.enter()
.append('p')
.text(function(d){
return d;
});
Will not return anything.
Hope someone can help.
The docs and other tutorials all say you can use the above but always use the array as an example/demo.