title: d3 zoom and pan upgrade to version 4
body: <p>Help would be appreciated updating the code below to work in version 4.  I have changed zoom.behaviour to d3.zoom but I'm not clear about the other changes that are needed.  It looks more complicated than v3!</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
     &lt;!-- &lt;script type="text/javascript" src="http://d3js.org/d3.v3.js"&gt;&lt;/script&gt;--&gt;
  
     &lt;script data-require="d3@4.0.0" data-semver="4.0.0" src="https://d3js.org/d3.v4.min.js"&gt;&lt;/script&gt;
  
      &lt;style type="text/css"&gt;
        body, html {
          width: 100%;
          height: 100%;
          margin: 0;
        }
        svg {
          position: absolute;
          top: 0;
          left: 0;
        }
        p {
          text-align: center;
        }
      &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;p&gt;Use the mouse to pan (click and move) / zoom (scrollwheel)&lt;/p&gt;
    &lt;/body&gt;
    &lt;script type="text/javascript"&gt;
        var svg = d3.select("body")
          .append("svg")
          .attr("width", "100%")
          .attr("height", "100%")
          .call(d3.zoom().on("zoom", function () {
              svg.attr("transform", "translate(" + d3.event.translate + ")" + " scale(" + d3.event.scale + ")")
          }))
          .append("g")
  
        svg.append("circle")
          .attr("cx", document.body.clientWidth / 2)
          .attr("cy", document.body.clientHeight / 2)
          .attr("r", 50)
          .style("fill", "#B8DEE6")
    &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>