d3 zoom not working as in example
<p>I am trying to get a zoom functionality to work with my d3 network (as per <a href="http://bl.ocks.org/mbostock/6123708" rel="noreferrer">here</a>), but am not replicating the behaviour. I first create the zoom variable:</p>

<pre><code> var zoom = d3.behavior.zoom()
.scaleExtent([1, 10])
.on("zoom", zoomed);
</code></pre>

<p>Then I create the svg:</p>

<pre><code> var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.right + ")")
.call(zoom);
</code></pre>

<p>Then finally the function itself:</p>

<pre><code>function zoomed() {
  container.attr("transform", "translate(" + d3.event.translate + ")scale("     + d3.event.scale + ")");
 }
</code></pre>

<p>However, the network does not allow me to zoom, either by clicking on a node, or from zooming. I attach the full <a href="https://www.dropbox.com/s/lbsjfycomdiuod2/test.html?dl=0" rel="noreferrer">file</a> if this is needed also.</p>

<p>Does anyone know why I am not getting this behaviour?</p>

<p>Best,</p>

<p>Ben</p>