Skip to main content
100%

Fork of Map of India - States and Union Territories

✓ Published1🌍 Public
NNita
Last edited Feb 27, 2025
Created on Feb 27, 2025

This interactive map of India visualizes all states and union territories as color-coded SVG regions, distinguishing union territories with a distinct color and displaying state names as labels. Users can hover to see tooltips, click to zoom into a specific state via a smooth transition, and pan using d3.zoom. The map loads GeoJSON data from an external repository, renders paths with d3.geoPath, and includes zoom controls and a legend panel. The implementation relies on d3.js version 5 and the d3-zoom API.

AI-generated description

India Map Visualization

This visualization displays an interactive map of India showing all states and union territories.

Features

  • Color-coded states and union territories
  • Interactive hover effects with tooltips
  • Click to select states and view detailed information
  • Zoom and pan functionality
  • Responsive design for different screen sizes
  • State information panel with details about each region

Data Source

The map uses GeoJSON format data from: https://raw.githubusercontent.com/geohacker/india/master/state/india_state.geojson

Technology

  • HTML5, CSS3, JavaScript
  • D3.js for visualization and interactivity
  • GeoJSON for map data

How to Use

  • Hover over any state to see its name in a tooltip
  • Click on a state to select it and view detailed information
  • Zoom in/out using the buttons or mouse wheel
  • Pan the map by clicking and dragging

Project Structure

  • index.html - Main HTML structure
  • styles.css - All styling for the application
  • index.js - Main application logic
  • mapUtils.js - Utility functions for map rendering and interaction

Accessibility

The visualization includes keyboard navigation and appropriate contrast ratios for text readability.

Browser Compatibility

Tested and working on the latest versions of Chrome, Firefox, Safari, and Edge.

Future Improvements

  • Adding more detailed data for each state/UT
  • Implementing choropleth visualization for various metrics
  • Adding time-series data visualization
  • Improving mobile experience with touch-optimized interactions
MIT Licensed

Similar vizzes