how to know the current Zoom level in D3.js

后端 未结 3 1035
独厮守ぢ
独厮守ぢ 2021-01-04 07:40

I have a problem since a few days. I have a graph and when I use Zoom Behavior it works, but I need to know when I reach maximum zoom to load new given

// Sp         


        
3条回答
  •  孤街浪徒
    2021-01-04 07:59

    As of D3 v4 there are two documented ways of retrieving the zoom state. To quote d3/d3-zoom README (under Zoom Transforms):

    To retrieve the zoom state, use event.transform on a current zoom event within a zoom event listener (see zoom.on), or use d3.zoomTransform for a given node.

    https://github.com/d3/d3-zoom/blob/master/README.md#zoom-transforms

提交回复
热议问题