-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.html
294 lines (258 loc) · 9.61 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
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>epwvis</title>
<!-- load css -->
<link rel="stylesheet" href="./lib/css/bootstrap/bootstrap.min.css" type="text/css"/>
<link rel="stylesheet" href="./lib/css/epwvis.css" type="text/css"/>
<!-- load javascript libraries -->
<script type="text/javascript" src="./lib/js/jQuery/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="./lib/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="./lib/js/d3/d3.min.js"></script>
<script type="text/javascript" src="./lib/js/crossfilter/crossfilter.min.js"></script>
<script type="text/javascript" src="./lib/js/epw2json.js"></script>
<script type="text/javascript" src="./lib/js/epwCharts.js"></script>
<style>
html {
position: relative;
min-height: 100%;
}
body {
background-color: white;
font-family: sans-serif;
font-weight: normal;
margin-bottom: 60px;
}
.heading{
font-size: 14px;
font-weight: normal;
font-style: italic;
}
.upload-drop-zone {
height: 60;
width: 200;
border-width: 2px;
margin-bottom: 5px;
color: #ccc;
border-style: dashed;
border-color: #ccc;
line-height: 60px;
text-align: center;
}
.upload-drop-zone.drop {
color: #4169E1;
border-color: #4169E1;
}
a:link {
color: steelblue;
}
a:visited {
color: grey;
}
a:hover {
color: black;
}
#epwChartDiv {
display: none;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 40px;
background-color: #f5f5f5;
}
</style>
</head>
<body>
<div id="wrapper">
<!-- header -->
<header>
<nav class="navbar navbar-default navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<span>
<h3>epwvis
<span class="heading"> - An online viewer and analysis tool for EnergyPlus Weather (EPW) files</span>
</h3>
</span>
</div>
</div>
</nav>
</header> <!-- header -->
<!-- side bar navigation -->
<!-- <div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav in" id="side-menu">
<li>
<a href="#TemperatureFloodplot">Temperature Floodplot</a>
</li>
<li>
<a href="#Filter">Filter</a>
</li>
<li>
<a href="#Windrose">Windrose</a>
</li>
</ul>
</div>
</div> -->
<!-- page wrapper -->
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<!-- second nav bar -->
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li>
<label>Select EPW File:</label>
<input type="file" id="fileinput" style="width:200px;"></input>
</li>
<li style="text-align:center; padding-right:15px;"><h3>OR</h3></li>
<li>
<!-- from: http://bootsnipp.com/snippets/featured/bootstrap-drag-and-drop-upload -->
<div class="upload-drop-zone" id="drop-zone">
drag and drop EPW file here
</div>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
Unit System:
<div class="btn-group" data-toggle="buttons">
<button type="button" class="btn btn-default navbar-btn active" id="buttonIP">IP</button>
<button type="button" class="btn btn-default navbar-btn" id="buttonSI">SI</button>
<!-- <label type="button" class="btn btn-default navbar-btn active">
<input type="radio" id="buttonIP">IP</input>
</label>
<label type="button" class="btn btn-default navbar-btn">
<input type="radio" id="buttonSI">SI</input>
</label> -->
</div>
</li>
</ul>
</div> <!-- second nav bar -->
<h3 id="stationName"></h3>
<div id="epwChartDiv">
<div id="TemperatureFloodplot">
<h3>Drybulb Temperature Floodplot</h3>
<div id="epwTempFloodPlot"></div>
</div>
<div id="epwTempFilter">
<h3>Drybulb Temperature Filter</h3>
<p id="tempFilterExamples"></p>
<aside id="xfilterTotals"><span id="xfilterActive">-</span> of <span id="xfilterTotal">-</span> hours (<span id="xfilterPercent">-</span>) selected.</aside>
<div id="xfilterCharts">
<div id="month-chart" class="xfilterChart">
<div class="title">Month</div>
</div>
<div id="hour-chart" class="xfilterChart">
<div class="title">Hour</div>
</div>
<div id="value-chart" class="xfilterChart">
<div class="title">Value</div>
</div>
</div>
</div>
<div id="CloudFloodplot">
<h3>Cloud Cover Floodplot</h3>
<div id="epwCloudFloodPlot"></div>
</div>
<div id="WindRose">
<h3>Wind Rose</h3>
<div id="epwWindRose"></div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- page wrapper -->
<!-- footer -->
<footer class="footer">
<div class="container-fluid">
<p>Source code is available under an MIT license on <a href="https://github.com/mdahlhausen/epwvis" rel="link">Github</a>. Please provide <a href="https://github.com/mdahlhausen/epwvis/issues" rel="link">feedback, report issues, and request graphs you would like to see here</a>.</p>
</div>
</footer> <!-- footer -->
</div> <!-- end page elements-->
<script type="text/javascript">
//from: http://www.html5rocks.com/en/tutorials/file/dndfiles/
//global variables
var epw = {};
var unitSystem = "IP";
$("#buttonIP").on("click", function(e) {
$(this).toggleClass("active");
$("#buttonSI").toggleClass("active");
unitSystem = "IP";
updateCharts(epw,unitSystem);
});
$("#buttonSI").on("click", function(e) {
$(this).toggleClass("active");
$("#buttonIP").toggleClass("active");
unitSystem = "SI";
updateCharts(epw,unitSystem);
});
function updateCharts(epw,unitSystem) {
console.log("drawing charts in " + unitSystem + " units");
clearEPWCharts();
$("#epwChartDiv").show(); //unhide
//update graphs
epwTempFloodPlot(epw);
epwTempFilter(epw);
epwCloudFloodPlot(epw);
epwWindRose(epw);
};
function readSingleFile(file) {
var f = file;
if (f) {
var r = new FileReader();
r.onloadstart = function(e) {
clearEPWCharts();
document.getElementById('fileinput').innerHTML = "parsing file...";
};
r.onload = function(e) {
// read in file
var contents = e.target.result;
var raw = r.result;
// parse file to an epw json object
epw = epw2json(raw);
//console.log(epw);
document.getElementById('stationName').innerHTML = "Weather for " + epw.stationLocation;
updateCharts(epw, unitSystem)
};
r.readAsText(f);
} else {
alert("Failed to load file");
}
};
fileInput = document.getElementById('fileinput');
fileInput.onchange = function(evt) {
readSingleFile(evt.target.files[0]);
};
dropZone = document.getElementById('drop-zone');
dropZone.ondrop = function(e) {
e.preventDefault();
this.className = 'upload-drop-zone';
readSingleFile(e.dataTransfer.files[0]);
};
dropZone.ondragover = function() {
this.className = 'upload-drop-zone drop';
return false;
};
dropZone.ondragleave = function() {
this.className = 'upload-drop-zone';
return false;
};
</script>
<script>
//google analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-80247337-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>