-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorr.html
71 lines (62 loc) · 2.19 KB
/
corr.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'">
<title>Correlation</title>
<script defer src="corr.js"></script>
<style type="text/css">
#corr_box {font-size: large; margin-bottom: 1em;}
#corr:not(:empty) {color: black; border: solid 1px black; padding: 0.2em;}
#corr:empty::before {content: "?"; color: gray;}
#corr_box > span {margin-right: 1em;}
#sample_size_span {color: gray;}
#main_canvas_box, #main_canvas {margin: 0px; padding: 0px;}
#main_canvas {position: absolute; background: #eee;}
#control_box {margin-top: 0.5em;}
#coord {color: gray;}
#points_text_box {margin-top: 1em;}
#points_text {resize: none;}
#about {color: gray; margin-top: 1em;}
.hidden {display: none;}
</style>
</head>
<body>
<h1>Interactive Correlation (+ PCA)</h1>
<div id="corr_box">
<span>correlation: <span id="corr"></span></span>
<span id="sample_size_span">(<span id="sample_size"></span> points)</span><br>
<label>
<input type="checkbox" id="regression_check" onclick="update()" checked>
regression<span id="regression"></span>
</label><br>
<label>
<input type="checkbox" id="pca_check" onclick="update()">
PCA<span id="pca"></span>
</label>
</div>
<div id="main_canvas_box">
<canvas id="main_canvas"></canvas>
</div>
<div id="control_box">
<button id="undo_all" onclick="undo_all()">clear</button>
<button id="undo" onclick="undo()">undo</button>
<button id="redo" onclick="redo()">redo</button>
<button id="redo_all" onclick="redo_all()">redo all</button>
<a id="download">Download image</a>
<span id="coord"></span>
</div>
<div id="points_text_box">
<textarea id="points_text" cols="20" rows="5" readonly placeholder="No points"></textarea>
<button id="copy_points" onclick="copy_points()">Copy to clipboard</button>
</div>
<div id="about">
This is an interactive learning material of "correlation" in statistics.
Plot points interactively and observe the correlation to get a sense of it.
(The dotted lines represent the mean values of x and y,
and the thin orange cross represents PCA.)
</div>
<p>
<a href="https://github.com/kaorahi/interactive_correlation">Project Home</a>
</p>
</body>