-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsmoothers.html
75 lines (59 loc) · 2.3 KB
/
smoothers.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
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>One Dimensional Smoothers Demonstration</title>
<link href="css/smoothers.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="d3/d3.js"></script>
<script type="text/javascript" src="numeric-js/numeric.js"></script>
<script type="text/javascript" src="markdown-js/markdown.js"></script>
<script type="text/javascript" src="js/smoothers.js"></script>
<script type="text/javascript" src="js/smoother-ui.js"></script>
<script type="text/javascript" src="js/parameter-ui.js"></script>
<script type="text/javascript" src="js/canvas.js"></script>
<script type="text/javascript" src="js/controller.js"></script>
</head>
<body>
<div id=title class=title>
<h1>Fun With 1D Smoothers</h1>
</div>
<div id=instructions class=instructions>
<p class=p-instructions>
This app demos various 1d scatterplot smoothers in real time.
</p>
<p class=instructions>
Click on the canvas to add points to the scatterplot. Use
the interface below the canvas to select the smoothing algorithm.
<p class=instructions>
Once you've added three points, the smoother will kick in
automatically.
</p>
</div>
<div id=graph class=graph></div>
<br>
<div id=interface-hyperparamters class=interface>
<label for=hyperparameter-interface>Smoothing Parameters:</label>
<div id=interface-hyperparamter-sliders></div>
</div>
<div id=interface-smoother class=interface>
<label for=smooth-type>Smoothing Type:</label>
<select name=smooth-type id=smooth-type>
</select>
<button id=clear type=button>Clear</button>
</div>
</body>
<script type="text/javascript">
/* Initialize the interface */
let c = canvas("div#graph",
{height: 400, width: 600},
{top: 25, bottom: 25, left:25, right: 25});
c.bind_click_listener();
let sui = smoother_ui(smoothers);
sui.bind(document.getElementById("smooth-type"),
document.getElementById("clear"))
let pui = parameter_ui();
pui.bind(document.getElementById("interface-hyperparamter-sliders"))
let ct = controller(c, sui, pui);
ct.run();
</script>
</html>