Skip to content
All stat categories and definitions used on Player Stats and other AFL pages.
Show code
defs = window.aflStatDefs
{
const container = html`<div></div>`
for (const [key, cat] of Object.entries(defs)) {
if (cat.columns.length === 0) continue
const section = document.createElement("div")
section.style.marginBottom = "2rem"
const h2 = document.createElement("h2")
h2.textContent = cat.label
h2.style.marginBottom = "0.75rem"
section.appendChild(h2)
const table = document.createElement("table")
table.className = "table table-sm"
const thead = document.createElement("thead")
const headRow = document.createElement("tr")
for (const label of ["Stat", "Description"]) {
const th = document.createElement("th")
th.textContent = label
headRow.appendChild(th)
}
thead.appendChild(headRow)
table.appendChild(thead)
const tbody = document.createElement("tbody")
for (const col of cat.columns) {
const tr = document.createElement("tr")
const tdName = document.createElement("td")
const strong = document.createElement("strong")
strong.textContent = cat.header[col] || col
tdName.appendChild(strong)
tdName.style.whiteSpace = "nowrap"
const tdDesc = document.createElement("td")
tdDesc.textContent = cat.tooltip?.[col] || "—"
tr.appendChild(tdName)
tr.appendChild(tdDesc)
tbody.appendChild(tr)
}
table.appendChild(tbody)
section.appendChild(table)
container.appendChild(section)
}
return container
}