-
Notifications
You must be signed in to change notification settings - Fork 0
/
by_client_codes.html
80 lines (45 loc) · 1.84 KB
/
by_client_codes.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.css" type="text/css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis-network.min.js"> </script>
<center>
<h1>By Client Codes</h1>
</center>
<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
<style type="text/css">
#mynetwork {
width: 100%;
height: 90%;
background-color: #ffffff;
border: 1px solid lightgray;
position: relative;
float: left;
}
</style>
</head>
<body>
<div id = "mynetwork"></div>
<script type="text/javascript">
// initialize global variables.
var edges;
var nodes;
var network;
var container;
var options, data;
// This method is responsible for drawing the graph, returns the drawn network
function drawGraph() {
var container = document.getElementById('mynetwork');
// parsing and collecting nodes and edges from the python
nodes = new vis.DataSet([]);
edges = new vis.DataSet([]);
// adding nodes and edges to the graph
data = {nodes: nodes, edges: edges};
var options = {"physics": {"enabled": true}, "minVelocity": 0.05, "timestep": 0.22, "forceAtlas2Based": {"gravitationalConstant": -100, "centralGravity": 0.11, "springLength": 100, "springConstant": 0.09, "avoidOverlap": 1}, "barnesHut": {"gravitationalConstant": 100, "avoidOverlap": 1}, "solver": "barnesHut"};
network = new vis.Network(container, data, options);
return network;
}
drawGraph();
</script>
</body>
</html>