Commit 1ef860a0 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[js/doc] Add display using a browser and documentation

parent 483a2b9b
......@@ -19,4 +19,8 @@ dot -Tpdf /tmp/ > /tmp/my_dynamic_graph.pdf
It provides the following output:
\image html my_dynamic_graph.png
\section fromdottojs Viewing in a browser
To view the dot file you can simply use the view_sot_dg.html file.
Click on the "Choose File" to specify the filem and click on "Rendering" to display the graph.
<script src=""></script>
<script src=""></script>
function renderDOTFile() {
var fileInputElement = document.getElementById("fileInputElement");
var reader = new FileReader();
var graphtextres = ""
reader.onloadend = function(e) {
graphtextres =
var viz = new Viz();
.then(function(element) {
if (elementToRemove != null)
.catch(error => {
// Create a new Viz instance (@see Caveats page for more info)
viz = new Viz();
// Possibly display the error
<input type="file" id="fileInputElement">
<input id="Rendering" type="button" value="Rendering" onclick="renderDOTFile();" />
var el = document.getElementById("Rendering");
if (el.addEventListener)
el.addEventListener("click", renderDOTFile, false);
else if (el.attachEvent)
el.attachEvent('onclick', renderDOTFile);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment