forked from BioKIC/Symbiota
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
286 lines (271 loc) · 11.1 KB
/
index.php
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
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
include_once('config/symbini.php');
include_once('content/lang/index.' . $LANG_TAG . '.php');
include_once($SERVER_ROOT . '/neon/classes/PortalStatistics.php');
header('Cache-Control: no-cache');
header('Pragma: no-cache');
header("Content-Type: text/html; charset=" . $CHARSET);
$stats = new PortalStatistics();
$totalSamples = $stats->getTotalNeonSamples();
$totalTaxa = $stats->getTotalNeonTaxa();
$sampleArr = $stats->getNeonSamplesByTax();
$taxaArr = $stats->getNeonTaxa();
?>
<html>
<head>
<title><?php echo $DEFAULT_TITLE; ?> Home</title>
<meta http-equiv="Expires" content="Tue, 01 Jan 1995 12:12:12 GMT">
<meta http-equiv="Pragma" content="no-cache">
<!-- UNIVERSAL CSS –––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/skeleton.css">
<?php
$activateJQuery = true;
include_once($SERVER_ROOT . '/includes/head.php');
include_once($SERVER_ROOT . '/includes/googleanalytics.php');
?>
<script type="text/javascript" src="<?php echo $CLIENT_ROOT . '/neon/js/d3.min.js'; ?>"></script>
</head>
<body class="home-page">
<style>
.bar:hover {
opacity: 0.5;
}
.bar-label {
font-size: 7px !important;
color: #0073cf !important;
}
.bar-label a {
color: #0073cf !important;
text-decoration: underline;
}
</style>
<?php include($SERVER_ROOT . '/includes/header.php'); ?>
<!-- This is inner text! -->
<div id="innertext" class="container" style="margin-top: 2rem">
<h1 class="centered">Discover and access sample-based data</h1>
<section>
<div style="border-bottom-width:2px;border-color:#F0AB00;border-left-width:20px;border-right-width:2px;border-style:solid;border-top-width:2px;padding:10px;">
<p>Attention: two NSF Dear Colleague Letters outline opportunities for innovative use of NEON resources! 1) <a href="https://www.nsf.gov/pubs/2024/nsf24081/nsf24081.jsp">Using Long-Term Research Associated Data (ULTRA-Data)</a> encourages the use of data from environmental time series. 2) <a href="https://www.nsf.gov/pubs/2024/nsf24069/nsf24069.jsp">Innovative Use of Scientific Collections (IUSC)</a> presents an opportunity to leverage the NEON Biorepository collections. Please <a href="mailto:[email protected]">contact us</a> with any questions or for information needed for potential innovative use of NEON! We are here to support you.</p>
</div>
</section>
<section>
<div class="row">
<img src="images/layout/Home-Map-2.jpg" alt="Map with samples collected within NEON sites" class="hide-on-small" style="width:100%;">
<img src="images/layout/map-mobile.jpg" alt="Map with samples collected within NEON sites" class="hide-on-large">
<p class="hide-on-small"><span style="font-size: 70%; line-height: 1">Samples available in the portal (Aug 2019), collected in Alaska (top left), Continental US (center), and Puerto Rico (bottom right). Colors indicate different collection types. Circle sizes indicate quantity of samples per collection in a given locality.</span></p>
<p class="hide-on-large"><span style="font-size: 70%; line-height: 1">Samples available in the portal (Aug 2019), collected in Continental US (top), Alaska (bottom left), and Puerto Rico (bottom right). Colors indicate different collection types. Circle sizes indicate quantity of samples per collection in a given locality.</span></p>
</div>
</section>
<section>
<div class="row centered">
<div class="four columns centered" style="background-color:#0071ce; color: white; margin-top:0.5em; padding: 0.4em 0">
<a href="<?php echo $CLIENT_ROOT; ?>/neon/search/index.php">
<div>
<img src="images/layout/glyphicon-search.png" alt="ImgPlaceholder" width="50px" height="50px" style="padding-top:0.5em;">
<p style="text-decoration: none;font-size:1.2rem;background-color:#0071ce; color: white;">Sample search</p>
</div>
</a>
</div>
<div class="four columns centered" style="background-color:#0071ce; color: white; margin-top:0.5em; padding: 0.4em 0">
<a href="<?php echo $CLIENT_ROOT; ?>/collections/map/index.php" target="_blank">
<div>
<img src="images/layout/glyphicon-globe.png" alt="ImgPlaceholder" width="50px" height="50px" style="padding-top:0.5em;">
<p style="text-decoration: none;font-size:1.2rem;background-color:#0071ce; color: white;">Map search</p>
</div>
</a>
</div>
<div class="four columns centered" style="background-color:#0071ce; color: white; margin-top:0.5em; padding: 0.4em 0">
<a href="<?php echo $CLIENT_ROOT; ?>/misc/checklists.php">
<div>
<img src="images/layout/glyphicon-list-alt.png" alt="ImgPlaceholder" width="50px" height="50px" style="padding-top:0.5em;">
<p style="text-decoration: none;font-size:1.2rem;background-color:#0071ce; color: white;">Checklists</p>
</div>
</a>
</div>
</div>
</section>
<section>
<div class="row" style="vertical-align: bottom">
<div class="six columns centered">
<h4 class="centered">> <?php echo number_format($totalSamples); ?> samples</h4>
<div id="graph"></div>
</div>
<div class="six columns centered">
<h4 class="centered">> <?php echo number_format($totalTaxa); ?> taxa</h4>
<div id="graph2"></div>
</div>
</div>
</section>
<section>
<div class="row">
<div class="four columns">
<h4 class="centered">Data</h4>
<p>Visit the <a href="misc/cite.php">How to Cite</a> page for information on how to cite NEON Biorepository data and samples.</p>
</div>
<div class="four columns">
<h4 class="centered">Samples</h4>
<p>Please consult the <a href="https://biorepo.neonscience.org/portal/misc/samplepolicy.php">Sample Use Policy</a> and the <a href="https://biorepo.neonscience.org/portal/misc/samplerequest.php">Sample Request Form</a> to initiate inquiries about sample use.</p>
</div>
<div class="four columns">
<h4 class="centered">Contact</h4>
<p><a href="https://biorepo.neonscience.org/portal/profile/newprofile.php">Join the portal</a> as a regular visitor or contributor, and send direct feedback or inquiries to <a href="mailto:[email protected]">[email protected]</a>.</p>
</div>
</div>
</section>
<section>
<div class="row">
<div class="six columns">
<h2 class="centered">Services</h2>
<p>NEON Biorepository Data Portal services:</p>
<ul>
<li>Discover sample availability and suitability for focal research interests</li>
<li>Initiate sample loan requests</li>
<li>Contribute and publish value-added sample data</li>
</ul>
<p>The majority of the NEON samples published here are physically housed at the <a href="https://biokic.asu.edu/collections" target="_blank">Arizona State University Biocollections</a>, located in Tempe, Arizona.</p>
</div>
<div class="six columns">
<h2 class="centered">Learn more</h2>
<p>This portal is offered through the <a href="https://symbiota.org/" target="_blank">Symbiota</a> software platform and is informationally synchronized with the <a href="https://neonscience.org/data/" target="_blank">main NEON Data Portal</a>, which serves the full spectrum of NEON data products.</p>
<p>To learn more about the features and capabilities available through Symbiota, visit the <a href="https://symbiota.org/docs/" target="_blank">Symbiota Docs site</a>.</p>
<p>Visit the <a href="https://scholar.google.com/citations?user=MGg_jIcAAAAJ&hl=en&oi=ao">NEON Biorepository Google Scholar Profile</a> for an up-to-date list of publications related to NEON samples and specimens.</p>
<p>Read more about NEON's history and experimental design on the <a href="https://www.neonscience.org/" target="_blank">NEON homepage</a>.</p>
<p>To explore sample collection and processing methods, visit the <a href="https://www.neonscience.org/data-collection/protocols-standardized-methods">NEON Protocols & Standardized Methods page</a>.</p>
</div>
</div>
</section>
</div>
<?php include($SERVER_ROOT . '/includes/footer.php'); ?>
</body>
<script>
const collsdb = <?php echo json_encode($sampleArr); ?>;
const collstx = <?php echo json_encode($taxaArr); ?>;
console.dir(collstx);
function barChart(dataObj, div, tabIndex, selector) {
console.log(selector);
let min = d3.min(dataObj, (d) => parseInt(d[`${selector}`]));
let max = d3.max(dataObj, (d) => parseInt(d[`${selector}`]));
console.log(max);
let w = 300;
let h = 200;
let pd = 0;
let cYScale = d3.scaleLinear()
.domain([0, max])
.range([0, h - h / 5]);
let cSvg = d3
.select(div)
.append('svg')
.attr('viewBox', `0 0 ${w} ${h}`);
cSvg.selectAll('rect')
.data(dataObj)
.enter()
.append('a')
.attr('xlink:href', (d) => `collections/list.php?db=${d.db}&includeothercatnum=1&usethes=1&taxontype=1&tabindex=${tabIndex}`) // Adds url to text
.attr('xlink:title', (d) => `Click to see ${d[`${selector}`]} ${selector}`) // Adds url to text
.append('rect')
.attr('title', (d, i) => parseInt(d[`${selector}`]))
// .on('click', (d) => console.log(d))
.attr('x', 0)
.attr('y', (d, i) => 5 + i * 20)
// .attr('x', (d) => h - d)
// .attr('y', (d, i) => i * (w / dataObj.length))
.attr('width', (d, i) => cYScale(parseInt(d[`${selector}`])))
.attr('height', 15)
.attr('fill', '#565a5c')
// .attr('fill', (d, i) => d.color)
.attr('class', 'bar');
cSvg
.selectAll('text')
.data(dataObj)
.enter()
.append('text')
.attr('class', 'bar-label')
.attr('x', (d, i) => 5 + cYScale(parseInt(d[`${selector}`]))) // all on right side
.attr('y', (d, i) => 20 + i * 20) // adds gap on top
.append('a') // Adds link element
.attr('xlink:href', (d) => `collections/list.php?db=${d.db}&includeothercatnum=1&usethes=1&taxontype=1&tabindex=${tabIndex}`) // Adds url to text
.attr('xlink:title', (d) => `Click to see ${d[`${selector}`]} ${selector}`)
.text((d, i) => d.name);
}
const colls = [{
name: "Microbes",
samples: "5000",
db: "5,31,69,6",
color: "#F65C5C"
},
{
name: "Invertebrates",
samples: "4500",
db: "i",
color: "#1E9BF5"
},
{
name: "Vertebrates",
samples: "3000",
db: "v",
color: "#DF4AED"
},
{
name: "Plants",
samples: "500",
db: "p",
color: "#18BC6A"
},
{
name: "Environmental",
samples: "300",
db: "e",
color: "#e3e302"
},
{
name: "Algae",
samples: "100",
db: "a",
color: "#18BC6A"
}
];
const taxa = [{
name: "Ground Beetles",
samples: "5000",
db: "5,31,69,6",
color: "#F65C5C"
},
{
name: "Plants",
samples: "4500",
db: "i",
color: "#1E9BF5"
},
{
name: "Other Invertebrates",
samples: "3000",
db: "v",
color: "#DF4AED"
},
{
name: "Mammals",
samples: "500",
db: "p",
color: "#18BC6A"
},
{
name: "Fishes",
samples: "300",
db: "e",
color: "#e3e302"
},
{
name: "Algae",
samples: "100",
db: "a",
color: "#18BC6A"
}
];
// barChart(colls, '#graph');
barChart(collsdb, '#graph', 1, 'samples');
barChart(collstx, '#graph2', 0, 'taxa');
</script>
</html>