Commit 35c9e4e
fix(#103): chart canvases overflowing GridStack tiles
The chart-aspect-container's padding-bottom: 72% trick sizes the
inner canvas from the parent's width — which worked under the old
flex grid (every card was the same shape, height matched width
naturally) but breaks under GridStack: the tile's height is
gs-h × cellHeight (320px on a default tile), independent of the
tile's width. Where width × 72% > 320px, the canvas overflowed
the tile.
Visible result on a typical viewport: legends + time-axis labels
bleeding out of every chart card into the rows below them
(screenshot in the PR thread).
Fix: scope `.chart-aspect-container` so it behaves as a flex-fill
container inside the GridStack grid:
- #charts-grid .grid-stack-item-content → display: flex,
flex-direction: column, height: 100%, overflow: hidden so the
chart container can flex to the GridStack-set height and
stragglers can't escape during resize transitions.
- #charts-grid .chart-aspect-container → flex: 1 1 auto, min-height: 0,
padding-bottom: 0. min-height: 0 is the flex-child idiom that
lets the container shrink below its content's intrinsic size —
without it, the chart refused to render below ~432px.
- The original aspect-ratio rule stays in place for usages
outside the metrics grid (drill-down drawer, etc.).
The canvas absolute-fill rule (width/height: 100% !important)
was already correct; it just needed a parent with a real flex-
computed height to fill.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fc023d7 commit 35c9e4e
1 file changed
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
451 | 458 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
456 | 478 | | |
| 479 | + | |
| 480 | + | |
457 | 481 | | |
458 | 482 | | |
459 | 483 | | |
| |||
0 commit comments