I\'m trying to learn D3 by experimenting with one of their basic bubblecharts. First task: figure out how to drag an bubble and have it become the topmost object while it\'s
You can assign IDs and classes to the individual elements if you want when you append:
node.append("circle.bubble")
.attr("r", function(d) { return d.r; })
.style("fill", function(d) { return fill(d.packageName); })
.attr("id", function(d, i) { return ("idlabel_" + i)})
.attr("class", "bubble")
;
And then you can select by class with selectAll("circle.bubble") or select by id and modify attributes like so:
var testCircle = svg.select("#idlabel_3")
.style("stroke-width", 8);