Top 100 American Whiskeys of 2024
Format: rank, name with distillery under, proof
Search
Distillery
All
Export
Showing 0 of 100
Avg proof: NA
Top distillery: NA
Note: Proof displays to two decimals when numeric.
” +
“
”
);
}).join(“”);
}
function updateStats(items){
const distCounts = new Map();
let sum = 0, count = 0;
items.forEach(x => {
distCounts.set(x.distillery, (distCounts.get(x.distillery) || 0) + 1);
const n = Number(x.proof);
if (Number.isFinite(n)) { sum += n; count += 1; }
});
let top = “NA”, topCount = 0;
distCounts.forEach((c, name) => {
if (c > topCount) { topCount = c; top = name || “NA”; }
});
statVisible.textContent = “Showing ” + items.length + ” of 100″;
statAvgProof.textContent = count ? (“Avg proof: ” + (sum / count).toFixed(2)) : “Avg proof: NA”;
statTopDist.textContent = top === “NA” ? “Top distillery: NA” : (“Top distillery: ” + top + ” (” + topCount + “)”);
}
function buildCsv(items){
const headers = [“Rank”,”Name”,”Distillery”,”Proof”];
const lines = [headers.join(“,”)];
items.forEach(x => {
const row = [
x.rank,
x.name,
x.distillery,
formatProof(x.proof)
].map(v => {
const s = String(v ?? “”);
return /[“,\n]/.test(s) ? ‘”‘ + s.replace(/”/g,’””‘) + ‘”‘ : s;
}).join(“,”);
lines.push(row);
});
return lines.join(“\n”);
}
function downloadCsv(filename, csvText){
const blob = new Blob([csvText], { type:”text/csv;charset=utf-8″ });
const url = URL.createObjectURL(blob);
const a = document.createElement(“a”);
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function refresh(){
const filtered = getFiltered();
render(filtered);
updateStats(filtered);
}
uniqueDistilleries(data).forEach(d => {
const opt = document.createElement(“option”);
opt.value = d;
opt.textContent = d;
distEl.appendChild(opt);
});
searchEl.addEventListener(“input”, refresh);
distEl.addEventListener(“change”, refresh);
exportBtn.addEventListener(“click”, function () {
const items = getFiltered();
const csv = buildCsv(items);
downloadCsv(“fred-minnick-top-100-american-whiskeys-2024.csv”, csv);
});
refresh();
})();
” + x.rank + “
” +
“” +
“
” +
“” + escapeHtml(x.name) + “
” + “” + escapeHtml(x.distillery) + “
” + “” +
“
” +
“” + escapeHtml(proofOut) + “
” + “
