I am trying out d3 as a tool for representing biological data.
I am trying to open the following example in my chrome browser so that I can understand how it works
In order to get it to work I had to replace the line
d3.json("flare.json", function(error, root) {
with
d3.json("flare.json", function(root) {
I used my intuition here and I still do not understand how it worked on the example website and not mine, or what the true significance of my change in the code is. If you know how to answer this in a more in-depth fashion, please contribute and I will accept your answer.
It's because the returned json object is received by the first parameter of the function. It might because of the versions of d3.
<script>
function liveProject() {
var a=200;
this. x=600;
this. y=300;
this. z= function () {
return this.x+this.y;
}
}
var lp=new liveProject();
document.write(lp.z());
</script>
Had the same exact error. The solution is pretty simple: You are not providing a JSON object array. You said your JSON begun as follows:
{ "name": "flare", "children": [ ...
Please change so change is begins as follows:
[{ "name": "flare", "children": [ ...}]
That way D3 will be able to locate the "first child
"
The code is from d3.v3 but it's pointing to d3.v2, which does not use the error call in the d3.json function.