Third in a D3 series: start adding user interaction to SVG elements, with a live, step-by-step tutorial you can run in the browser or clone from a gist.
From the Art+Logic archive · written in 2015. The tools may have moved on; the thinking still holds.
In my previous two articles about D3, I wrote about what D3 is (and is not) and data binding. This month we’ll begin exploring user interaction with elements on a SVG canvas.
We’ll progress over a series of “slides,” each showing an active SVG element with narrative text describing the key points of the slide, along with the javascript code that generated the SVG. As this is a tutorial on user interaction with SVG, you get to play along as we go.
This tutorial is a single-page app requring a modern browser (tested on recent chrome, firefox, IE). This tutorial can be run live in your browser at the wonderful bl.ocks.org site. If so inclined, you can also clone the tutorial from gist and run it locally on your computer.
Regardless of how you view the tutorial, you can leave comments about it here.
Some problems are easier to explain in writing. Send us a few lines about what you're working on, and we'll reply within one business day. Helpful to include: