How to prevent d3.drag().on('end' from firing .on('click'
问题 I have an svg element I'd like to be able to click and drag separately. As far as I can tell in D3, clicking fires the "drag end" event (and possibly also drag start?). In the code below, simply clicking the circle gives it a red outline: var svg = d3.select('body').append('svg'); var g = svg.append('g'); var c = g.append('circle').attr('r', 20).attr('cx', 25).attr('cy', 25) .call(d3.drag().on('drag', dragged).on('end', end)) .on('click', clicked); function dragged() { d3.select(this).attr(