Skip to content

Commit 874bf96

Browse files
committed
Merge remote-tracking branch 'origin/fix-axis-tick-key' into 3.3.4
2 parents 9405e45 + 06e2077 commit 874bf96

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

d3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7882,7 +7882,7 @@ d3 = function() {
78827882
function axis(g) {
78837883
g.each(function() {
78847884
var g = d3.select(this);
7885-
var ticks = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain() : tickValues, tickFormat = tickFormat_ == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, d3_identity), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", 1e-6), tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform;
7885+
var ticks = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain() : tickValues, tickFormat = tickFormat_ == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", 1e-6), tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform;
78867886
var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
78877887
d3.transition(path));
78887888
var scale1 = scale.copy(), scale0 = this.__chart__ || scale1;

d3.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/svg/axis.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ d3.svg.axis = function() {
2121
// Ticks, or domain values for ordinal scales.
2222
var ticks = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain()) : tickValues,
2323
tickFormat = tickFormat_ == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : d3_identity) : tickFormat_,
24-
tick = g.selectAll(".tick").data(ticks, d3_identity),
24+
tick = g.selectAll(".tick").data(ticks, scale),
2525
tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", 1e-6),
2626
tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(),
2727
tickUpdate = d3.transition(tick).style("opacity", 1),

test/svg/axis-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ suite.addBatch({
6161
var x = _.scale.quantile().domain([6, 3, 5, 2, 7, 8, 4, 0, 1, 9]).range([10, 50, 90]),
6262
a = d3.svg.axis().scale(x),
6363
g = d3.select("body").html("").append("g").call(a);
64-
assert.inDelta(g.selectAll(".tick").data(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1e-4);
65-
assert.inDelta(g.selectAll(".tick").data().map(x), [10, 10, 10, 50, 50, 50, 90, 90, 90, 90], 1e-4);
64+
assert.inDelta(g.selectAll(".tick").data(), [0, 3, 6], 1e-4);
65+
assert.inDelta(g.selectAll(".tick").data().map(x), [10, 50, 90], 1e-4);
6666
assert.equal(g.select("path").attr("d"), "M10,6V0H90V6");
6767
},
6868
"can be a threshold scale": function(d3) {

0 commit comments

Comments
 (0)