National Stats
Various statistics on national level
All Time Table
Result Matrix
import {Plot} from "@mkfreeman/plot-tooltip"
result_data_trans = transpose(result_data)
result_data_ojs = result_data_trans.filter(function(result) {
return result.country == ctry;
})
Plot.plot({
color: {
legend: false,
type: "pow",
//scheme: "oranges"
range: ["#fef3e4","#F6B352"]
},
y: {
grid: false,
label:"Home"
},
x: {
grid: false,
label:"Away",
axis: "top"
},
marks: [
Plot.cell(result_data_ojs, {
x: "GA",
y: "GH",
fill: "frac",
title: d => d.GH + " : " + d.GA + "\n\n" +d.frac?.toFixed(3) + "%"
}),
Plot.text(result_data_ojs, {
x: "GA",
y: "GH",
text: d => d.frac?.toFixed(3) + "%",
fill: d=> (d.frac>=5.5) ? "black" : "black"
})
],
style: {
background: "#383A3F",
fill: "#D3D3D3",
fontFamily: "Poppins",
fontSize: "20px"
},
tooltip: {
stroke: "white",
color: "#F68657"
},
height: 950,
width: 950,
marginLeft: 50,
marginRight: 50,
marginTop: 50,
marginBottom: 50,
insetTop: 0,
insetBottom: 0,
insetLeft: 0,
insetRight: 0
})
Average Number of Goals
avg_data_trans = transpose(avg_data)
avg_data_ojs = avg_data_trans.filter(function(result) {
return result.country == ctry;
})
Plot.plot({
color: {
legend: true
},
y: {
grid: false,
domain: d3.extent(avg_data_ojs,d => d.avg_goals),
zero: true,
label:"↑ Average number of goals per match",
ticks: 5
},
x: {
grid: false,
domain: d3.extent(avg_data_ojs,d => d.year),
label:"Year",
ticks: 5
},
marks: [
Plot.gridY({ticks:5, stroke: "#fff", strokeOpacity: 0.2}),
Plot.dot(avg_data_ojs, {x: "year", y: "avg_goals",
title: (d) => `${d.avg_goals}`
}),
Plot.line(avg_data_ojs, {x: "year", y: "avg_goals"
})
],
style: {
background: "#383A3F",
fill: "#D3D3D3",
fontFamily: "Poppins",
fontSize: "20px"
},
height: 600,
width: 950,
marginLeft: 50,
marginRight: 50,
marginTop: 50,
marginBottom: 50,
insetTop: 0,
insetBottom: 0,
insetLeft: 0,
insetRight: 0
})
Home Field Advantage
hfa_data_trans = transpose(hfa_data)
hfa_data_ojs = hfa_data_trans.filter(function(result) {
return result.country == ctry;
})
Plot.plot({
color: {
legend: true
},
y: {
grid: false,
domain: d3.extent(hfa_data_ojs,d => d.hfa),
zero: true,
label:"↑ Fraction of home games won",
ticks: 5
},
x: {
grid: false,
domain: d3.extent(hfa_data_ojs,d => d.year),
label:"Year",
ticks: 5
},
marks: [
Plot.gridY({ticks:5, stroke: "#fff", strokeOpacity: 0.2}),
Plot.dot(hfa_data_ojs, {x: "year", y: "hfa",
title: (d) => `${d.hfa}`
}),
Plot.line(hfa_data_ojs, {x: "year", y: "hfa"
})
],
style: {
background: "#383A3F",
fill: "#D3D3D3",
fontFamily: "Poppins",
fontSize: "20px"
},
height: 600,
width: 950,
marginLeft: 50,
marginRight: 50,
marginTop: 50,
marginBottom: 50,
insetTop: 0,
insetBottom: 0,
insetLeft: 0,
insetRight: 0
})
Most goals per match
Zero-Zero
Most absolute number of 0:0
toptotaljs = transpose(top_total)
disp_toptotal = toptotaljs.filter(function(team) {
return team.country == ctry;
})
Inputs.table(disp_toptotal, {
columns: [
"Team",
"Count",
"Matches"
],
header: {
Team: "Team",
Count: "Count",
Matches: "#Matches"
}
})
Highest Percentage of 0:0 (only teams with more than 20 games considered)
Runs
longest unbeaten run
streaksjs = transpose(streaks)
disp_streak = streaksjs.filter(function(team) {
return team.country == ctry;
})
Inputs.table(disp_streak, {
columns: [
"team",
"streak",
"from",
"to"
],
header: {
team: "Team",
streak: "streak length",
from: "from",
to: "to"
}
})
(Last update: 2025-06-23)