-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgraphviz-demo.html
44 lines (43 loc) · 1.45 KB
/
graphviz-demo.html
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"/>
<!-- Note: <script>...</script> cannot be shortened by <script/> -->
<script type="text/javascript" src="./graphviz-client.js"></script>
</head>
<!-- When the body is loaded, read Graphviz source code from a <pre>
tag and post it to graphviz-server server on reverse proxy path
'/graphviz/'. The returned HTML <img> tag will be inserted
into the HTML page. -->
<body onload="mcDrawGraphviz('graphviz_source', '/graphviz/', 'dot_img')">
<h2>Graphviz Server Demo</h2>
<p>
I would like to have Graphviz Dot source files embedded in my
HTML pages, but renderred into PNG images when pages are loaded.
</p>
<div id="dot_img">
<pre type="text/graphviz" id="graphviz_source">
digraph finite_state_machine {
rankdir=LR;
size="8,5"
node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
node [shape = circle];
LR_0 -> LR_2 [ label = "SS(B)" ];
LR_0 -> LR_1 [ label = "SS(S)" ];
LR_1 -> LR_3 [ label = "S($end)" ];
LR_2 -> LR_6 [ label = "SS(b)" ];
LR_2 -> LR_5 [ label = "SS(a)" ];
LR_2 -> LR_4 [ label = "S(A)" ];
LR_5 -> LR_7 [ label = "S(b)" ];
LR_5 -> LR_5 [ label = "S(a)" ];
LR_6 -> LR_6 [ label = "S(b)" ];
LR_6 -> LR_5 [ label = "S(a)" ];
LR_7 -> LR_8 [ label = "S(b)" ];
LR_7 -> LR_5 [ label = "S(a)" ];
LR_8 -> LR_6 [ label = "S(b)" ];
LR_8 -> LR_5 [ label = "S(a)" ];
}
</pre>
</div>
</body>
</html>