-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclustering_demo.html
More file actions
24 lines (23 loc) · 873 Bytes
/
clustering_demo.html
File metadata and controls
24 lines (23 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
<title>Clustering demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.4/p5.js"></script>
<script src="clustering.js"></script>
</head>
<body>
<div id="clustering_canvas"></div>
<div>
<button onclick="clear_data();">Clear data</button>
<button onclick="new_data();">New data</button>
<label for="n_data"># data points</label>
<input type="text" id="n_data" value="20" pattern="[0-9]+" size="10">
<button onclick="clear_centers();">Clear centers</button>
<button id="move_btn" onclick="move_centers();">Move centers</button>
<button id="classify_btn" onclick="classify();">Classify</button>
</div>
<div>
<p>You can add data points by clicking on the canvas. If any keyboard key is pressed and you click on the canvas, a new center point is added.</p>
</div>
</body>
</html>