Better margin calclulation when there are several diagrams on one page.

This commit is contained in:
knsv 2015-01-25 16:39:34 +01:00
parent a38a156d3b
commit 910b90b79c
7 changed files with 9 additions and 8 deletions

View File

@ -23395,7 +23395,7 @@ exports.draw = function (text, id,isDot) {
// Run the renderer. This is what draws the final graph. // Run the renderer. This is what draws the final graph.
render(d3.select("#" + id + " g"), g); render(d3.select("#" + id + " g"), g);
var svgb = document.querySelector('#mermaidChart0'); var svgb = document.querySelector("#" + id);
/* /*
var xPos = document.querySelectorAll('.clusters rect')[0].x.baseVal.value; var xPos = document.querySelectorAll('.clusters rect')[0].x.baseVal.value;
@ -23439,7 +23439,7 @@ exports.draw = function (text, id,isDot) {
} }
i = i + 1; i = i + 1;
}); });
},200); },20);
}; };

File diff suppressed because one or more lines are too long

View File

@ -23363,7 +23363,7 @@ exports.draw = function (text, id,isDot) {
// Run the renderer. This is what draws the final graph. // Run the renderer. This is what draws the final graph.
render(d3.select("#" + id + " g"), g); render(d3.select("#" + id + " g"), g);
var svgb = document.querySelector('#mermaidChart0'); var svgb = document.querySelector("#" + id);
/* /*
var xPos = document.querySelectorAll('.clusters rect')[0].x.baseVal.value; var xPos = document.querySelectorAll('.clusters rect')[0].x.baseVal.value;
@ -23407,7 +23407,7 @@ exports.draw = function (text, id,isDot) {
} }
i = i + 1; i = i + 1;
}); });
},200); },20);
}; };

File diff suppressed because one or more lines are too long

1
test/sconf.json Normal file
View File

@ -0,0 +1 @@
{"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":165,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35}

View File

@ -9,7 +9,7 @@
var mermaid_config = { var mermaid_config = {
startOnLoad:true startOnLoad:true
} }
mermaid.sequenceConfig = '{"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":45,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35, "mirrorActors":true}'; //mermaid.sequenceConfig = '{"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":45,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35, "mirrorActors":false}';
//mermaid.sequenceConfig = JSON.parse('{"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":165,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35}'); //mermaid.sequenceConfig = JSON.parse('{"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":165,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35}');
</script> </script>

View File

@ -82,7 +82,7 @@
c1-->a2 c1-->a2
</div> </div>
<div class="mermaid2">graph TB <div class="mermaid">graph TB
subgraph subgraph
sq[Square shape] -.-> ci((Circle shape)) sq[Square shape] -.-> ci((Circle shape))
od>Odd shape]-. Two line<br>edge comment .-> ro od>Odd shape]-. Two line<br>edge comment .-> ro