Skip to content

Filter by country when clicking the world map - #471

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

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

Conversation

@smehmood

@smehmood smehmood commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Clicking a country on the world map now filters the dashboard to that country, the same way clicking an entry in the Countries list does (?country=eq.XX).

  • Click a country with data → applies the country filter (chip appears, all panels update)
  • Click the selected country again → clears the filter
  • Pointer cursor only on clickable countries; while a filter is active any country can be clicked so you can switch selections (the map data is itself filtered at that point, so data presence can't gate clicks)
  • Clicks that are the tail end of a pan/drag are ignored
  • Filtering is disabled on the realtime map, which doesn't read query filters

Note: PR #464 on smehmood/worldmap-click-to-filter already implements this feature. That branch was left untouched — pick whichever one you prefer.

Verification

Verified in the browser on the Hulu dashboard: clicking the US set ?country=eq.US and the filter chip + all panels updated (visitors 2.53k → 1.14k); clicking Brazil switched the filter; clicking it again cleared it; clicking a no-data country (Greenland) did nothing; dragging to pan did not apply a filter; the realtime map is not clickable. No console errors.

Screenshots

After clicking the US on the map — filter chip applied, metrics scoped to that country:

The map itself with the selection highlighted and the Countries panel scoped to it:

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


Open in Devin Review

Clicking a country on the world map applies the same country=eq.XX filter
that the country metrics table produces. Clicking the selected country
again clears the filter.

Countries with data get a pointer cursor; while a filter is active any
country can be clicked so you can switch selections. Clicks that are the
tail end of a pan are ignored, and filtering is disabled on the realtime
map, which does not read query filters.

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

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