diff --git a/src/traces/surface/index.js b/src/traces/surface/index.js index 72434cfa3c8..83f284b878f 100644 --- a/src/traces/surface/index.js +++ b/src/traces/surface/index.js @@ -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`.', diff --git a/test/image/baselines/gl3d_traces-with-opacity.png b/test/image/baselines/gl3d_traces-with-opacity.png new file mode 100644 index 00000000000..2d46bb03096 Binary files /dev/null and b/test/image/baselines/gl3d_traces-with-opacity.png differ diff --git a/test/image/mocks/gl3d_traces-with-opacity.json b/test/image/mocks/gl3d_traces-with-opacity.json new file mode 100644 index 00000000000..6c8a7000c45 --- /dev/null +++ b/test/image/mocks/gl3d_traces-with-opacity.json @@ -0,0 +1,175 @@ +{ + "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, + "colorscale": [[0, "#FF0"], [1, "#FF0"]], + "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, + "color": "#FF0", + "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.5] + }, + "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 } } + } + } +}