How do I specify the initial zoom level in D3?

前端 未结 3 2032
臣服心动
臣服心动 2021-01-04 09:57

I have written a script to graphically display some row-oriented data, with bars, labels and connections between rows. As the dataset has grown, the resulting SVG element ha

3条回答
  •  囚心锁ツ
    2021-01-04 10:25

    As of D3 2.8.0, the new d3.behavior.zoom allows you to set the current scale, e.g.

    d3.behavior.zoom()
        .scale(currentScale);
    

提交回复
热议问题