Permalink
Browse files

Merge branch '2.9.2'

  • Loading branch information...
2 parents 1affcd2 + 5fff2c3 commit dd2a424f2bdb8fae1dab5ac27168f5bba186a0c4 @mbostock mbostock committed May 16, 2012
View
@@ -10,7 +10,7 @@ try {
d3_style_setProperty.call(this, name, value + "", priority);
};
}
-d3 = {version: "2.9.1"}; // semver
+d3 = {version: "2.9.2"}; // semver
function d3_class(ctor, properties) {
try {
for (var key in properties) {
@@ -661,7 +661,7 @@ d3.format = function(specifier) {
// Apply the scale, computing it from the value's exponent for si format.
if (scale < 0) {
var prefix = d3.formatPrefix(value, precision);
- value *= prefix.scale;
+ value = prefix.scale(value);
suffix = prefix.symbol;
} else {
value *= scale;
@@ -730,12 +730,12 @@ d3.formatPrefix = function(value, precision) {
};
function d3_formatPrefix(d, i) {
+ var k = Math.pow(10, Math.abs(8 - i) * 3);
return {
- scale: Math.pow(10, (8 - i) * 3),
+ scale: i > 8 ? function(d) { return d / k; } : function(d) { return d * k; },
symbol: d
};
}
-
/*
* TERMS OF USE - EASING EQUATIONS
*
@@ -5564,6 +5564,7 @@ d3.layout.pie = function() {
// They are stored in the original data's order.
var arcs = [];
index.forEach(function(i) {
+ var d;
arcs[i] = {
data: data[i],
value: d = values[i],
@@ -5987,7 +5988,8 @@ d3.layout.hierarchy = function() {
n,
c = node.children = [],
v = 0,
- j = depth + 1;
+ j = depth + 1,
+ d;
while (++i < n) {
d = recurse(childs[i], j, nodes);
d.parent = node;
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -67,7 +67,7 @@
equator
.attr("y1", xy([0, 0])[1])
- .attr("y2", xy([0, 0])[1])
+ .attr("y2", xy([0, 0])[1]);
});
function refresh() {
@@ -77,7 +77,7 @@
equator
.attr("y1", xy([0, 0])[1])
- .attr("y2", xy([0, 0])[1])
+ .attr("y2", xy([0, 0])[1]);
d3.select("#scale span")
.text(xy.scale());
View
@@ -1,6 +1,6 @@
{
"name": "d3",
- "version": "2.9.1",
+ "version": "2.9.2",
"description": "A small, free JavaScript library for manipulating documents based on data.",
"keywords": [
"dom",
View
@@ -1 +1 @@
-d3 = {version: "2.9.1"}; // semver
+d3 = {version: "2.9.2"}; // semver
View
@@ -43,7 +43,7 @@ d3.format = function(specifier) {
// Apply the scale, computing it from the value's exponent for si format.
if (scale < 0) {
var prefix = d3.formatPrefix(value, precision);
- value *= prefix.scale;
+ value = prefix.scale(value);
suffix = prefix.symbol;
} else {
value *= scale;
View
@@ -12,9 +12,9 @@ d3.formatPrefix = function(value, precision) {
};
function d3_formatPrefix(d, i) {
+ var k = Math.pow(10, Math.abs(8 - i) * 3);
return {
- scale: Math.pow(10, (8 - i) * 3),
+ scale: i > 8 ? function(d) { return d / k; } : function(d) { return d * k; },
symbol: d
};
}
-
View
@@ -15,7 +15,8 @@ d3.layout.hierarchy = function() {
n,
c = node.children = [],
v = 0,
- j = depth + 1;
+ j = depth + 1,
+ d;
while (++i < n) {
d = recurse(childs[i], j, nodes);
d.parent = node;
View
@@ -30,6 +30,7 @@ d3.layout.pie = function() {
// They are stored in the original data's order.
var arcs = [];
index.forEach(function(i) {
+ var d;
arcs[i] = {
data: data[i],
value: d = values[i],
View
@@ -78,6 +78,7 @@ suite.addBatch({
assert.strictEqual(f(999.5), "999.5");
assert.strictEqual(f(999500), "999.5k");
assert.strictEqual(f(1000), "1k");
+ assert.strictEqual(f(1400), "1.4k");
assert.strictEqual(f(1500.5), "1.5005k");
assert.strictEqual(f(.000001), "");
},

0 comments on commit dd2a424

Please sign in to comment.