This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
236 lines (200 loc) · 9.71 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- CSS for Leaflet and local CSS-->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<link rel="stylesheet" href="style.css">
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="
crossorigin=""></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<title>FuTRES Data Portal</title>
</head>
<body>
<header class="header">
<h1 class="logo">FuTRES Data Portal</h1>
<nav>
<ul class="nav-links">
<li><a id="query-nav" class="tablink">Query</a></li>
<li><a id="browse-nav" class="tablink">Browse</a></li>
<li><a id="home-nav" class="nav-btn">Home</a></li>
</ul>
</nav>
</header>
<div id="home-tab" class="tabcontent">
<div id="hero-image">
<div id="hero-text">
<h1 class="page-h">FuTRES Data Portal</h1>
<p>FuTRES (Functional Trait Resource for Environmental Studies) is a workflow for assembling functional trait data measured at the specimen level, and a database to serve that data. It is based on a semantic model and is powered by extensible parsers, a backend database, and an API. A key aspect of FuTRES is the ability to collect, store, aggregate, and share data at the individual or specimen and higher levels without loss of information.</p>
</div>
</div>
</div>
<div id="query-tab" class="tabcontent">
<div class="selects-container">
<form>
<label class="select-labels" for="scientific-name-select">Scientific Name:</label><br>
<select name="scientificName" id="scientific-name-select">
<option value="">- Select a Scientific Name -</option>
</select> <br>
<label class="select-labels" for="measure-type-select">Measurement Type:</label><br>
<select name="measurement" id="measurement-type-select">
<option value="">- Select a Measurement Type -</option>
</select> <br>
<label class="select-labels" for="year-select">Year Collected:</label><br>
<select name="year" id="year-select">
<option value="">- Select Year Collected -</option>
</select> <br>
<label class="select-labels" for="country-select">Country:</label><br>
<select name="country" id="country-select">
<option value="">- Select a Country -</option>
</select><br>
<input type="radio" id="radio-map" name="display" value="map">
<label class="radio-label" for="map">Show on Map</label>
<input type="radio" id="radio-table" name="display" value="table">
<label class="radio-label" for="table">Show in Table</label><br>
<label class="select-labels" for="number-results">Results:</label>
<select name="number" id="number-results">
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="100">100</option>
<option value="125">125</option>
<option value="150">150</option>
<option value="200">200</option>
</select><br>
<button id="search-btn" class="btn-all" type="button">Search</button>
</div> <!--selects div-->
<div id="map-container">
<div id="map">
</div> <!--map div-->
</div> <!--map container-->
<div id="query-table-container" style="display: none;">
</div>
</div> <!-- query tab div -->
<div id="browse-tab" class="tabcontent" style="display: none;">
<h2 class="page-h">Browse Data Visualization</h2>
<h2 class="collapsible-button">Charts</h2>
<div id="chart-wrapper" class="collapse-content">
<div id="chart-selects-container">
<select name="chart-select" id="chart-select">
<option value="">- Select a Chart -</option>
<option value="country">Countries</option>
<option value="measurement-type">Measurement Type</option>
<option value="year-collected">Year Collected</option>
<option value="species">Species Collected</option>
</select> <br>
</div> <!--chart select container-->
<div id="chart-container">
<canvas id="dataChart" width="800" height="650"></canvas>
</div>
</div> <!-- chart wrapper -->
<h2 class="collapsible-button">Projects</h2>
<div id="projects-wrapper" class="collapse-content">
<div id="proj-table-container">
<table id="project-table">
<thead>
<tr class="no-hover">
<th>Project Title</th>
<th>Principal Investigator</th>
<th>PI Affiliation</th>
<th>Number of Measurements</th>
</tr>
</thead>
</table>
</div>
</div> <!--projects wrapper-->
<h2 class="collapsible-button">Summary Tables</h2>
<div id="tables-wrapper" class="collapse-content">
<div id="year-table-container">
<table id="year-table">
<tr class="no-hover">
<th class="ascending" onclick="sortTable('year-table', 0)">Year Collected</th>
<th class="ascending" onclick="sortTable('year-table', 1)">Count</th>
</tr>
</table>
</div>
<div id="species-table-container">
<table id="species-table">
<tr class="no-hover">
<th class="ascending" onclick="sortTable('species-table', 0)">Species</th>
<th class="ascending" onclick="sortTable('species-table', 1)">Count</th>
</tr>
</table>
</div>
<div id="country-table-container">
<table id="country-table">
<tr class="no-hover">
<th class="ascending" onclick="sortTable('country-table', 0)">Country</th>
<th class="ascending" onclick="sortTable('country-table', 1)">Count</th>
</tr>
</table>
</div>
<div id="measure-table-container">
<table id="measure-table">
<tr class="no-hover">
<th class="ascending" onclick="sortTable('measure-table', 0)">Measurement Type</th>
<th class="ascending" onclick="sortTable('measure-table', 1)">Count</th>
</tr>
</table>
</div>
</div> <!--tables wrapper-->
<!-- The Modal -->
<div id="detail-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<div id="modal-table-container">
</div>
</div> <!--modal content-->
</div> <!--modal -->
</div> <!-- browse tab-->
<!-- JS -->
<script type="text/javascript" src="app.js"></script>
<script>
function sortTable(tableId, n) {
let table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
table = document.getElementById(tableId);
switching = true;
dir = "asc";
while (switching) {
switching = false;
rows = table.getElementsByTagName("TR");
for (i = 1; i < (rows.length - 1); i++) {
shouldSwitch = false;
x = rows[i].getElementsByTagName("TD")[n];
y = rows[i + 1].getElementsByTagName("TD")[n];
let cmpX=isNaN(parseInt(x.innerHTML))?x.innerHTML.toLowerCase():parseInt(x.innerHTML);
let cmpY=isNaN(parseInt(y.innerHTML))?y.innerHTML.toLowerCase():parseInt(y.innerHTML);
cmpX=(cmpX=='-')?0:cmpX;
cmpY=(cmpY=='-')?0:cmpY;
if (dir == "asc") {
if (cmpX > cmpY) {
shouldSwitch= true;
break;
}
} else if (dir == "desc") {
if (cmpX < cmpY) {
shouldSwitch= true;
break;
}
}
}
if (shouldSwitch) {
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
switching = true;
switchcount ++;
} else {
if (switchcount == 0 && dir == "asc") {
dir = "desc";
switching = true;
}
}
}
}
</script>
</body>
</html>