fix: make treemap and punchcard responsive with viewBox scaling

Replaced hardcoded width/height on SVG elements with viewBox + width:100%
so both components fill their parent container instead of using fixed pixels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-30 10:28:29 +02:00
parent 9d2d87e7e1
commit 7a1625c297
2 changed files with 3 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ export function PunchcardHeatmap({ cells, mode, width, height }: PunchcardHeatma
}, [cells, mode, width, height]);
return (
<svg width={width} height={height} style={{ display: 'block' }}>
<svg viewBox={`0 0 ${width} ${height}`} style={{ width: '100%', height: 'auto', display: 'block' }}>
{/* Day labels (top) */}
{DAYS.map((day, i) => (
<text