Neilos / bihisankey

A d3 javascript library/plugin for drawing bi-directional hierarchical sankey diagrams
68 stars 24 forks source link

Double click node cannot expand. #13

Closed Fangyh09 closed 6 years ago

Fangyh09 commented 7 years ago

I double clicked node but it cannot expand. Thanks~

duhaime commented 6 years ago

To follow up on @Fangyh09's comment, the doubleclick event seems to run fine in recent Firefox, but not recent Chrome or Safari.

aherve commented 6 years ago

Not sure what the problem is, but I played around with the script, and it seems that the function dragmove prevents the click events from firing.

If you comment the .on("drag", dragmove) section, then double click works as expected

duhaime commented 6 years ago

@Fangyh09 @aherve This happens in the example on bl.ocks.org because that example re-appends a dragged node to its parent on drag start, which effectively removes the double-click event listener. You can fix this problem and enable drag by removing that line, as I've done here: http://bl.ocks.org/duhaime/3865371eea1bd32b36f53e63dabb6b72

aherve commented 6 years ago

@duhaime Nice !

Fangyh09 commented 6 years ago

@duhaime Thanks!