title: two dimensions brush in d3 v4
body: <p>I have a problem with converting d3 v3 to d3 v4</p>
  
  <p>I have this code :</p>
  
  <pre><code>  var brush = d3.svg.brush()
        .x(x)
        .y(y)
        .on("brushstart", brushstart)
        .on("brush", brushmove)
        .on("brushend", brushend);
  </code></pre>
  
  <p>but I don't know how to write it in v4</p>
  
  <p>I tried</p>
  
  <pre><code> var brush = d3.brush()
        .brushX(x)
        .brushY(y)
        .on("brushstart", brushstart)
        .on("brush", brushmove)
        .on("brushend", brushend); 
  </code></pre>
  
  <p>but it doesn't work
  <a href="https://i.stack.imgur.com/mpEYJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mpEYJ.png" alt="enter image description here"></a></p>
  
  <p>NB: Im using the package npm:  "d3-brush": "^1.0.4",</p>