Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6571 fix scatter3d marker opacity when marker.opacity is set to 0 #6581

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
1 change: 1 addition & 0 deletions draftlogs/6581_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fix scatter3d marker opacity when marker.opacity is set to 0 [[#6581](https://github.com/plotly/plotly.js/pull/6581)]
2 changes: 1 addition & 1 deletion src/traces/scatter3d/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,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 && data.marker.opacity !== undefined) 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);
});
});