mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
30 lines
600 B
HTML
30 lines
600 B
HTML
|
<html>
|
||
|
<body>
|
||
|
<pre id="diagram" class="mermaid">
|
||
|
graph TB
|
||
|
a --> b
|
||
|
a --> c
|
||
|
b --> d
|
||
|
c --> d
|
||
|
</pre>
|
||
|
|
||
|
<div id="d2"></div>
|
||
|
|
||
|
<script src="/mermaid.min.js"></script>
|
||
|
<script>
|
||
|
mermaid.initialize({
|
||
|
startOnLoad: true,
|
||
|
});
|
||
|
const value = `graph TD\nHello --> World`;
|
||
|
const el = document.getElementById('d2');
|
||
|
mermaid.render('did', value).then(({ svg }) => {
|
||
|
console.log(svg);
|
||
|
el.innerHTML = svg;
|
||
|
if (window.Cypress) {
|
||
|
window.rendered = true;
|
||
|
}
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|