@@ -14,7 +14,6 @@ var d3 = require('d3');
14
14
var isNumeric = require ( 'fast-isnumeric' ) ;
15
15
var hasHover = require ( 'has-hover' ) ;
16
16
17
- var Plotly = require ( '../plotly' ) ;
18
17
var Lib = require ( '../lib' ) ;
19
18
var Events = require ( '../lib/events' ) ;
20
19
var Queue = require ( '../lib/queue' ) ;
@@ -25,6 +24,7 @@ var Plots = require('../plots/plots');
25
24
var Polar = require ( '../plots/polar/legacy' ) ;
26
25
var initInteractions = require ( '../plots/cartesian/graph_interact' ) ;
27
26
27
+ var Axes = require ( '../plots/cartesian/axes' ) ;
28
28
var Drawing = require ( '../components/drawing' ) ;
29
29
var Color = require ( '../components/color' ) ;
30
30
var xmlnsNamespaces = require ( '../constants/xmlns_namespaces' ) ;
@@ -176,7 +176,7 @@ exports.plot = function(gd, data, layout, config) {
176
176
Drawing . initGradients ( gd ) ;
177
177
178
178
// save initial show spikes once per graph
179
- if ( graphWasEmpty ) Plotly . Axes . saveShowSpikeInitial ( gd ) ;
179
+ if ( graphWasEmpty ) Axes . saveShowSpikeInitial ( gd ) ;
180
180
181
181
// prepare the data and find the autorange
182
182
@@ -327,24 +327,24 @@ exports.plot = function(gd, data, layout, config) {
327
327
function doAutoRangeAndConstraints ( ) {
328
328
if ( gd . _transitioning ) return ;
329
329
330
- var axList = Plotly . Axes . list ( gd , '' , true ) ;
330
+ var axList = Axes . list ( gd , '' , true ) ;
331
331
for ( var i = 0 ; i < axList . length ; i ++ ) {
332
332
var ax = axList [ i ] ;
333
333
cleanAxisConstraints ( gd , ax ) ;
334
334
335
- Plotly . Axes . doAutoRange ( ax ) ;
335
+ Axes . doAutoRange ( ax ) ;
336
336
}
337
337
338
338
enforceAxisConstraints ( gd ) ;
339
339
340
340
// store initial ranges *after* enforcing constraints, otherwise
341
341
// we will never look like we're at the initial ranges
342
- if ( graphWasEmpty ) Plotly . Axes . saveRangeInitial ( gd ) ;
342
+ if ( graphWasEmpty ) Axes . saveRangeInitial ( gd ) ;
343
343
}
344
344
345
345
// draw ticks, titles, and calculate axis scaling (._b, ._m)
346
346
function drawAxes ( ) {
347
- return Plotly . Axes . doTicks ( gd , 'redraw' ) ;
347
+ return Axes . doTicks ( gd , 'redraw' ) ;
348
348
}
349
349
350
350
// Now plot the data
@@ -1440,7 +1440,7 @@ function _restyle(gd, aobj, traces) {
1440
1440
1441
1441
// for autoranging multiple axes
1442
1442
function addToAxlist ( axid ) {
1443
- var axName = Plotly . Axes . id2name ( axid ) ;
1443
+ var axName = Axes . id2name ( axid ) ;
1444
1444
if ( axlist . indexOf ( axName ) === - 1 ) axlist . push ( axName ) ;
1445
1445
}
1446
1446
@@ -1639,7 +1639,7 @@ function _restyle(gd, aobj, traces) {
1639
1639
1640
1640
// swap the data attributes of the relevant x and y axes?
1641
1641
if ( [ 'swapxyaxes' , 'orientationaxes' ] . indexOf ( ai ) !== - 1 ) {
1642
- Plotly . Axes . swap ( gd , traces ) ;
1642
+ Axes . swap ( gd , traces ) ;
1643
1643
}
1644
1644
1645
1645
// swap hovermode if set to "compare x/y data"
@@ -1676,7 +1676,7 @@ function _restyle(gd, aobj, traces) {
1676
1676
1677
1677
// do we need to force a recalc?
1678
1678
var autorangeOn = false ;
1679
- var axList = Plotly . Axes . list ( gd ) ;
1679
+ var axList = Axes . list ( gd ) ;
1680
1680
for ( i = 0 ; i < axList . length ; i ++ ) {
1681
1681
if ( axList [ i ] . autorange ) {
1682
1682
autorangeOn = true ;
@@ -1721,7 +1721,7 @@ function _restyle(gd, aobj, traces) {
1721
1721
* attribute object `{astr1: val1, astr2: val2 ...}`
1722
1722
* allows setting multiple attributes simultaneously
1723
1723
*/
1724
- Plotly . relayout = function relayout ( gd , astr , val ) {
1724
+ exports . relayout = function relayout ( gd , astr , val ) {
1725
1725
gd = Lib . getGraphDiv ( gd ) ;
1726
1726
helpers . clearPromiseQueue ( gd ) ;
1727
1727
@@ -1787,7 +1787,7 @@ function _relayout(gd, aobj) {
1787
1787
var layout = gd . layout ,
1788
1788
fullLayout = gd . _fullLayout ,
1789
1789
keys = Object . keys ( aobj ) ,
1790
- axes = Plotly . Axes . list ( gd ) ,
1790
+ axes = Axes . list ( gd ) ,
1791
1791
arrayEdits = { } ,
1792
1792
arrayStr ,
1793
1793
i ,
@@ -2131,7 +2131,7 @@ function _relayout(gd, aobj) {
2131
2131
function refAutorange ( gd , obj , axLetter ) {
2132
2132
if ( ! Lib . isPlainObject ( obj ) ) return false ;
2133
2133
var axRef = obj [ axLetter + 'ref' ] || axLetter ,
2134
- ax = Plotly . Axes . getFromId ( gd , axRef ) ;
2134
+ ax = Axes . getFromId ( gd , axRef ) ;
2135
2135
2136
2136
if ( ! ax && axRef . charAt ( 0 ) === axLetter ) {
2137
2137
// fall back on the primary axis in case we've referenced a
@@ -2141,7 +2141,7 @@ function refAutorange(gd, obj, axLetter) {
2141
2141
// The only thing this is used for is to determine whether to
2142
2142
// do a full `recalc`, so the only ill effect of this error is
2143
2143
// to waste some time.
2144
- ax = Plotly . Axes . getFromId ( gd , axLetter ) ;
2144
+ ax = Axes . getFromId ( gd , axLetter ) ;
2145
2145
}
2146
2146
return ( ax || { } ) . autorange ;
2147
2147
}
@@ -2403,8 +2403,8 @@ function diffData(gd, oldFullData, newFullData, immutable) {
2403
2403
for ( i = 0 ; i < oldFullData . length ; i ++ ) {
2404
2404
trace = newFullData [ i ] ;
2405
2405
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
2408
2408
) : false ;
2409
2409
getDiffFlags ( oldFullData [ i ] , trace , [ ] , diffOpts ) ;
2410
2410
}
0 commit comments