@@ -19,7 +19,7 @@ var Lib = require('../lib');
1919var Color = require ( '../components/color' ) ;
2020var BADNUM = require ( '../constants/numerical' ) . BADNUM ;
2121
22- var axisIDs = require ( '../plots /cartesian/axis_ids' ) ;
22+ var axisIDs = require ( './cartesian/axis_ids' ) ;
2323
2424var animationAttrs = require ( './animation_attributes' ) ;
2525var frameAttrs = require ( './frame_attributes' ) ;
@@ -476,6 +476,15 @@ plots.supplyDefaults = function(gd, opts) {
476476 // clean subplots and other artifacts from previous plot calls
477477 plots . cleanPlot ( newFullData , newFullLayout , oldFullData , oldFullLayout ) ;
478478
479+ // clear selection outline until we implement persistent selection,
480+ // don't clear them though when drag handlers (e.g. listening to
481+ // `plotly_selecting`) update the graph.
482+ // we should try to come up with a better solution when implementing
483+ // https://github.com/plotly/plotly.js/issues/1851
484+ if ( oldFullLayout . _zoomlayer && ! gd . _dragging ) {
485+ oldFullLayout . _zoomlayer . selectAll ( '.select-outline' ) . remove ( ) ;
486+ }
487+
479488 // relink functions and _ attributes to promote consistency between plots
480489 relinkPrivateKeys ( newFullLayout , oldFullLayout ) ;
481490
@@ -779,10 +788,6 @@ plots.cleanPlot = function(newFullData, newFullLayout, oldFullData, oldFullLayou
779788 oldFullLayout . _infolayer . select ( '.cb' + oldUid ) . remove ( ) ;
780789 }
781790 }
782-
783- if ( oldFullLayout . _zoomlayer ) {
784- oldFullLayout . _zoomlayer . selectAll ( '.select-outline' ) . remove ( ) ;
785- }
786791} ;
787792
788793plots . linkSubplots = function ( newFullData , newFullLayout , oldFullData , oldFullLayout ) {
0 commit comments