Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Cheap Tricks for Interaction

Public visualization

Viewing a saved revision (read-only)

1e5ef0b10c7d427b99951ae8d7d2d72e

Cheap Tricks for Interaction

0 stars0🌍 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