-
Notifications
You must be signed in to change notification settings - Fork 4
/
optics_cluster_without_webworker.html
73 lines (54 loc) · 2.05 KB
/
optics_cluster_without_webworker.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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OPTICS-Clustering-Algo without WebWorker</title>
<script src="libs/datasets/random_points.js" type="text/javascript"></script>
<script src="libs/datasets/birth_and_death_rate.js" type="text/javascript"></script>
<script src="libs/optics.js" type="text/javascript"></script>
<script type="text/javascript">
var clusteringAlgo = null;
window.onload = function(){
clusteringAlgo = new OPTICS(birth_and_death_rate);
document.getElementById('clusterButton').onclick = function(event){
var epsilon = Number(document.getElementById('epsilon').value);
var minPts = Number(document.getElementById('minPts').value);
var output = clusteringAlgo.start(epsilon,minPts);
img = clusteringAlgo.draw2DPlot(output,1000,1000);
document.body.appendChild(img);
img = clusteringAlgo.drawBarChartPlot(output, epsilon, minPts, 3000, 1000);
document.body.appendChild(img);
};
};
function changeDataset(obj){
if(obj.value === 'birth_and_death_rate')
clusteringAlgo = new OPTICS(birth_and_death_rate);
else if(obj.value === 'random_points')
clusteringAlgo = new OPTICS(random_points);
}
</script>
</head>
<body>
<h2>This app is made for testing different parameter-values for OPTICS</h2>
<table>
<form>
<tr>
<td>
Use Dataset
<select onchange="changeDataset(this)">
<option value="birth_and_death_rate" selected>Birth and Death Rate of Countries</option>
<option value="random_points">Random Points on ground</option>
</select>
</td>
<td>
with Parameter-Values:
<td>Epsilon<input type="text" id="epsilon" placeholder="epsilon" /></td>
<td>MinPts</td>
<td><input type="text" id="minPts" placeholder="minPts" /></td>
<td><input type="button" id="clusterButton" value="calculate"/></td>
</td>
</tr>
</form>
</table>
</body>
</html>