Adding image snapshots for graphs

This commit is contained in:
Knut Sveidqvist
2019-05-31 14:20:43 +02:00
parent 7242a98adb
commit 357e738983
9 changed files with 1147 additions and 60 deletions

View File

@@ -12,23 +12,13 @@ const contentLoaded = function () {
const graphBase64 = document.location.href.substr(pos)
const graphObj = JSON.parse(Base64.decode(graphBase64))
// const graph = 'hello'
console.log(graphObj.code)
console.log(graphObj)
const div = document.createElement('div')
div.id = 'block'
div.className = 'mermaid'
div.innerHTML = graphObj.code
document.getElementsByTagName('body')[0].appendChild(div)
global.mermaid.initialize({
theme: 'neutral',
themeCSS: '.node rect { fill: red; }',
htmlLabels: false,
// logLevel: 3,
// flowchart: { curve: 'linear' },
// gantt: { axisFormat: '%m/%d/%Y' },
// sequence: { actorMargin: 50 },
// sequenceDiagram: { actorMargin: 300 } // deprecated
startOnLoad: false
})
global.mermaid.initialize(graphObj.mermaid)
global.mermaid.init()
}
}