-
Notifications
You must be signed in to change notification settings - Fork 0
/
presentation.js
51 lines (44 loc) · 974 Bytes
/
presentation.js
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
const defaultNodeStyle = {
color: {
background: 'white',
border: 'black'
}
};
const newNodeStyle = {
color: {
background: 'lightblue',
border: 'blue'
}
};
const nodeStyles = {
default: {
background: '#ccc',
border: '#999',
highlight: {
background: '#eee',
border: '#666'
},
font: {color: 'black'}
}
};
const edgeStyles = {
color: 'black',
font: {color: 'black', size: 14}
};
function initializeGraph() {
nodes = new vis.DataSet();
edges = new vis.DataSet();
var container = document.getElementById('mynetwork');
var data = { nodes: nodes, edges: edges };
var options = {
nodes: nodeStyles.default,
edges: edgeStyles,
manipulation: {
enabled: false
},
interaction: {
hover: true
}
};
network = new vis.Network(container, data, options);
}