-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenesis.php
45 lines (35 loc) · 1.41 KB
/
genesis.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
<?php include "includes/header.php"; ?>
<section class="center pure-g-r">
<article class="pure-u-1 pure-center">
<?php include "img/genesis_entry.svg";?>
<p><a class="pure-button pure-button-tile" href="/macrogenesis" style="display:block;">Makrogenese-Lab</a></p>
</article>
</section>
<script type="text/javascript">
requirejs(['faust_common','json!data/testimony-stats', 'json!data/witness-stats', 'domReady'],
function(Faust, testimony, witnesses, domReady) {
// set breadcrumbs
domReady(function() {
Faust.context.setContextSimple("Genese", []);
var updateGraph = function(data, idPrefix, labelSuffix) {
try {
Object.keys(data.counts).forEach(function (year) {
var el = document.getElementById(idPrefix + year);
if (el) {
var height = data.counts[year] / data.max;
el.setAttribute('height', height)
if (labelSuffix)
el.setAttribute('title', year + ': ' + data.counts[year] + labelSuffix);
}
});
} catch (e) {
console.error(e, 'while updating graph', idPrefix)
}
};
updateGraph(testimony, 'tes_', ' Entstehungszeugnisse');
updateGraph(witnesses, 'wit_');
Faust.tooltip.addToTooltipElements();
});
});
</script>
<?php include "includes/footer.php"; ?>