Skip to content

Commit a2f2ce8

Browse files
committed
assure that re-plots changing subplots pass through make framework
1 parent 09de224 commit a2f2ce8

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/plot_api/plot_api.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ Plotly.plot = function(gd, data, layout, config) {
141141
makePlotFramework(gd);
142142
}
143143
}
144+
else if(!hasSameSubplots) {
145+
gd.framework = makePlotFramework;
146+
makePlotFramework(gd);
147+
}
144148
else if(graphWasEmpty) makePlotFramework(gd);
145149

146150
var fullLayout = gd._fullLayout;

test/jasmine/tests/plot_interact_test.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,22 @@ describe('Test plot structure', function() {
7575
});
7676
});
7777

78-
it('should delete be able to get deleted', function(done) {
78+
it('should be able to get deleted', function(done) {
7979
expect(countScatterTraces()).toEqual(mock.data.length);
8080
expect(countSubplots()).toEqual(1);
8181

8282
Plotly.deleteTraces(gd, [0]).then(function() {
8383
expect(countScatterTraces()).toEqual(0);
8484
expect(countSubplots()).toEqual(1);
85+
86+
return Plotly.relayout(gd, {xaxis: null, yaxis: null});
87+
}).then(function() {
88+
expect(countScatterTraces()).toEqual(0);
89+
expect(countSubplots()).toEqual(0);
90+
91+
done();
92+
});
93+
});
8594
done();
8695
});
8796
});
@@ -222,7 +231,7 @@ describe('Test plot structure', function() {
222231

223232
return Plotly.deleteTraces(gd, [0]);
224233
}).then(function() {
225-
expect(countSubplots()).toEqual(4);
234+
expect(countSubplots()).toEqual(3);
226235
assertHeatmapNodes(0);
227236
assertContourNodes(0);
228237
expect(countColorBars()).toEqual(0);

0 commit comments

Comments
 (0)