Commit 874bf961 authored by Mike Bostock's avatar Mike Bostock
Browse files

Merge remote-tracking branch 'origin/fix-axis-tick-key' into 3.3.4

parents 9405e451 06e2077f
......@@ -7882,7 +7882,7 @@ d3 = function() {
function axis(g) {
g.each(function() {
var g = d3.select(this);
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;
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;
var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
d3.transition(path));
var scale1 = scale.copy(), scale0 = this.__chart__ || scale1;
......
This diff is collapsed.
......@@ -21,7 +21,7 @@ d3.svg.axis = function() {
// Ticks, or domain values for ordinal scales.
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),
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),
......
......@@ -61,8 +61,8 @@ suite.addBatch({
var x = _.scale.quantile().domain([6, 3, 5, 2, 7, 8, 4, 0, 1, 9]).range([10, 50, 90]),
a = d3.svg.axis().scale(x),
g = d3.select("body").html("").append("g").call(a);
assert.inDelta(g.selectAll(".tick").data(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1e-4);
assert.inDelta(g.selectAll(".tick").data().map(x), [10, 10, 10, 50, 50, 50, 90, 90, 90, 90], 1e-4);
assert.inDelta(g.selectAll(".tick").data(), [0, 3, 6], 1e-4);
assert.inDelta(g.selectAll(".tick").data().map(x), [10, 50, 90], 1e-4);
assert.equal(g.select("path").attr("d"), "M10,6V0H90V6");
},
"can be a threshold scale": function(d3) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment