Skip to content

Commit 85934e4

Browse files
committed
refactor variables
1 parent 8886e45 commit 85934e4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/plots/cartesian/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,10 @@ function makeSubplotLayer(gd, plotinfo) {
568568
var yLayer = constants.layerValue2layerClass[plotinfo.yaxis.layer];
569569
var hasOnlyLargeSploms = fullLayout._hasOnlyLargeSploms;
570570

571-
if(!plotinfo.mainplot || fullLayout._zindices.length > 1) {
571+
var hasMultipleZ = fullLayout._zindices.length > 1;
572+
var mainplotinfo = plotinfo.mainplotinfo;
573+
574+
if(!plotinfo.mainplot || hasMultipleZ) {
572575
if(hasOnlyLargeSploms) {
573576
// TODO could do even better
574577
// - we don't need plot (but we would have to mock it in lsInner
@@ -622,17 +625,14 @@ function makeSubplotLayer(gd, plotinfo) {
622625
}
623626
}
624627

625-
if(fullLayout._zindices.length > 1) {
626-
var mainplotinfo = plotinfo.mainplotinfo;
628+
if(hasMultipleZ) {
627629
if(mainplotinfo) {
628630
plotinfo.minorGridlayer = mainplotinfo.minorGridlayer;
629631
plotinfo.gridlayer = mainplotinfo.gridlayer;
630632
plotinfo.zerolinelayer = mainplotinfo.zerolinelayer;
631633
}
632634
}
633-
634635
} else {
635-
var mainplotinfo = plotinfo.mainplotinfo;
636636
var mainplotgroup = mainplotinfo.plotgroup;
637637
var xId = id + '-x';
638638
var yId = id + '-y';

0 commit comments

Comments
 (0)