Skip to content

Commit 74ecbf8

Browse files
committed
scaled pad value by normMax only under sizemode: 'scaled'
1 parent fb2ec1e commit 74ecbf8

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/traces/cone/convert.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ function convert(scene, trace) {
109109
meshData.opacity = trace.opacity;
110110

111111
// stash autorange pad value
112-
trace._pad = anchor2coneSpan[trace.anchor] * meshData.vectorScale * trace._normMax * trace.sizeref;
112+
trace._pad = anchor2coneSpan[trace.anchor] * meshData.vectorScale * trace.sizeref;
113+
if(trace.sizemode === 'scaled') trace._pad *= trace._normMax;
113114

114115
return meshData;
115116
}
-18.9 KB
Loading

test/image/mocks/gl3d_cone-simple.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
"w": [0, 0, 2],
1111
"sizemode": "absolute",
1212
"sizeref": 2,
13-
"anchor": "tip"
13+
"anchor": "tip",
14+
"colorbar": {
15+
"x": 0,
16+
"xanchor": "right",
17+
"side": "left"
18+
}
1419
},
1520
{
1621
"type": "cone",
@@ -26,18 +31,15 @@
2631
"layout": {
2732
"scene": {
2833
"domain": {"x": [0, 0.5]},
29-
"xaxis": {
30-
"range": [-2, 5]
31-
},
32-
"yaxis": {
33-
"range": [-2, 5]
34-
},
35-
"zaxis": {
36-
"range": [-2, 5]
34+
"camera": {
35+
"eye": {"x": -1.57, "y": 1.36, "z": 0.58}
3736
}
3837
},
3938
"scene2": {
40-
"domain": {"x": [0.5, 1]}
39+
"domain": {"x": [0.5, 1]},
40+
"camera": {
41+
"eye": {"x": -1.57, "y": 1.36, "z": 0.58}
42+
}
4143
},
4244
"width": 800
4345
}

0 commit comments

Comments
 (0)