mermaid layout improvements

This commit is contained in:
zadam
2021-09-30 10:18:03 +02:00
parent f4dde84f06
commit af3fd61974
7 changed files with 23 additions and 10 deletions

View File

@@ -86,14 +86,15 @@ async function getRenderedContent(note, options = {}) {
await libraryLoader.requireLibrary(libraryLoader.MERMAID);
const noteComplement = await froca.getNoteComplement(note.noteId);
const graph = noteComplement.content || "";
const content = noteComplement.content || "";
const updateWithContent = (content) => {
$renderedContent.append($(content))
}
$renderedContent
.css("display", "flex")
.css("justify-content", "space-around");
try {
mermaid.mermaidAPI.render('graphDiv', graph, updateWithContent);
mermaid.mermaidAPI.render("mermaid-graph", content,
content => $renderedContent.append($(content)));
} catch (e) {
const $error = $("<p>The diagram could not displayed.</p>");