Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cheap Tricks for Interaction(Even cheaper with CSS)

Public visualization

Viewing a saved revision (read-only)

355644c7c33f4e3a81e6c1d663df0161

Cheap Tricks for Interaction(Even cheaper with CSS)

0 stars0🌍 Public
RRyan Fleming
Last edited Nov 7, 2018
Created on Sep 25, 2018

This example demonstrates a zoomable world map with interactive country selection, where clicking toggles a filled highlight state. It uses d3.geoNaturalEarth1 and d3.geoPath to render TopoJSON country boundaries from the world-atlas dataset, combined with d3.zoom for panning and scaling. The effect relies on CSS :hover and a .selected class triggered via d3’s event handler, supplemented by SVG <title> elements for tooltips. The render loop binds the country features and appends path elements to the SVG canvas.

AI-generated description