Skip to main content
100%

Cheap Tricks for Interaction

✓ Published0🌍 Public
Eerin
Last edited Feb 6, 2020
Created on Feb 6, 2020

This example demonstrates how to add interactive highlighting to a geographic map with minimal code. It renders an SVG world map using TopoJSON and D3’s `geoNaturalEarth1` projection, styled via CSS classes. The visualization uses D3 v5 with a JavaScript `Heatmap` class, though the class is instantiated with sample array data rather than heatmap-specific values. The key interaction is a simple CSS `:hover` rule that changes country fill colors from light green to red. The code also initializes a zoom behavior, though no zoom transforms or panning are implemented in the provided scripts.

AI-generated description
MIT Licensed

Similar vizzes