Skip to main content
100%

Fork of Fork of HTML Starter

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

This interactive map displays the states of India with hover effects that highlight each state and reveal its name in a tooltip. The visualization is built with React and D3.js, using the `d3.geoMercator` projection and `d3.geoPath` to render GeoJSON state boundaries as SVG paths. State polygons are colored a muted teal and brighten on mouseover. The GeoJSON data is loaded from an external GitHub repository, and the tooltip is implemented as an HTML overlay positioned via mouse event coordinates.

AI-generated description

India Map Visualization

This project displays an interactive map of India using D3.js, React, and GeoJSON data. The map shows state boundaries and provides interactive hover effects.

Features

  • Interactive map of India with state boundaries
  • Hover effects to highlight states
  • Tooltip displaying state names
  • Responsive design that works across different screen sizes

Data Source

The GeoJSON data for India's states is sourced from: https://github.com/geohacker/india/blob/master/state/india_state.geojson

Technologies Used

  • React for UI components and state management
  • D3.js for data visualization and mapping
  • JavaScript for interactivity
  • CSS for styling

Getting Started

  1. Clone the repository
  2. Run npm install to install dependencies
  3. Run npm start to start the development server
  4. Open your browser to http://localhost:3000

Building for Production

Run npm run build to create an optimized production build.

Troubleshooting

If the map doesn't appear:

  1. Make sure you have an active internet connection, as the GeoJSON data is loaded from an external source
  2. Check browser console for any JavaScript errors
  3. Try using a different web browser
MIT Licensed

Similar vizzes