Skip to content

Commit 5fa1e97

Browse files
committed
add test case for nodes add/remove on redraw:false animations
1 parent c8c3197 commit 5fa1e97

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/jasmine/tests/scatter_test.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,42 @@ describe('end-to-end scatter tests', function() {
539539
.catch(fail)
540540
.then(done);
541541
});
542+
543+
it('should smoothly add/remove nodes tags with *ids* during animations', function(done) {
544+
Plotly.plot(gd, {
545+
data: [{
546+
mode: 'markers+text',
547+
y: [1, 2, 1],
548+
text: ['apple', 'banana', 'clementine'],
549+
ids: ['A', 'B', 'C'],
550+
marker: { color: ['red', 'green', 'blue'] }
551+
}],
552+
frames: [{
553+
data: [{
554+
y: [2, 1, 2],
555+
text: ['apple', 'banana', 'dragon fruit'],
556+
ids: ['A', 'C', 'D'],
557+
marker: { color: ['red', 'blue', 'yellow'] }
558+
}]
559+
}]
560+
})
561+
.then(function() {
562+
_assertNodes(
563+
['rgb(255, 0, 0)', 'rgb(0, 128, 0)', 'rgb(0, 0, 255)'],
564+
['apple', 'banana', 'clementine']
565+
);
566+
567+
return Plotly.animate(gd, null, {frame: {redraw: false}});
568+
})
569+
.then(function() {
570+
_assertNodes(
571+
['rgb(255, 0, 0)', 'rgb(0, 0, 255)', 'rgb(255, 255, 0)'],
572+
['apple', 'banana', 'dragon fruit']
573+
);
574+
})
575+
.catch(fail)
576+
.then(done);
577+
});
542578
});
543579

544580
describe('scatter hoverPoints', function() {

0 commit comments

Comments
 (0)