Permalink
Browse files

Simplify the line tracking slightly.

  • Loading branch information...
1 parent 7119203 commit e947800ffb67f9a945d1f2cd9443f758b902154a @dustin dustin committed May 3, 2012
Showing with 11 additions and 7 deletions.
  1. +11 −7 static/vbmap.js
View
@@ -583,18 +583,22 @@ function makeVBThing(w, h, container) {
// Push nodes toward their designated focus.
var k = .9 * e.alpha;
vbuckets.forEach(function(o, i) {
- if (recentState[o.vbid][o.which] >= 0) {
- o.y += (positions[recentState[o.vbid][o.which]].y - o.y) * k;
- o.x += (positions[recentState[o.vbid][o.which]].x - o.x) * k;
- if (o.vbid == selectedVB) {
- update.updateSelectionLine();
- }
+ var sid =recentState[o.vbid][o.which];
+ var gpoint = sid >= 0 ? positions[sid] : null;
+ if (gpoint) {
+ o.y += (gpoint.y - o.y) * k;
+ o.x += (gpoint.x - o.x) * k;
}
});
svg.selectAll("circle")
.attr("cx", function(d) { return d.x; })
- .attr("cy", function(d) { return d.y; });
+ .attr("cy", function(d) { return d.y; })
+ .each(function(d) {
+ if (d.vbid == selectedVB) {
+ update.updateSelectionLine();
+ }
+ });
});
recentState = sstate.repmap;

0 comments on commit e947800

Please sign in to comment.