Skip to content

Click a country on the world map to filter by it - #457

Open
smehmood wants to merge 2 commits into
masterfrom
smehmood/task-branch-491313
Open

Click a country on the world map to filter by it#457
smehmood wants to merge 2 commits into
masterfrom
smehmood/task-branch-491313

Conversation

@smehmood

@smehmood smehmood commented Jul 27, 2026

Copy link
Copy Markdown

What

Clicking a country on the world map now filters the dashboard to that country.

  • Sets country=eq.<code> — the same URL param the Countries metrics table uses — so every panel (metrics, chart, pages, sources, etc.) and the filter bar chip update together.
  • Clicking the currently selected country again clears the filter.
  • The selected country is drawn in the full base color so it stays obvious which one is active; clickable countries get a pointer cursor.
  • Panning/dragging the map is not treated as a click.
  • Filtering is disabled on the realtime map (allowFilter={false}), since realtime data ignores filters.

Verification

Verified in the browser on the Hulu website dashboard: clicking the US applied the Country is United States filter (visitors 8.15k → 3.69k), clicking it again cleared it, and dragging the map applied nothing.

Screenshots

United States selected on the map after clicking it:

The resulting filter chip and narrowed metrics at the top of the page:

🌒 Run on Niteshift: View Task


Open in Devin Review

Clicking a country on the world map now applies a `country=eq.<code>`
filter, the same param the country metrics table uses, so the whole
dashboard narrows to that country. Clicking the selected country again
clears the filter, and the selected country is highlighted on the map.

Panning the map is not treated as a click, and filtering is disabled on
the realtime map since realtime data ignores filters.

Run-on: Niteshift

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mesa-dot-dev

mesa-dot-dev Bot commented Jul 27, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread src/components/metrics/WorldMap.tsx Outdated
Regions missing from ISO_COUNTRIES (Antarctica, Somaliland, South Sudan)
have an undefined code, which compared equal to the undefined
selectedCountry when no filter was active and painted them in the full
highlight color. Default selectedCountry to null and guard the
comparison on a non-empty code.

Run-on: Niteshift

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant