github.com/awesome-flow/flow@v0.0.3-0.20190918184116-508d75d68a2c/web/template/page/graphviz.tmpl (about)

     1  {{ define "graphviz" }}
     2  <textarea style="display:none;" name="graphviz-dot-text" id="graphviz-dot-text">
     3  	{{.GraphViz}}
     4  </textarea>
     5  <div id="graph-place"></div>
     6  <script src="/static/js/viz.js"></script>
     7  <script type='text/javascript'>
     8  	document.addEventListener("DOMContentLoaded", function(event) {
     9  		var dotsrc = document.getElementById("graphviz-dot-text")
    10  		var data = Viz(dotsrc.value, "svg")
    11  		var placeholder = document.getElementById("graph-place")
    12  		placeholder.innerHTML = data
    13  	})
    14  </script>
    15  {{ end }}