Pointer events escape SVG

I built a fun vibrating string model for a class I’m teaching next semester. You can pluck the string and watch it vibrate right here:

I’ve used the new pointer based events so nicely described by @Fil to get it to work with the mouse or touchpad. Strangely, though, the plucked point is constrained as I’d expect it to be on my laptop but can be dragged well outside the SVG when I run this on my iPhone. Here’s a screen shot of my iPhone to illustrate:

Hmm… I don’t think I made that screenshot at 2:47 AM! I guess that’s a question for another forum. :slight_smile:

well I can pluck it out of the SVG on desktop too :slight_smile:

See setPointerCapture, detailed in Pointer Events / Fil / Observable and (probably better) in Multitouch done right / D3 / Observable

1 Like