-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
64 lines (63 loc) · 2.43 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site" content="@jobtalle"/>
<meta name="twitter:description" content="Distribution plots"/>
<meta name="twitter:title" content="Distribution plots"/>
<meta name="twitter:image" content="https://jobtalle.com/DistributionPlots/preview.png"/>
<meta property="og:image" content="https://jobtalle.com/DistributionPlots/preview.png"/>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Distribution plots</title>
</head>
<body>
<div id="wrapper">
<form>
<fieldset>
<legend>Plot</legend>
<label>
Spacing
<input id="plot-spacing" type="range" min="10" max="150" step="1" value="50" onchange="distribution.update()">
</label>
<button type="button" onclick="distribution.update()">Generate</button>
</fieldset>
<fieldset>
<legend>Type</legend>
<label>
Random
<input type="radio" name="type" onclick="distribution = pointDistributionRandom; distribution.update()" checked>
</label>
<label>
Grid
<input type="radio" name="type" onclick="distribution = pointDistributionGrid; distribution.update()">
</label>
<label>
Poisson
<input type="radio" name="type" onclick="distribution = pointDistributionPoisson; distribution.update()">
</label>
</fieldset>
</form>
<canvas id="plot" width="600" height="400"></canvas>
</div>
<script src="point.js"></script>
<script src="pointPlot.js"></script>
<script src="pointDistributionRandom.js"></script>
<script src="pointDistributionGrid.js"></script>
<script src="pointDistributionPoisson.js"></script>
<script>
const pointPlot = new PointPlot(document.getElementById("plot"));
const pointDistributionRandom = new PointDistributionRandom(
pointPlot,
document.getElementById("plot-spacing"));
const pointDistributionGrid = new PointDistributionGrid(
pointPlot,
document.getElementById("plot-spacing"));
const pointDistributionPoisson = new PointDistributionPoisson(
pointPlot,
document.getElementById("plot-spacing"));
let distribution = pointDistributionRandom;
distribution.update();
</script>
</body>
</html>