score:1

Accepted answer

d3.json is used to load data from url not an object present in the page. So if you have an object already in the page just pass it to the required function.

Example

function draw(nationsObj){
    // A bisector since many nation's data is sparsely-defined.
       var bisect = d3.bisector(function(d) { return d[0]; });

        .....contents
} 

draw(nations); 

Related Query

More Query from same tag