score:3

Accepted answer

The problem is, you are appending all nodes and links directly to the svg and not to the g element. Since zoom transformations are applied to the vis (g element), nodes and links will not zoom/pan.

So instead of below code

var link = svgnt.selectAll("line")
        .data(mis1.links)
        .enter()
        .append("svg:line")
        .style("stroke","#ddd");

var node = svgnt.selectAll("circle")
        .data(mis1.nodes)
        .enter()
        .append("svg:circle")
---------------------- 
---------------------- 
----------------------     

try this code.

var link = vis.selectAll("line")
        .data(mis1.links)
        .enter()
        .append("svg:line")
        .style("stroke","#ddd");

var node = vis.selectAll("circle")
        .data(mis1.nodes)
        .enter()
        .append("svg:circle")
---------------------- 
---------------------- 
----------------------  

Related Query

More Query from same tag