Skip to content

Commit

Permalink
Fix a bug in path z-index.
Browse files Browse the repository at this point in the history
The test wasn't catching it because it wasn't updating the domain.
  • Loading branch information
mbostock committed Aug 23, 2011
1 parent 8df9552 commit d8557e0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion d3.chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ d3.chart.axis = function() {
var ticks = scale.ticks.apply(scale, tickArguments_),
tickFormat = tickFormat_ || scale.tickFormat.apply(scale, tickArguments_),
tick = g.selectAll("g.tick").data(ticks, String),
tickEnter = tick.enter().append("svg:g").attr("class", "tick").style("opacity", 1e-6),
tickEnter = tick.enter().insert("svg:g", "path").attr("class", "tick").style("opacity", 1e-6),
tickExit = transition(tick.exit()).style("opacity", 1e-6).remove(),
tickUpdate = transition(tick).style("opacity", 1),
tickTransform;
Expand Down
2 changes: 1 addition & 1 deletion d3.chart.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/chart/axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ d3.chart.axis = function() {
var ticks = scale.ticks.apply(scale, tickArguments_),
tickFormat = tickFormat_ || scale.tickFormat.apply(scale, tickArguments_),
tick = g.selectAll("g.tick").data(ticks, String),
tickEnter = tick.enter().append("svg:g").attr("class", "tick").style("opacity", 1e-6),
tickEnter = tick.enter().insert("svg:g", "path").attr("class", "tick").style("opacity", 1e-6),
tickExit = transition(tick.exit()).style("opacity", 1e-6).remove(),
tickUpdate = transition(tick).style("opacity", 1),
tickTransform;
Expand Down
6 changes: 3 additions & 3 deletions test/chart/axis-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ suite.addBatch({
"updates the domain path": function(axis) {
var a = axis(),
g = d3.select("body").html("").append("svg:g").call(a);
a.scale().range([1, 2]);
a.scale().domain([0, 2]).range([1, 2]);
a.tickSize(3);
g.call(a);
var path = g.selectAll("path.domain");
assert.equal(path[0].length, 1);
assert.equal(path.attr("d"), "M1,3V0H2V3");
assert.isNull(path.node().nextSibling);
assert.domEqual(path.node().nextSibling, null);
},
"enters, exits and updates tick marks": function(axis) {
var a = axis(),
Expand All @@ -287,7 +287,7 @@ suite.addBatch({
assert.equal(t.select("text").text(), tickFormat(ticks[i]));
});
}
},
}
}
});

Expand Down

0 comments on commit d8557e0

Please sign in to comment.