@@ -14,7 +14,6 @@ var d3 = require('d3');
1414var isNumeric = require ( 'fast-isnumeric' ) ;
1515var hasHover = require ( 'has-hover' ) ;
1616
17- var Plotly = require ( '../plotly' ) ;
1817var Lib = require ( '../lib' ) ;
1918var Events = require ( '../lib/events' ) ;
2019var Queue = require ( '../lib/queue' ) ;
@@ -25,6 +24,7 @@ var Plots = require('../plots/plots');
2524var Polar = require ( '../plots/polar/legacy' ) ;
2625var initInteractions = require ( '../plots/cartesian/graph_interact' ) ;
2726
27+ var Axes = require ( '../plots/cartesian/axes' ) ;
2828var Drawing = require ( '../components/drawing' ) ;
2929var Color = require ( '../components/color' ) ;
3030var xmlnsNamespaces = require ( '../constants/xmlns_namespaces' ) ;
@@ -176,7 +176,7 @@ exports.plot = function(gd, data, layout, config) {
176176 Drawing . initGradients ( gd ) ;
177177
178178 // save initial show spikes once per graph
179- if ( graphWasEmpty ) Plotly . Axes . saveShowSpikeInitial ( gd ) ;
179+ if ( graphWasEmpty ) Axes . saveShowSpikeInitial ( gd ) ;
180180
181181 // prepare the data and find the autorange
182182
@@ -327,24 +327,24 @@ exports.plot = function(gd, data, layout, config) {
327327 function doAutoRangeAndConstraints ( ) {
328328 if ( gd . _transitioning ) return ;
329329
330- var axList = Plotly . Axes . list ( gd , '' , true ) ;
330+ var axList = Axes . list ( gd , '' , true ) ;
331331 for ( var i = 0 ; i < axList . length ; i ++ ) {
332332 var ax = axList [ i ] ;
333333 cleanAxisConstraints ( gd , ax ) ;
334334
335- Plotly . Axes . doAutoRange ( ax ) ;
335+ Axes . doAutoRange ( ax ) ;
336336 }
337337
338338 enforceAxisConstraints ( gd ) ;
339339
340340 // store initial ranges *after* enforcing constraints, otherwise
341341 // we will never look like we're at the initial ranges
342- if ( graphWasEmpty ) Plotly . Axes . saveRangeInitial ( gd ) ;
342+ if ( graphWasEmpty ) Axes . saveRangeInitial ( gd ) ;
343343 }
344344
345345 // draw ticks, titles, and calculate axis scaling (._b, ._m)
346346 function drawAxes ( ) {
347- return Plotly . Axes . doTicks ( gd , 'redraw' ) ;
347+ return Axes . doTicks ( gd , 'redraw' ) ;
348348 }
349349
350350 // Now plot the data
@@ -1440,7 +1440,7 @@ function _restyle(gd, aobj, traces) {
14401440
14411441 // for autoranging multiple axes
14421442 function addToAxlist ( axid ) {
1443- var axName = Plotly . Axes . id2name ( axid ) ;
1443+ var axName = Axes . id2name ( axid ) ;
14441444 if ( axlist . indexOf ( axName ) === - 1 ) axlist . push ( axName ) ;
14451445 }
14461446
@@ -1639,7 +1639,7 @@ function _restyle(gd, aobj, traces) {
16391639
16401640 // swap the data attributes of the relevant x and y axes?
16411641 if ( [ 'swapxyaxes' , 'orientationaxes' ] . indexOf ( ai ) !== - 1 ) {
1642- Plotly . Axes . swap ( gd , traces ) ;
1642+ Axes . swap ( gd , traces ) ;
16431643 }
16441644
16451645 // swap hovermode if set to "compare x/y data"
@@ -1676,7 +1676,7 @@ function _restyle(gd, aobj, traces) {
16761676
16771677 // do we need to force a recalc?
16781678 var autorangeOn = false ;
1679- var axList = Plotly . Axes . list ( gd ) ;
1679+ var axList = Axes . list ( gd ) ;
16801680 for ( i = 0 ; i < axList . length ; i ++ ) {
16811681 if ( axList [ i ] . autorange ) {
16821682 autorangeOn = true ;
@@ -1721,7 +1721,7 @@ function _restyle(gd, aobj, traces) {
17211721 * attribute object `{astr1: val1, astr2: val2 ...}`
17221722 * allows setting multiple attributes simultaneously
17231723 */
1724- Plotly . relayout = function relayout ( gd , astr , val ) {
1724+ exports . relayout = function relayout ( gd , astr , val ) {
17251725 gd = Lib . getGraphDiv ( gd ) ;
17261726 helpers . clearPromiseQueue ( gd ) ;
17271727
@@ -1787,7 +1787,7 @@ function _relayout(gd, aobj) {
17871787 var layout = gd . layout ,
17881788 fullLayout = gd . _fullLayout ,
17891789 keys = Object . keys ( aobj ) ,
1790- axes = Plotly . Axes . list ( gd ) ,
1790+ axes = Axes . list ( gd ) ,
17911791 arrayEdits = { } ,
17921792 arrayStr ,
17931793 i ,
@@ -2131,7 +2131,7 @@ function _relayout(gd, aobj) {
21312131function refAutorange ( gd , obj , axLetter ) {
21322132 if ( ! Lib . isPlainObject ( obj ) ) return false ;
21332133 var axRef = obj [ axLetter + 'ref' ] || axLetter ,
2134- ax = Plotly . Axes . getFromId ( gd , axRef ) ;
2134+ ax = Axes . getFromId ( gd , axRef ) ;
21352135
21362136 if ( ! ax && axRef . charAt ( 0 ) === axLetter ) {
21372137 // fall back on the primary axis in case we've referenced a
@@ -2141,7 +2141,7 @@ function refAutorange(gd, obj, axLetter) {
21412141 // The only thing this is used for is to determine whether to
21422142 // do a full `recalc`, so the only ill effect of this error is
21432143 // to waste some time.
2144- ax = Plotly . Axes . getFromId ( gd , axLetter ) ;
2144+ ax = Axes . getFromId ( gd , axLetter ) ;
21452145 }
21462146 return ( ax || { } ) . autorange ;
21472147}
@@ -2403,8 +2403,8 @@ function diffData(gd, oldFullData, newFullData, immutable) {
24032403 for ( i = 0 ; i < oldFullData . length ; i ++ ) {
24042404 trace = newFullData [ i ] ;
24052405 diffOpts . autoranged = trace . xaxis ? (
2406- Plotly . Axes . getFromId ( gd , trace . xaxis ) . autorange ||
2407- Plotly . Axes . getFromId ( gd , trace . yaxis ) . autorange
2406+ Axes . getFromId ( gd , trace . xaxis ) . autorange ||
2407+ Axes . getFromId ( gd , trace . yaxis ) . autorange
24082408 ) : false ;
24092409 getDiffFlags ( oldFullData [ i ] , trace , [ ] , diffOpts ) ;
24102410 }
0 commit comments