@@ -89,8 +89,8 @@ proto.plot = function(polarCalcData, fullLayout) {
8989
9090 _this . updateLayers ( fullLayout , polarLayout ) ;
9191 _this . updateLayout ( fullLayout , polarLayout ) ;
92- _this . updateFx ( fullLayout , polarLayout ) ;
9392 Plots . generalUpdatePerTraceModule ( _this , polarCalcData , polarLayout ) ;
93+ _this . updateFx ( fullLayout , polarLayout ) ;
9494} ;
9595
9696proto . updateLayers = function ( fullLayout , polarLayout ) {
@@ -891,6 +891,11 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
891891 return Math . atan2 ( cyy - y , x - cxx ) ;
892892 }
893893
894+ // scatter trace, points and textpoints selections
895+ var scatterTraces = layers . frontplot . select ( '.scatterlayer' ) . selectAll ( '.trace' ) ;
896+ var scatterPoints = scatterTraces . selectAll ( '.point' ) ;
897+ var scatterTextPoints = scatterTraces . selectAll ( '.textpoint' ) ;
898+
894899 // mouse px position at drag start (0), move (1)
895900 var x0 , y0 ;
896901 // angular axis angle rotation at drag start (0), move (1)
@@ -911,9 +916,19 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
911916 strTranslate ( _this . xOffset2 , _this . yOffset2 ) + strRotate ( [ - da , cxx , cyy ] )
912917 ) ;
913918
914- _this . clipPaths . circle . select ( 'path' ) . attr ( 'transform' ,
915- strTranslate ( cxx , cyy ) + strRotate ( da )
916- ) ;
919+ // 'un-rotate' marker and text points
920+ scatterPoints . each ( function ( ) {
921+ var sel = d3 . select ( this ) ;
922+ var xy = Drawing . getTranslate ( sel ) ;
923+ sel . attr ( 'transform' , strTranslate ( xy . x , xy . y ) + strRotate ( [ da ] ) ) ;
924+ } ) ;
925+ scatterTextPoints . each ( function ( ) {
926+ var sel = d3 . select ( this ) ;
927+ var tx = sel . select ( 'text' ) ;
928+ var xy = Drawing . getTranslate ( sel ) ;
929+ // N.B rotate -> translate ordering matters
930+ sel . attr ( 'transform' , strRotate ( [ da , tx . attr ( 'x' ) , tx . attr ( 'y' ) ] ) + strTranslate ( xy . x , xy . y ) ) ;
931+ } ) ;
917932
918933 var angularAxis = _this . angularAxis ;
919934 angularAxis . rotation = wrap180 ( rot1 ) ;
@@ -931,10 +946,7 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
931946 if ( _this . _hasClipOnAxisFalse && ! isFullCircle ( sector ) ) {
932947 // mutate sector to trick isPtWithinSector
933948 _this . sector = [ sector0 [ 0 ] - da , sector0 [ 1 ] - da ] ;
934-
935- layers . frontplot
936- . select ( '.scatterlayer' ) . selectAll ( '.trace' )
937- . call ( Drawing . hideOutsideRangePoints , _this ) ;
949+ scatterTraces . call ( Drawing . hideOutsideRangePoints , _this ) ;
938950 }
939951
940952 for ( var k in _this . traceHash ) {
@@ -950,6 +962,7 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
950962 }
951963
952964 function doneFn ( ) {
965+ scatterTextPoints . select ( 'text' ) . attr ( 'transform' , null ) ;
953966 var updateObj = { } ;
954967 updateObj [ _this . id + '.angularaxis.rotation' ] = rot1 ;
955968 Plotly . relayout ( gd , updateObj ) ;
0 commit comments