-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotter.html
242 lines (222 loc) · 6.96 KB
/
plotter.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
Plotter
</title>
<link rel="stylesheet" href="assets/css/jquery-ui.min.css">
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
div {
display: block;
}
#container {
width: 100%;
height: 100%;
}
#graph {
float: left;
width: 70%;
height: 100%;
box-sizing: border-box;
padding: 10px;
}
#data {
float: right;
width: 30%;
height: 100%;
overflow-y: auto;
box-sizing: border-box;
padding: 10px;
}
#data div {
margin-top: 10px;
}
.form-group {
display: table;
}
label,
input {
display: table-cell;
}
#formula-display {
text-align: center;
}
button {
background-color: #BDBDBD;
border-radius: 8px;
color: black;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
transition-duration: 0.4s;
}
button:hover {
background-color: #1E88E5;
color: white;
}
button.active {
background-color: #1E88E5;
color: white;
}
button.inactive {
background-color: #BDBDBD;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
max-width: 90%;
height: auto;
}
</style>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}, "HTML-CSS": { scale: 150, linebreaks: { automatic: true } }, SVG: { linebreaks: { automatic:true } }, displayAlign: "left" });
</script>
</head>
<body>
<button id="default" class=" device_button inactive">Settling Velocity</button>
<button id="chamber" class="device_button inactive">Settling Chamber</button>
<button id="esp" class="device_button inactive">Electrostatic Precipiator</button>
<button id="venturi" class="device_button inactive">Venturi Scrubber</button>
<button id="cyclone" class="device_button inactive">Cyclone</button>
<button id="adsorption" class="device_button inactive">Adsorption</button>
<div id="container">
<div id="graph">
</div>
<div id="data">
<h4>Instructions</h4>
<P>1) Select a formula from the dropdown menu below the graph</P>
<P>2) Adjust the input variables as needed; the formula value is computed below (in the Result section) </P>
<P>3) Enter "x" in one of the variables input box to plot the equation value as a function of that variable. <strong>You might need to adjust the x and y axes ranges in the Options tab</strong></P>
<div id="options">
<h4>Options:</h4>
<div id="tabs">
<ul>
<li><a href="#diagram">Diagram</a></li>
<li><a href="#xaxis">X-Axis</a></li>
<li><a href="#yaxis">Y-Axis</a></li>
</ul>
<!-- Contents of the Diagram Tab -->
<img id="diagram" src="default.jpg" alt="Force Balance on Settling Velocity">
<!-- Contents of X-Axis Tab -->
<div id="xaxis">
<div class="form-group">
<label>
Log scale:
</label>
<input type="checkbox" id="xaxis-log" autocomplete="off"/>
</div>
<div class="form-group">
<label>
Start value of x:
</label>
<input id="startx" />
</div>
<div class="form-group">
<label>
End value of x:
</label>
<input id="endx" />
</div>
</div>
<!-- Contents of Second Tab -->
<div id="yaxis">
<div class="form-group">
<label>
Log scale:
</label>
<input type="checkbox" id="yaxis-log" autocomplete="off"/>
</div>
<div class="form-group">
<label>
Fix Axis Values:
</label>
<input type="checkbox" id="yaxis-fix" autocomplete="off"/>
</div>
<div id="yvalues" style="display: none;">
<div class="form-group">
<label>
Start value of y:
</label>
<input id="starty" />
</div>
<div class="form-group">
<label>
End value of y:
</label>
<input id="endy" />
</div>
</div>
</div>
</div>
</div>
<select id="select_formula" style="width:100%; margin-top:10px;"></select>
<h4>Formula: <span id="formula-name"></span></h4>
<!-- <P>Select a forumla from the above dropdown menu. Enter "x" in one of the variables input box to showplot the equation value as a funciton of that variable. You might need to adjust the x and y axes ranges in the Options section</P> -->
<div id="formula-display"></div>
<div><h4>Result: <span id="output"></span><span id="formula-unit"></span></div>
<div id="values">
</div>
<div class="form-group">
<!-- <label>
<h4>Number of calculated points: </h4>
</label> -->
<h4>Enter the number of points to be calculated for the graph:</h4>
<input id="tick_boost"/>
<p>User Warning: Increasing the number of points will give a smooth looking curve when plotting variables with a non-linear relationship to the result. However, if the number of points entered is too large, it will crash the plotter.</p>
</div>
</div>
</div>
<!-- A template to clone whenever a new formula is selected -->
<div id="value-template" class="form-group" style="display: none;">
<label></label>
<input /><span class='variable-units'></span>
<div class="slider">
</div>
</div>
<!-- JAVASCRIPT INCLUDES -->
<!-- Plugins and Libraries -->
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/jquery-ui.min.js"></script>
<script type='text/javascript' src='assets/js/math.min.js'></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js"></script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML-full"></script>
<!-- Project files -->
<script type='text/javascript' src='config/formulas.js'></script>
<script type='text/javascript' src='config/config.js'></script>
<script type='text/javascript' src='assets/js/main.js'></script>
<script type='text/javascript' src='assets/js/plotter.js'></script>
<script>
$(document).ready(function() {
init("default");
$('.device_button').each(function() {
var device_name = $(this).context.id;
var selector = "#" + device_name;
var source = device_name + ".jpg";
var alternative = device_name + " diagram";
$(selector).on("click", function() {
init(device_name);
$("#diagram").attr("src", source);
$("#diagram").attr("alt", alternative);
});
});
update_active_button();
});
</script>
</body>
<P>This JavaScript was developed thanks to funding from the <strong>University of Alberta's Open Educational Resources Award</strong>, and the <strong>American Society of Mechanical Engineers' Environmental Engineering Education Support Program</strong></P>
//<h4><font size="+1"> </font></h4>
</html>