Skip to content

Commit 2db7e92

Browse files
committed
Merge remote-tracking branch 'origin/transition-gc' into 3.5
2 parents f82dd6f + 135a84a commit 2db7e92

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

d3.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8576,9 +8576,13 @@
85768576
subgroups.push(subgroup = []);
85778577
for (var group = this[j], i = 0, n = group.length; i < n; i++) {
85788578
if (node = group[i]) {
8579-
transition = Object.create(node.__transition__[id0]);
8580-
transition.delay += transition.duration;
8581-
d3_transitionNode(node, i, id1, transition);
8579+
transition = node.__transition__[id0];
8580+
d3_transitionNode(node, i, id1, {
8581+
time: transition.time,
8582+
ease: transition.ease,
8583+
delay: transition.delay + transition.duration,
8584+
duration: transition.duration
8585+
});
85828586
}
85838587
subgroup.push(node);
85848588
}
@@ -8599,6 +8603,7 @@
85998603
delay: inherit.delay,
86008604
duration: inherit.duration
86018605
};
8606+
inherit = null;
86028607
++lock.count;
86038608
d3.timer(function(elapsed) {
86048609
var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, timer = d3_timer_active, tweened = [];

d3.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/transition/subtransition.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ d3_transitionPrototype.transition = function() {
1313
subgroups.push(subgroup = []);
1414
for (var group = this[j], i = 0, n = group.length; i < n; i++) {
1515
if (node = group[i]) {
16-
transition = Object.create(node.__transition__[id0]);
17-
transition.delay += transition.duration;
18-
d3_transitionNode(node, i, id1, transition);
16+
transition = node.__transition__[id0];
17+
d3_transitionNode(node, i, id1, {time: transition.time, ease: transition.ease, delay: transition.delay + transition.duration, duration: transition.duration});
1918
}
2019
subgroup.push(node);
2120
}

src/transition/transition.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ function d3_transitionNode(node, i, id, inherit) {
6060
duration: inherit.duration
6161
};
6262

63+
inherit = null; // allow gc
64+
6365
++lock.count;
6466

6567
d3.timer(function(elapsed) {

0 commit comments

Comments
 (0)