Skip to main content
100%

Map Pan / Zoom with Cities and Text v5

✓ Published0🌍 Public
Dd3noob
Last edited Dec 2, 2019
Created on Dec 2, 2019

This example displays an interactive map of the world centered on the Pacific, overlaid with red circular markers for eleven cities and their labels. Pan and zoom controls are implemented using the `d3.zoom` API, which applies SVG `transform` attributes to all map paths, circles, and text. The map geometry and city positions are projected using `d3.geoMercator` and `d3.geoPath`, with country outlines loaded from a TopoJSON file. City coordinates come from a CSV loaded via `d3.csv`, and text labels are placed above each marker, each linking to a web search.

AI-generated description

This is a simple map example with pan and zoom centered on the Pacific with added cities and text

This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 5 of d3.js.

mit Licensed

Similar vizzes