d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.

Home Page:https://d3js.org/d3-zoom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zoom.on() not working if using a name

lebesnec opened this issue · comments

from the doc for zoom.on(typenames[, listener]) :

The typenames is a string containing one or more typename separated by whitespace. Each typename is a type, optionally followed by a period (.) and a name, such as zoom.foo and zoom.bar; the name allows multiple listeners to be registered for the same type.

but I can't get zoom.on('zoom.foo', () => { ... }) to work...
zoom.on('zoom', () => { ... }) seems to work but is problematic because it remove listeners previously registered with the same typename.