parent
60e4585e20
commit
23e590e09b
|
@ -19,10 +19,9 @@
|
||||||
function rerender(text) {
|
function rerender(text) {
|
||||||
const graphText = `graph TD
|
const graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`;
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
mermaid.mermaidAPI.renderAsync('id', graphText).then((svg) => {
|
const graph = mermaid.mermaidAPI.render('id', graphText);
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', svg);
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
||||||
document.getElementById('graph').innerHTML = svg;
|
document.getElementById('graph').innerHTML = graph;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
||||||
|
|
Loading…
Reference in New Issue