Skip to content

Commit 51113b7

Browse files
committed
add gl2d replot-from-blank-graph test case
1 parent dc3ab87 commit 51113b7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/jasmine/tests/gl_plot_interact_test.js

+37
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,41 @@ describe('Test gl plot side effects', function() {
580580
});
581581
});
582582
});
583+
584+
it('should be able to replot from a blank graph', function(done) {
585+
var gd = createGraphDiv();
586+
587+
function assert(cnt) {
588+
var nodes = d3.selectAll('canvas');
589+
expect(nodes.size()).toEqual(cnt);
590+
}
591+
592+
var data = [{
593+
type: 'scattergl',
594+
x: [1, 2, 3],
595+
y: [2, 1, 2]
596+
}];
597+
598+
Plotly.plot(gd, []).then(function() {
599+
assert(0);
600+
601+
return Plotly.plot(gd, data);
602+
}).then(function() {
603+
assert(1);
604+
605+
return Plotly.purge(gd);
606+
}).then(function() {
607+
assert(0);
608+
609+
return Plotly.plot(gd, data);
610+
}).then(function() {
611+
assert(1);
612+
613+
return Plotly.deleteTraces(gd, [0]);
614+
}).then(function() {
615+
assert(0);
616+
617+
return Plotly.purge(gd);
618+
}).then(done);
619+
});
583620
});

0 commit comments

Comments
 (0)