@@ -1828,6 +1828,7 @@ axes.doTicks = function(gd, axid, skipTitle) {
1828
1828
if ( ! ax . showticklabels || ! isNumeric ( position ) ) {
1829
1829
tickLabels . remove ( ) ;
1830
1830
drawAxTitle ( ) ;
1831
+ calcBoundingBox ( ) ;
1831
1832
return ;
1832
1833
}
1833
1834
@@ -1993,23 +1994,43 @@ axes.doTicks = function(gd, axid, skipTitle) {
1993
1994
}
1994
1995
1995
1996
function calcBoundingBox ( ) {
1996
- var bBox = container . node ( ) . getBoundingClientRect ( ) ;
1997
- var gdBB = gd . getBoundingClientRect ( ) ;
1998
-
1999
- /*
2000
- * the way we're going to use this, the positioning that matters
2001
- * is relative to the origin of gd. This is important particularly
2002
- * if gd is scrollable, and may have been scrolled between the time
2003
- * we calculate this and the time we use it
2004
- */
2005
- ax . _boundingBox = {
2006
- width : bBox . width ,
2007
- height : bBox . height ,
2008
- left : bBox . left - gdBB . left ,
2009
- right : bBox . right - gdBB . left ,
2010
- top : bBox . top - gdBB . top ,
2011
- bottom : bBox . bottom - gdBB . top
2012
- } ;
1997
+ if ( ax . showticklabels ) {
1998
+ var gdBB = gd . getBoundingClientRect ( ) ;
1999
+ var bBox = container . node ( ) . getBoundingClientRect ( ) ;
2000
+
2001
+ /*
2002
+ * the way we're going to use this, the positioning that matters
2003
+ * is relative to the origin of gd. This is important particularly
2004
+ * if gd is scrollable, and may have been scrolled between the time
2005
+ * we calculate this and the time we use it
2006
+ */
2007
+
2008
+ ax . _boundingBox = {
2009
+ width : bBox . width ,
2010
+ height : bBox . height ,
2011
+ left : bBox . left - gdBB . left ,
2012
+ right : bBox . right - gdBB . left ,
2013
+ top : bBox . top ,
2014
+ bottom : bBox . bottom
2015
+ } ;
2016
+ } else {
2017
+ var gs = fullLayout . _size ;
2018
+ var pos ;
2019
+
2020
+ // set dummy bbox for ticklabel-less axes
2021
+
2022
+ if ( axLetter === 'x' ) {
2023
+ pos = ax . anchor === 'free' ?
2024
+ gs . t + gs . h * ( 1 - ax . position ) :
2025
+ gs . t + gs . h * ( 1 - ax . _anchorAxis . domain [ { bottom : 0 , top : 1 } [ ax . side ] ] ) ;
2026
+ ax . _boundingBox = { top : pos , bottom : pos } ;
2027
+ } else {
2028
+ pos = ax . anchor === 'free' ?
2029
+ gs . l + gs . w * ax . position :
2030
+ gs . l + gs . w * ax . _anchorAxis . domain [ { left : 0 , right : 1 } [ ax . side ] ] ;
2031
+ ax . _boundingBox = { left : pos , right : pos } ;
2032
+ }
2033
+ }
2013
2034
2014
2035
/*
2015
2036
* for spikelines: what's the full domain of positions in the
0 commit comments