I try to make a simple web page that : loads viz.js, put some dot in a textarea, have a button to render the diagram and put the result in a div.
I've tried
<html>
<body>
<textarea id="dot">digraph{ A -> B; }</textarea>
<p>let's diag</p>
<div id="diag"></div>
</body>
</html>
<script type="module" src="main.cdn.js"></script>
<script>
input = document.getElementById("dot").value;
dot2svg(input)
.then((svgString) => {
console.log(svgString);
})
.catch((error) => {
console.error(error);
});
</script>
main.cdn.js is basically what is proposed in the README.
I've tried many ways (declare my code as a module, use export, etc.).
But I always end up with Uncaught ReferenceError: dot2svg is not defined.
Can someone please a small demo page ?
I try to make a simple web page that : loads viz.js, put some dot in a textarea, have a button to render the diagram and put the result in a div.
I've tried
main.cdn.jsis basically what is proposed in the README.I've tried many ways (declare my code as a module, use export, etc.).
But I always end up with
Uncaught ReferenceError: dot2svg is not defined.Can someone please a small demo page ?