@@ -30,7 +30,6 @@ var FROM_BR = alignmentConstants.FROM_BR;
3030var getLegendData = require ( './get_legend_data' ) ;
3131var style = require ( './style' ) ;
3232var helpers = require ( './helpers' ) ;
33- var anchorUtils = require ( './anchor_utils' ) ;
3433
3534var DBLCLICKDELAY = interactConstants . DBLCLICKDELAY ;
3635
@@ -154,17 +153,17 @@ module.exports = function draw(gd) {
154153 lx = gs . l + gs . w * opts . x ,
155154 ly = gs . t + gs . h * ( 1 - opts . y ) ;
156155
157- if ( anchorUtils . isRightAnchor ( opts ) ) {
156+ if ( Lib . isRightAnchor ( opts ) ) {
158157 lx -= opts . _width ;
159158 }
160- else if ( anchorUtils . isCenterAnchor ( opts ) ) {
159+ else if ( Lib . isCenterAnchor ( opts ) ) {
161160 lx -= opts . _width / 2 ;
162161 }
163162
164- if ( anchorUtils . isBottomAnchor ( opts ) ) {
163+ if ( Lib . isBottomAnchor ( opts ) ) {
165164 ly -= opts . _height ;
166165 }
167- else if ( anchorUtils . isMiddleAnchor ( opts ) ) {
166+ else if ( Lib . isMiddleAnchor ( opts ) ) {
168167 ly -= opts . _height / 2 ;
169168 }
170169
@@ -699,18 +698,18 @@ function expandMargin(gd) {
699698 opts = fullLayout . legend ;
700699
701700 var xanchor = 'left' ;
702- if ( anchorUtils . isRightAnchor ( opts ) ) {
701+ if ( Lib . isRightAnchor ( opts ) ) {
703702 xanchor = 'right' ;
704703 }
705- else if ( anchorUtils . isCenterAnchor ( opts ) ) {
704+ else if ( Lib . isCenterAnchor ( opts ) ) {
706705 xanchor = 'center' ;
707706 }
708707
709708 var yanchor = 'top' ;
710- if ( anchorUtils . isBottomAnchor ( opts ) ) {
709+ if ( Lib . isBottomAnchor ( opts ) ) {
711710 yanchor = 'bottom' ;
712711 }
713- else if ( anchorUtils . isMiddleAnchor ( opts ) ) {
712+ else if ( Lib . isMiddleAnchor ( opts ) ) {
714713 yanchor = 'middle' ;
715714 }
716715
@@ -730,10 +729,10 @@ function expandHorizontalMargin(gd) {
730729 opts = fullLayout . legend ;
731730
732731 var xanchor = 'left' ;
733- if ( anchorUtils . isRightAnchor ( opts ) ) {
732+ if ( Lib . isRightAnchor ( opts ) ) {
734733 xanchor = 'right' ;
735734 }
736- else if ( anchorUtils . isCenterAnchor ( opts ) ) {
735+ else if ( Lib . isCenterAnchor ( opts ) ) {
737736 xanchor = 'center' ;
738737 }
739738
0 commit comments