move to front
JavaScript
d3.selection.prototype.moveToTop = function () {
return this.each(function () {
this.parentNode.appendChild(this);
});
};
var svg = d3.select("body").append("svg");
var data = d3.range(10);
circles = svg.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr({
"r": 50,
"cx": function (d,i) { return d * 20 + 100},
"cy": function (d,i) { return d * 20 + 100},
"fill": "steelblue",
"stroke": "red"
})
circles.on("mouseover", function () {
d3.select(this).moveToTop();
});