Skip to content

Filter by country when clicking the world map - #465

Open
smehmood wants to merge 1 commit into
masterfrom
smehmood/world-map-country-filter
Open

Filter by country when clicking the world map#465
smehmood wants to merge 1 commit into
masterfrom
smehmood/world-map-country-filter

Conversation

@smehmood

@smehmood smehmood commented Aug 7, 2026

Copy link
Copy Markdown

What

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

  • Applies the same country=eq.<code> URL param the countries table's FilterLink uses, so every panel (metrics, charts, tables) scopes to the clicked country and the country chip shows up in the filter bar.
  • Clicking the currently selected country clears the filter (toggle).
  • The selected country is painted in the primary map color so the active selection is visible, and clickable countries get a pointer cursor.
  • The realtime page passes allowFilter={false} — realtime queries don't take filters — so its map keeps the previous non-interactive behavior.

Verification

Verified in the browser on the Hulu demo site: clicking the US navigated to ?country=eq.US, visitors dropped from 4.9k to 2.23k (matching the US row in the countries table), the "Country Is United States" filter chip appeared, and the countries table collapsed to United States at 100%. Clicking the US again removed the filter. On the realtime page no map country renders a pointer cursor. No console errors.

Screenshots

Map with United States selected — the clicked country is highlighted and the location table scopes to it:

Top of the same page — the Country Is United States filter chip and the scoped metrics:

🤖 Generated with Claude Code
🌒 Run on Niteshift: View Task


Open in Devin Review

Clicking a country on the world map now applies the same `country=eq.<code>`
filter that the countries table produces, so the whole dashboard scopes to
that country. Clicking the already-selected country clears the filter, and
the selected country is highlighted on the map.

The realtime page opts out (allowFilter={false}) since realtime data does not
support filters.

Run-on: Niteshift

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

@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: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@smehmood
smehmood force-pushed the smehmood/world-map-country-filter branch from 45b1420 to 60a8244 Compare August 7, 2026 14:07
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