mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
da7ff777d1
mermaid.min.js and mermaid.js will now be IIFE instead of UMD.
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>
|