Is there any way to embed a picture with mermaid.js in a flow diagram graph node? I tried:
<div class="mermaid">
graph LR
A(<img src="pic.svg"></img>) --> B
</div>
Mermaid is a flowchart and diagram visualization tool based on JavaScript and uses syntax inspired by Markdown in order to create and dynamically modify flowcharts.
Mermaid is a JavaScript-based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
Mermaid. js lets you create various diagrams and flowcharts using only simple markup-like text. It is a free, open source, and easy-to-use JavaScript library.
Here is the API example from this thread
var mermaidAPI = mermaid.mermaidAPI;
mermaidAPI.initialize({
startOnLoad:false
});
var element = document.getElementById("app");
var insertSvg = function(svgCode, bindFunctions) {
element.innerHTML = svgCode;
};
var graphDefinition = `graph LR; Systemstart-->SomeIcon(<img src='https://iconscout.com/ms-icon-310x310.png' width='40' height='40' />)`;
var graph = mermaidAPI.render("mermaid", graphDefinition, insertSvg);
<script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script>
<div id="app"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With