@@ -14,7 +14,7 @@ var Lib = require('../../lib');
1414var constants = require ( './constants' ) ;
1515
1616
17- // convert between axis names (xaxis, xaxis2, etc, elements of td .layout)
17+ // convert between axis names (xaxis, xaxis2, etc, elements of gd .layout)
1818// and axis id's (x, x2, etc). Would probably have ditched 'xaxis'
1919// completely in favor of just 'x' if it weren't ingrained in the API etc.
2020exports . id2name = function id2name ( id ) {
@@ -43,8 +43,8 @@ exports.cleanId = function cleanId(id, axLetter) {
4343// get all axis object names
4444// optionally restricted to only x or y or z by string axLetter
4545// 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 ;
4848 if ( ! fullLayout ) return [ ] ;
4949
5050 function filterAxis ( obj , extra ) {
@@ -76,23 +76,23 @@ function listNames(td, axLetter, only2d) {
7676}
7777
7878// 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 )
8181 . map ( function ( axName ) {
82- return Lib . nestedProperty ( td . _fullLayout , axName ) . get ( ) ;
82+ return Lib . nestedProperty ( gd . _fullLayout , axName ) . get ( ) ;
8383 } ) ;
8484} ;
8585
8686// get all axis ids, optionally restricted by letter
8787// 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 ) ;
9090} ;
9191
9292// get an axis object from its id 'x','x2' etc
9393// 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 ;
9696
9797 if ( type === 'x' ) id = id . replace ( / y [ 0 - 9 ] * / , '' ) ;
9898 else if ( type === 'y' ) id = id . replace ( / x [ 0 - 9 ] * / , '' ) ;
@@ -101,8 +101,8 @@ exports.getFromId = function(td, id, type) {
101101} ;
102102
103103// 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 ;
106106 var ax = null ;
107107
108108 if ( Plots . traceIs ( fullTrace , 'gl3d' ) ) {
@@ -112,7 +112,7 @@ exports.getFromTrace = function(td, fullTrace, type) {
112112 }
113113 }
114114 else {
115- ax = exports . getFromId ( td , fullTrace [ type + 'axis' ] || type ) ;
115+ ax = exports . getFromId ( gd , fullTrace [ type + 'axis' ] || type ) ;
116116 }
117117
118118 return ax ;
0 commit comments