2017-09-27 10 views
0
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ブラシに設定しようとしています。私はその範囲にアクセスする2つの方法を試みました。しかし、どちらもうまくいきませんでした。d3 v4エクステントは未定義を返しますか?

助けてください。

答えて

1
console.log(selectZoom.extent().call()); 

上記の声明は私に役立ちました。

関連する問題