mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
Fix for padding issue and some cleanup
This commit is contained in:
@@ -22,16 +22,16 @@
|
||||
<body>
|
||||
<h1>info below</h1>
|
||||
<div class="flex">
|
||||
<div class="mermaid2" style="width: 50%; height: 20%;">
|
||||
<div class="mermaid" style="width: 50%; height: 20%;">
|
||||
flowchart BT
|
||||
subgraph two
|
||||
b1
|
||||
subgraph S1
|
||||
sub1 -->sub2
|
||||
end
|
||||
subgraph three
|
||||
c1-->c2
|
||||
subgraph S2
|
||||
sub4
|
||||
end
|
||||
c1 --apa apa apa--> b1
|
||||
two --> c2
|
||||
S1 --> S2
|
||||
sub1 --> sub4
|
||||
</div>
|
||||
<div class="mermaid2" style="width: 50%; height: 200px;">
|
||||
sequenceDiagram
|
||||
@@ -163,7 +163,7 @@ _one --> b
|
||||
// arrowMarkerAbsolute: true,
|
||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||
logLevel: 0,
|
||||
flowchart: { curve: 'cardinal', htmlLabels: true },
|
||||
flowchart: { curve: 'cardinal', htmlLabels: false },
|
||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||
|
@@ -137,7 +137,7 @@ flowchart TD
|
||||
flowchart LR
|
||||
a["<strong>Haiya</strong>"]---->b
|
||||
</div>
|
||||
<div class="mermaid2" style="">
|
||||
<div class="mermaid" style="">
|
||||
flowchart LR
|
||||
%%{init: { "logLevel": 1, "flowchart": {"htmlLabels":true }} }%%
|
||||
a["<strong>Haiya</strong>"]---->b
|
||||
|
@@ -471,7 +471,6 @@ export const draw = function (text, id) {
|
||||
rect.setAttribute('ry', 0);
|
||||
rect.setAttribute('width', dim.width);
|
||||
rect.setAttribute('height', dim.height);
|
||||
// rect.setAttribute('style', 'fill:#e8e8e8;');
|
||||
|
||||
label.insertBefore(rect, label.firstChild);
|
||||
}
|
||||
|
@@ -931,6 +931,10 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth)
|
||||
if (sWidth > width) {
|
||||
tx = (sWidth - width) / 2 + padding;
|
||||
width = sWidth + padding * 2;
|
||||
} else {
|
||||
if (Math.abs(sWidth - width) >= 2 * padding + 1) {
|
||||
width = width - padding;
|
||||
}
|
||||
}
|
||||
if (sHeight > height) {
|
||||
ty = (sHeight - height) / 2 + padding;
|
||||
|
Reference in New Issue
Block a user