ErikGartner / dTree

A library for visualizing data trees with multiple parents, such as family trees. Built on top of D3.
https://treehouse.gartner.io/ErikGartner/58e58be650453b6d49d7
MIT License
509 stars 135 forks source link

how to handle touch events #115

Open mle-moni opened 3 years ago

mle-moni commented 3 years ago

I do not see where you handle mouse events to navigate in the family chart on your code, do you have any clues on how I could handle touch events to make it work on mobile too?

ErikGartner commented 3 years ago

Currently the library allows for setting callbacks (e.g. "nodeClick") for mouse clicks.

The callbacks are handled here: https://github.com/ErikGartner/dTree/blob/3bb7cbaa8de2fad4fe1481699ea484bf2603119b/dist/dTree.js#L123

Not sure if it applies to touch event or if you need to setup another D3 listener for that.

/Erik