-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
143 lines (125 loc) · 6.24 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset = "UTF-8">
<meta name = "description" content = "Plot points and find fits. No nonsense.">
<meta name = "keywords" content = "plot, points, plot points, graph, linear, linear fit, polynomial, polynomial fit, fit">
<meta name = "author" content = "John Mauney">
<title>Plot Points</title>
<link rel = "icon" type = "image/vnd.microsoft.icon" href = "favicon.ico">
<link rel = "stylesheet" type = "text/css" href = "style.css">
</head>
<body>
<div id = "container">
<div id = "leftPanel">
<div id = "inputWrapper">
<div id = "leftText">X Coordinate:</div>
<div id = "leftInput"><input type = "text" id = "xCoord" size = 5 onkeydown = "if (event.keyCode == 13) document getElementById('addCoordButton').click()" autofocus></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Y Coordinate:</div>
<div id = "leftInput"><input type = "text" id = "yCoord" size = 5 onkeydown = "if (event.keyCode == 13) document.getElementById('addCoordButton').click()"><br></div>
</div>
<div id = "inputWrapper">
<div id = "leftText"></div>
<div id = "leftInput"><button type = "button" id = "addCoordButton" onclick = "addPointFromInput(); document.getElementById('xCoord').value = ''; document.getElementById('yCoord').value = ''; document.getElementById('xCoord').focus()">Add Coordinate</button></div>
</div><br><br><br>
<div id = "inputWrapper">
<div id = "leftText">X Axis Length:</div>
<div id = "leftInput"><input type = "text" id = "xAxisLength" size = 5 onkeydown = "if (event.keyCode == 13) document.getElementById('setAxisButton').click()"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Y Axis Length:</div>
<div id = "leftInput"><input type = "text" id = "yAxisLength" size = 5 onkeydown = "if (event.keyCode == 13) document.getElementById('setAxisButton').click()"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText"># Axis Markers:</div>
<div id = "leftInput"><input type = "text" id = "numMarkers" size = 5 onkeydown = "if (event.keyCode == 13) document.getElementById('setAxisButton').click()"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText"></div>
<div id = "leftInput"><button type = "button" id = "setAxisButton" onclick = "redrawAxes(); document.getElementById('xAxisLength').value = ''; document.getElementById('yAxisLength').value = ''; document.getElementById('numMarkers').value = ''; document.getElementById('xAxisLength').focus()">Set Axis Length</button></div>
</div><br><br><br>
<div id = "inputWrapper">
<div id = "leftText">Title:</div>
<div id = "leftInput"><input type = "text" id = "titleText" size = "13" onkeydown = "if (event.keyCode == 13) document.getElementById('setLabels').click()"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">X Axis Label:</div>
<div id = "leftInput"><input type = "text" id = "xAxisText" size = "13" onkeydown = "if (event.keyCode == 13) document.getElementById('setLabels').click()"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Y Axis Label:</div>
<div id = "leftInput"><input type = "text" id = "yAxisText" size = "13" onkeydown = "if (event.keyCode == 13) document.getElementById('setLabels').click()"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText"></div>
<div id = "leftInput"><button type = "button" id = "setLabels" onclick = "setLabels()">Set Labels</button></div>
</div><br><br>
<div id = "inputWrapper">
<div id = "leftText">Show Border</div>
<div id = "leftCheckbox"><input type = "checkbox" id = "borderBox" onchange = "setOptions()" checked></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Show Coordinates</div>
<div id = "leftCheckbox"><input type = "checkbox" id = "coordBox" onchange = "setOptions()" checked></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Show Grid</div>
<div id = "leftCheckbox"><input type = "checkbox" id = "gridBox" onchange = "setOptions()" checked></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Show Lines</div>
<div id = "leftCheckbox"><input type = "checkbox" id = "lineBox" onchange = "setOptions()" checked></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">Show Points</div>
<div id = "leftCheckbox"><input type = "checkbox" id = "pointBox" onchange = "setOptions()" checked></div>
</div><br><br>
<div id = "inputWrapper">
<div id = "leftText"></div>
<div id = "leftInput"><button type = "button" onclick = "exportToPNG()">Create PNG</button></div>
</div>
<div id = "inputWrapper">
<div id = "leftText"></div>
<div id = "leftInput"><button type = "button" onclick = "createLink()">Permalink</button></div>
</div>
<div id = "inputWrapper">
<div id = "leftText"></div>
<div id = "leftInput"><button type = "button" onclick = "reset()">Clear</button></div>
</div>
</div>
<div id = "canvasWrapper">
<div id = "header">
Plot Points
</div>
<div id = "header2">
Works Best with Google Chrome
</div>
<canvas id = "myCanvas"></canvas>
<div id = "footer">
Contact: admin@plotpoints.net<br>
<a href = "https://github.com/ParkerM/graph">GitHub</a>
</div>
</div>
<div id = "rightPanel">
<div id = "inputWrapper">
<div id = "leftButton"><button type = "button" onclick = "linearRegression()">Linear Fit</button></div>
<div id = "rightInput"><input type = "color" id = "linearColor" value = "#FF0000"></div>
</div>
<div id = "inputWrapper">
<div id = "leftButton"><button type = "button" id = "polyRegButton" onclick = "polynomialRegression()">Polynomial Fit</button></div>
<div id = "rightInput"><input type = "color" id = "polynomialColor" value = "#FF0000"></div>
</div>
<div id = "inputWrapper">
<div id = "leftText">n = </div>
<div id = "leftInput"><input type = "text" id = "polyOrder" size = "1" value = "2" onkeydown = "if (event.keyCode == 13) document.getElementById('polyRegButton').click()"></div>
</div><br><br><br>
<div id = "textboxWrapper">
<textarea rows = "24" cols = "15" id = "console"></textarea>
</div>
</div>
</div>
<script type = "text/javascript" src = "graph.js" charset="UTF-8"></script>
</body>
</html>