@@ -14,7 +14,7 @@ var Lib = require('../../lib');
14
14
var constants = require ( './constants' ) ;
15
15
16
16
17
- // convert between axis names (xaxis, xaxis2, etc, elements of td .layout)
17
+ // convert between axis names (xaxis, xaxis2, etc, elements of gd .layout)
18
18
// and axis id's (x, x2, etc). Would probably have ditched 'xaxis'
19
19
// completely in favor of just 'x' if it weren't ingrained in the API etc.
20
20
exports . id2name = function id2name ( id ) {
@@ -43,8 +43,8 @@ exports.cleanId = function cleanId(id, axLetter) {
43
43
// get all axis object names
44
44
// optionally restricted to only x or y or z by string axLetter
45
45
// and optionally 2D axes only, not those inside 3D scenes
46
- function listNames ( td , axLetter , only2d ) {
47
- var fullLayout = td . _fullLayout ;
46
+ function listNames ( gd , axLetter , only2d ) {
47
+ var fullLayout = gd . _fullLayout ;
48
48
if ( ! fullLayout ) return [ ] ;
49
49
50
50
function filterAxis ( obj , extra ) {
@@ -76,23 +76,23 @@ function listNames(td, axLetter, only2d) {
76
76
}
77
77
78
78
// get all axis objects, as restricted in listNames
79
- exports . list = function ( td , axletter , only2d ) {
80
- return listNames ( td , axletter , only2d )
79
+ exports . list = function ( gd , axletter , only2d ) {
80
+ return listNames ( gd , axletter , only2d )
81
81
. map ( function ( axName ) {
82
- return Lib . nestedProperty ( td . _fullLayout , axName ) . get ( ) ;
82
+ return Lib . nestedProperty ( gd . _fullLayout , axName ) . get ( ) ;
83
83
} ) ;
84
84
} ;
85
85
86
86
// get all axis ids, optionally restricted by letter
87
87
// this only makes sense for 2d axes
88
- exports . listIds = function ( td , axletter ) {
89
- return listNames ( td , axletter , true ) . map ( exports . name2id ) ;
88
+ exports . listIds = function ( gd , axletter ) {
89
+ return listNames ( gd , axletter , true ) . map ( exports . name2id ) ;
90
90
} ;
91
91
92
92
// get an axis object from its id 'x','x2' etc
93
93
// optionally, id can be a subplot (ie 'x2y3') and type gets x or y from it
94
- exports . getFromId = function ( td , id , type ) {
95
- var fullLayout = td . _fullLayout ;
94
+ exports . getFromId = function ( gd , id , type ) {
95
+ var fullLayout = gd . _fullLayout ;
96
96
97
97
if ( type === 'x' ) id = id . replace ( / y [ 0 - 9 ] * / , '' ) ;
98
98
else if ( type === 'y' ) id = id . replace ( / x [ 0 - 9 ] * / , '' ) ;
@@ -101,8 +101,8 @@ exports.getFromId = function(td, id, type) {
101
101
} ;
102
102
103
103
// get an axis object of specified type from the containing trace
104
- exports . getFromTrace = function ( td , fullTrace , type ) {
105
- var fullLayout = td . _fullLayout ;
104
+ exports . getFromTrace = function ( gd , fullTrace , type ) {
105
+ var fullLayout = gd . _fullLayout ;
106
106
var ax = null ;
107
107
108
108
if ( Plots . traceIs ( fullTrace , 'gl3d' ) ) {
@@ -112,7 +112,7 @@ exports.getFromTrace = function(td, fullTrace, type) {
112
112
}
113
113
}
114
114
else {
115
- ax = exports . getFromId ( td , fullTrace [ type + 'axis' ] || type ) ;
115
+ ax = exports . getFromId ( gd , fullTrace [ type + 'axis' ] || type ) ;
116
116
}
117
117
118
118
return ax ;
0 commit comments