Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaa08ae

Browse files
committed
Merge pull request plotly#408 from plotly/surfaceaxis-opacity
Pass scatter3d trace opacity to surface axes
2 parents f9b0226 + 6c086a1 commit aaa08ae

File tree

3 files changed

+235
-1
lines changed

3 files changed

+235
-1
lines changed

src/traces/scatter3d/convert.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,10 @@ proto.update = function(data) {
407407
var delaunayOptions = constructDelaunay(
408408
options.position,
409409
options.delaunayColor,
410-
options.delaunayAxis);
410+
options.delaunayAxis
411+
);
412+
delaunayOptions.opacity = data.opacity;
413+
411414
if(this.delaunayMesh) {
412415
this.delaunayMesh.update(delaunayOptions);
413416
} else {

test/image/baselines/gl3d_cube.png

23.6 KB
Loading

test/image/mocks/gl3d_cube.json

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
{
2+
"data": [
3+
{
4+
"type": "scatter3d",
5+
"mode": "lines",
6+
"x": [
7+
0,
8+
1,
9+
1,
10+
0,
11+
0
12+
],
13+
"y": [
14+
0,
15+
0,
16+
1,
17+
1,
18+
0
19+
],
20+
"z": [
21+
0,
22+
0,
23+
0,
24+
0,
25+
0
26+
],
27+
"surfaceaxis": 2,
28+
"name": "face 1",
29+
"line": {
30+
"width": 5
31+
},
32+
"uid": "6a4a7a",
33+
"opacity": 0.3
34+
},
35+
{
36+
"type": "scatter3d",
37+
"mode": "lines",
38+
"x": [
39+
0,
40+
1,
41+
1,
42+
0,
43+
0
44+
],
45+
"y": [
46+
0,
47+
0,
48+
1,
49+
1,
50+
0
51+
],
52+
"z": [
53+
1,
54+
1,
55+
1,
56+
1,
57+
1
58+
],
59+
"surfaceaxis": 2,
60+
"name": "face 2",
61+
"line": {
62+
"width": 5
63+
},
64+
"uid": "4b1345",
65+
"opacity": 0.3
66+
},
67+
{
68+
"type": "scatter3d",
69+
"mode": "lines",
70+
"x": [
71+
0,
72+
1,
73+
1,
74+
0,
75+
0
76+
],
77+
"y": [
78+
0,
79+
0,
80+
0,
81+
0,
82+
0
83+
],
84+
"z": [
85+
0,
86+
0,
87+
1,
88+
1,
89+
0
90+
],
91+
"surfaceaxis": 1,
92+
"name": "face 3",
93+
"line": {
94+
"width": 5
95+
},
96+
"uid": "1fb492",
97+
"opacity": 0.3
98+
},
99+
{
100+
"type": "scatter3d",
101+
"mode": "lines",
102+
"x": [
103+
0,
104+
1,
105+
1,
106+
0,
107+
0
108+
],
109+
"y": [
110+
1,
111+
1,
112+
1,
113+
1,
114+
1
115+
],
116+
"z": [
117+
0,
118+
0,
119+
1,
120+
1,
121+
0
122+
],
123+
"surfaceaxis": 1,
124+
"name": "face 4",
125+
"line": {
126+
"width": 5
127+
},
128+
"uid": "c96af2",
129+
"opacity": 0.3
130+
},
131+
{
132+
"type": "scatter3d",
133+
"mode": "lines",
134+
"x": [
135+
0,
136+
0,
137+
0,
138+
0,
139+
0
140+
],
141+
"y": [
142+
0,
143+
0,
144+
1,
145+
1,
146+
0
147+
],
148+
"z": [
149+
0,
150+
1,
151+
1,
152+
0,
153+
0
154+
],
155+
"surfaceaxis": 0,
156+
"name": "face 5",
157+
"line": {
158+
"width": 5
159+
},
160+
"uid": "9501a8",
161+
"opacity": 0.3
162+
},
163+
{
164+
"type": "scatter3d",
165+
"mode": "lines",
166+
"x": [
167+
1,
168+
1,
169+
1,
170+
1
171+
],
172+
"y": [
173+
0,
174+
0,
175+
1,
176+
1,
177+
0
178+
],
179+
"z": [
180+
0,
181+
1,
182+
1,
183+
0,
184+
0
185+
],
186+
"surfaceaxis": 0,
187+
"name": "face 6",
188+
"line": {
189+
"width": 5
190+
},
191+
"uid": "44e541",
192+
"opacity": 0.3
193+
}
194+
],
195+
"layout": {
196+
"scene": {
197+
"xaxis": {
198+
"showgrid": false,
199+
"showline": false,
200+
"zeroline": false,
201+
"showticklabels": false,
202+
"title": "",
203+
"type": "linear"
204+
},
205+
"yaxis": {
206+
"showgrid": false,
207+
"showline": false,
208+
"zeroline": false,
209+
"showticklabels": false,
210+
"title": "",
211+
"type": "linear"
212+
},
213+
"zaxis": {
214+
"showgrid": false,
215+
"showline": false,
216+
"zeroline": false,
217+
"showticklabels": false,
218+
"title": "",
219+
"type": "linear"
220+
},
221+
"aspectratio": {
222+
"x": 1,
223+
"y": 1,
224+
"z": 1
225+
}
226+
},
227+
"height": 450,
228+
"width": 1731.82,
229+
"autosize": true
230+
}
231+
}

0 commit comments

Comments
 (0)