mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
nice, node highlighting now
This commit is contained in:
parent
1d59152931
commit
8534bdad2c
4 changed files with 57 additions and 19 deletions
18
src/tree.js
18
src/tree.js
|
@ -488,7 +488,7 @@ var VisNode = Backbone.Model.extend({
|
|||
r: this.getRadius(),
|
||||
fill: this.getFill(),
|
||||
'stroke-width': this.get('stroke-width'),
|
||||
'stroke': this.get('stroke')
|
||||
stroke: this.get('stroke')
|
||||
},
|
||||
text: {
|
||||
x: textPos.x,
|
||||
|
@ -498,6 +498,22 @@ var VisNode = Backbone.Model.extend({
|
|||
};
|
||||
},
|
||||
|
||||
highlightTo: function(branch, speed, easing) {
|
||||
// a small function to highlight the color of a node for demonstration purposes
|
||||
var color = branch.get('fill');
|
||||
|
||||
var attr = {
|
||||
circle: {
|
||||
fill: color,
|
||||
stroke: color,
|
||||
'stroke-width': this.get('stroke-width') * 5
|
||||
},
|
||||
text: {}
|
||||
};
|
||||
|
||||
this.animateToAttr(attr, speed, easing);
|
||||
},
|
||||
|
||||
animateUpdatedPosition: function(speed, easing) {
|
||||
var attr = this.getAttributes();
|
||||
this.animateToAttr(attr, speed, easing);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue