Skip to content

Commit b9ec1f6

Browse files
committed
scatter3d use error bars' defaults values when possible
1 parent 12b8aa1 commit b9ec1f6

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

src/traces/scatter3d/convert.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ 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');
2726

2827
function LineWithMarkers(scene, uid) {
2928
this.scene = scene;
@@ -117,17 +116,17 @@ function constructDelaunay(points, color, axis) {
117116
function calculateErrorParams(errors) {
118117
var capSize = [0.0, 0.0, 0.0],
119118
color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]],
120-
lineWidth = [0.0, 0.0, 0.0];
119+
lineWidth = [1.0, 1.0, 1.0];
121120

122121
for(var i = 0; i < 3; i++) {
123122
var e = errors[i];
124123

125-
if(e && e.copy_zstyle !== false) e = errors[2];
126-
if(!e) continue;
124+
if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];
125+
if(!e || !e.visible) continue;
127126

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

132131
}
133132

320 Bytes
Loading

test/image/mocks/gl3d_errorbars_xy.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
"data": [{
33
"type": "scatter3d",
44
"mode": "markers",
5-
"x": [1],
6-
"y": [1],
7-
"z": [1],
5+
"x": [5, 10],
6+
"y": [5, 10],
7+
"z": [5, 10],
88
"error_x": {
99
"type": "sqrt",
10-
"thickness": 5
10+
"color": "red"
1111
},
1212
"error_y": {
13-
"type": "sqrt",
14-
"thickness": 5,
15-
"color": "red"
13+
"type": "sqrt"
1614
}
1715
}],
1816
"layout": {}

0 commit comments

Comments
 (0)