d3 / d3-zoom

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

mouseenter being consumed by zoom rect? #168

Closed eckmLJE closed 5 years ago

eckmLJE commented 5 years ago

I am attempting to attach mouseover or mouseenter + mouseleave behavior on rect elements inside the g targeted by my zoomed function . I've read through a similar issue here and the API Reference table of events, and the mouse events I'm trying to use don't appear to be included in the zoom events.

Here is a fiddle: https://jsfiddle.net/eckmLJE/abp85uhe/4/

If I comment out the zoom rect (ln 146-157 in the js) then my mouseenter listener fires as expected.

Is the event being consumed by the d3-zoom listener?

mbostock commented 5 years ago

Please use Stack Overflow tag d3.js to ask for help. Stack Overflow provides a better collaborative forum: thousands of D3-related questions have been asked there, and some answers may be relevant to you.

When asking for help, please include a link to demonstrate the issue, preferably as an Observable notebook. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.

If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.

Thank you! 🤗