The Interactive Geographic Explorer is a comprehensive web interface that allows users to explore demographic update patterns across India at both state and district levels. It integrates the quantitative insights from PATTERN_INSIGHTS.md into an interactive, filterable, and comparable visualization system.
- URL Route:
/geographic-explorer - Navigation: Available in the sidebar as "Geographic Explorer"
- Icon: Location marker (HiLocationMarker)
- Source:
website/public/geographic-data.json(374KB) - Coverage:
- 967 districts with metrics
- 63 states with aggregated metrics
- 10 months of data (March 2025 - January 2026)
Each district is automatically classified into one of four patterns:
| Pattern | Criteria | Count |
|---|---|---|
| High Volatility | σ > 5,000 | 289 districts |
| Child Lag | Adult/Child ratio > 20× | 103 districts |
| High Volume | Avg adult updates > 10,000/month | 196 districts |
| Normal | None of the above | 379 districts |
Four summary cards displaying:
- High Volatility districts count (289)
- Child Lag districts count (103)
- High Volume districts count (196)
- Total regions (967 districts, 63 states)
Three synchronized controls:
- Search Bar: Real-time filtering by state/district name
- View Mode Toggle: Switch between States View and Districts View
- Pattern Filter: Filter by pattern type (All, High Volatility, Child Lag, High Volume, Normal)
Scrollable list displaying up to 50 filtered regions with:
- Region name and parent state (for districts)
- Pattern classification badge (color-coded)
- Three key metrics:
- Total Adult Updates
- Volatility (σ)
- Adult/Child Ratio
- "Add to Compare" button (up to 5 regions)
- Click to view full details
When a region is selected, displays:
- Pattern Classification: Color-coded badge
- Update Statistics:
- Total Child Updates
- Total Adult Updates
- Average Child Updates/Month
- Average Adult Updates/Month
- Pattern Indicators:
- Volatility (σ)
- Adult/Child Ratio
- Age Ratio
- Districts Count (states only)
Appears when 1+ regions are selected for comparison:
- Side-by-side table comparing up to 5 regions
- Columns: Region, Pattern, Adult Updates, Child Updates, Volatility, A/C Ratio
- "Clear All" button to reset comparison
- Purple ring indicator on compared regions
Each district includes:
{
"district": "Pune",
"state": "Maharashtra",
"totalChild": 30818,
"totalAdult": 416445,
"avgChild": 3081.8,
"avgAdult": 41644.5,
"volatility": 40895.0,
"ageRatio": 0.074,
"adultChildRatio": 13.51,
"isHighVolatility": true,
"isChildLag": false,
"isHighVolume": true,
"pattern": "high_volatility"
}Each state includes:
{
"state": "Maharashtra",
"totalChild": 234567,
"totalAdult": 3456789,
"avgChild": 1234.5,
"avgAdult": 12345.6,
"volatility": 123456.7,
"ageRatio": 0.0678,
"districtsCount": 45,
"isHighVolatility": true
}- High Volatility: Red (
bg-red-500/20,border-red-500/50,text-red-400) - Child Lag: Yellow (
bg-yellow-500/20,border-yellow-500/50,text-yellow-400) - High Volume: Blue (
bg-blue-500/20,border-blue-500/50,text-blue-400) - Normal: Green (
bg-green-500/20,border-green-500/50,text-green-400)
- Selected Region: Blue border (
border-blue-500) with blue background tint - Compared Region: Purple ring (
ring-2 ring-purple-500) - Hover State: Gray background transition
- Select "Districts View" from view mode
- Choose "High Volatility" from pattern filter
- Scroll through 289 high-volatility districts
- Click on any district to see detailed metrics
- Add up to 5 districts to comparison panel
- Review side-by-side volatility statistics
- Select "States View" from view mode
- Search for specific states (e.g., "Maharashtra", "Uttar Pradesh")
- Click each state to view aggregated metrics
- Add states to comparison panel
- Analyze differences in total updates and district counts
- Select "Districts View"
- Choose "Child Lag" from pattern filter
- Review 103 districts with adult/child ratio > 20×
- Click districts to see exact ratios
- Compare multiple child lag districts to identify common characteristics
- Type district/state name in search bar
- View filtered results
- Click to see full details
- Add to comparison if needed
GeographicExplorer.jsx (380 lines)
├── State Management (useState hooks)
│ ├── geoData (loaded from JSON)
│ ├── selectedRegion (details panel)
│ ├── searchTerm (search filter)
│ ├── viewMode (states/districts)
│ ├── filterPattern (pattern filter)
│ └── compareRegions (comparison array)
├── Data Loading (useEffect)
├── Filtering Logic (getFilteredData)
├── Helper Functions
│ ├── getPatternColor
│ ├── getPatternLabel
│ ├── handleRegionClick
│ ├── toggleCompare
│ ├── isInCompare
│ └── formatNumber
└── UI Components
├── Header Section
├── Stats Overview (4 cards)
├── Controls Panel (search, view, filter)
├── Region List (2 columns)
├── Details Panel (1 column, sticky)
└── Comparison Panel (conditional)
- App.jsx: Added route
<Route path="/geographic-explorer" element={<GeographicExplorer />} /> - Sidebar.jsx: Added navigation item with HiLocationMarker icon
- Import:
import GeographicExplorer from './components/sections/GeographicExplorer';
Python Dataset (2.38M records)
↓
df_monthly_district.pkl (7,062 records)
df_monthly_state.pkl (385 records)
↓
Python Extraction Script
↓
geographic-data.json (374KB)
↓
React Component (fetch on mount)
↓
Interactive UI (filtering, comparison, details)
- JSON file is 374KB (reasonable for web loading)
- Initial render shows first 50 regions (pagination boundary)
- Search and filter operate on client-side for instant response
- Sticky details panel prevents re-rendering on scroll
- India Map Visualization: SVG-based clickable map with district boundaries
- Export Functionality: CSV/PDF export of comparison tables
- Time Series Integration: Link to monthly trends for selected regions
- Advanced Filters: Multi-select patterns, custom thresholds
- Sorting Options: Sort by any metric (volatility, ratio, updates)
- Pincode Drill-Down: Expand districts to show top pincodes
The Geographic Explorer directly implements and visualizes the quantitative findings from PATTERN_INSIGHTS.md:
| Pattern Insight | Explorer Feature |
|---|---|
| Section 1: Adult Volatility | High Volatility filter shows 289 districts with σ > 5,000 |
| Section 2: Persistent Districts | High Volume filter shows 196 districts with avg > 10K updates |
| Section 3: Child Update Lag | Child Lag filter shows 103 districts with ratio > 20× |
| Section 4: Pincode Concentration | District-level aggregation enables regional concentration analysis |
| Section 5: Correlations | Comparison panel allows visual correlation inspection |
- Component:
/website/src/components/sections/GeographicExplorer.jsx - Data:
/website/public/geographic-data.json - Route:
/geographic-explorerin App.jsx - Navigation: Sidebar.jsx (7th item)
- Documentation: This file (
/docs/GEOGRAPHIC_EXPLORER_FEATURE.md)
- Component renders without errors
- JSON data loads successfully (374KB file)
- Search filter works (case-insensitive, real-time)
- View mode toggle switches between states/districts
- Pattern filter correctly filters 289/103/196 districts
- Region selection shows details panel
- Comparison panel accepts up to 5 regions
- Comparison table displays all metrics correctly
- "Clear All" button resets comparison
- Routing integration works (/geographic-explorer)
- Sidebar navigation link added
- No console errors or warnings
✅ COMPLETED - All 5 todos finished, routing integrated, PROJECT_CHECKLIST.md updated