Skip to content
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
2 changes: 1 addition & 1 deletion src/traces/surface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
moduleType: 'trace',
name: 'surface',
basePlotModule: require('../../plots/gl3d'),
categories: ['gl3d', '2dMap', 'noOpacity'],
categories: ['gl3d', '2dMap'],
meta: {
description: [
'The data the describes the coordinates of the surface is set in `z`.',
Expand Down
Binary file added test/image/baselines/gl3d_traces-with-opacity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 173 additions & 0 deletions test/image/mocks/gl3d_traces-with-opacity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"data": [{
"x": [-1, 0, 1],
"y": [-1, 0, 1],
"z": [
[0, 1, 0],
[1, 0, 1],
[0, 1, 0]
],
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 1,
"showscale": false,
"type": "surface",
"name": "surface",
"scene": "scene1"
}, {
"x": [0, 1, 0, 1, 0, 1, 0, 1],
"y": [0, 0, 1, 1, 0, 0, 1, 1],
"z": [0, 0, 0, 0, 1, 1, 1, 1],
"i": [0, 3, 4, 7, 0, 6, 1, 7, 0, 5, 2, 7],
"j": [1, 2, 5, 6, 2, 4, 3, 5, 4, 1, 6, 3],
"k": [3, 0, 7, 4, 6, 0, 7, 1, 5, 0, 7, 2],
"flatshading": true,
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 1,
"type": "mesh3d",
"name": "mesh3d",
"scene": "scene2"
}, {
"x": [-1, 0, 1],
"y": [-1, 0, 1],
"z": [
[0, 1, 0],
[1, 0, 1],
[0, 1, 0]
],
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 0.5,
"showscale": false,
"type": "surface",
"name": "surface",
"scene": "scene3"
}, {
"x": [0, 1, 0, 1, 0, 1, 0, 1],
"y": [0, 0, 1, 1, 0, 0, 1, 1],
"z": [0, 0, 0, 0, 1, 1, 1, 1],
"i": [0, 3, 4, 7, 0, 6, 1, 7, 0, 5, 2, 7],
"j": [1, 2, 5, 6, 2, 4, 3, 5, 4, 1, 6, 3],
"k": [3, 0, 7, 4, 6, 0, 7, 1, 5, 0, 7, 2],
"flatshading": true,
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 0.5,
"type": "mesh3d",
"name": "mesh3d",
"scene": "scene4"
}, {
"x": [0, 0, 1, 1, 0, 0, 1, 1],
"y": [0, 1, 1, 0, 0, 1, 1, 0],
"z": [0, 0, 0, 0, 1, 1, 1, 1],
"u": [0, 0, 1, 1, 0, 0, 1, 1],
"v": [0, 1, 1, 0, 0, 1, 1, 0],
"w": [0, 0, 0, 0, 1, 1, 1, 1],
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 0.5,
"showscale": false,
"type": "cone",
"name": "cone",
"scene": "scene5"
}, {
"x": [0, 0, 1, 1, 0, 0, 1, 1],
"y": [0, 1, 1, 0, 0, 1, 1, 0],
"z": [0, 0, 0, 0, 1, 1, 1, 1],
"u": [0, 0, 1, 1, 0, 0, 1, 1],
"v": [0, 1, 1, 0, 0, 1, 1, 0],
"w": [0, 0, 0, 0, 1, 1, 1, 1],
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 0.5,
"showscale": false,
"type": "streamtube",
"name": "streamtube",
"scene": "scene6"
}, {
"x": [0, 0, 0, 0, 1, 1, 1, 1],
"y": [0, 0, 1, 1, 0, 0, 1, 1],
"z": [0, 1, 0, 1, 0, 1, 0, 1],
"value": [0, 0, 0, 1, 1, 0, 0, 0],
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacity": 0.5,
"showscale": false,
"type": "isosurface",
"name": "isosurface",
"scene": "scene7"
}, {
"x": [0, 0, 0, 0, 1, 1, 1, 1],
"y": [0, 0, 1, 1, 0, 0, 1, 1],
"z": [0, 1, 0, 1, 0, 1, 0, 1],
"value": [0, 0, 0, 1, 1, 0, 0, 0],
"lightposition": { "x": 1000, "y": 1000, "z": 0 },
"opacityscale": "max",
"opacity": 0.5,
"showscale": false,
"type": "volume",
"name": "volume",
"scene": "scene8"
}],
"layout": {
"paper_bgcolor": "rgba(0,0,255, 0.5)",
"margin": {
"t": 0,
"b": 0,
"l": 0,
"r": 0
},
"width": 1000,
"height": 500,
"scene1": {
"domain": {
"x": [0, 0.25],
"y": [0, 0.25]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"y": [0, 0.25]
"y": [0, 0.5]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good eye! Done in 0dd8748.
I also think we may want to close #2477.

},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene2": {
"domain": {
"x": [0, 0.25],
"y": [0.5, 1]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene3": {
"domain": {
"x": [0.25, 0.5],
"y": [0, 0.5]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene4": {
"domain": {
"x": [0.25, 0.5],
"y": [0.5, 1]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene5": {
"domain": {
"x": [0.5, 0.75],
"y": [0, 0.5]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene6": {
"domain": {
"x": [0.5, 0.75],
"y": [0.5, 1]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene7": {
"domain": {
"x": [0.75, 1],
"y": [0, 0.5]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
},
"scene8": {
"domain": {
"x": [0.75, 1],
"y": [0.5, 1]
},
"camera": { "eye": { "x": 1.5, "y": 3, "z": 1 } }
}
}
}