Skip to content

Commit

Permalink
Add transition.transition.
Browse files Browse the repository at this point in the history
This derives a new transition from the existing transition, equivalent to (and
implemented as) transition.select(function() { return this; }).
  • Loading branch information
mbostock committed Aug 25, 2011
1 parent 0f4152e commit d553327
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -40,6 +40,7 @@ d3.core.js: \
src/core/date.js \
src/core/object.js \
src/core/array.js \
src/core/this.js \
src/core/functor.js \
src/core/rebind.js \
src/core/ascending.js \
Expand Down Expand Up @@ -113,6 +114,7 @@ d3.core.js: \
src/core/transition-delay.js \
src/core/transition-duration.js \
src/core/transition-each.js \
src/core/transition-transition.js \
src/core/timer.js \
src/core/noop.js

Expand Down
6 changes: 6 additions & 0 deletions d3.js
Expand Up @@ -18,6 +18,9 @@ function(array, prototype) {
function(array, prototype) {
for (var property in prototype) array[property] = prototype[property];
};
function d3_this() {
return this;
}
d3.functor = function(v) {
return typeof v === "function" ? v : function() { return v; };
};
Expand Down Expand Up @@ -1949,6 +1952,9 @@ function d3_transition_each(callback) {
}
return this;
}
d3_transitionPrototype.transition = function() {
return this.select(d3_this);
};
var d3_timer_queue = null,
d3_timer_interval, // is an interval (or frame) active?
d3_timer_timeout; // is a timeout active?
Expand Down
4 changes: 2 additions & 2 deletions d3.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/core/this.js
@@ -0,0 +1,3 @@
function d3_this() {
return this;
}
3 changes: 3 additions & 0 deletions src/core/transition-transition.js
@@ -0,0 +1,3 @@
d3_transitionPrototype.transition = function() {
return this.select(d3_this);
};

0 comments on commit d553327

Please sign in to comment.