Skip to content

Commit

Permalink
Move to front fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Oct 28, 2015
1 parent 536243e commit 056ff29
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/gitgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ var PosY = function(d, i, location) { return scaleY.invert(data.nodes[d[location

nodeUpdateSelection.exit().remove();

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

nodeUpdateSelection.enter().append("svg:circle")
.attr("class", "node")
.attr("cx", function(d, i) { return scaleX(d.pos[0]); })
Expand All @@ -85,6 +91,7 @@ var PosY = function(d, i, location) { return scaleY.invert(data.nodes[d[location
.ease('cubic-out')
.duration('200')
.attr("r", 20);
d3.select(this).moveToFront();
})
.on('mouseout', function(d,i) {
d3.select(this).transition()
Expand All @@ -99,7 +106,10 @@ var PosY = function(d, i, location) { return scaleY.invert(data.nodes[d[location
.attr("cx", function(d, i) { return scaleX(d.pos[0]); })
.attr("cy", function(d, i) { return scaleY.invert(d.pos[1]); })
.attr('fill', function(d, i) {if (reverseMap[d.id]==reverseMap[data['HEAD']]){return '#99FF66';} else {return '#EEEEEE';}} )
.attr("r", 10)
.attr("r", 10).each(function() {
var sel = d3.select(this);
sel.moveToFront();
});

var textUpdateSelection = vis.selectAll("text.message")
.data(data.nodes, function(d) {return d.id});
Expand Down

0 comments on commit 056ff29

Please sign in to comment.