Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/traces/scatter3d/convert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

var isNumeric = require('fast-isnumeric');

var createLinePlot = require('../../../stackgl_modules').gl_line3d;
var createScatterPlot = require('../../../stackgl_modules').gl_scatter3d;
var createErrorBars = require('../../../stackgl_modules').gl_error3d;
Expand Down Expand Up @@ -403,7 +405,7 @@ proto.update = function(data) {

// N.B. marker.opacity must be a scalar for performance
var scatterOpacity = data.opacity;
if(data.marker && data.marker.opacity) scatterOpacity *= data.marker.opacity;
if(data.marker && isNumeric(data.marker.opacity)) scatterOpacity *= data.marker.opacity;

scatterOptions = {
gl: this.scene.glplot.gl,
Expand Down
17 changes: 17 additions & 0 deletions test/jasmine/tests/scatter3d_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,21 @@ describe('Test scatter3d interactions:', function() {
})
.then(done, done.fail);
});

it('@gl markers should be transparent when marker.opacity is 0', function(done) {
Plotly.newPlot(gd, [
{
type: 'scatter3d',
x: [0],
y: [0],
z: [0],
mode: 'markers',
marker: { opacity: 0 }
},
])
.then(function() {
expect(gd._fullLayout.scene._scene.glplot.objects[0].opacity).toEqual(0);
})
.then(done, done.fail);
});
});