d3 / d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.
https://d3js.org/d3-zoom
ISC License
501 stars 144 forks source link

zoom.on() not working if using a name #241

Open lebesnec opened 2 years ago

lebesnec commented 2 years ago

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.