fix mermaid diagram size

This commit is contained in:
zadam 2021-09-30 13:48:01 +02:00
parent 291b434d70
commit 831de3ffed
2 changed files with 17 additions and 5 deletions

Binary file not shown.

View file

@ -11,10 +11,13 @@ const TPL = `<div class="mermaid-widget">
border-bottom: 1px solid var(--main-border-color);
padding: 20px;
margin-bottom: 10px;
display: flex;
justify-content: space-around; /* centering rendered SVG */
flex-basis: 0;
}
.mermaid-render {
overflow: auto;
height: 100%;
}
</style>
<div class="mermaid-error alert alert-warning">
@ -48,9 +51,18 @@ export default class MermaidWidget extends NoteContextAwareWidget {
const documentStyle = window.getComputedStyle(document.documentElement);
const mermaidTheme = documentStyle.getPropertyValue('--mermaid-theme');
console.log(mermaidTheme, "mermaidTheme");
mermaid.mermaidAPI.initialize({ startOnLoad: false, theme: mermaidTheme.trim() });
mermaid.mermaidAPI.initialize({
startOnLoad: false,
theme: mermaidTheme.trim(),
flow: { useMaxWidth: false },
sequence: { useMaxWidth: false },
gantt: { useMaxWidth: false },
"class": { useMaxWidth: false },
state: { useMaxWidth: false },
pie: { useMaxWidth: false },
journey: { useMaxWidth: false },
git: { useMaxWidth: false },
});
const noteComplement = await froca.getNoteComplement(note.noteId);
const content = noteComplement.content || "";