@@ -124,7 +124,7 @@ axes.cleanPosition = function(pos, gd, axRef) {
124124 return cleanPos ( pos ) ;
125125} ;
126126
127- axes . getDataToCoordFunc = function ( gd , trace , target , targetArray ) {
127+ var getDataConversions = axes . getDataConversions = function ( gd , trace , target , targetArray ) {
128128 var ax ;
129129
130130 // If target points to an axis, use the type we already have for that
@@ -155,15 +155,23 @@ axes.getDataToCoordFunc = function(gd, trace, target, targetArray) {
155155
156156 // if 'target' has corresponding axis
157157 // -> use setConvert method
158- if ( ax ) return ax . d2c ;
158+ if ( ax ) return { d2c : ax . d2c , c2d : ax . c2d } ;
159159
160160 // special case for 'ids'
161161 // -> cast to String
162- if ( d2cTarget === 'ids' ) return function ( v ) { return String ( v ) ; } ;
162+ if ( d2cTarget === 'ids' ) return { d2c : toString , c2d : toString } ;
163163
164164 // otherwise (e.g. numeric-array of 'marker.color' or 'marker.size')
165165 // -> cast to Number
166- return function ( v ) { return + v ; } ;
166+
167+ return { d2c : toNum , c2d : toNum } ;
168+ } ;
169+
170+ function toNum ( v ) { return + v ; }
171+ function toString ( v ) { return String ( v ) ; }
172+
173+ axes . getDataToCoordFunc = function ( gd , trace , target , targetArray ) {
174+ return getDataConversions ( gd , trace , target , targetArray ) . d2c ;
167175} ;
168176
169177// empty out types for all axes containing these traces
0 commit comments