@@ -89,8 +89,8 @@ proto.plot = function(polarCalcData, fullLayout) {
89
89
90
90
_this . updateLayers ( fullLayout , polarLayout ) ;
91
91
_this . updateLayout ( fullLayout , polarLayout ) ;
92
- _this . updateFx ( fullLayout , polarLayout ) ;
93
92
Plots . generalUpdatePerTraceModule ( _this , polarCalcData , polarLayout ) ;
93
+ _this . updateFx ( fullLayout , polarLayout ) ;
94
94
} ;
95
95
96
96
proto . updateLayers = function ( fullLayout , polarLayout ) {
@@ -891,6 +891,11 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
891
891
return Math . atan2 ( cyy - y , x - cxx ) ;
892
892
}
893
893
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
+
894
899
// mouse px position at drag start (0), move (1)
895
900
var x0 , y0 ;
896
901
// angular axis angle rotation at drag start (0), move (1)
@@ -911,9 +916,19 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
911
916
strTranslate ( _this . xOffset2 , _this . yOffset2 ) + strRotate ( [ - da , cxx , cyy ] )
912
917
) ;
913
918
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
+ } ) ;
917
932
918
933
var angularAxis = _this . angularAxis ;
919
934
angularAxis . rotation = wrap180 ( rot1 ) ;
@@ -931,10 +946,7 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
931
946
if ( _this . _hasClipOnAxisFalse && ! isFullCircle ( sector ) ) {
932
947
// mutate sector to trick isPtWithinSector
933
948
_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 ) ;
938
950
}
939
951
940
952
for ( var k in _this . traceHash ) {
@@ -950,6 +962,7 @@ proto.updateAngularDrag = function(fullLayout, polarLayout) {
950
962
}
951
963
952
964
function doneFn ( ) {
965
+ scatterTextPoints . select ( 'text' ) . attr ( 'transform' , null ) ;
953
966
var updateObj = { } ;
954
967
updateObj [ _this . id + '.angularaxis.rotation' ] = rot1 ;
955
968
Plotly . relayout ( gd , updateObj ) ;
0 commit comments