Last active
April 10, 2019 03:23
-
-
Save danbo/0a944f6cb60f759509f7a3ff4505cfaa to your computer and use it in GitHub Desktop.
cayley visualizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<head> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script> | |
<script src="https://unpkg.com/d3-graphviz@1.4.0/build/d3-graphviz.min.js"></script> | |
<script type = "text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | |
</head> | |
<body> | |
<div id="graph" style="text-align: center;"></div> | |
<script> | |
$(document).ready(function() { | |
$.ajax({ | |
type: 'GET', | |
url: 'http://cayley_host:64210/api/v2/read?format=graphviz', | |
complete: function(data){ | |
var graphData = data.responseText; | |
console.log(graphData); | |
d3.select("#graph").graphviz() | |
.fade(false) | |
.renderDot(graphData); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment