Wednesday, 12 April 2017

two dimensions brush in d3 v4

I have a problem with converting d3 v3 to d3 v4

I have this code :

  var brush = d3.svg.brush()
      .x(x)
      .y(y)
      .on("brushstart", brushstart)
      .on("brush", brushmove)
      .on("brushend", brushend);

but I don't know how to write it in v4

I tried

 var brush = d3.brush()
      .brushX(x)
      .brushY(y)
      .on("brushstart", brushstart)
      .on("brush", brushmove)
      .on("brushend", brushend); 

but it doesn't work enter image description here

NB: Im using the package npm: "d3-brush": "^1.0.4",



via MrGildarts

No comments:

Post a Comment