Skip to content

Commit dfdcb39

Browse files
committed
Simpler update between ordinal & quantitative scales.
1 parent 11a4a6e commit dfdcb39

3 files changed

Lines changed: 22 additions & 34 deletions

File tree

d3.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8236,20 +8236,17 @@ d3 = function() {
82368236
}
82378237
}
82388238
if (scale1.rangeBand) {
8239-
var dx = scale1.rangeBand() / 2, x = function(d) {
8240-
return scale1(d) + dx;
8239+
var x = scale1, dx = x.rangeBand() / 2;
8240+
scale0 = scale1 = function(d) {
8241+
return x(d) + dx;
82418242
};
8242-
tickEnter.call(tickTransform, x);
8243-
tickUpdate.call(tickTransform, x);
8243+
} else if (scale0.rangeBand) {
8244+
scale0 = scale1;
82448245
} else {
8245-
if (scale0.rangeBand) {
8246-
tickEnter.call(tickTransform, scale1);
8247-
} else {
8248-
tickEnter.call(tickTransform, scale0);
8249-
tickExit.call(tickTransform, scale1);
8250-
}
8251-
tickUpdate.call(tickTransform, scale1);
8246+
tickExit.call(tickTransform, scale1);
82528247
}
8248+
tickEnter.call(tickTransform, scale0);
8249+
tickUpdate.call(tickTransform, scale1);
82538250
});
82548251
}
82558252
axis.scale = function(x) {

0 commit comments

Comments
 (0)