Cleanup of sequence diagram rendering code (still experimental)

Better handling of width. Instead uf using width 100% the width is set to the width of the graph. Should help issue #19.
This commit is contained in:
knsv
2014-12-05 10:19:07 +01:00
parent 8949166a17
commit 2b9e464798
7 changed files with 299 additions and 239 deletions

View File

@@ -267,7 +267,8 @@ var draw = function (text, id,isDot) {
// Center the graph
var xCenterOffset = (svg.attr("width") - g.graph().width) / 2;
//svgGroup.attr("transform", "translate(" + xCenterOffset + ", 20)");
svg.attr("height", g.graph().height + 40);
svg.attr("height", g.graph().height );
svg.attr("width", g.graph().width );
};
/**
@@ -295,7 +296,7 @@ var init = function () {
txt = txt.replace(/</g,'&lt;');
txt = he.decode(txt).trim();
element.innerHTML = '<svg id="' + id + '" width="100%">' +
element.innerHTML = '<svg id="' + id + '">' +
'<g />' +
'</svg>';