Skip to content

Commit 14516cf

Browse files
committed
Tweak point enter/exit transitions
1 parent 9079632 commit 14516cf

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/traces/scatter/plot.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,23 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
400400
.classed('point', true);
401401

402402
enter.call(Drawing.pointStyle, trace)
403-
.call(Drawing.translatePoints, xa, ya, trace, transitionConfig, 1);
403+
.call(Drawing.translatePoints, xa, ya, trace);
404404

405-
join.transition().each(function(d) {
405+
if(hasTransition) {
406+
enter.style('opacity', 0).transition()
407+
.style('opacity', 1);
408+
}
409+
410+
join.each(function(d) {
406411
var sel = transition(d3.select(this));
407-
Drawing.translatePoint(d, sel, xa, ya, trace, transitionConfig, 0);
412+
Drawing.translatePoint(d, sel, xa, ya);
408413
Drawing.singlePointStyle(d, sel, trace);
409414
});
410415

411416
if(hasTransition) {
412-
join.exit()
413-
.call(Drawing.translatePoints, xa, ya, trace, transitionConfig, -1);
417+
join.exit().transition()
418+
.style('opacity', 0)
419+
.remove();
414420
} else {
415421
join.exit().remove();
416422
}

test/jasmine/tests/animate_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ describe('Test animate API', function() {
307307

308308
it('animates reasonably even when transition duration >> frame duration', function(done) {
309309
var starts = 0;
310-
var ends= 0;
310+
var ends = 0;
311311

312312
gd.on('plotly_animating', function() {
313313
starts++;

0 commit comments

Comments
 (0)