Fix for issue #70

This commit is contained in:
knsv
2014-12-23 18:06:07 +01:00
parent 83d9a3269e
commit 385e823c17
5 changed files with 20 additions and 14 deletions

View File

@@ -284,8 +284,10 @@ exports.draw = function (text, id,isDot) {
// Run the renderer. This is what draws the final graph.
render(d3.select("#" + id + " g"), g);
var svgb = document.querySelector('#mermaidChart0');
// Center the graph
svg.attr("height", g.graph().height );
svg.attr("width", g.graph().width );
svg.attr("viewBox", svgb.getBBox().x + ' 0 '+ g.graph().width+' '+ g.graph().height);
};