Skip to main content
100%

Adding names to places

✓ Published0🌍 Public
Dd3noob
Last edited Nov 30, 2019
Created on Nov 8, 2014

This example shows a world map with red dots marking cities and their names placed just above each point. It uses D3.js version 3.5.17 with a Mercator projection and TopoJSON to render country outlines from a world-110m2.json file. City coordinates are loaded from a CSV file and plotted using `d3.geo.path`. The city labels are SVG text elements anchored above each circle, and each dot links to a Google search for that city. The map supports zoom and pan through `d3.behavior.zoom`.

AI-generated description

This small example was made to answer a quesition on the d3noob.org blog about how to add the names of the cities beside the dots.

mit Licensed

Similar vizzes