Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5eed7e

Browse filesBrowse files
committed
Merge pull request plotly#405 from plotly/toggle-surfaceaxis
dispose delaunayMeadh on scatter3d toggle [fixes plotly#399]
2 parents e8fc236 + ee35dc3 commit b5eed7e
Copy full SHA for b5eed7e

File tree

Expand file treeCollapse file tree

2 files changed

+29
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+29
-3
lines changed

‎src/traces/scatter3d/convert.js

Copy file name to clipboardExpand all lines: src/traces/scatter3d/convert.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,15 @@ proto.dispose = function() {
432432
this.scatterPlot.dispose();
433433
}
434434
if(this.errorBars) {
435-
this.scene.remove(this.errorBars);
435+
this.scene.glplot.remove(this.errorBars);
436436
this.errorBars.dispose();
437437
}
438438
if(this.textMarkers) {
439439
this.scene.glplot.remove(this.textMarkers);
440440
this.textMarkers.dispose();
441441
}
442442
if(this.delaunayMesh) {
443-
this.scene.glplot.remove(this.textMarkers);
443+
this.scene.glplot.remove(this.delaunayMesh);
444444
this.delaunayMesh.dispose();
445445
}
446446
};

‎test/jasmine/tests/gl_plot_interact_test.js

Copy file name to clipboardExpand all lines: test/jasmine/tests/gl_plot_interact_test.js
+27-1Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,17 @@ describe('Test gl plot interactions', function() {
7373

7474
beforeEach(function(done) {
7575
gd = createGraphDiv();
76-
Plotly.plot(gd, mock.data, mock.layout).then(function() {
76+
77+
var mockCopy = Lib.extendDeep({}, mock);
78+
79+
// lines, markers, text, error bars and surfaces each
80+
// correspond to one glplot object
81+
mockCopy.data[0].mode = 'lines+markers+text';
82+
mockCopy.data[0].error_z = { value: 10 };
83+
mockCopy.data[0].surfaceaxis = 2;
84+
mockCopy.layout.showlegend = true;
85+
86+
Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() {
7787
delay(done);
7888
});
7989
});
@@ -190,6 +200,22 @@ describe('Test gl plot interactions', function() {
190200
});
191201
});
192202

203+
it('should be able to toggle visibility', function(done) {
204+
var objects = gd._fullLayout.scene._scene.glplot.objects;
205+
206+
expect(objects.length).toEqual(5);
207+
208+
Plotly.restyle(gd, 'visible', 'legendonly').then(function() {
209+
expect(objects.length).toEqual(0);
210+
211+
return Plotly.restyle(gd, 'visible', true);
212+
}).then(function() {
213+
expect(objects.length).toEqual(5);
214+
215+
done();
216+
});
217+
});
218+
193219
});
194220

195221
describe('gl2d plots', function() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.