score:0

I'm assuming that you meant that you changed the class of the nodes to 'selected' and not their attribute. I'm a beginner in D3js, but here's what I think should happen:

d3.behaviour.drag()
    .on("dragstart", function() {
        d3.selectAll('.selected').each(dragstart(d,i))
    }) 
    .on("drag", function() {
        d3.selectAll('.selected').each(dragmove(d,i))
    }) 
    .on("dragend", function() {
        d3.selectAll('.selected').each(dragend(d,i))
    })

Depending on what your function tick() does, this may work for you.


Related Query