Skip to main content
100%

Cheap Tricks for Interaction(Even cheaper with CSS)

✓ Published0🌍 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
MIT Licensed

Similar vizzes