mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
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:
@@ -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,'<');
|
||||
txt = he.decode(txt).trim();
|
||||
|
||||
element.innerHTML = '<svg id="' + id + '" width="100%">' +
|
||||
element.innerHTML = '<svg id="' + id + '">' +
|
||||
'<g />' +
|
||||
'</svg>';
|
||||
|
||||
|
Reference in New Issue
Block a user