-
Notifications
You must be signed in to change notification settings - Fork 3
/
history.html
85 lines (80 loc) · 2.25 KB
/
history.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
---
layout: default
title: History
---
<div
class="d-flex flex-column"
style="height: calc(100vh - 56px - var(--bs-border-width) - 4rem)"
>
<div class="card my-2">
<div class="card-body">
<div class="d-flex flex-column flex-md-row gap-2 gap-md-3">
<a
href="data/history.csv"
class="text-decoration-none d-inline-flex flex-row align-items-center gap-1"
download
>
{% include icons/download.html %} Download CSV</a
>
<a
href="data/history.json"
class="text-decoration-none d-inline-flex flex-row align-items-center gap-1"
download
>
{% include icons/download.html %} Download JSON</a
>
<a
href="data/history.xlsx"
class="text-decoration-none d-inline-flex flex-row align-items-center gap-1"
download
>
{% include icons/download.html %} Download Excel Sheet</a
>
</div>
</div>
</div>
<div class="flex-grow-1">
<canvas id="history" width="800" height="400"></canvas>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js@latest"></script>
<script>
const data = {{ site.data.history | jsonify }};
Chart.defaults.font.family =
'system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
const historyContext = document.getElementById("history").getContext("2d");
const historyChart = new Chart(historyContext, {
type: "line",
data: {
labels: data.map((day) => day.Date),
datasets: [
{
label: "Tagged Regions",
data: data.map((day) => day.Count),
fill: false,
borderColor: "#0d6efd",
pointBackgroundColor: "#0d6efd",
tension: 0.1,
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false,
},
title: {
display: true,
text: "Tagged Regions Found by Day",
},
},
interaction: {
mode: "nearest",
intersect: false,
axis: "x",
},
},
});
</script>