Skip to content

Commit 2b5d3aa

Browse files
committed
Use hours spent and not total sessions for the visualization
1 parent de0794d commit 2b5d3aa

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

site/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,17 +1698,17 @@
16981698
var barColors={total:"var(--fg)",edm:"var(--cyan)",lofi:"var(--amber)",synthwave:"#ff66cc"};
16991699

17001700
if(daily.length>0){
1701-
var maxSessions=Math.max.apply(null,daily.map(function(d){return d.sessions}))||1;
1701+
var maxHours=Math.max.apply(null,daily.map(function(d){return d.listen_hours}))||1;
17021702
daily.forEach(function(d){
1703-
var pct=Math.max((d.sessions/maxSessions)*100,3);
1703+
var pct=Math.max((d.listen_hours/maxHours)*100,3);
17041704
var bar=document.createElement("div");
17051705
bar.className="radio-chart-bar";
17061706
bar.style.height=pct+"%";
17071707
bar.style.background=barColors[stationKey]||barColors.lofi;
17081708
bar.style.opacity="0.7";
17091709
var tip=document.createElement("div");
17101710
tip.className="tooltip";
1711-
tip.textContent=d.date+" - "+d.sessions+" sessions, "+d.listen_hours.toFixed(1)+"h";
1711+
tip.textContent=d.date+" - "+d.listen_hours.toFixed(1)+"h, "+d.sessions+" sessions";
17121712
bar.appendChild(tip);
17131713
chart.appendChild(bar);
17141714
});

0 commit comments

Comments
 (0)