#3659 Adding height when not using maxWidth

This commit is contained in:
Knut Sveidqvist
2022-10-13 14:26:05 +02:00
parent 57b883c7dd
commit 4be66554b3
2 changed files with 21 additions and 20 deletions

View File

@@ -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');

View File

@@ -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;