-
Notifications
You must be signed in to change notification settings - Fork 1
/
sigma.html
98 lines (89 loc) · 3.11 KB
/
sigma.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<title>FA2 Sigma.</title>
<script type="text/javascript" src="js/sigma/sigma.min.js"></script>
<script type="text/javascript" src="js/sigma/supervisor.js"></script>
<script type="text/javascript" src="js/sigma/worker.js"></script>
<script type="text/javascript" src="js/data.js"></script>
<script type="text/javascript" src="js/helper.js"></script>
<link href="main.css" rel="stylesheet"/>
</head>
<body>
<div id="map" class="map-container"></div>
<div class="controller">
<input type="checkbox" id="cbForceAtlas2" checked/><label for="cbForceAtlas2">Toggle ForceAtlas2</label>
<br/>
<input type="checkbox" id="cbToggleSettings"/><label for="cbToggleSettings">Toggle Settings</label>
<div class="settings not-shown" id="settings">
<ul>
<li>
<label>linLogMode</label><input type="checkbox" id="linLogMode"/>
</li>
<li>
<label>outboundAttractionDistribution</label><input type="checkbox" id="outboundAttractionDistribution"/>
</li>
<li>
<label>adjustSizes</label><input type="checkbox" id="adjustSizes"/>
</li>
<li>
<label>edgeWeightInfluence</label><input type="number" step="any" value="0" id="edgeWeightInfluence"/>
</li>
<li>
<label>scalingRatio</label><input type="number" step="any" value="1" id="scalingRatio"/>
</li>
<li>
<label>strongGravityMode</label><input type="checkbox" id="strongGravityMode"/>
</li>
<li>
<label>gravity</label><input type="number" step="any" value="1" id="gravity"/>
</li>
<li>
<label>slowDown</label><input type="number" step="any" value="1" id="slowDown"/>
</li>
<li>
<label>barnesHutOptimize</label><input type="checkbox" id="barnesHutOptimize"/>
</li>
<li>
<label>barnesHutTheta</label><input type="number" step="any" value="0.5" id="barnesHutTheta"/>
</li>
<li>
<label>startingIterations</label><input type="number" value="1" id="startingIterations"/>
</li>
<li>
<label>iterationsPerRender</label><input type="number" value="1" id="iterationsPerRender"/>
</li>
</ul>
<button id="btnUpdateConfig">Update</button>
</div>
</div>
<script type="text/javascript">
(function() {
var g = {
nodes: [],
edges: []
};
GraphCommons.Helper.sigmaAddData(g);
s = new sigma({
graph: g,
container: 'map',
settings: {
drawEdges: true
}
});
// Start the ForceAtlas2 algorithm:
s.startForceAtlas2({worker: true, barnesHutOptimize: false});
var cbForceAtlas2 = document.getElementById('cbForceAtlas2');
cbForceAtlas2.addEventListener('change', function() {
if (this.checked) {
s.startForceAtlas2({worker: true, barnesHutOptimize: false});
}
else {
s.stopForceAtlas2();
}
});
GraphCommons.Helper.initSettings(s);
}(GraphCommons));
</script>
</body>
</html>