Skip to content

Commit

Permalink
Optimise; and fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Apr 13, 2011
1 parent a7b3c32 commit e7d359e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions d3.chart.js
Expand Up @@ -230,8 +230,7 @@ function d3_chart_boxQuartiles(d) {
var len = d.length;
return [.25, .5, .75].map(function(q) {
q *= len;
if (parseInt(q) === q) return (d[q] + q[q + 1]) / 2;
return d[Math.round(q)];
return ~~q === q ? (d[q] + d[q + 1]) / 2 : d[Math.round(q)];
});
}
// ranges (bad, satisfactory, good)
Expand Down
2 changes: 1 addition & 1 deletion d3.chart.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/chart/box.js
Expand Up @@ -229,7 +229,6 @@ function d3_chart_boxQuartiles(d) {
var len = d.length;
return [.25, .5, .75].map(function(q) {
q *= len;
if (parseInt(q) === q) return (d[q] + q[q + 1]) / 2;
return d[Math.round(q)];
return ~~q === q ? (d[q] + d[q + 1]) / 2 : d[Math.round(q)];
});
}

0 comments on commit e7d359e

Please sign in to comment.