@@ -82,6 +82,8 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
82
82
var isSubplotConstrained ;
83
83
// do we need to edit x/y ranges?
84
84
var editX , editY ;
85
+ // graph-wide optimization flags
86
+ var hasScatterGl , hasOnlyLargeSploms , hasSplom , hasSVG ;
85
87
86
88
function recomputeAxisLists ( ) {
87
89
xa0 = plotinfo . xaxis ;
@@ -117,6 +119,12 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
117
119
isSubplotConstrained = links . isSubplotConstrained ;
118
120
editX = ew || isSubplotConstrained ;
119
121
editY = ns || isSubplotConstrained ;
122
+
123
+ var fullLayout = gd . _fullLayout ;
124
+ hasScatterGl = fullLayout . _has ( 'scattergl' ) ;
125
+ hasOnlyLargeSploms = fullLayout . _hasOnlyLargeSploms ;
126
+ hasSplom = hasOnlyLargeSploms || fullLayout . _has ( 'splom' ) ;
127
+ hasSVG = fullLayout . _has ( 'svg' ) ;
120
128
}
121
129
122
130
recomputeAxisLists ( ) ;
@@ -696,14 +704,6 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
696
704
var fullLayout = gd . _fullLayout ;
697
705
var plotinfos = fullLayout . _plots ;
698
706
var subplots = fullLayout . _subplots . cartesian ;
699
-
700
- // TODO can we move these to outer scope?
701
- var hasScatterGl = fullLayout . _has ( 'scattergl' ) ;
702
- var hasOnlyLargeSploms = fullLayout . _hasOnlyLargeSploms ;
703
- var hasSplom = hasOnlyLargeSploms || fullLayout . _has ( 'splom' ) ;
704
- var hasSVG = fullLayout . _has ( 'svg' ) ;
705
- var hasDraggedPts = fullLayout . _has ( 'draggedPts' ) ;
706
-
707
707
var i , sp , xa , ya ;
708
708
709
709
if ( hasSplom || hasScatterGl ) {
0 commit comments