Skip to content

Commit 2c78ce3

Browse files
committed
Adds 2025 Q4 data in web page
1 parent 00d85fc commit 2c78ce3

File tree

4 files changed

+65
-7
lines changed

4 files changed

+65
-7
lines changed

dataset.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
{"from": "20250101", "to": "20250331", "requests": 668, "users": 1425},
1010
{"from": "20250401", "to": "20250630", "requests": 547, "users": 1024},
1111
{"from": "20250701", "to": "20250930", "requests": 513, "users": 1171},
12-
{"from": "20251001", "to": "20251231", "requests": 496, "users": 1201}
12+
{"from": "20251001", "to": "20251231", "requests": 496, "users": 1201},
13+
{"from": "20250101", "to": "20251231", "requests": 2224, "users": 4821}
1314
],
1415
"USA": [
1516
{"from": "20240101", "to": "20240930", "requests": 14, "users": 108},
@@ -18,7 +19,8 @@
1819
{"from": "20250101", "to": "20250331", "requests": 576, "users": 1664},
1920
{"from": "20250401", "to": "20250630", "requests": 457, "users": 1196},
2021
{"from": "20250701", "to": "20250930", "requests": 339, "users": 863},
21-
{"from": "20251001", "to": "20251231", "requests": 334, "users": 1084}
22+
{"from": "20251001", "to": "20251231", "requests": 334, "users": 1084},
23+
{"from": "20250101", "to": "20251231", "requests": 1706, "users": 4807}
2224
],
2325
"NLD": [
2426
{"from": "20240101", "to": "20240930", "requests": 1, "users": 1},
@@ -34,7 +36,8 @@
3436
{"from": "20250101", "to": "20250331", "requests": 1311, "users": 3777},
3537
{"from": "20250401", "to": "20250630", "requests": 1094, "users": 4534},
3638
{"from": "20250701", "to": "20250930", "requests": 1165, "users": 2533},
37-
{"from": "20251001", "to": "20251231", "requests": 758, "users": 1611}
39+
{"from": "20251001", "to": "20251231", "requests": 758, "users": 1611},
40+
{"from": "20250101", "to": "20251231", "requests": 4328, "users": 12455}
3841
],
3942
"ROU": [
4043
{"from": "20240101", "to": "20240930", "requests": 3, "users": 3},
@@ -67,7 +70,8 @@
6770
{"from": "20250101", "to": "20250331", "requests": 493, "users": 1129},
6871
{"from": "20250401", "to": "20250630", "requests": 436, "users": 873},
6972
{"from": "20250701", "to": "20250930", "requests": 601, "users": 1480},
70-
{"from": "20251001", "to": "20251231", "requests": 538, "users": 1069}
73+
{"from": "20251001", "to": "20251231", "requests": 538, "users": 1069},
74+
{"from": "20250101", "to": "20251231", "requests": 2068, "users": 4551}
7175
],
7276
"GBR": [
7377
{"from": "20240101", "to": "20240930", "requests": 3, "users": 7},

index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ <h2>Data</h2>
3939
<option value="2024Q4">2024 Q4</option>
4040
<option value="2025Q1">2025 Q1</option>
4141
<option value="2025Q2">2025 Q2</option>
42-
<option value="2025Q3" selected="selected">2025 Q3</option>
42+
<option value="2025Q3">2025 Q3</option>
43+
<option value="2025Q4" selected="selected">2025 Q4</option>
4344
</select>
4445
</div>
4546
<table class="table" id="dataTable" data-toggle="table">
@@ -71,7 +72,7 @@ <h2>Country</h2>
7172
<tr>
7273
<th rowspan="2"></th>
7374
<th colspan="4" class="text-center">2024</th>
74-
<th colspan="2" class="text-center">2025</th>
75+
<th colspan="4" class="text-center">2025</th>
7576
</tr>
7677
<tr>
7778
<th class="text-center">Q1</th>
@@ -81,6 +82,7 @@ <h2>Country</h2>
8182
<th class="text-center">Q1</th>
8283
<th class="text-center">Q2</th>
8384
<th class="text-center">Q3</th>
85+
<th class="text-center">Q4</th>
8486
</tr>
8587
</table>
8688
</div>

scripts/linter.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import sys
55

6-
EXISTING_DATES = ["20240101", "20240331", "20240401", "20240630", "20240701", "20240930", "20241001", "20241231", "20250101", "20250331", "20250401", "20250630", "20250701", "20250930"]
6+
EXISTING_DATES = ["20240101", "20240331", "20240401", "20240630", "20240701", "20240930", "20241001", "20241231", "20250101", "20250331", "20250401", "20250630", "20250701", "20250930", "20251001", "20251231"]
77

88

99
def check_format(fpath):
@@ -40,6 +40,47 @@ def check_format(fpath):
4040
print("Invalid date {} for {}".format(entry["to"], country))
4141
success = False
4242

43+
# check if total per year exist and are good
44+
for year in range(2024, 2027):
45+
try:
46+
q1 = [a for a in data[country] if a["from"] == str(year) + '0101' and a["to"] == str(year) + '0331'][0]
47+
q2 = [a for a in data[country] if a["from"] == str(year) + '0401' and a["to"] == str(year) + '0630'][0]
48+
q3 = [a for a in data[country] if a["from"] == str(year) + '0701' and a["to"] == str(year) + '0930'][0]
49+
q4 = [a for a in data[country] if a["from"] == str(year) + '1001' and a["to"] == str(year) + '1231'][0]
50+
except IndexError:
51+
# Not all data for this year
52+
pass
53+
else:
54+
users = q1["users"] + q2["users"] + q3["users"] + q4["users"]
55+
requests = q1["requests"] + q2["requests"] + q3["requests"] + q4["requests"]
56+
yeard = [a for a in data[country] if a["from"] == str(year) + "0101" and a["to"] == str(year) + '1231']
57+
if len(yeard) == 0:
58+
print("Missing total year {} for country {} ({{\"from\": \"{}0101\", \"to\": \"{}1231\", \"requests\": {}, \"users\": {}}})".format(
59+
year,
60+
country,
61+
year,
62+
year,
63+
requests,
64+
users
65+
))
66+
success = False
67+
else:
68+
d = yeard[0]
69+
if d["users"] != users:
70+
print("Mistake in users for year data of year {} and country {}, it should be {}".format(
71+
year,
72+
country,
73+
users
74+
))
75+
success = False
76+
if d["requests"] != requests:
77+
print("Mistake in requests for year data of year {} and country {}, it should be {}".format(
78+
year,
79+
country,
80+
requests
81+
))
82+
success = False
83+
4384
return success
4485

4586

static/custom.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ function drawtable() {
7272
case "2025Q3":
7373
var entry = dataset[country].filter((entry) => entry["from"] == "20250701" && entry["to"] == "20250930")[0];
7474
break;
75+
case "2025Q4":
76+
var entry = dataset[country].filter((entry) => entry["from"] == "20251001" && entry["to"] == "20251231")[0];
77+
break;
7578
}
7679

7780
if (entry !== undefined) {
@@ -93,9 +96,11 @@ function drawCountry() {
9396
var entryq4 = dataset[country].filter((entry) => entry["from"] == "20241001" && entry["to"] == "20241231")[0];
9497
var entryq13 = dataset[country].filter((entry) => entry["from"] == "20240101" && entry["to"] == "20240930")[0];
9598
var entry2024 = dataset[country].filter((entry) => entry["from"] == "20240101" && entry["to"] == "20241231")[0];
99+
var entry2025 = dataset[country].filter((entry) => entry["from"] == "20250101" && entry["to"] == "20251231")[0];
96100
var entry2025q1 = dataset[country].filter((entry) => entry["from"] == "20250101" && entry["to"] == "20250331")[0];
97101
var entry2025q2 = dataset[country].filter((entry) => entry["from"] == "20250401" && entry["to"] == "20250630")[0];
98102
var entry2025q3 = dataset[country].filter((entry) => entry["from"] == "20250701" && entry["to"] == "20250930")[0];
103+
var entry2025q4 = dataset[country].filter((entry) => entry["from"] == "20251001" && entry["to"] == "20251231")[0];
99104
if (entryq1 !== undefined) {
100105
$("#country-table").find('tbody')
101106
.append($('<tr class="temp">')
@@ -107,10 +112,12 @@ function drawCountry() {
107112
.append($('<td class="text-center">').text(entry2025q1 === undefined ? "Unknown" : entry2025q1.requests))
108113
.append($('<td class="text-center">').text(entry2025q2 === undefined ? "Unknown" : entry2025q2.requests))
109114
.append($('<td class="text-center">').text(entry2025q3 === undefined ? "Unknown" : entry2025q3.requests))
115+
.append($('<td class="text-center">').text(entry2025q4 === undefined ? "Unknown" : entry2025q4.requests))
110116
);
111117
$("#country-table").find('tbody')
112118
.append($('<tr class="temp">')
113119
.append($('<td colspan="4" class="text-center">').text(entry2024 === undefined ? "Unknown" : entry2024.requests))
120+
.append($('<td colspan="4" class="text-center">').text(entry2025 === undefined ? "Unknown" : entry2025.requests))
114121
)
115122
.append($('<tr class="temp">')
116123
.append($('<th rowspan="3">').text('Users'))
@@ -121,10 +128,12 @@ function drawCountry() {
121128
.append($('<td class="text-center">').text(entry2025q1 === undefined ? "Unknown" : entry2025q1.users))
122129
.append($('<td class="text-center">').text(entry2025q2 === undefined ? "Unknown" : entry2025q2.users))
123130
.append($('<td class="text-center">').text(entry2025q3 === undefined ? "Unknown" : entry2025q3.users))
131+
.append($('<td class="text-center">').text(entry2025q4 === undefined ? "Unknown" : entry2025q4.users))
124132
);
125133
$("#country-table").find('tbody')
126134
.append($('<tr class="temp">')
127135
.append($('<td colspan="4" class="text-center">').text(entry2024 === undefined ? "Unknown" : entry2024.users))
136+
.append($('<td colspan="4" class="text-center">').text(entry2025 === undefined ? "Unknown" : entry2025.users))
128137
)
129138
} else {
130139
$("#country-table").find('tbody')
@@ -135,6 +144,7 @@ function drawCountry() {
135144
.append($('<td class="text-center">').text(entry2025q1 === undefined ? "Unknown" : entry2025q1.requests))
136145
.append($('<td class="text-center">').text(entry2025q2 === undefined ? "Unknown" : entry2025q2.requests))
137146
.append($('<td class="text-center">').text(entry2025q3 === undefined ? "Unknown" : entry2025q3.requests))
147+
.append($('<td class="text-center">').text(entry2025q4 === undefined ? "Unknown" : entry2025q4.requests))
138148
);
139149
$("#country-table").find('tbody')
140150
.append($('<tr class="temp">')
@@ -147,6 +157,7 @@ function drawCountry() {
147157
.append($('<td class="text-center">').text(entry2025q1 === undefined ? "Unknown" : entry2025q1.users))
148158
.append($('<td class="text-center">').text(entry2025q2 === undefined ? "Unknown" : entry2025q2.users))
149159
.append($('<td class="text-center">').text(entry2025q3 === undefined ? "Unknown" : entry2025q3.users))
160+
.append($('<td class="text-center">').text(entry2025q4 === undefined ? "Unknown" : entry2025q4.users))
150161
);
151162
$("#country-table").find('tbody')
152163
.append($('<tr class="temp">')

0 commit comments

Comments
 (0)