equal
deleted
inserted
replaced
|
1 d3_transitionPrototype.attr = function(name, value) { |
|
2 return this.attrTween(name, d3_transitionTween(name, value)); |
|
3 }; |
|
4 |
|
5 d3_transitionPrototype.attrTween = function(nameNS, tween) { |
|
6 var name = d3.ns.qualify(nameNS); |
|
7 |
|
8 function attrTween(d, i) { |
|
9 var f = tween.call(this, d, i, this.getAttribute(name)); |
|
10 return f === d3_transitionRemove |
|
11 ? (this.removeAttribute(name), null) |
|
12 : f && function(t) { this.setAttribute(name, f(t)); }; |
|
13 } |
|
14 |
|
15 function attrTweenNS(d, i) { |
|
16 var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); |
|
17 return f === d3_transitionRemove |
|
18 ? (this.removeAttributeNS(name.space, name.local), null) |
|
19 : f && function(t) { this.setAttributeNS(name.space, name.local, f(t)); }; |
|
20 } |
|
21 |
|
22 return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); |
|
23 }; |