tomgp
7/2/2014 - 3:41 PM

d3 move selection to front. note - this may mess with data bindings to be sure, use an exmplicit binding in the data function e.g. selection

d3 move selection to front. note - this may mess with data bindings to be sure, use an explicit binding in the data function e.g. selection.data(data, function(d){ return d.index; } )

d3.selection.prototype.moveToFront = function() {
  return this.each(function(){
    this.parentNode.appendChild(this);
  });
};