@@ -124,7 +124,7 @@ axes.cleanPosition = function(pos, gd, axRef) {
124
124
return cleanPos ( pos ) ;
125
125
} ;
126
126
127
- axes . getDataToCoordFunc = function ( gd , trace , target , targetArray ) {
127
+ var getDataConversions = axes . getDataConversions = function ( gd , trace , target , targetArray ) {
128
128
var ax ;
129
129
130
130
// 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) {
155
155
156
156
// if 'target' has corresponding axis
157
157
// -> use setConvert method
158
- if ( ax ) return ax . d2c ;
158
+ if ( ax ) return { d2c : ax . d2c , c2d : ax . c2d } ;
159
159
160
160
// special case for 'ids'
161
161
// -> cast to String
162
- if ( d2cTarget === 'ids' ) return function ( v ) { return String ( v ) ; } ;
162
+ if ( d2cTarget === 'ids' ) return { d2c : toString , c2d : toString } ;
163
163
164
164
// otherwise (e.g. numeric-array of 'marker.color' or 'marker.size')
165
165
// -> 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 ;
167
175
} ;
168
176
169
177
// empty out types for all axes containing these traces
0 commit comments