Heatmap overlay for next-move frequencies#18
Open
jeffpalm wants to merge 2 commits into
Open
Conversation
Adds a "Heatmap" toggle next to the Export button. When on, every candidate next move at the current position renders an overlay on its destination square: a cold-to-hot color tint (saturated blue → red, skipping green/yellow so it doesn't clash with the wood board), the differentiating opening name, the share %, and the game count. Insignificant cells (< 3% share) drop the tint and use board-aware text colors so the label still reads cleanly. The ECO catalog (~800 kB) is dynamic-imported the first time the toggle is enabled, so users who never open the heatmap don't pay for it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the atamano's projects Team on Vercel. A member of the Team first needs to authorize it. |
…rge-conflict-lHJgw
Owner
|
Hey, thanks for the contribution! The idea looks interesting, I'll take a closer look and get back to you ASAP. |
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.
Hey! 👋 Just discovered Opening Scanner — really impressed with it. The no-server-state, all-client-side scan model is a delightful piece of engineering and the warm wood/paper aesthetic is gorgeous. Whipped this up in an evening and figured I'd toss it over the fence.
What this adds
A "Heatmap" toggle next to the Export button on the board panel. Flip it on and every candidate next move at the current position gets a per-square overlay:
0.02%instead of collapsing to0%).Everything fades in/out smoothly when you drill, and the typography is
cqi-driven so it scales with the rendered square width — not the viewport.Screenshots
Hikaru on chess.com, last year, blitz + rapid, 500 games:
Default — heatmap off

Heatmap on, initial position

Board close-up — gradient + adaptive labels

You can see the cold-to-hot scale at work: Nimzo-Larsen (b3) at 36% reads as deep red, Queen's Pawn / King's Pawn step down through magenta, English (c4) at 5% reads as cool blue. Insignificant cells (Mieses, Van't Kruijs, Hungarian, Zukertort) skip the tint entirely and switch to board-aware text colors so the label still reads cleanly on the bare squares.
Heatmap on, mid-opening (after

1.Nf3 d5 2.c4)Implementation notes
A few things you might want to know before reviewing:
MoveNodecontinuations tree. Lives inlib/heatmap/heatmap.ts.eco-data.tsis ~800 kB. Users who never flip the toggle don't pay for it —hooks/use-eco-lookup.tslazy-imports the module on first enable, then caches the lookup.react-chessboardAPI. Uses thesquareRendereroption (v5+) to paint per-square overlays. No fork, no monkey-patch.heatmap.label/heatmap.tooltiptranslations in this PR.Files
lib/heatmap/heatmap.ts—buildHeatmap(), gradient color, significance threshold (3% share), variation-name pickerhooks/use-eco-lookup.ts— lazy ECO catalog loadercomponents/chess/heatmap-toggle.tsx— labelled<Switch>with a flame icon (lit when on)components/chess/chess-board.tsx— accepts aheatmapprop, renders the overlay viasquareRendererwith a fade-in/out state machinecomponents/scanner/dashboard.tsx— owns the toggle state, plumbs cells to the boardTest plan
pnpm typecheckcleanpnpm lintclean (0 new warnings)49% · 1,071) shrink the stat font instead of overflowingHappy to iterate on color, threshold, label placement, or anything else — and equally happy if this just turns out not to be the direction you want for the project. Either way, thanks for building Opening Scanner.
🤖 Generated with Claude Code