File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ var connectColorbar = require('../components/colorbar/connect');
32
32
var initInteractions = require ( '../plots/cartesian/graph_interact' ) . initInteractions ;
33
33
var xmlnsNamespaces = require ( '../constants/xmlns_namespaces' ) ;
34
34
var svgTextUtils = require ( '../lib/svg_text_utils' ) ;
35
+ var clearSelect = require ( '../plots/cartesian/select' ) . clearSelect ;
35
36
36
37
var dfltConfig = require ( './plot_config' ) . dfltConfig ;
37
38
var manageArrays = require ( './manage_arrays' ) ;
@@ -2001,7 +2002,13 @@ function addAxRangeSequence(seq, rangesAltered) {
2001
2002
return Axes . draw ( gd , 'redraw' ) ;
2002
2003
} ;
2003
2004
2005
+ var _clearSelect = function ( gd ) {
2006
+ var zoomlayer = gd . _fullLayout . _zoomlayer ;
2007
+ if ( zoomlayer ) clearSelect ( zoomlayer ) ;
2008
+ } ;
2009
+
2004
2010
seq . push (
2011
+ _clearSelect ,
2005
2012
subroutines . doAutoRangeAndConstraints ,
2006
2013
drawAxes ,
2007
2014
subroutines . drawData ,
Original file line number Diff line number Diff line change @@ -1226,6 +1226,28 @@ describe('Test select box and lasso in general:', function() {
1226
1226
. then ( done ) ;
1227
1227
} ) ;
1228
1228
1229
+ it ( '@flaky should have their selection outlines cleared during *axrange* relayout calls' , function ( done ) {
1230
+ var gd = createGraphDiv ( ) ;
1231
+ var fig = Lib . extendDeep ( { } , mock ) ;
1232
+ fig . layout . dragmode = 'select' ;
1233
+
1234
+ function _drag ( ) {
1235
+ resetEvents ( gd ) ;
1236
+ drag ( selectPath ) ;
1237
+ return selectedPromise ;
1238
+ }
1239
+
1240
+ Plotly . plot ( gd , fig )
1241
+ . then ( _drag )
1242
+ . then ( function ( ) { assertSelectionNodes ( 0 , 2 , 'after drag 1' ) ; } )
1243
+ . then ( function ( ) { return Plotly . relayout ( gd , 'xaxis.range' , [ - 5 , 5 ] ) ; } )
1244
+ . then ( function ( ) { assertSelectionNodes ( 0 , 0 , 'after axrange relayout' ) ; } )
1245
+ . then ( _drag )
1246
+ . then ( function ( ) { assertSelectionNodes ( 0 , 2 , 'after drag 2' ) ; } )
1247
+ . catch ( failTest )
1248
+ . then ( done ) ;
1249
+ } ) ;
1250
+
1229
1251
it ( '@flaky should select the right data with the corresponding select direction' , function ( done ) {
1230
1252
1231
1253
var gd = createGraphDiv ( ) ;
You can’t perform that action at this time.
0 commit comments