My force layout graph is construct by d3.js. I want add zoom and pan to my force graph. I have access to relevant information,and the zoom and pan works.But it bring new problem when I try to drag the node to somewhere only make the whole graph panning,the before node drag function is does not works. The approach I taken is Here
I find the key point is the
.call(d3.behavior.zoom().on("zoom", redraw))
.append('svg:g');
but when I delete .append('svg:g');
the zoom and pan not working again. So how can I keep these functions(zoom and pan,node drag) at the same time.
I need the effort like this jsFiddle,I follow this method to my own project but it does not works,I don't konw if I missing something.