Skip to content

Commit b86e4e4

Browse files
committed
Getter support for transition.{delay,duration}.
Fixes d3#1773.
1 parent 28538c4 commit b86e4e4

4 files changed

Lines changed: 5 additions & 1 deletion

File tree

d3.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8578,6 +8578,7 @@
85788578
};
85798579
d3_transitionPrototype.delay = function(value) {
85808580
var id = this.id;
8581+
if (arguments.length < 1) return this.node().__transition__[id].delay;
85818582
return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
85828583
node.__transition__[id].delay = +value.call(node, node.__data__, i, j);
85838584
} : (value = +value, function(node) {
@@ -8586,6 +8587,7 @@
85868587
};
85878588
d3_transitionPrototype.duration = function(value) {
85888589
var id = this.id;
8590+
if (arguments.length < 1) return this.node().__transition__[id].duration;
85898591
return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
85908592
node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j));
85918593
} : (value = Math.max(1, value), function(node) {

d3.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/transition/delay.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "transition";
33

44
d3_transitionPrototype.delay = function(value) {
55
var id = this.id;
6+
if (arguments.length < 1) return this.node().__transition__[id].delay;
67
return d3_selection_each(this, typeof value === "function"
78
? function(node, i, j) { node.__transition__[id].delay = +value.call(node, node.__data__, i, j); }
89
: (value = +value, function(node) { node.__transition__[id].delay = value; }));

src/transition/duration.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "transition";
33

44
d3_transitionPrototype.duration = function(value) {
55
var id = this.id;
6+
if (arguments.length < 1) return this.node().__transition__[id].duration;
67
return d3_selection_each(this, typeof value === "function"
78
? function(node, i, j) { node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j)); }
89
: (value = Math.max(1, value), function(node) { node.__transition__[id].duration = value; }));

0 commit comments

Comments
 (0)