-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot.html
24 lines (23 loc) · 878 Bytes
/
plot.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
<!DOCTYPE html>
<html>
<head>
<title>Automaton Visualization</title>
<script type="text/javascript" src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"></script>
<style type="text/css">
#mynetwork { width: 800px; height: 600px; border: 1px solid lightgray; }
</style>
</head>
<body>
<div id="mynetwork"></div>
<script type="text/javascript">
fetch('automaton_data.json')
.then(response => response.json())
.then(data => {
var nodes = new vis.DataSet(data.nodes);
var edges = new vis.DataSet(data.edges.map(edge => ({ ...edge, arrows: 'to' })));
var container = document.getElementById('mynetwork');
var network = new vis.Network(container, { nodes, edges }, {});
});
</script>
</body>
</html>