Skip to content

feat: TileGrid — interactive hover-to-highlight tile clusters#256

Merged
ivanmkc merged 2 commits into
masterfrom
feat/tile-grid
Jul 10, 2026
Merged

feat: TileGrid — interactive hover-to-highlight tile clusters#256
ivanmkc merged 2 commits into
masterfrom
feat/tile-grid

Conversation

@ivanmkc

@ivanmkc ivanmkc commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Interactive SVG grid component. Hovering a cell highlights all cells of the same cluster (greying out others).

Props

  • cols, rows — grid dimensions
  • cellSize — pixel size per cell (default 12)
  • cells — flat array of {cluster: number, color: string} (row-major)
  • bgImage — optional background image URL
  • gap — gap between cells (default 1)

Test plan

  • npm run build passes
  • 647/647 tests pass
  • Visual test after deploy

SVG grid where each cell belongs to a cluster. On hover, all cells
NOT in the hovered cluster get greyed out (opacity 0.08), visually
isolating the cluster. Shows cluster ID and cell count.

Props: cols, rows, cellSize (default 12), cells (array of
{cluster, color}), bgImage (optional), gap (default 1).

Added to KNOWN_COMPONENTS and viewer registry.
One onMouseMove on the <svg> with coordinate→cell math replaces N
per-rect onMouseEnter/onMouseLeave callbacks — O(1) listeners for any
grid size. Matters for large grids (100×100 = 10K rects).
@ivanmkc ivanmkc merged commit 019a933 into master Jul 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants