cutter/src/html/graph.html
Hugo Teso ca821e1064 First code commit
First commit with the app code
2017-03-29 12:18:37 +02:00

44 lines
853 B
HTML

<html>
<body>
<!--
<style type="text/css">
.center {
position: absolute;
left: 50%;
/* top: 50%; */
-webkit-transform: translate(-50%, 0);
transform: translate(-50%, 0);
}
</style>
-->
<div class="center" id="output"></div>
<script src="qrc:/html/viz.js"></script>
<script type="text/vnd.graphviz" id="test">
MEOW
</script>
<script>
function src(id) {
return document.getElementById(id).innerHTML;
}
var format = "svg";
var engine = "dot";
var result = Viz(src("test"), format, engine);
//var result = Viz(input, format, engine);
if (format == "svg") {
document.getElementById("output").innerHTML = result;
} else {
document.getElementById("output").innerHTML = "";
}
</script>
</body>
</html>