Skip to main content
Public

Share visualization

Loading preview…

Cheap Tricks for Interaction

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Cheap Tricks for Interaction

0
Qqhu11
Last edited May 16, 2020
Created on May 16, 2020

This example shows a world map with countries filled in light green, rendered using a natural Earth projection in SVG. It demonstrates simple pan-and-zoom interaction by attaching a `d3.zoom` handler to the SVG, which applies the current zoom transform to a group element containing all country paths. The map loads country boundaries from TopoJSON in the world-atlas package and joins them with names from a TSV file, adding a `<title>` tooltip per country. The code uses `d3.geoPath`, `d3.geoNaturalEarth1`, and `d3.zoom` from D3 v5.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed