Skip to content

Commit 4dc16e4

Browse files
committed
use ax.?2? while composing convert methods
- so that they can be mutated downstream
1 parent f4b14e6 commit 4dc16e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/plots/cartesian/set_convert.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ module.exports = function setConvert(ax, fullLayout) {
184184
ax.d2r = ax.r2d = ax.d2c = ax.r2c = ax.d2l = ax.r2l = cleanNumber;
185185
ax.c2d = ax.c2r = ax.l2d = ax.l2r = num;
186186

187-
ax.d2p = ax.r2p = function(v) { return l2p(cleanNumber(v)); };
187+
ax.d2p = ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };
188188
ax.p2d = ax.p2r = p2l;
189189
}
190190
else if(ax.type === 'log') {
@@ -198,10 +198,10 @@ module.exports = function setConvert(ax, fullLayout) {
198198
ax.c2r = toLog;
199199
ax.l2d = fromLog;
200200

201-
ax.d2p = function(v, clip) { return l2p(ax.d2r(v, clip)); };
201+
ax.d2p = function(v, clip) { return ax.l2p(ax.d2r(v, clip)); };
202202
ax.p2d = function(px) { return fromLog(p2l(px)); };
203203

204-
ax.r2p = function(v) { return l2p(cleanNumber(v)); };
204+
ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };
205205
ax.p2r = p2l;
206206
}
207207
else if(ax.type === 'date') {
@@ -220,7 +220,7 @@ module.exports = function setConvert(ax, fullLayout) {
220220
ax.d2c = ax.r2c = ax.d2l = ax.r2l = dt2ms;
221221
ax.c2d = ax.c2r = ax.l2d = ax.l2r = ms2dt;
222222

223-
ax.d2p = ax.r2p = function(v, _, calendar) { return l2p(dt2ms(v, 0, calendar)); };
223+
ax.d2p = ax.r2p = function(v, _, calendar) { return ax.l2p(dt2ms(v, 0, calendar)); };
224224
ax.p2d = ax.p2r = function(px, r, calendar) { return ms2dt(p2l(px), r, calendar); };
225225
}
226226
else if(ax.type === 'category') {
@@ -236,9 +236,9 @@ module.exports = function setConvert(ax, fullLayout) {
236236

237237
ax.r2l = ax.l2r = ax.r2c = ax.c2r = num;
238238

239-
ax.d2p = function(v) { return l2p(getCategoryIndex(v)); };
239+
ax.d2p = function(v) { return ax.l2p(getCategoryIndex(v)); };
240240
ax.p2d = function(px) { return getCategoryName(p2l(px)); };
241-
ax.r2p = l2p;
241+
ax.r2p = ax.l2p;
242242
ax.p2r = p2l;
243243
}
244244

0 commit comments

Comments
 (0)