feat: TileGrid — interactive hover-to-highlight tile clusters#256
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interactive SVG grid component. Hovering a cell highlights all cells of the same cluster (greying out others).
Props
cols,rows— grid dimensionscellSize— pixel size per cell (default 12)cells— flat array of{cluster: number, color: string}(row-major)bgImage— optional background image URLgap— gap between cells (default 1)Test plan
npm run buildpasses