Skip to content

Draw downloaded patch extent on click (#38)#51

Open
aivanchenk wants to merge 2 commits into
mainfrom
38-patch-extent
Open

Draw downloaded patch extent on click (#38)#51
aivanchenk wants to merge 2 commits into
mainfrom
38-patch-extent

Conversation

@aivanchenk

@aivanchenk aivanchenk commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #38.

A click does not download a single pixel: internally it pulls the whole on-disk chunk, a 40x40 patch (2° x 2°). This PR draws that patch on the map so you can see what was actually fetched, with a button to show or hide it.

What

  • chunkPatchBounds (geogrid) computes the geographic box of the native chunk that contains the clicked cell. The store's chunk footprint ([1461, 24, 40, 40]) is recorded as ZARR_STORE.nativeChunks.
  • The selection overlay draws the patch as a faint fill with a dashed accent outline, drawn beneath the precise cell marker, and works in both 2D and globe (react-map-gl GeoJSON layers).
  • A nav toggle button (with a pressed/active state and an accessible label) shows/hides the patch. On by default once a point is selected.

Verify

  • eslint, next build, and vitest (43, including a new chunkPatchBounds test asserting it spans 40x40 and contains the clicked cell) all pass.
  • Confirmed from the store metadata that the NEE spatial chunk is 40x40.
  • Live: click a point, a dashed 2° box appears around the pixel; the patch button in the nav toggles it.

A click does not download a single pixel: it pulls the whole native chunk
(40x40 cells = 2° x 2°). This outlines that patch on the map so the user
can see what was actually fetched.

- New geogrid helper `chunkPatchBounds` computes the geographic box of the
  native chunk containing the clicked cell; the store's chunk footprint is
  recorded in `ZARR_STORE.nativeChunks`.
- The selection overlay draws the patch as a faint fill with a dashed
  accent outline, beneath the precise cell marker, in both 2D and globe.
- A toggle button in the nav (with a pressed/active state) shows or hides
  the patch; it is on by default when a point is selected.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a feature to visualize the downloaded on-disk chunk (patch) extent on the map. It adds a toggle button in the navigation bar, calculates the geographic bounds of the 40x40 native chunk containing the selected cell, and renders this patch extent as a faint filled polygon with a dashed outline using MapLibre layers. It also updates the IconButton component to support pressed states and adds corresponding unit tests. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🚀 Vercel preview deployed

Preview URL: https://earth-prints-2bj67h0i0-anastasiia-s-projects10.vercel.app

@aivanchenk aivanchenk changed the base branch from ui-rework to main July 6, 2026 22:42
@aivanchenk aivanchenk marked this pull request as ready for review July 7, 2026 04:36
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.

draw box-extent of all pixels downloaded on a click

1 participant