Reputation: 186
var selectZoom = d3.brush().extent([[0, 0], [WIDTH, HEIGHT]])
.on("brush",brush)
.on("end", brushended);
function brush(){
var selection = d3.event.selection;
console.log(selectZoom.extent()); // this prints function
console.log(d3.extent(selectZoom)); // this prints [undefined,undefined]
}
I am trying to set extent to d3.js v4 brush. I tried two ways to access the extent. But both did not work.
Please help.
Upvotes: 0
Views: 890
Reputation: 186
console.log(selectZoom.extent().call());
Above statement worked for me.
Upvotes: 1