Fork of React Starter
✓ Published0🌍 Public
This interactive map of India displays each state as a colored SVG region, highlighting states and showing their names via tooltips on hover. Using React for the UI and D3.js for rendering, the map loads GeoJSON data from a remote TopoJSON repository and projects it with a Mercator projection. The code uses `d3.geoPath` for drawing shapes, `topojson.feature` for converting data, and a tooltip system driven by mouse events.
AI-generated descriptionD3.js Map of India in React
This project displays an interactive map of India using:
- React for the UI framework
- D3.js for data visualization and map rendering
- TopoJSON for parsing map data
Features
- Interactive state highlighting on hover
- Tooltips showing state names
- Responsive design that works on different screen sizes
- Proper code organization with separate component and utility files
Data Source
The map uses GeoJSON data for India's states from the deldersveld/topojson repository.
Project Structure
index.js: Main entry point that renders the App componentcomponents/IndiaMap.js: React component for the India maputils/mapUtils.js: D3.js utility functions for rendering the map
How to Run
- Install dependencies:
npm install - Build the project:
npm run build - Open the
index.htmlfile in a browser
MIT Licensed