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