Skip to content

Commit

Permalink
3.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
logicalhan committed Apr 16, 2014
1 parent 8d1ccbc commit d89e1ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
16 changes: 7 additions & 9 deletions app/assets/javascripts/d3.js
@@ -1,6 +1,6 @@
!function() {
var d3 = {
version: "3.4.5"
version: "3.4.6"
};
if (!Date.now) Date.now = function() {
return +new Date();
Expand Down Expand Up @@ -91,13 +91,13 @@
return x != null && !isNaN(x);
}
d3.mean = function(array, f) {
var n = array.length, a, m = 0, i = -1, j = 0;
var s = 0, n = array.length, a, i = -1, j = n;
if (arguments.length === 1) {
while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
while (++i < n) if (d3_number(a = array[i])) s += a; else --j;
} else {
while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
while (++i < n) if (d3_number(a = f.call(array, array[i], i))) s += a; else --j;
}
return j ? m : undefined;
return j ? s / j : undefined;
};
d3.quantile = function(values, p) {
var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
Expand Down Expand Up @@ -2675,7 +2675,7 @@
return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
}
function d3_time_parseZone(date, string, i) {
return /^[+-]\d{4}$/.test(string = string.substring(i, i + 5)) ? (date.Z = +string,
return /^[+-]\d{4}$/.test(string = string.substring(i, i + 5)) ? (date.Z = -string,
i + 5) : -1;
}
function d3_time_expandYear(d) {
Expand Down Expand Up @@ -7703,9 +7703,7 @@
}
scale.domain = function(x) {
if (!arguments.length) return domain;
domain = x.filter(function(d) {
return !isNaN(d);
}).sort(d3_ascending);
domain = x.filter(d3_number).sort(d3_ascending);
return rescale();
};
scale.range = function(x) {
Expand Down

0 comments on commit d89e1ce

Please sign in to comment.