Skip to content

Commit 8ee6c12

Browse files
committed
Squash warnings.
1 parent b262629 commit 8ee6c12

19 files changed

Lines changed: 57 additions & 100 deletions

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ d3.core.js: \
3535
src/core/array.js \
3636
src/core/map.js \
3737
src/core/identity.js \
38-
src/core/this.js \
3938
src/core/true.js \
4039
src/core/functor.js \
4140
src/core/rebind.js \

d3.js

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@
104104
function d3_identity(d) {
105105
return d;
106106
}
107-
function d3_this() {
108-
return this;
109-
}
110107
function d3_true() {
111108
return true;
112109
}
@@ -1860,7 +1857,7 @@
18601857
d3_selectionPrototype.empty = function() {
18611858
return !this.node();
18621859
};
1863-
d3_selectionPrototype.node = function(callback) {
1860+
d3_selectionPrototype.node = function() {
18641861
for (var j = 0, m = this.length; j < m; j++) {
18651862
for (var group = this[j], i = 0, n = group.length; i < n; i++) {
18661863
var node = group[i];
@@ -1986,7 +1983,7 @@
19861983
}
19871984
}
19881985
d3_transitionPrototype.select = function(selector) {
1989-
var id = this.id, subgroups = [], subgroup, subnode, node, transition, subtransition;
1986+
var id = this.id, subgroups = [], subgroup, subnode, node;
19901987
if (typeof selector !== "function") selector = d3_selection_selector(selector);
19911988
for (var j = -1, m = this.length; ++j < m; ) {
19921989
subgroups.push(subgroup = []);
@@ -2643,7 +2640,7 @@
26432640
function d3_scale_quantile(domain, range) {
26442641
var thresholds;
26452642
function rescale() {
2646-
var k = 0, n = domain.length, q = range.length;
2643+
var k = 0, q = range.length;
26472644
thresholds = [];
26482645
while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
26492646
return scale;
@@ -2889,7 +2886,7 @@
28892886
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
28902887
points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
28912888
}
2892-
function d3_svg_lineCardinal(points, tension, closed) {
2889+
function d3_svg_lineCardinal(points, tension) {
28932890
return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
28942891
}
28952892
function d3_svg_lineHermite(points, tangents) {
@@ -3214,12 +3211,6 @@
32143211
function d3_svg_chordRadius(d) {
32153212
return d.radius;
32163213
}
3217-
function d3_svg_chordStartAngle(d) {
3218-
return d.startAngle;
3219-
}
3220-
function d3_svg_chordEndAngle(d) {
3221-
return d.endAngle;
3222-
}
32233214
d3.svg.diagonal = function() {
32243215
var source = d3_svg_chordSource, target = d3_svg_chordTarget, projection = d3_svg_diagonalProjection;
32253216
function diagonal(d, i) {
@@ -3326,9 +3317,10 @@
33263317
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_;
33273318
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);
33283319
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;
3329-
var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathEnter = path.enter().append("path").attr("class", "domain"), pathUpdate = d3.transition(path);
3320+
var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = d3.transition(path);
33303321
var scale1 = scale.copy(), scale0 = this.__chart__ || scale1;
33313322
this.__chart__ = scale1;
3323+
path.enter().append("path").attr("class", "domain");
33323324
tickEnter.append("line").attr("class", "tick");
33333325
tickEnter.append("text");
33343326
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 @@
34303422
tickFormat_ = x;
34313423
return axis;
34323424
};
3433-
axis.tickSize = function(x, y, z) {
3425+
axis.tickSize = function(x, y) {
34343426
if (!arguments.length) return tickMajorSize;
34353427
var n = arguments.length - 1;
34363428
tickMajorSize = +x;
@@ -4069,9 +4061,9 @@
40694061
return chord;
40704062
};
40714063
d3.layout.force = function() {
4072-
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;
4064+
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;
40734065
function repulse(node) {
4074-
return function(quad, x1, y1, x2, y2) {
4066+
return function(quad, x1, _, x2) {
40754067
if (quad.point !== node) {
40764068
var dx = quad.cx - node.x, dy = quad.cy - node.y, dn = 1 / Math.sqrt(dx * dx + dy * dy);
40774069
if ((x2 - x1) * dn < theta) {
@@ -4319,10 +4311,10 @@
43194311
quad.cx = cx / quad.charge;
43204312
quad.cy = cy / quad.charge;
43214313
}
4322-
function d3_layout_forceLinkDistance(link) {
4314+
function d3_layout_forceLinkDistance() {
43234315
return 20;
43244316
}
4325-
function d3_layout_forceLinkStrength(link) {
4317+
function d3_layout_forceLinkStrength() {
43264318
return 1;
43274319
}
43284320
d3.layout.partition = function() {
@@ -4364,7 +4356,7 @@
43644356
};
43654357
d3.layout.pie = function() {
43664358
var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = 2 * π;
4367-
function pie(data, i) {
4359+
function pie(data) {
43684360
var values = data.map(function(d, i) {
43694361
return +value.call(pie, d, i);
43704362
});
@@ -4417,7 +4409,7 @@
44174409
var series = data.map(function(d, i) {
44184410
return values.call(stack, d, i);
44194411
});
4420-
var points = series.map(function(d, i) {
4412+
var points = series.map(function(d) {
44214413
return d.map(function(v, i) {
44224414
return [ x.call(stack, v, i), y.call(stack, v, i) ];
44234415
});
@@ -4513,7 +4505,7 @@
45134505
return y0;
45144506
},
45154507
wiggle: function(data) {
4516-
var n = data.length, x = data[0], m = x.length, max = 0, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
4508+
var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
45174509
y0[0] = o = o0 = 0;
45184510
for (j = 1; j < m; ++j) {
45194511
for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
@@ -4863,7 +4855,7 @@
48634855
d3.layout.cluster = function() {
48644856
var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ];
48654857
function cluster(d, i) {
4866-
var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0, kx, ky;
4858+
var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
48674859
d3_layout_treeVisitAfter(root, function(node) {
48684860
var children = node.children;
48694861
if (children && children.length) {
@@ -5499,7 +5491,7 @@
54995491
}
55005492
d3.geo.circle = function() {
55015493
var origin = [ 0, 0 ], degrees, clip, precision = 6, rotate, interpolate;
5502-
function circle(d) {
5494+
function circle() {
55035495
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
55045496
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
55055497
var rings = [ [] ];
@@ -5618,7 +5610,7 @@
56185610
}
56195611
};
56205612
function d3_geo_circleClip(degrees, rotate) {
5621-
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);
5613+
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);
56225614
return {
56235615
point: function(coordinates, context) {
56245616
if (visible(coordinates = rotate(coordinates))) {
@@ -5802,18 +5794,18 @@
58025794
d[2] /= l;
58035795
}
58045796
function d3_geo_circleBufferSegments(f) {
5805-
return function(coordinates, context) {
5806-
var segments = [], segment, winding = f(coordinates, {
5807-
point: function() {},
5797+
return function(coordinates) {
5798+
var segments = [], segment;
5799+
return [ f(coordinates, {
5800+
point: d3_noop,
58085801
moveTo: function(x, y) {
58095802
segments.push(segment = [ [ x, y ] ]);
58105803
},
58115804
lineTo: function(x, y) {
58125805
segment.push([ x, y ]);
58135806
},
5814-
closePath: function() {}
5815-
}, 0);
5816-
return [ winding, segments ];
5807+
closePath: d3_noop
5808+
}, 0), segments ];
58175809
};
58185810
}
58195811
function d3_geo_circleWinding(p0, p) {
@@ -5992,11 +5984,6 @@
59925984
};
59935985
return interpolate;
59945986
}
5995-
function d3_geo_greatArcInterpolate(a, b) {
5996-
var i = d3_geo_greatArcInterpolator().source(a).target(b);
5997-
i.distance();
5998-
return i;
5999-
}
60005987
function d3_geo_mercator(λ, φ) {
60015988
return [ λ / (2 * π), Math.max(-.5, Math.min(+.5, Math.log(Math.tan(π / 4 + φ / 2)) / (2 * π))) ];
60025989
}
@@ -7191,7 +7178,7 @@
71917178
return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
71927179
},
71937180
Z: d3_time_zone,
7194-
"%": function(d) {
7181+
"%": function() {
71957182
return "%";
71967183
}
71977184
};
@@ -7545,9 +7532,7 @@
75457532
}
75467533
var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
75477534
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 ] ];
7548-
var d3_time_scaleLocalFormats = [ [ d3.time.format("%Y"), function(d) {
7549-
return true;
7550-
} ], [ d3.time.format("%B"), function(d) {
7535+
var d3_time_scaleLocalFormats = [ [ d3.time.format("%Y"), d3_true ], [ d3.time.format("%B"), function(d) {
75517536
return d.getMonth();
75527537
} ], [ d3.time.format("%b %d"), function(d) {
75537538
return d.getDate() != 1;
@@ -7572,9 +7557,7 @@
75727557
var d3_time_scaleUTCMethods = d3_time_scaleLocalMethods.map(function(m) {
75737558
return [ m[0].utc, m[1] ];
75747559
});
7575-
var d3_time_scaleUTCFormats = [ [ d3.time.format.utc("%Y"), function(d) {
7576-
return true;
7577-
} ], [ d3.time.format.utc("%B"), function(d) {
7560+
var d3_time_scaleUTCFormats = [ [ d3.time.format.utc("%Y"), d3_true ], [ d3.time.format.utc("%B"), function(d) {
75787561
return d.getUTCMonth();
75797562
} ], [ d3.time.format.utc("%b %d"), function(d) {
75807563
return d.getUTCDate() != 1;

d3.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/selection-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
d3_selectionPrototype.node = function(callback) {
1+
d3_selectionPrototype.node = function() {
22
for (var j = 0, m = this.length; j < m; j++) {
33
for (var group = this[j], i = 0, n = group.length; i < n; i++) {
44
var node = group[i];

src/core/this.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/core/transition-select.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ d3_transitionPrototype.select = function(selector) {
33
subgroups = [],
44
subgroup,
55
subnode,
6-
node,
7-
transition,
8-
subtransition;
6+
node;
97

108
if (typeof selector !== "function") selector = d3_selection_selector(selector);
119

src/geo/circle.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ d3.geo.circle = function() {
66
rotate,
77
interpolate;
88

9-
function circle(d) {
9+
function circle() {
1010
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
1111
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
1212
var rings = [[]];
@@ -131,10 +131,7 @@ d3.geo.circle = function() {
131131
function d3_geo_circleClip(degrees, rotate) {
132132
var radians = degrees * d3_radians,
133133
normal = [1, 0, 0], // Cartesian normal to the circle origin.
134-
reference = [0, -1, 0], // Cartesian reference point lying on the circle.
135-
cr = Math.cos(radians),
136-
sr = Math.sin(radians),
137-
center = d3_geo_circleScale(normal, cr), // Cartesian center of the circle.
134+
center = d3_geo_circleScale(normal, Math.cos(radians)), // Cartesian center of the circle.
138135
angle = d3_geo_circleAngle(center),
139136
interpolate = d3_geo_circleInterpolate(radians, 6 * d3_radians);
140137

@@ -403,16 +400,18 @@ function d3_geo_circleNormalize(d) {
403400
}
404401

405402
function d3_geo_circleBufferSegments(f) {
406-
return function(coordinates, context) {
403+
return function(coordinates) {
407404
var segments = [],
408-
segment,
409-
winding = f(coordinates, {
410-
point: function() {},
411-
moveTo: function(x, y) { segments.push(segment = [[x, y]]); },
412-
lineTo: function(x, y) { segment.push([x, y]); },
413-
closePath: function() {}
414-
}, 0);
415-
return [winding, segments];
405+
segment;
406+
return [
407+
f(coordinates, {
408+
point: d3_noop,
409+
moveTo: function(x, y) { segments.push(segment = [[x, y]]); },
410+
lineTo: function(x, y) { segment.push([x, y]); },
411+
closePath: d3_noop
412+
}, 0),
413+
segments
414+
];
416415
};
417416
}
418417

src/geo/greatArc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,3 @@ function d3_geo_greatArcInterpolator() {
100100

101101
return interpolate;
102102
}
103-
104-
function d3_geo_greatArcInterpolate(a, b) {
105-
var i = d3_geo_greatArcInterpolator().source(a).target(b);
106-
i.distance();
107-
return i;
108-
}

src/layout/cluster.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ d3.layout.cluster = function() {
99
var nodes = hierarchy.call(this, d, i),
1010
root = nodes[0],
1111
previousNode,
12-
x = 0,
13-
kx,
14-
ky;
12+
x = 0;
1513

1614
// First walk, computing the initial x & y values.
1715
d3_layout_treeVisitAfter(root, function(node) {

src/layout/force.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ d3.layout.force = function() {
1111
charge = -30,
1212
gravity = .1,
1313
theta = .8,
14-
interval,
1514
nodes = [],
1615
links = [],
1716
distances,
1817
strengths,
1918
charges;
2019

2120
function repulse(node) {
22-
return function(quad, x1, y1, x2, y2) {
21+
return function(quad, x1, _, x2) {
2322
if (quad.point !== node) {
2423
var dx = quad.cx - node.x,
2524
dy = quad.cy - node.y,
@@ -347,10 +346,10 @@ function d3_layout_forceAccumulate(quad, alpha, charges) {
347346
quad.cy = cy / quad.charge;
348347
}
349348

350-
function d3_layout_forceLinkDistance(link) {
349+
function d3_layout_forceLinkDistance() {
351350
return 20;
352351
}
353352

354-
function d3_layout_forceLinkStrength(link) {
353+
function d3_layout_forceLinkStrength() {
355354
return 1;
356355
}

0 commit comments

Comments
 (0)