Skip to content

Instantly share code, notes, and snippets.

@danbo
Last active April 10, 2019 03:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbo/0a944f6cb60f759509f7a3ff4505cfaa to your computer and use it in GitHub Desktop.
Save danbo/0a944f6cb60f759509f7a3ff4505cfaa to your computer and use it in GitHub Desktop.
cayley visualizer
<!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