To-do report: активных дней за последние 7 рядом с активностью за день снимка; подпись над столбиком не обрезается
All checks were successful
ci / test (push) Successful in 21s
ci / deploy (push) Successful in 1m42s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 14:44:12 +03:00
parent 715546bdae
commit 3fae6b2792
7 changed files with 49 additions and 34 deletions

View File

@@ -28,7 +28,7 @@ export function renderPersonChart(days: ActivityDay[], threshold: number, yMax:
const w = days.length * CELL;
const cols = days
.map((d, i) => {
const h = d.total > 0 ? Math.max(3, Math.round((d.total / yMax) * (CHART_H - 6))) : 0;
const h = d.total > 0 ? Math.max(3, Math.round((d.total / yMax) * (CHART_H - 14))) : 0;
const bar = h ? `<rect x="${i * CELL + 3}" y="${CHART_H - h}" width="${CELL - 6}" height="${h}" fill="#ffffff" stroke="#111827" stroke-width="0.8"/>` : "";
const num = d.total > 0 ? `<text x="${i * CELL + CELL / 2}" y="${CHART_H - h - 2}" text-anchor="middle" font-size="8" font-weight="700" fill="#111827" paint-order="stroke" stroke="#ffffff" stroke-width="2">${d.total}</text>` : "";
return `<g><title>${esc(describeDay(d, threshold))} (${weekday(d.date)})</title><rect x="${i * CELL}" y="0" width="${CELL}" height="${CHART_H}" fill="${COLORS[d.status]}" stroke="#ffffff" stroke-width="0.6"/>${bar}${num}</g>`;