Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cheap Tricks for Interaction

Public visualization

Cheap Tricks for Interaction

0 stars0🌍 Public
Ssrrajendran
Last edited Sep 25, 2018
Created on Sep 25, 2018

This example demonstrates how a simple map of world countries can be made interactive through basic selection and styling. A Natural Earth projection, built with `d3.geoNaturalEarth1` and `d3.geoPath`, renders country boundaries from TopoJSON data enriched with names from a TSV file. Clicking a country toggles its class from `country` to `selectedCountry`, changing its fill to brown via CSS, while hovering turns it red. The interaction relies on D3 v5’s event handling and class manipulation, without complex zoom or panning logic.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed