Skip to content

Commit

Permalink
Merge branch '2.9.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed May 16, 2012
2 parents 1affcd2 + 5fff2c3 commit dd2a424
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 17 deletions.
12 changes: 7 additions & 5 deletions d3.v2.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions d3.v2.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/mercator/mercator.html
Expand Up @@ -67,7 +67,7 @@ <h3>Mercator Projection</h3>

equator
.attr("y1", xy([0, 0])[1])
.attr("y2", xy([0, 0])[1])
.attr("y2", xy([0, 0])[1]);
});

function refresh() {
Expand All @@ -77,7 +77,7 @@ <h3>Mercator Projection</h3>

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());
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.js
@@ -1 +1 @@
d3 = {version: "2.9.1"}; // semver
d3 = {version: "2.9.2"}; // semver
2 changes: 1 addition & 1 deletion src/core/format.js
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/core/formatPrefix.js
Expand Up @@ -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
};
}

3 changes: 2 additions & 1 deletion src/layout/hierarchy.js
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/layout/pie.js
Expand Up @@ -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],
Expand Down
1 change: 1 addition & 0 deletions test/core/format-test.js
Expand Up @@ -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), "1μ");
},
Expand Down

0 comments on commit dd2a424

Please sign in to comment.