Skip to content

Commit c8a2c9d

Browse files
committed
Placeholder ticks for d3.scale.pow.
Just reuse the linear tick algorithm for now.
1 parent be85713 commit c8a2c9d

4 files changed

Lines changed: 79 additions & 53 deletions

File tree

d3.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,10 @@ d3.scale.pow = function() {
17631763
return linear(powp(x));
17641764
}
17651765

1766+
function tick() {
1767+
return d3.scale.linear().domain(scale.domain());
1768+
}
1769+
17661770
scale.invert = function(x) {
17671771
return powb(linear.invert(x));
17681772
};
@@ -1779,6 +1783,15 @@ d3.scale.pow = function() {
17791783
return arguments.length ? scale : x;
17801784
};
17811785

1786+
// TODO better tick formatting...
1787+
scale.ticks = function(m) {
1788+
return tick().ticks(m);
1789+
};
1790+
1791+
scale.tickFormat = function(m) {
1792+
return tick().tickFormat(m);
1793+
};
1794+
17821795
scale.exponent = function(x) {
17831796
if (!arguments.length) return p;
17841797
var domain = scale.domain();

0 commit comments

Comments
 (0)