search for standard sites pub-search.waow.tech
search zig blog atproto

fix: allow sparkline to render with single data point, keep one leading zero for context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+3 -1
+3 -1
site/dashboard.js
··· 266 // trim leading zeros — only draw from first non-zero point 267 let firstNonZero = sliced.findIndex(d => d.count > 0); 268 if (firstNonZero === -1) return; // nothing to draw 269 const data = sliced.slice(firstNonZero); 270 - if (data.length < 2) return; 271 272 const max = Math.max(...data.map(d => d.count), 1); 273 const w = container.clientWidth || 560;
··· 266 // trim leading zeros — only draw from first non-zero point 267 let firstNonZero = sliced.findIndex(d => d.count > 0); 268 if (firstNonZero === -1) return; // nothing to draw 269 + // include one zero point before the first non-zero for context 270 + if (firstNonZero > 0) firstNonZero--; 271 const data = sliced.slice(firstNonZero); 272 + if (data.length === 0) return; 273 274 const max = Math.max(...data.map(d => d.count), 1); 275 const w = container.clientWidth || 560;