未验证 提交 d435cb1f 编写于 作者: D daminglu 提交者: GitHub

Make SVG viewBox adaptive to the actual model (#350)

上级 f9de540b
...@@ -120,6 +120,10 @@ ...@@ -120,6 +120,10 @@
} }
render(d3.select("svg g"), g); render(d3.select("svg g"), g);
// adjust viewBox so that the whole graph can be shown, with scroll bar
d3.select("svg")
.attr('viewBox', '0 0 ' + g.graph().width + ' ' + g.graph().height);
}); });
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册