toolkit/javascript/d3/src/core/transition-style.js
changeset 47 c0b4a8b5a012
equal deleted inserted replaced
46:efd9c589177a 47:c0b4a8b5a012
       
     1 d3_transitionPrototype.style = function(name, value, priority) {
       
     2   if (arguments.length < 3) priority = "";
       
     3   return this.styleTween(name, d3_transitionTween(name, value), priority);
       
     4 };
       
     5 
       
     6 d3_transitionPrototype.styleTween = function(name, tween, priority) {
       
     7   if (arguments.length < 3) priority = "";
       
     8   return this.tween("style." + name, function(d, i) {
       
     9     var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name));
       
    10     return f === d3_transitionRemove
       
    11         ? (this.style.removeProperty(name), null)
       
    12         : f && function(t) { this.style.setProperty(name, f(t), priority); };
       
    13   });
       
    14 };