0

I've next code:

vis.forceRep.circle.enter()
    .append("g")
    .attr("class", "cRepo")
    .attr("transform", tr)

    .on("mouseover.select", vis.meRepo)
    .on("mouseout.select", vis.mlRepo)

    .on("mousemove.mtt", vis.mtt)

    .on("click.select", vis.clRepo)

    .call(vis.forceRep.drag)
;

Into v3.1 we've got the following behavior:

  • Dragging is not select a node. (MouseDown -> MouseMove -> MouseUp).
  • Click is select a node. (MouseDown -> MouseUp).

Now into v3.2+:

  • Drag == Click. That is after dragging after MouseUp.drag the Click event is raised.

How to fix it?

Artem Zubkov
  • 559
  • 1
  • 14
  • 29
  • 2
    [This question](http://stackoverflow.com/questions/17953106/why-does-d3-js-v3-break-my-force-graph-when-implementing-zooming-when-v2-doesnt) may help. – Lars Kotthoff Jan 29 '14 at 11:43
  • @LarsKotthoff it didn't help me. I've tried it [here](http://ghv.artzub.com/test/) – Artem Zubkov Jan 30 '14 at 02:40
  • @LarsKotthoff I've been found [the other your answer] (http://stackoverflow.com/questions/19075381/d3-mouse-events-click-dragend) it is solution! Thank you very much!!! – Artem Zubkov Jan 30 '14 at 02:48

1 Answers1

0

Solution is

vis.clRepo = function() {
    if (d3.event.defaultPrevented)
        return;
    /* handle the click event */
}

found in this answer

Community
  • 1
  • 1
Artem Zubkov
  • 559
  • 1
  • 14
  • 29