-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph_show.html
52 lines (43 loc) · 2.46 KB
/
graph_show.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
45
46
47
48
49
50
51
52
<html>
<head>
<script type="text/javascript" src="VIS/dist/vis.js"></script>
<link href="VIS/dist/vis.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="VIS_draw"></div>
<script type="text/javascript">
var nodes = [{'group': 'Event', 'id': 20, 'label': '谢雕'}, {'group': 'Event', 'id': 19, 'label': '关键词'}, {'group': 'Event', 'id': 22, 'label': '周凯旋'}, {'group': 'Event', 'id': 24, 'label': '家人'}, {'group': 'Event', 'id': 26, 'label': '南都'}, {'group': 'Event', 'id': 28, 'label': '记者'}, {'group': 'Event', 'id': 32, 'label': '同学'}, {'group': 'Event', 'id': 38, 'label': '告诉'}, {'group': 'Event', 'id': 30, 'label': '高中同学'}, {'group': 'Event', 'id': 34, 'label': '匕首'}, {'group': 'Event', 'id': 36, 'label': '凯旋'}, {'group': 'Event', 'id': 39, 'label': '高频词'}];
var edges = [{'from': 20, 'label': '', 'to': 19}, {'from': 22, 'label': '', 'to': 19}, {'from': 24, 'label': '', 'to': 19}, {'from': 26, 'label': '', 'to': 19}, {'from': 28, 'label': '', 'to': 19}, {'from': 32, 'label': '', 'to': 19}, {'from': 38, 'label': '', 'to': 19}, {'from': 30, 'label': '', 'to': 19}, {'from': 34, 'label': '', 'to': 19}, {'from': 36, 'label': '', 'to': 19}, {'from': 20, 'label': '', 'to': 39}, {'from': 22, 'label': '', 'to': 39}, {'from': 24, 'label': '', 'to': 39}, {'from': 26, 'label': '', 'to': 39}, {'from': 28, 'label': '', 'to': 39}, {'from': 30, 'label': '', 'to': 39}, {'from': 32, 'label': '', 'to': 39}, {'from': 34, 'label': '', 'to': 39}, {'from': 36, 'label': '', 'to': 39}, {'from': 38, 'label': '', 'to': 39}];
var container = document.getElementById("VIS_draw");
var data = {
nodes: nodes,
edges: edges
};
var options = {
nodes: {
shape: 'circle',
size: 15,
font: {
size: 15
}
},
edges: {
font: {
size: 10,
align: 'center'
},
color: 'red',
arrows: {
to: {enabled: true, scaleFactor: 1.2}
},
smooth: {enabled: true}
},
physics: {
enabled: true
}
};
var network = new vis.Network(container, data, options);
</script>
</body>
</html>