Skip to content

Commit 0548db3

Browse files
committed
test of polar toggle staticPlot
1 parent 1074804 commit 0548db3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/jasmine/tests/plot_api_test.js

+26
Original file line numberDiff line numberDiff line change
@@ -2513,6 +2513,32 @@ describe('Test plot api', function() {
25132513
.then(done);
25142514
});
25152515

2516+
it('can put polar plots into staticPlot mode', function(done) {
2517+
// tested separately since some of the relevant code is actually
2518+
// in cartesian/graph_interact... hopefully we'll fix that
2519+
// sometime and the test will still pass.
2520+
var data = [{r: [1, 2, 3], theta: [0, 120, 240], type: 'scatterpolar'}];
2521+
var layout = {};
2522+
2523+
Plotly.newPlot(gd, data, layout)
2524+
.then(countPlots)
2525+
.then(function() {
2526+
expect(d3.select(gd).selectAll('.drag').size()).toBe(3);
2527+
2528+
return Plotly.react(gd, data, layout, {staticPlot: true});
2529+
})
2530+
.then(function() {
2531+
expect(d3.select(gd).selectAll('.drag').size()).toBe(0);
2532+
2533+
return Plotly.react(gd, data, layout, {});
2534+
})
2535+
.then(function() {
2536+
expect(d3.select(gd).selectAll('.drag').size()).toBe(3);
2537+
})
2538+
.catch(fail)
2539+
.then(done);
2540+
});
2541+
25162542
it('can change frames without redrawing', function(done) {
25172543
var data = [{y: [1, 2, 3]}];
25182544
var layout = {};

0 commit comments

Comments
 (0)