@@ -16,13 +16,14 @@ var supportsPassive = require('has-passive-events');
16
16
var Registry = require ( '../../registry' ) ;
17
17
var Lib = require ( '../../lib' ) ;
18
18
var svgTextUtils = require ( '../../lib/svg_text_utils' ) ;
19
- var clearGlCanvases = require ( '../../lib/clear_gl_canvases' ) ;
20
19
var Color = require ( '../../components/color' ) ;
21
20
var Drawing = require ( '../../components/drawing' ) ;
22
21
var Fx = require ( '../../components/fx' ) ;
23
22
var setCursor = require ( '../../lib/setcursor' ) ;
24
23
var dragElement = require ( '../../components/dragelement' ) ;
25
24
var FROM_TL = require ( '../../constants/alignment' ) . FROM_TL ;
25
+ var clearGlCanvases = require ( '../../lib/clear_gl_canvases' ) ;
26
+ var redrawReglTraces = require ( '../../plot_api/subroutines' ) . redrawReglTraces ;
26
27
27
28
var Plots = require ( '../plots' ) ;
28
29
@@ -84,7 +85,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
84
85
// do we need to edit x/y ranges?
85
86
var editX , editY ;
86
87
// graph-wide optimization flags
87
- var hasScatterGl , hasOnlyLargeSploms , hasSplom , hasSVG ;
88
+ var hasScatterGl , hasSplom , hasSVG ;
88
89
// collected changes to be made to the plot by relayout at the end
89
90
var updates ;
90
91
@@ -125,8 +126,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
125
126
126
127
var fullLayout = gd . _fullLayout ;
127
128
hasScatterGl = fullLayout . _has ( 'scattergl' ) ;
128
- hasOnlyLargeSploms = fullLayout . _hasOnlyLargeSploms ;
129
- hasSplom = hasOnlyLargeSploms || fullLayout . _has ( 'splom' ) ;
129
+ hasSplom = fullLayout . _has ( 'splom' ) ;
130
130
hasSVG = fullLayout . _has ( 'svg' ) ;
131
131
}
132
132
@@ -744,33 +744,29 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
744
744
var subplots = fullLayout . _subplots . cartesian ;
745
745
var i , sp , xa , ya ;
746
746
747
- if ( hasSplom || hasScatterGl ) {
748
- clearGlCanvases ( gd ) ;
749
- }
750
-
751
747
if ( hasSplom ) {
752
748
Registry . subplotsRegistry . splom . drag ( gd ) ;
753
- if ( hasOnlyLargeSploms ) return ;
754
749
}
755
750
756
751
if ( hasScatterGl ) {
757
- // loop over all subplots (w/o exceptions) here,
758
- // as we cleared the gl canvases above
759
752
for ( i = 0 ; i < subplots . length ; i ++ ) {
760
753
sp = plotinfos [ subplots [ i ] ] ;
761
754
xa = sp . xaxis ;
762
755
ya = sp . yaxis ;
763
756
764
- var scene = sp . _scene ;
765
- if ( scene ) {
766
- // FIXME: possibly we could update axis internal _r and _rl here
757
+ if ( sp . _scene ) {
767
758
var xrng = Lib . simpleMap ( xa . range , xa . r2l ) ;
768
759
var yrng = Lib . simpleMap ( ya . range , ya . r2l ) ;
769
- scene . update ( { range : [ xrng [ 0 ] , yrng [ 0 ] , xrng [ 1 ] , yrng [ 1 ] ] } ) ;
760
+ sp . _scene . update ( { range : [ xrng [ 0 ] , yrng [ 0 ] , xrng [ 1 ] , yrng [ 1 ] ] } ) ;
770
761
}
771
762
}
772
763
}
773
764
765
+ if ( hasSplom || hasScatterGl ) {
766
+ clearGlCanvases ( gd ) ;
767
+ redrawReglTraces ( gd ) ;
768
+ }
769
+
774
770
if ( hasSVG ) {
775
771
var xScaleFactor = viewBox [ 2 ] / xa0 . _length ;
776
772
var yScaleFactor = viewBox [ 3 ] / ya0 . _length ;
0 commit comments