Node size increasing on double click on node D3 v4

165 views
Skip to first unread message

iamdeepakbasnal

unread,
Aug 30, 2017, 1:25:37 AM8/30/17
to d3-js

How to prevent increasing node size on double click on node. I disabled the double click zoom behaviour but node size still increasing. Here is my code for disable zoom behaviour on double click


svg.call(d3.zoom().scaleExtent([0.3, 2]).on("zoom", function() {



    newTag
.attr("transform", d3.event.transform)

})).on("dblclick.zoom", null)



Also I tried to prevent from double click event on node.








var svg = d3.select("svg"),

    width
= +svg.attr("width"),

    height
= +svg.attr("height");




var newTag = svg.append("g");




var node = newTag.attr("class","nodes")

     
.selectAll("circle")

     
.data(graph.nodes).enter()

     
.append("g").attr("class", "entity")

     
.on("click", clicked)

     
.on("dblclick", null)

     
.call(d3.drag().on("start", dragstarted).on("drag",

       dragged
).on("end", dragended));


How can i prevent increasing node size on node double click.


BeforeDblClick.png
AfterDblClick.png
Reply all
Reply to author
Forward
0 new messages