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]
}
我正在尝试将范围设置为d3.js v4画笔。我尝试了两种方法来访问范围。但两者都不起作用。
请帮忙。
最佳答案
console.log(selectZoom.extent().call());
以上声明对我有用。
关于javascript - d3 v4 范围返回未定义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46451021/