score:3

Accepted answer

solution:

1.you can assign the json data to variable name then you can build the tree layout

2.use one function to get the json data

fiddle for 1 solution

fiddle for 2 solution

    var root = getdata(),
    nodes = cluster.nodes(root),
    links = cluster.links(nodes);

Related Query