From 51ffecd437c7ac5f9c2686433ae588352e69c09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sgeir=20Thor=20Johnson?= Date: Thu, 18 Jun 2026 23:55:05 +0000 Subject: [PATCH] Promote Page Trends to top, show full day-detail breakdown - move Page Trends chart directly under the main views/stars charts (it's the most useful view) and widen it to 8 lines / taller - day detail: drop the top-5 cap on pages and referrers (GitHub snapshots cap at 10 each, so show all of them) and add unique counts --- .github/scripts/accumulate-traffic.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/scripts/accumulate-traffic.py b/.github/scripts/accumulate-traffic.py index 768a73e..e8b3aa5 100644 --- a/.github/scripts/accumulate-traffic.py +++ b/.github/scripts/accumulate-traffic.py @@ -208,6 +208,8 @@ DASHBOARD_TEMPLATE = r"""
Daily Views

Drag to zoom — click Reset to restore

GitHub Stars (cumulative)

Bars show stars gained per day · drag to zoom

+

Page Trends — daily 14-day view count for the top pages

+
Top Pages (top 20 — peak 14-day count across all snapshots)
Top Referrers (top 20 — peak 14-day count across all snapshots)
@@ -216,8 +218,6 @@ DASHBOARD_TEMPLATE = r"""

Referrer Trends

-

Page Trends

-

Day Detail

Click a day on the views chart to see that day's breakdown

Daily Clones

@@ -420,15 +420,15 @@ new ApexCharts(document.getElementById('refTrendChart'), { const allPathNames = new Set(); DATA.paths_series.forEach(s=>s.paths.forEach(p=>allPathNames.add(p.path))); -const topPathNames = [...allPathNames].map(n=>({n,c:(allPathsMap[n]||{count:0}).count})).sort((a,b)=>b.c-a.c).slice(0,6).map(x=>x.n); +const topPathNames = [...allPathNames].map(n=>({n,c:(allPathsMap[n]||{count:0}).count})).sort((a,b)=>b.c-a.c).slice(0,8).map(x=>x.n); new ApexCharts(document.getElementById('pathTrendChart'), { ...baseOpts, - chart:{...baseOpts.chart, type:'line', height:320, zoom:{enabled:true,type:'x'}}, + chart:{...baseOpts.chart, type:'line', height:380, zoom:{enabled:true,type:'x'}}, series:topPathNames.map((name,i)=>({ name:shortenPath(name), data:DATA.paths_series.map(s=>{const p=s.paths.find(x=>x.path===name); return [new Date(s.date).getTime(), p?p.count:null];}) })), - colors:colors.slice(0,6), + colors:colors.slice(0,8), stroke:{curve:'smooth',width:2}, xaxis:{type:'datetime'}, yaxis:{labels:{formatter:v=>v>=1000?(v/1000).toFixed(1)+'k':v}}, @@ -449,15 +449,15 @@ function showDayDetail(date) { let html = '
'; html += '
Views: '+(day?fmt(day.count)+' ('+fmt(day.uniques)+' unique)':'no data')+'
Clones: '+(clone?fmt(clone.count)+' ('+fmt(clone.uniques)+' unique)':'no data')+'
'; if (snap) { - html += '
Referrers (14-day window):
'; - snap.referrers.slice(0,5).forEach(r=>{ html += `${r.referrer}: ${fmt(r.count)}
`; }); + html += `
Referrers (14-day window, ${snap.referrers.length}):
`; + snap.referrers.forEach(r=>{ html += `${r.referrer}: ${fmt(r.count)} (${fmt(r.uniques)} uniq)
`; }); html += '
'; } html += '
'; if (pathSnap) { - html += '
Top pages (14-day window):'; - html += ''; - pathSnap.paths.slice(0,5).forEach(p=>{ html += ``; }); + html += `
Top pages (14-day window, ${pathSnap.paths.length}):`; + html += '
PageViews
${shortenPath(p.path)}${fmt(p.count)}
'; + pathSnap.paths.forEach(p=>{ html += ``; }); html += '
PageViewsUnique
${shortenPath(p.path)}${fmt(p.count)}${fmt(p.uniques)}
'; } el.innerHTML = html;