mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-12 18:49:37 +02:00
#3659 Adding height when not using maxWidth
This commit is contained in:
@@ -56,21 +56,10 @@
|
|||||||
<body>
|
<body>
|
||||||
<div>Security check</div>
|
<div>Security check</div>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
classDiagram
|
flowchart TD
|
||||||
direction LR
|
A --> B
|
||||||
class Student {
|
B --> C
|
||||||
-idCard : IdCard
|
A --> C
|
||||||
}
|
|
||||||
class IdCard{
|
|
||||||
-id : int
|
|
||||||
-name : string
|
|
||||||
}
|
|
||||||
class Bike{
|
|
||||||
-id : int
|
|
||||||
-name : string
|
|
||||||
}
|
|
||||||
Student "1" --o "1" IdCard : carries
|
|
||||||
Student "1" --o "1" Bike : rides
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
mindmap
|
mindmap
|
||||||
@@ -98,8 +87,14 @@ mindmap
|
|||||||
::icon(mdi mdi-fire)
|
::icon(mdi mdi-fire)
|
||||||
gc7((grand<br/>grand<br/>child 8))
|
gc7((grand<br/>grand<br/>child 8))
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid">
|
||||||
example-diagram
|
gantt
|
||||||
|
title Style today marker (vertical line should be 5px wide and half-transparent blue)
|
||||||
|
dateFormat YYYY-MM-DD
|
||||||
|
axisFormat %d
|
||||||
|
todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
|
||||||
|
section Section1
|
||||||
|
Today: 1, -1h
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<!-- <div id="cy"></div> -->
|
<!-- <div id="cy"></div> -->
|
||||||
@@ -116,13 +111,18 @@ mindmap
|
|||||||
theme: 'forest',
|
theme: 'forest',
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
// basePath: './packages/',
|
flowchart: {
|
||||||
// themeVariables: { darkMode: true },
|
useMaxWidth: false,
|
||||||
|
htmlLabels: true,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
useMaxWidth: false,
|
||||||
|
},
|
||||||
|
useMaxWidth: false,
|
||||||
lazyLoadedDiagrams: [
|
lazyLoadedDiagrams: [
|
||||||
'./mermaid-mindmap-detector.esm.mjs',
|
'./mermaid-mindmap-detector.esm.mjs',
|
||||||
'./mermaid-example-diagram-detector.esm.mjs',
|
'./mermaid-example-diagram-detector.esm.mjs',
|
||||||
],
|
],
|
||||||
// lazyLoadedDiagrams: ['../../mermaid-mindmap/registry.ts'],
|
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
|
@@ -26,6 +26,7 @@ export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {
|
|||||||
attrs.set('width', '100%');
|
attrs.set('width', '100%');
|
||||||
attrs.set('style', `max-width: ${width}px;`);
|
attrs.set('style', `max-width: ${width}px;`);
|
||||||
} else {
|
} else {
|
||||||
|
attrs.set('height', height);
|
||||||
attrs.set('width', width);
|
attrs.set('width', width);
|
||||||
}
|
}
|
||||||
return attrs;
|
return attrs;
|
||||||
|
Reference in New Issue
Block a user