This commit is contained in:
Mike Bostock 2011-06-11 18:11:15 -07:00
Родитель 9bf55832ea
Коммит 1dfcda4888
6 изменённых файлов: 10 добавлений и 10 удалений

6
d3.js поставляемый
Просмотреть файл

@ -1,4 +1,4 @@
(function(){d3 = {version: "1.20.1"}; // semver
(function(){d3 = {version: "1.20.2"}; // semver
if (!Date.now) Date.now = function() {
return +new Date;
};
@ -2245,7 +2245,7 @@ d3.scale.linear = function() {
};
function d3_scale_linearNice(dx) {
dx = Math.pow(10, Math.round(Math.log(dx) / Math.log(10)) - 1);
dx = Math.pow(10, Math.round(Math.log(dx) / Math.LN10) - 1);
return {
floor: function(x) { return Math.floor(x / dx) * dx; },
ceil: function(x) { return Math.ceil(x / dx) * dx; },
@ -2382,7 +2382,7 @@ d3.scale.pow = function() {
scale.tickFormat = tick.tickFormat;
scale.nice = function() {
return scale.domain(d3_scale_nice(scale.domain(), d3_scale_niceDefault));
return scale.domain(d3_scale_nice(scale.domain(), d3_scale_linearNice));
};
scale.exponent = function(x) {

4
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1 +1 @@
d3 = {version: "1.20.1"}; // semver
d3 = {version: "1.20.2"}; // semver

Просмотреть файл

@ -91,7 +91,7 @@ d3.scale.linear = function() {
};
function d3_scale_linearNice(dx) {
dx = Math.pow(10, Math.round(Math.log(dx) / Math.log(10)) - 1);
dx = Math.pow(10, Math.round(Math.log(dx) / Math.LN10) - 1);
return {
floor: function(x) { return Math.floor(x / dx) * dx; },
ceil: function(x) { return Math.ceil(x / dx) * dx; },

Просмотреть файл

@ -31,7 +31,7 @@ d3.scale.pow = function() {
scale.tickFormat = tick.tickFormat;
scale.nice = function() {
return scale.domain(d3_scale_nice(scale.domain(), d3_scale_niceDefault));
return scale.domain(d3_scale_nice(scale.domain(), d3_scale_linearNice));
};
scale.exponent = function(x) {

Просмотреть файл

@ -43,7 +43,7 @@ nice():
[ 1.100, 10.900 ] -> 1.000, 11.000
[ 10.900, 1.100 ] -> 11.000, 1.000
[ 0.700, 11.001 ] -> 0.000, 12.000
[ 123.100, 6.700 ] -> 124.000, 6.000
[ 0.000, 0.490 ] -> 0.000, 1.000
[ 123.100, 6.700 ] -> 130.000, 0.000
[ 0.000, 0.490 ] -> 0.000, 0.500
[ 0.100, 1.000, 2.500, 3.000, 10.900 ] -> 0.000, 1.000, 2.500, 3.000, 11.000