Skip to content

Commit 3ffb898

Browse files
committed
scatter3d errorbars now fallback to default attributes if error_z is empty
1 parent 5fa493a commit 3ffb898

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/traces/scatter3d/convert.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var DASH_PATTERNS = require('../../constants/gl3d_dashes');
2323
var MARKER_SYMBOLS = require('../../constants/gl3d_markers');
2424

2525
var calculateError = require('./calc_errors');
26+
var errorBarsAttributes = require('../../components/errorbars/attributes');
2627

2728
function LineWithMarkers(scene, uid) {
2829
this.scene = scene;
@@ -124,9 +125,9 @@ function calculateErrorParams(errors) {
124125
if(e && e.copy_zstyle !== false) e = errors[2];
125126
if(!e) continue;
126127

127-
capSize[i] = e.width / 2; // ballpark rescaling
128+
capSize[i] = (e.width || 0) / 2; // ballpark rescaling
128129
color[i] = str2RgbaArray(e.color);
129-
lineWidth = e.thickness;
130+
lineWidth = (e.thickness || errorBarsAttributes.thickness.dflt);
130131

131132
}
132133

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"data": [{
3+
"type": "scatter3d",
4+
"mode": "markers",
5+
"x": [1],
6+
"y": [1],
7+
"z": [1],
8+
"error_x": {
9+
"type": "sqrt",
10+
"thickness": 5
11+
},
12+
"error_y": {
13+
"type": "sqrt",
14+
"thickness": 5,
15+
"color": "red"
16+
}
17+
}],
18+
"layout": {}
19+
}

0 commit comments

Comments
 (0)