This repository has been archived by the owner on Apr 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
d3_transitionPrototype.style = function(name, value, priority) { | ||
var n = arguments.length; | ||
if (n < 3) { | ||
|
||
// For style(object) or style(object, string), the object specifies the | ||
// names and values of the attributes to set or remove. The values may be | ||
// functions that are evaluated for each element. The optional string | ||
// specifies the priority. | ||
if (typeof name !== "string") { | ||
if (n < 2) value = ""; | ||
for (priority in name) this.styleTween(priority, d3_tweenByName(name[priority], priority), value); | ||
return this; | ||
} | ||
|
||
// For style(string, string) or style(string, function), use the default | ||
// priority. The priority is ignored for style(string, null). | ||
priority = ""; | ||
} | ||
|
||
// Otherwise, a name, value and priority are specified, and handled as below. | ||
return this.styleTween(name, d3_tweenByName(value, name), priority); | ||
}; | ||
|
||
d3_transitionPrototype.styleTween = function(name, tween, priority) { | ||
if (arguments.length < 3) priority = ""; | ||
return this.tween("style." + name, function(d, i) { | ||
var f = tween.call(this, d, i, this.getCurrentStyle()[name]); | ||
return f === d3_tweenRemove | ||
? (this.removeStyleProperty(name), null) | ||
: f && function(t) { this.setStyleProperty(name, f(t), priority); }; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters