mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Small fix for issue #3881
This commit is contained in:
parent
abc6ee049d
commit
b68fee7e65
@ -56,29 +56,24 @@
|
|||||||
<body>
|
<body>
|
||||||
<div>Security check</div>
|
<div>Security check</div>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
graph LR
|
flowchart LR
|
||||||
subgraph external
|
subgraph external
|
||||||
|
subgraph internal
|
||||||
inside
|
inside
|
||||||
end
|
end
|
||||||
outside --> external
|
end
|
||||||
</pre>
|
outside --> inside
|
||||||
<pre id="diagram" class="mermaid">
|
|
||||||
mindmap
|
|
||||||
root
|
|
||||||
child1((Circle))
|
|
||||||
grandchild 1
|
|
||||||
grandchild 2
|
|
||||||
child2(Round rectangle)
|
|
||||||
grandchild 3
|
|
||||||
grandchild 4
|
|
||||||
child3[Square]
|
|
||||||
grandchild 5
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
gc6((grand<br/>child 6))
|
|
||||||
::icon(mdi mdi-fire)
|
|
||||||
gc7((grand<br/>grand<br/>child 8))
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
|
flowchart LR
|
||||||
|
subgraph parent
|
||||||
|
subgraph childB
|
||||||
|
grandchild
|
||||||
|
end
|
||||||
|
end
|
||||||
|
foo --> childA </pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
gantt
|
gantt
|
||||||
title Style today marker (vertical line should be 5px wide and half-transparent blue)
|
title Style today marker (vertical line should be 5px wide and half-transparent blue)
|
||||||
dateFormat YYYY-MM-DD
|
dateFormat YYYY-MM-DD
|
||||||
@ -103,7 +98,7 @@ mindmap
|
|||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'base',
|
theme: 'default',
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: {
|
flowchart: {
|
||||||
@ -114,10 +109,6 @@ mindmap
|
|||||||
useMaxWidth: false,
|
useMaxWidth: false,
|
||||||
},
|
},
|
||||||
useMaxWidth: false,
|
useMaxWidth: false,
|
||||||
lazyLoadedDiagrams: [
|
|
||||||
'./mermaid-mindmap-detector.esm.mjs',
|
|
||||||
'./mermaid-example-diagram-detector.esm.mjs',
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
|
@ -59,11 +59,9 @@ const rect = (parent, node) => {
|
|||||||
// Center the label
|
// Center the label
|
||||||
label.attr(
|
label.attr(
|
||||||
'transform',
|
'transform',
|
||||||
'translate(' +
|
// This puts the labal on top of the box instead of inside it
|
||||||
(node.x - bbox.width / 2) +
|
// 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - bbox.height) + ')'
|
||||||
', ' +
|
'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2) + ')'
|
||||||
(node.y - node.height / 2 + node.padding / 3) +
|
|
||||||
')'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const rectBox = rect.node().getBBox();
|
const rectBox = rect.node().getBBox();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user