Skip to main content
100%

Cheap Tricks for Interaction

✓ Published0🌍 Public
CChooo4u
Last edited Mar 29, 2019
Created on Sep 26, 2018

This example demonstrates interactive annotation on a natural Earth projection world map. Clicking anywhere places a scaled pointer marker that fades in via a D3 transition, while holding Ctrl and clicking a marker removes it. The map is rendered from TopoJSON world-atlas data using `d3.geoPath`, with pan and zoom handled by `d3.zoom`. The pointer shape is defined as an SVG symbol, and mouse events rely on `d3.event` and `d3.mouse`.

AI-generated description

Since meeting a problem when trying to select multiple countries, I choose to add a landmark on the world map by clcking. Thanks to the tutorial:D3.JS TUTORIAL: MOUSE EVENTS HANDLING

MIT Licensed

Similar vizzes