title: D3 - tree nodes not built from external JSON file
body: <p>I'm having difficulty processing external JSON data to build/dispaly a tree. The issue is that nodes are not built from received JSON file. The code only looks as at the JSON data as one object and does not create leafs(other nodes)</p>
  
  <p>When adding the same JSON data as array inside HTML file, the same code creates nodes and displays the tree correctly.</p>
  
  <p>Here is an  extract of the code in question:</p>
  
  <pre><code>&lt;body onload="myFunction()"&gt;
  
      &lt;script type="text/javascript" &gt;
          function myFunction()
          {
              d3.json("/data/mydata.json", function (error, data) {
              var root2 = [data];
              root = root2[0];
             ........... other stuff comes here .....
            var nodes = tree.nodes(root.reverse());
  </code></pre>
  
  <p>The browser debugger gives me the following:</p>
  
  <pre><code>nodes
  </code></pre>
  
  <p>[Array[1]0: Object 
  childern: Array[2]
  name: "Max"
  parent: "null"
  <strong>proto</strong>: Object
  depth: 0
  length: 1
  x: 230
  y: 0
  <strong>proto</strong>: Array[0]</p>
  
  <p>JOSN file is at the bottom</p>
  
  <h1>I appreciate your feedback in this regard.</h1>
  
  <pre><code>[{
      "name": "Max",
      "parent": "null",
      "size": 4938,
      "childern": [
          {
              "name": "David",
              "parent": "Max",
              "Childern": [
                  {
                      "name": "Craig",
                      "parent": "David",
                      "size": 3938
                  },
                  {
                      "name": "Robin",
                      "parent": "David",
                      "size": 3812
                  },
                  {
                      "name": "Anna",
                      "parent": "David",
                      "size": 743
                  }
              ]
          },
          {
              "name": "Peter",
              "parent": "Max",
              "Childern": [
                  {
                      "name": "Jeff",
                      "parent": "Peter",
                      "size": 3534
                  },
                  {
                      "name": "Buffy",
                      "parent": "Peter",
                      "size": 5731
                  }
              ]
          }
      ]
  
  }
  </code></pre>
  
  <p>]</p>