ivanvanderbyl / ember-d3

Loads the latest D3 packages into Ember CLI so you can use them in your app
MIT License
68 stars 37 forks source link

events / dragged not working #35

Open yankeeinlondon opened 7 years ago

yankeeinlondon commented 7 years ago

When I used the d3-drag/drag function in conjunction with d3-selection/event it would appear all events are not getting through to d3. I had a suspicion that the Ember component was swallowing up these events so I changed over to a tagless component figuring I'd have greater control of the events on the SVG/Canvas element. Sadly that didn't seem to help. Any ideas?

Code here: https://github.com/ksnyde/d3-fun/blob/master/app/components/circle-dragging.js#L79-L84

P.S. I have really enjoyed using this addon to get started with d3 in Ember. Great work. I actually will likely send you a PR which just adds a few more examples of charts you can build with this addon (if you're amendable). I think it will make your work more approachable to have the dummy app have a variety of examples working for people to engage with

ivanvanderbyl commented 7 years ago

I haven't tried events with canvas, so can't really offer much advice there. Ember doesn't swallow events, instead relies on them bubbling up to the document level to catch them in global event handlers, then delegate them to any components which register handlers. So what's more likely is that your event handlers aren't attaching correctly, which might require something different with canvas.

yankeeinlondon commented 7 years ago

Hmmm. At the moment I’m just transcribing examples on Bl.ocks using your add-on so my approach is a proven approach. Must be something I’m doing in translation.

On May 18, 2017, 1:57 AM -0700, Ivan Vanderbyl notifications@github.com, wrote:

I haven't tried events with canvas, so can't really offer much advice there. Ember doesn't swallow events, instead relies on them bubbling up to the document level to catch them in global event handlers, then delegate them to any components which register handlers. So what's more likely is that your event handlers aren't attaching correctly, which might require something different with canvas. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ivanvanderbyl commented 7 years ago

@ksnyde did you resolve this?

yankeeinlondon commented 7 years ago

I didn't but largely due to lack of bandwidth. If you want to close it I can reopen when I come back to this in a week or so.