-
Notifications
You must be signed in to change notification settings - Fork 6
/
diagram.mustache
44 lines (40 loc) · 1010 Bytes
/
diagram.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<style>
#credit {
margin-top: 3em;
text-align: center
}
</style>
</head>
<body>
<div id='diagram'></div>
<div id='credit'>
<p>Powered by <a href='https://github.com/mdaines/viz.js'>viz.js</a></p>
<p>Generated at {{{now}}}</p>
</div>
<script type="text/vnd.graphviz" id="cluster">
{{{dotdata}}}
</script>
<script src="viz.js"></script>
<script>
function inspect(s) {
return "<pre>" + s.replace(/</g, "<").replace(/>/g, ">").replace(/\"/g, """) + "</pre>"
}
function byId(id) {
return document.getElementById(id);
}
function example(id) {
try {
return Viz(byId(id).innerHTML, "svg");
} catch(e) {
return inspect(e.toString());
}
}
byId('diagram').innerHTML = example("cluster");
</script>
</body>
</html>