-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (42 loc) · 1.82 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="Stefan Eysoldt">
<meta name="description" content="Visualization of Voronoi cells">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Voronoi Cells</title>
<link rel="icon" href="favicon-32.png" sizes="32x32">
<link rel="icon" href="favicon-128.png" sizes="128x128">
<link rel="icon" href="favicon-180.png" sizes="180x180">
<link rel="icon" href="favicon-192.png" sizes="192x192">
<link rel="stylesheet" type="text/css" href="voronoi.css">
<script type="module" src="voronoi.js" defer> </script>
</head>
<body>
<header>
<h1>Voronoi diagram</h1>
<div id="controls">
<fieldset>
<legend>Regions</legend>
<input id="regionCount" type="number" min=0 placeholder=10 value=10 required>
<input id="generate" type="submit" value="Generate new points">
</fieldset>
<fieldset>
<legend>Draw speed</legend>
<input id="speed" type="range" min=1 max=11 value=3>
</fieldset>
<div id="btnGrid">
<input id="redraw" type="submit" value="Redraw Diagram">
<input id="stop" type="submit" value="Stop Drawing">
<div class="help">
<p>?</p>
<span>A <b>Voronoi diagram</b> is a partition of a space into cells around a set of generators. Each <b>cell</b> contains all points that are <b>closest</b> to its <b>generator</b>.<br><br>While drawing, all cells simultaneously claim points of the same distance to their generator.<br><b>Click the canvas</b> to add a new generator point. This interrupts the expansion of other cells until all cells have the same radius.</span>
</div>
</div>
</div>
</header>
<canvas id="voronoiCells" width=1920 height=1080></canvas>
<noscript>Javascript is required to draw the Voronoi diagram</noscript>
</body>
</html>