@@ -267,8 +267,8 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
267
267
_id : 'x' ,
268
268
_pos : 0 ,
269
269
270
- // radialaxis uses 'top'/'bottom' -> convert to 'x' axis equivalent
271
- side : { left : 'top' , right : 'bottom' } [ radialLayout . side ] ,
270
+ // convert to 'x' axis equivalent
271
+ side : { counterclockwise : 'top' , clockwise : 'bottom' } [ radialLayout . side ] ,
272
272
273
273
// spans length 1 radius
274
274
domain : [ 0 , radius / gs . w ] ,
@@ -313,7 +313,7 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
313
313
Axes . doTicks ( gd , ax , true ) ;
314
314
315
315
updateElement ( layers [ 'radial-axis' ] , radialLayout . showticklabels || radialLayout . ticks , {
316
- transform : strTranslate ( cx , cy ) + strRotate ( - radialLayout . position )
316
+ transform : strTranslate ( cx , cy ) + strRotate ( - radialLayout . angle )
317
317
} ) ;
318
318
319
319
// move all grid paths to about circle center,
@@ -328,7 +328,7 @@ proto.updateRadialAxis = function(fullLayout, polarLayout) {
328
328
y1 : 0 ,
329
329
x2 : radius ,
330
330
y2 : 0 ,
331
- transform : strTranslate ( cx , cy ) + strRotate ( - radialLayout . position )
331
+ transform : strTranslate ( cx , cy ) + strRotate ( - radialLayout . angle )
332
332
} )
333
333
. attr ( 'stroke-width' , radialLayout . linewidth )
334
334
. call ( Color . stroke , radialLayout . linecolor ) ;
@@ -343,7 +343,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) {
343
343
var radialLayout = polarLayout . radialaxis ;
344
344
var titleClass = _this . id + 'title' ;
345
345
346
- var angle = _angle !== undefined ? _angle : radialLayout . position ;
346
+ var angle = _angle !== undefined ? _angle : radialLayout . angle ;
347
347
var angleRad = deg2rad ( angle ) ;
348
348
var cosa = Math . cos ( angleRad ) ;
349
349
var sina = Math . sin ( angleRad ) ;
@@ -352,7 +352,7 @@ proto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) {
352
352
if ( radialLayout . title ) {
353
353
var h = Drawing . bBox ( _this . layers [ 'radial-axis' ] . node ( ) ) . height ;
354
354
var ts = radialLayout . titlefont . size ;
355
- pad = radialLayout . side === 'left ' ?
355
+ pad = radialLayout . side === 'counterclockwise ' ?
356
356
- h - ts * 0.4 :
357
357
h + ts * 0.8 ;
358
358
}
@@ -381,8 +381,8 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
381
381
var sector = polarLayout . sector ;
382
382
var sectorInRad = sector . map ( deg2rad ) ;
383
383
384
- if ( ! ( 'angularaxis.position ' in _this . viewInitial ) ) {
385
- _this . viewInitial [ 'angularaxis.position ' ] = angularLayout . position ;
384
+ if ( ! ( 'angularaxis.rotation ' in _this . viewInitial ) ) {
385
+ _this . viewInitial [ 'angularaxis.rotation ' ] = angularLayout . rotation ;
386
386
}
387
387
388
388
var ax = _this . angularAxis = Lib . extendFlat ( { } , angularLayout , {
@@ -406,7 +406,7 @@ proto.updateAngularAxis = function(fullLayout, polarLayout) {
406
406
} ) ;
407
407
408
408
// Set the angular range in degrees to make auto-tick computation cleaner,
409
- // changing position /direction should not affect the angular tick labels.
409
+ // changing rotation /direction should not affect the angular tick labels.
410
410
if ( ax . type === 'linear' ) {
411
411
ax . autorange = false ;
412
412
@@ -572,8 +572,8 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
572
572
var path0 , dimmed , lum ;
573
573
// zoombox, corners elements
574
574
var zb , corners ;
575
- // angular axis angle offset at drag start (0), move (1)
576
- var angle0 , angle1 ;
575
+ // angular axis angle rotation at drag start (0), move (1)
576
+ var rot0 , rot1 ;
577
577
// copy of polar sector value at drag start
578
578
var sector0 ;
579
579
// angle about circle center at drag start
@@ -692,28 +692,27 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
692
692
693
693
function panPrep ( ) {
694
694
sector0 = fullLayout [ _this . id ] . sector . slice ( ) ;
695
- angle0 = fullLayout [ _this . id ] . angularaxis . position ;
695
+ rot0 = fullLayout [ _this . id ] . angularaxis . rotation ;
696
696
a0 = xy2a ( x0 , y0 ) ;
697
697
}
698
698
699
699
function panMove ( dx , dy ) {
700
700
var x1 = x0 + dx ;
701
701
var y1 = y0 + dy ;
702
702
var a1 = xy2a ( x1 , y1 ) ;
703
- var dangle = rad2deg ( a1 - a0 ) ;
704
-
705
- angle1 = angle0 + dangle ;
703
+ var da = rad2deg ( a1 - a0 ) ;
704
+ rot1 = rot0 + da ;
706
705
707
706
layers . frontplot . attr ( 'transform' ,
708
- strTranslate ( xOffset2 , yOffset2 ) + strRotate ( [ - dangle , cxx , cyy ] )
707
+ strTranslate ( xOffset2 , yOffset2 ) + strRotate ( [ - da , cxx , cyy ] )
709
708
) ;
710
709
711
710
_this . clipPaths . circle . select ( 'circle' ) . attr ( 'transform' ,
712
- strTranslate ( cxx , cyy ) + strRotate ( dangle )
711
+ strTranslate ( cxx , cyy ) + strRotate ( da )
713
712
) ;
714
713
715
714
var angularAxis = _this . angularAxis ;
716
- angularAxis . position = wrap180 ( angle1 ) ;
715
+ angularAxis . rotation = wrap180 ( rot1 ) ;
717
716
718
717
if ( angularAxis . type === 'linear' && ! isFullCircle ( sector ) ) {
719
718
angularAxis . range = sector0
@@ -727,7 +726,7 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
727
726
728
727
if ( _this . _hasClipOnAxisFalse && ! isFullCircle ( sector ) ) {
729
728
// mutate sector to trick isPtWithinSector
730
- _this . sector = [ sector0 [ 0 ] - dangle , sector0 [ 1 ] - dangle ] ;
729
+ _this . sector = [ sector0 [ 0 ] - da , sector0 [ 1 ] - da ] ;
731
730
732
731
layers . frontplot
733
732
. select ( '.scatterlayer' ) . selectAll ( '.trace' )
@@ -749,7 +748,7 @@ proto.updateMainDrag = function(fullLayout, polarLayout) {
749
748
function panDone ( dragged , numClicks ) {
750
749
if ( dragged ) {
751
750
var updateObj = { } ;
752
- updateObj [ _this . id + '.angularaxis.position ' ] = angle1 ;
751
+ updateObj [ _this . id + '.angularaxis.rotation ' ] = rot1 ;
753
752
Plotly . relayout ( gd , updateObj ) ;
754
753
} else if ( numClicks === 2 ) {
755
754
doubleClick ( ) ;
@@ -828,7 +827,7 @@ proto.updateRadialDrag = function(fullLayout, polarLayout) {
828
827
var cy = _this . cy ;
829
828
var radialAxis = _this . radialAxis ;
830
829
var radialLayout = polarLayout . radialaxis ;
831
- var angle0 = deg2rad ( radialLayout . position ) ;
830
+ var angle0 = deg2rad ( radialLayout . angle ) ;
832
831
var range0 = radialAxis . range . slice ( ) ;
833
832
var drange = range0 [ 1 ] - range0 [ 0 ] ;
834
833
@@ -866,7 +865,7 @@ proto.updateRadialDrag = function(fullLayout, polarLayout) {
866
865
867
866
function doneFn ( ) {
868
867
if ( angle1 !== null ) {
869
- Plotly . relayout ( gd , _this . id + '.radialaxis.position ' , angle1 ) ;
868
+ Plotly . relayout ( gd , _this . id + '.radialaxis.angle ' , angle1 ) ;
870
869
} else if ( rng1 !== null ) {
871
870
Plotly . relayout ( gd , _this . id + '.radialaxis.range[1]' , rng1 ) ;
872
871
}
@@ -988,7 +987,9 @@ function setScale(ax, axLayout, fullLayout) {
988
987
}
989
988
990
989
function strTickLayout ( axLayout ) {
991
- return axLayout . ticks + String ( axLayout . ticklen ) + String ( axLayout . showticklabels ) ;
990
+ var out = axLayout . ticks + String ( axLayout . ticklen ) + String ( axLayout . showticklabels ) ;
991
+ if ( 'side' in axLayout ) out += axLayout . side ;
992
+ return out ;
992
993
}
993
994
994
995
// Finds the bounding box of a given circle sector,
0 commit comments