Commit 970ad5de authored by Michał Woźniak's avatar Michał Woźniak
Browse files

The Czech Republic, eh! also, UTF-8 charset now

parent 38932c6d
Pipeline #104 passed with stage
in 0 seconds
...@@ -58,6 +58,8 @@ let getSiteCases = (site) => { ...@@ -58,6 +58,8 @@ let getSiteCases = (site) => {
// snowflake templates are snowflake // snowflake templates are snowflake
if (site === "China") { if (site === "China") {
site = "Mainland China" site = "Mainland China"
} else if (site === "Czech Republic") {
site = "The Czech Republic"
} }
console.log(`+-- fetching covid data for: ${site}`) console.log(`+-- fetching covid data for: ${site}`)
return wtf return wtf
...@@ -250,6 +252,7 @@ let selectSite = (e) => { ...@@ -250,6 +252,7 @@ let selectSite = (e) => {
var theChart = false; var theChart = false;
let chart = () => { let chart = () => {
var context = document.getElementById('the-chart').getContext('2d'); var context = document.getElementById('the-chart').getContext('2d');
var graph_width = 45;
Chart.defaults.global.defaultFontColor = '#bbb'; Chart.defaults.global.defaultFontColor = '#bbb';
Chart.defaults.global.defaultFontFamily = 'Play Regular'; Chart.defaults.global.defaultFontFamily = 'Play Regular';
theChart = new Chart(context, { theChart = new Chart(context, {
...@@ -257,27 +260,27 @@ let chart = () => { ...@@ -257,27 +260,27 @@ let chart = () => {
data: { data: {
datasets: [/*{ datasets: [/*{
label: 'Doubles every day', label: 'Doubles every day',
data: genArr(45, (i, arr)=>{ return arr[i-1]*2 }), data: genArr(graph_width, (i, arr)=>{ return arr[i-1]*2 }),
backgroundColor: 'rgba(127, 64, 64, 0.1)', backgroundColor: 'rgba(127, 64, 64, 0.1)',
borderColor: 'rgba(127, 64, 64, 0.1)', borderColor: 'rgba(127, 64, 64, 0.1)',
pointRadius: 0, pointRadius: 0,
borderWidth: 1 borderWidth: 1
}, */{ }, */{
label: 'Doubles every 2 days', label: 'Doubles every 2 days',
data: genArr(45, (i, arr)=>{ return arr[i-1]*Math.pow(2, 1/2) }), data: genArr(graph_width, (i, arr)=>{ return arr[i-1]*Math.pow(2, 1/2) }),
backgroundColor: 'rgba(192, 192, 127, 0.1)', backgroundColor: 'rgba(192, 192, 127, 0.1)',
borderColor: 'rgba(192, 192, 127, 0.1)', borderColor: 'rgba(192, 192, 127, 0.1)',
pointRadius: 0, pointRadius: 0,
borderWidth: 1 borderWidth: 1
}, { }, {
label: 'Doubles every 7 days', label: 'Doubles every 7 days',
data: genArr(45, (i, arr)=>{ return arr[i-1]*Math.pow(2, 1/7) }), data: genArr(graph_width, (i, arr)=>{ return arr[i-1]*Math.pow(2, 1/7) }),
backgroundColor: 'rgba(192, 255, 192, 0.1)', backgroundColor: 'rgba(192, 255, 192, 0.1)',
borderColor: 'rgba(192, 255, 192, 0.1)', borderColor: 'rgba(192, 255, 192, 0.1)',
pointRadius: 0, pointRadius: 0,
borderWidth: 1 borderWidth: 1
}], }],
labels: genArr(45, 1) labels: genArr(graph_width, 1)
}, },
options: { options: {
responsive: true, responsive: true,
......
<html> <html>
<head> <head>
<meta charset="utf-8"/>
<script src="./wtf_wikipedia-client.min.js"></script> <script src="./wtf_wikipedia-client.min.js"></script>
<script src="./Chart.bundle.min.js"></script> <script src="./Chart.bundle.min.js"></script>
<script src="./covid.js"></script> <script src="./covid.js"></script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment