Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Cheap Tricks for Interaction

Public visualization

Viewing a saved revision (read-only)

f04794c05f154104a90d8edf30f9f9bd

Fork of Cheap Tricks for Interaction

0 stars0🌍 Public
Xxyang3672
Last edited Mar 10, 2021
Created on Mar 10, 2021

This example displays a world map of countries colored light green on a blue sphere, using CSV data from happiness rankings to label each country. It demonstrates pan and zoom interactions built with D3 v5’s `zoom` API and `event.transform`, which applies transforms to the SVG group containing the map. Country boundaries are rendered via `d3.geoPath` with a `geoNaturalEarth1` projection, and topojson data from the world-atlas package supplies the geographic features. Hovering over a country turns it red through CSS `:hover` styling, while tooltips show the country name from the happiness dataset.

AI-generated description