Permalink
Browse files

Squash warnings.

  • Loading branch information...
1 parent b262629 commit 8ee6c126bcdc3f9965457b411794e9ae7c5972ec @mbostock mbostock committed Nov 11, 2012
View
@@ -35,7 +35,6 @@ d3.core.js: \
src/core/array.js \
src/core/map.js \
src/core/identity.js \
- src/core/this.js \
src/core/true.js \
src/core/functor.js \
src/core/rebind.js \
View
@@ -104,9 +104,6 @@
function d3_identity(d) {
return d;
}
- function d3_this() {
- return this;
- }
function d3_true() {
return true;
}
@@ -1860,7 +1857,7 @@
d3_selectionPrototype.empty = function() {
return !this.node();
};
- d3_selectionPrototype.node = function(callback) {
+ d3_selectionPrototype.node = function() {
for (var j = 0, m = this.length; j < m; j++) {
for (var group = this[j], i = 0, n = group.length; i < n; i++) {
var node = group[i];
@@ -1986,7 +1983,7 @@
}
}
d3_transitionPrototype.select = function(selector) {
- var id = this.id, subgroups = [], subgroup, subnode, node, transition, subtransition;
+ var id = this.id, subgroups = [], subgroup, subnode, node;
if (typeof selector !== "function") selector = d3_selection_selector(selector);
for (var j = -1, m = this.length; ++j < m; ) {
subgroups.push(subgroup = []);
@@ -2643,7 +2640,7 @@
function d3_scale_quantile(domain, range) {
var thresholds;
function rescale() {
- var k = 0, n = domain.length, q = range.length;
+ var k = 0, q = range.length;
thresholds = [];
while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
return scale;
@@ -2889,7 +2886,7 @@
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
}
- function d3_svg_lineCardinal(points, tension, closed) {
+ function d3_svg_lineCardinal(points, tension) {
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
}
function d3_svg_lineHermite(points, tangents) {
@@ -3214,12 +3211,6 @@
function d3_svg_chordRadius(d) {
return d.radius;
}
- function d3_svg_chordStartAngle(d) {
- return d.startAngle;
- }
- function d3_svg_chordEndAngle(d) {
- return d.endAngle;
- }
d3.svg.diagonal = function() {
var source = d3_svg_chordSource, target = d3_svg_chordTarget, projection = d3_svg_diagonalProjection;
function diagonal(d, i) {
@@ -3326,9 +3317,10 @@
var ticks = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain() : tickValues, tickFormat = tickFormat_ == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : String : tickFormat_;
var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide), subtick = g.selectAll(".minor").data(subticks, String), subtickEnter = subtick.enter().insert("line", "g").attr("class", "tick minor").style("opacity", 1e-6), subtickExit = d3.transition(subtick.exit()).style("opacity", 1e-6).remove(), subtickUpdate = d3.transition(subtick).style("opacity", 1);
var tick = g.selectAll("g").data(ticks, String), tickEnter = tick.enter().insert("g", "path").style("opacity", 1e-6), tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform;
- var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathEnter = path.enter().append("path").attr("class", "domain"), pathUpdate = d3.transition(path);
+ var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = d3.transition(path);
var scale1 = scale.copy(), scale0 = this.__chart__ || scale1;
this.__chart__ = scale1;
+ path.enter().append("path").attr("class", "domain");
tickEnter.append("line").attr("class", "tick");
tickEnter.append("text");
var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text");
@@ -3430,7 +3422,7 @@
tickFormat_ = x;
return axis;
};
- axis.tickSize = function(x, y, z) {
+ axis.tickSize = function(x, y) {
if (!arguments.length) return tickMajorSize;
var n = arguments.length - 1;
tickMajorSize = +x;
@@ -4069,9 +4061,9 @@
return chord;
};
d3.layout.force = function() {
- var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, gravity = .1, theta = .8, interval, nodes = [], links = [], distances, strengths, charges;
+ var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, gravity = .1, theta = .8, nodes = [], links = [], distances, strengths, charges;
function repulse(node) {
- return function(quad, x1, y1, x2, y2) {
+ return function(quad, x1, _, x2) {
if (quad.point !== node) {
var dx = quad.cx - node.x, dy = quad.cy - node.y, dn = 1 / Math.sqrt(dx * dx + dy * dy);
if ((x2 - x1) * dn < theta) {
@@ -4319,10 +4311,10 @@
quad.cx = cx / quad.charge;
quad.cy = cy / quad.charge;
}
- function d3_layout_forceLinkDistance(link) {
+ function d3_layout_forceLinkDistance() {
return 20;
}
- function d3_layout_forceLinkStrength(link) {
+ function d3_layout_forceLinkStrength() {
return 1;
}
d3.layout.partition = function() {
@@ -4364,7 +4356,7 @@
};
d3.layout.pie = function() {
var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = 2 * π;
- function pie(data, i) {
+ function pie(data) {
var values = data.map(function(d, i) {
return +value.call(pie, d, i);
});
@@ -4417,7 +4409,7 @@
var series = data.map(function(d, i) {
return values.call(stack, d, i);
});
- var points = series.map(function(d, i) {
+ var points = series.map(function(d) {
return d.map(function(v, i) {
return [ x.call(stack, v, i), y.call(stack, v, i) ];
});
@@ -4513,7 +4505,7 @@
return y0;
},
wiggle: function(data) {
- var n = data.length, x = data[0], m = x.length, max = 0, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
+ var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
y0[0] = o = o0 = 0;
for (j = 1; j < m; ++j) {
for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
@@ -4863,7 +4855,7 @@
d3.layout.cluster = function() {
var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ];
function cluster(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0, kx, ky;
+ var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
d3_layout_treeVisitAfter(root, function(node) {
var children = node.children;
if (children && children.length) {
@@ -5499,7 +5491,7 @@
}
d3.geo.circle = function() {
var origin = [ 0, 0 ], degrees, clip, precision = 6, rotate, interpolate;
- function circle(d) {
+ function circle() {
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
var rings = [ [] ];
@@ -5618,7 +5610,7 @@
}
};
function d3_geo_circleClip(degrees, rotate) {
- var radians = degrees * d3_radians, normal = [ 1, 0, 0 ], reference = [ 0, -1, 0 ], cr = Math.cos(radians), sr = Math.sin(radians), center = d3_geo_circleScale(normal, cr), angle = d3_geo_circleAngle(center), interpolate = d3_geo_circleInterpolate(radians, 6 * d3_radians);
+ var radians = degrees * d3_radians, normal = [ 1, 0, 0 ], center = d3_geo_circleScale(normal, Math.cos(radians)), angle = d3_geo_circleAngle(center), interpolate = d3_geo_circleInterpolate(radians, 6 * d3_radians);
return {
point: function(coordinates, context) {
if (visible(coordinates = rotate(coordinates))) {
@@ -5802,18 +5794,18 @@
d[2] /= l;
}
function d3_geo_circleBufferSegments(f) {
- return function(coordinates, context) {
- var segments = [], segment, winding = f(coordinates, {
- point: function() {},
+ return function(coordinates) {
+ var segments = [], segment;
+ return [ f(coordinates, {
+ point: d3_noop,
moveTo: function(x, y) {
segments.push(segment = [ [ x, y ] ]);
},
lineTo: function(x, y) {
segment.push([ x, y ]);
},
- closePath: function() {}
- }, 0);
- return [ winding, segments ];
+ closePath: d3_noop
+ }, 0), segments ];
};
}
function d3_geo_circleWinding(p0, p) {
@@ -5992,11 +5984,6 @@
};
return interpolate;
}
- function d3_geo_greatArcInterpolate(a, b) {
- var i = d3_geo_greatArcInterpolator().source(a).target(b);
- i.distance();
- return i;
- }
function d3_geo_mercator(λ, φ) {
return [ λ / (2 * π), Math.max(-.5, Math.min(+.5, Math.log(Math.tan/ 4 + φ / 2)) / (2 * π))) ];
}
@@ -7191,7 +7178,7 @@
return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
},
Z: d3_time_zone,
- "%": function(d) {
+ "%": function() {
return "%";
}
};
@@ -7545,9 +7532,7 @@
}
var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
var d3_time_scaleLocalMethods = [ [ d3.time.second, 1 ], [ d3.time.second, 5 ], [ d3.time.second, 15 ], [ d3.time.second, 30 ], [ d3.time.minute, 1 ], [ d3.time.minute, 5 ], [ d3.time.minute, 15 ], [ d3.time.minute, 30 ], [ d3.time.hour, 1 ], [ d3.time.hour, 3 ], [ d3.time.hour, 6 ], [ d3.time.hour, 12 ], [ d3.time.day, 1 ], [ d3.time.day, 2 ], [ d3.time.week, 1 ], [ d3.time.month, 1 ], [ d3.time.month, 3 ], [ d3.time.year, 1 ] ];
- var d3_time_scaleLocalFormats = [ [ d3.time.format("%Y"), function(d) {
- return true;
- } ], [ d3.time.format("%B"), function(d) {
+ var d3_time_scaleLocalFormats = [ [ d3.time.format("%Y"), d3_true ], [ d3.time.format("%B"), function(d) {
return d.getMonth();
} ], [ d3.time.format("%b %d"), function(d) {
return d.getDate() != 1;
@@ -7572,9 +7557,7 @@
var d3_time_scaleUTCMethods = d3_time_scaleLocalMethods.map(function(m) {
return [ m[0].utc, m[1] ];
});
- var d3_time_scaleUTCFormats = [ [ d3.time.format.utc("%Y"), function(d) {
- return true;
- } ], [ d3.time.format.utc("%B"), function(d) {
+ var d3_time_scaleUTCFormats = [ [ d3.time.format.utc("%Y"), d3_true ], [ d3.time.format.utc("%B"), function(d) {
return d.getUTCMonth();
} ], [ d3.time.format.utc("%b %d"), function(d) {
return d.getUTCDate() != 1;
View
Oops, something went wrong.
@@ -1,4 +1,4 @@
-d3_selectionPrototype.node = function(callback) {
+d3_selectionPrototype.node = function() {
for (var j = 0, m = this.length; j < m; j++) {
for (var group = this[j], i = 0, n = group.length; i < n; i++) {
var node = group[i];
View
@@ -1,3 +0,0 @@
-function d3_this() {
- return this;
-}
@@ -3,9 +3,7 @@ d3_transitionPrototype.select = function(selector) {
subgroups = [],
subgroup,
subnode,
- node,
- transition,
- subtransition;
+ node;
if (typeof selector !== "function") selector = d3_selection_selector(selector);
View
@@ -6,7 +6,7 @@ d3.geo.circle = function() {
rotate,
interpolate;
- function circle(d) {
+ function circle() {
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
var rings = [[]];
@@ -131,10 +131,7 @@ d3.geo.circle = function() {
function d3_geo_circleClip(degrees, rotate) {
var radians = degrees * d3_radians,
normal = [1, 0, 0], // Cartesian normal to the circle origin.
- reference = [0, -1, 0], // Cartesian reference point lying on the circle.
- cr = Math.cos(radians),
- sr = Math.sin(radians),
- center = d3_geo_circleScale(normal, cr), // Cartesian center of the circle.
+ center = d3_geo_circleScale(normal, Math.cos(radians)), // Cartesian center of the circle.
angle = d3_geo_circleAngle(center),
interpolate = d3_geo_circleInterpolate(radians, 6 * d3_radians);
@@ -403,16 +400,18 @@ function d3_geo_circleNormalize(d) {
}
function d3_geo_circleBufferSegments(f) {
- return function(coordinates, context) {
+ return function(coordinates) {
var segments = [],
- segment,
- winding = f(coordinates, {
- point: function() {},
- moveTo: function(x, y) { segments.push(segment = [[x, y]]); },
- lineTo: function(x, y) { segment.push([x, y]); },
- closePath: function() {}
- }, 0);
- return [winding, segments];
+ segment;
+ return [
+ f(coordinates, {
+ point: d3_noop,
+ moveTo: function(x, y) { segments.push(segment = [[x, y]]); },
+ lineTo: function(x, y) { segment.push([x, y]); },
+ closePath: d3_noop
+ }, 0),
+ segments
+ ];
};
}
View
@@ -100,9 +100,3 @@ function d3_geo_greatArcInterpolator() {
return interpolate;
}
-
-function d3_geo_greatArcInterpolate(a, b) {
- var i = d3_geo_greatArcInterpolator().source(a).target(b);
- i.distance();
- return i;
-}
@@ -9,9 +9,7 @@ d3.layout.cluster = function() {
var nodes = hierarchy.call(this, d, i),
root = nodes[0],
previousNode,
- x = 0,
- kx,
- ky;
+ x = 0;
// First walk, computing the initial x & y values.
d3_layout_treeVisitAfter(root, function(node) {
View
@@ -11,15 +11,14 @@ d3.layout.force = function() {
charge = -30,
gravity = .1,
theta = .8,
- interval,
nodes = [],
links = [],
distances,
strengths,
charges;
function repulse(node) {
- return function(quad, x1, y1, x2, y2) {
+ return function(quad, x1, _, x2) {
if (quad.point !== node) {
var dx = quad.cx - node.x,
dy = quad.cy - node.y,
@@ -347,10 +346,10 @@ function d3_layout_forceAccumulate(quad, alpha, charges) {
quad.cy = cy / quad.charge;
}
-function d3_layout_forceLinkDistance(link) {
+function d3_layout_forceLinkDistance() {
return 20;
}
-function d3_layout_forceLinkStrength(link) {
+function d3_layout_forceLinkStrength() {
return 1;
}
View
@@ -4,7 +4,7 @@ d3.layout.pie = function() {
startAngle = 0,
endAngle = 2 * π;
- function pie(data, i) {
+ function pie(data) {
// Compute the numeric values for each data element.
var values = data.map(function(d, i) { return +value.call(pie, d, i); });
View
@@ -15,7 +15,7 @@ d3.layout.stack = function() {
});
// Convert each series to canonical [[x,y]] representation.
- var points = series.map(function(d, i) {
+ var points = series.map(function(d) {
return d.map(function(v, i) {
return [x.call(stack, v, i), y.call(stack, v, i)];
});
@@ -157,7 +157,6 @@ var d3_layout_stackOffsets = d3.map({
var n = data.length,
x = data[0],
m = x.length,
- max = 0,
i,
j,
k,
@@ -7,7 +7,6 @@ function d3_scale_quantile(domain, range) {
function rescale() {
var k = 0,
- n = domain.length,
q = range.length;
thresholds = [];
while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
Oops, something went wrong.

0 comments on commit 8ee6c12

Please sign in to comment.