Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions draftlogs/5958_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix scatter3d opacity restyle bug [[#5958](https://github.com/plotly/plotly.js/pull/5958)],
with thanks to @dwoznicki for the contribution!
2 changes: 2 additions & 0 deletions src/traces/scatter3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ var attrs = module.exports = overrideAll({
family: extendFlat({}, scatterAttrs.textfont.family, {arrayOk: false})
},

opacity: baseAttrs.opacity,

hoverinfo: extendFlat({}, baseAttrs.hoverinfo)
}, 'calc', 'nested');

Expand Down
20 changes: 20 additions & 0 deletions test/jasmine/tests/scatter3d_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,24 @@ describe('Test scatter3d interactions:', function() {
})
.then(done, done.fail);
});

it('@gl should change marker opacity when restyle is called', function(done) {
Plotly.newPlot(
gd,
[
{
type: 'scatter3d',
x: [0],
y: [0],
z: [0],
mode: 'markers',
},
]
).then(function() {
Plotly.restyle(gd, 'opacity', 0.5).then(function() {
expect(gd._fullLayout.scene._scene.glplot.objects[0].hasAlpha).toEqual(true);
});
})
.then(done, done.fail);
});
});
2 changes: 1 addition & 1 deletion test/plot-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44927,7 +44927,7 @@
"opacity": {
"description": "Sets the opacity of the trace.",
"dflt": 1,
"editType": "style",
"editType": "calc",
"max": 1,
"min": 0,
"valType": "number"
Expand Down