File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,7 @@ proto.updateMainDrag = function(fullLayout) {
629
629
var cyy = _this . cyy ;
630
630
var sectorInRad = _this . sectorInRad ;
631
631
var vangles = _this . vangles ;
632
+ var radialAxis = _this . radialAxis ;
632
633
var clampTiny = helpers . clampTiny ;
633
634
var findXYatLength = helpers . findXYatLength ;
634
635
var findEnclosingVertexAngles = helpers . findEnclosingVertexAngles ;
@@ -840,16 +841,13 @@ proto.updateMainDrag = function(fullLayout) {
840
841
841
842
dragBox . showDoubleClickNotifier ( gd ) ;
842
843
843
- var radialAxis = _this . radialAxis ;
844
844
var rl = radialAxis . _rl ;
845
- var drl = rl [ 1 ] - rl [ 0 ] ;
846
- var updateObj = { } ;
847
- updateObj [ _this . id + '.radialaxis.range' ] = [
848
- rl [ 0 ] + r0 * drl / radius ,
849
- rl [ 0 ] + r1 * drl / radius
845
+ var m = ( rl [ 1 ] - rl [ 0 ] ) / ( 1 - innerRadius / radius ) / radius ;
846
+ var newRng = [
847
+ rl [ 0 ] + ( r0 - innerRadius ) * m ,
848
+ rl [ 0 ] + ( r1 - innerRadius ) * m
850
849
] ;
851
-
852
- Registry . call ( 'relayout' , gd , updateObj ) ;
850
+ Registry . call ( 'relayout' , gd , _this . id + '.radialaxis.range' , newRng ) ;
853
851
}
854
852
855
853
dragOpts . prepFn = function ( evt , startX , startY ) {
Original file line number Diff line number Diff line change @@ -924,6 +924,13 @@ describe('Test polar interactions:', function() {
924
924
expect ( eventCnts . plotly_relayout )
925
925
. toBe ( relayoutNumber , 'no new relayout events after *not far enough* cases' ) ;
926
926
} )
927
+ . then ( _reset )
928
+ . then ( function ( ) { return Plotly . relayout ( gd , 'polar.hole' , 0.2 ) ; } )
929
+ . then ( function ( ) { relayoutNumber ++ ; } )
930
+ . then ( function ( ) { return _drag ( [ mid [ 0 ] + 30 , mid [ 0 ] - 30 ] , [ 50 , - 50 ] ) ; } )
931
+ . then ( function ( ) {
932
+ _assertDrag ( [ 1.15 , 7.70 ] , 'with polar.hole>0, from quadrant #1 move top-right' ) ;
933
+ } )
927
934
. catch ( failTest )
928
935
. then ( done ) ;
929
936
} ) ;
You can’t perform that action at this time.
0 commit comments