2019-10-15 17:05:20 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
2022-09-04 21:30:47 +02:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
|
|
<title>Mermaid Quick Test Page</title>
|
|
|
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="graph"></div>
|
2019-10-15 17:05:20 +02:00
|
|
|
|
2022-09-04 21:30:47 +02:00
|
|
|
<script src="./mermaid.js"></script>
|
|
|
|
<script>
|
|
|
|
mermaid.init({ startOnLoad: false });
|
|
|
|
mermaid.mermaidAPI.initialize();
|
2019-10-15 17:05:20 +02:00
|
|
|
|
2022-09-04 21:30:47 +02:00
|
|
|
rerender('XMas');
|
2019-10-15 17:05:20 +02:00
|
|
|
|
2022-09-04 21:30:47 +02:00
|
|
|
function rerender(text) {
|
2022-10-05 08:08:53 +02:00
|
|
|
const graphText = `graph TD
|
2021-12-05 00:28:40 +01:00
|
|
|
A[${text}] -->|Get money| B(Go shopping)`;
|
2022-10-10 16:04:33 +02:00
|
|
|
const graph = mermaid.mermaidAPI.render('id', graphText);
|
|
|
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
|
|
|
document.getElementById('graph').innerHTML = graph;
|
2022-09-04 21:30:47 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<button id="rerender" onclick="rerender('Saturday')">Rerender</button>
|
|
|
|
</body>
|
2019-10-15 17:05:20 +02:00
|
|
|
</html>
|