Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84eebcb

Browse files
committed
Merge branch 'master' into send-frames-to-cloud
2 parents d97a28c + 7e9fc1d commit 84eebcb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/plot_api/plot_api.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,8 @@ Plotly.addFrames = function(gd, frameList, indices) {
25662566

25672567
var insertions = [];
25682568
for(i = frameList.length - 1; i >= 0; i--) {
2569+
if(!Lib.isPlainObject(frameList[i])) continue;
2570+
25692571
var name = (_hash[frameList[i].name] || {}).name;
25702572
var newName = frameList[i].name;
25712573

test/jasmine/tests/frame_api_test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ describe('Test frame api', function() {
4343
}).catch(fail).then(done);
4444
});
4545

46+
it('compresses garbage when adding frames', function(done) {
47+
Plotly.addFrames(gd, [null, 'garbage', 14, true, false, {name: 'test'}, null]).then(function() {
48+
expect(Object.keys(h)).toEqual(['test']);
49+
expect(f).toEqual([{name: 'test'}]);
50+
}).catch(fail).then(done);
51+
});
52+
4653
it('treats a null list as a noop', function(done) {
4754
Plotly.addFrames(gd, null).then(function() {
4855
expect(Object.keys(h)).toEqual([]);

0 commit comments

Comments
 (0)