Skip to content

Commit 67ccac9

Browse files
committed
Revert trace changes
1 parent dc9f4e5 commit 67ccac9

File tree

4 files changed

+16
-35
lines changed

4 files changed

+16
-35
lines changed

src/traces/heatmap/xyz_defaults.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,19 @@ module.exports = function handleXYZDefaults(traceIn, traceOut, coerce, layout, x
1919
yName = yName || 'y';
2020
var x, y;
2121

22-
var shapeX = x ? (x.shape ? x.shape[0] : x.length) || 0 : 0;
23-
var shapeY = y ? (y.shape ? y.shape[0] : y.length) || 0 : 0;
24-
var shapeZ = z ? (z.shape ? z.shape[0] : z.length) || 0 : 0;
22+
if(z === undefined || !z.length) return 0;
2523

26-
var zlen = shapeZ || (z && z.length) || 0;
27-
28-
if(z === undefined || !zlen) return 0;
29-
30-
if(Lib.isArray1D(traceIn.z) || (z && z.shape && z.shape.length === 1)) {
24+
if(Lib.isArray1D(traceIn.z)) {
3125
x = coerce(xName);
3226
y = coerce(yName);
3327

34-
var xlen = shapeX || Lib.minRowLength(x);
35-
var ylen = shapeY || Lib.minRowLength(y);
28+
var xlen = Lib.minRowLength(x);
29+
var ylen = Lib.minRowLength(y);
3630

3731
// column z must be accompanied by xName and yName arrays
3832
if(xlen === 0 || ylen === 0) return 0;
3933

40-
traceOut._length = Math.min(xlen, ylen, zlen);
34+
traceOut._length = Math.min(xlen, ylen, z.length);
4135
} else {
4236
x = coordDefaults(xName, coerce);
4337
y = coordDefaults(yName, coerce);

src/traces/isosurface/defaults.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,12 @@ function supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
3838
var z = coerce('z');
3939
var value = coerce('value');
4040

41-
var len = 0;
42-
43-
if(x && y && z && value) {
44-
len = Math.min(
45-
(x.shape ? x.shape[0] : x.length) || 0,
46-
(y.shape ? y.shape[0] : y.length) || 0,
47-
(z.shape ? z.shape[0] : z.length) || 0,
48-
(value.shape ? value.shape[0] : value.length) || 0
49-
);
50-
}
51-
52-
if(!len) {
41+
if(
42+
!x || !x.length ||
43+
!y || !y.length ||
44+
!z || !z.length ||
45+
!value || !value.length
46+
) {
5347
traceOut.visible = false;
5448
return;
5549
}

src/traces/scatter/xy_defaults.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,19 @@ module.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {
1919
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
2020
handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);
2121

22-
var shapeX = x && x.shape ? x.shape[0] : 0;
23-
var shapeY = y && y.shape ? y.shape[0] : 0;
24-
2522
if(x) {
26-
var xlen = shapeX || Lib.minRowLength(x);
23+
var xlen = Lib.minRowLength(x);
2724
if(y) {
28-
len = shapeY || Math.min(xlen, Lib.minRowLength(y));
25+
len = Math.min(xlen, Lib.minRowLength(y));
2926
} else {
30-
len = shapeX || xlen;
27+
len = xlen;
3128
coerce('y0');
3229
coerce('dy');
3330
}
3431
} else {
3532
if(!y) return 0;
3633

37-
len = shapeY || Lib.minRowLength(y);
34+
len = Lib.minRowLength(y);
3835
coerce('x0');
3936
coerce('dx');
4037
}

src/traces/scatter3d/defaults.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,8 @@ function handleXYZDefaults(traceIn, traceOut, coerce, layout) {
7878
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);
7979

8080
if(x && y && z) {
81-
var shapeX = (x.shape ? x.shape[0] : x.length) || 0;
82-
var shapeY = (y.shape ? y.shape[0] : y.length) || 0;
83-
var shapeZ = (z.shape ? z.shape[0] : z.length) || 0;
84-
8581
// TODO: what happens if one is missing?
86-
len = Math.min(shapeX, shapeY, shapeZ);
82+
len = Math.min(x.length, y.length, z.length);
8783
traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;
8884
}
8985

0 commit comments

Comments
 (0)