vendor/assets/javascripts/d3.v2.js in d3-rails-0.0.3 vs vendor/assets/javascripts/d3.v2.js in d3-rails-0.0.4

- old
+ new

@@ -8,11 +8,11 @@ d3_style_setProperty = d3_style_prototype.setProperty; d3_style_prototype.setProperty = function(name, value, priority) { 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) { Object.defineProperty(ctor.prototype, key, { value: properties[key], @@ -659,11 +659,11 @@ var negative = (value < 0) && (value = -value) ? "\u2212" : sign; // 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; } @@ -728,16 +728,16 @@ } return d3_formatPrefixes[8 + i / 3]; }; 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 * * Open source under the BSD License. * @@ -5562,10 +5562,11 @@ // Compute the arcs! // 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], startAngle: a, endAngle: a += d * k @@ -5985,10 +5986,11 @@ if (childs && (n = childs.length)) { var i = -1, 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; c.push(d); v += d.value;