Skip to content

Commit 07f5351

Browse files
committed
Remove accidental global vars
1 parent 5f13473 commit 07f5351

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/geom/hull.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ d3.geom.hull = function(vertices) {
2525

2626
var fx = d3_functor(x),
2727
fy = d3_functor(y),
28-
n = data.length;
28+
n = data.length,
29+
points = [], // of the form [[x0, y0, 0], ..., [xn, yn, n]]
30+
flipped_points = [];
2931

30-
for (i = 0, points = []; i < n; i++) {
31-
points.push([+fx.call(this, d = data[i], i), +fy.call(this, d, i), i]);
32+
for (var i = 0 ; i < n; i++) {
33+
points.push([+fx.call(this, data[i], i), +fy.call(this, data[i], i), i]);
3234
}
3335

3436
// sort ascending by x-coord first, y-coord second
3537
points.sort(function(a, b) { return (a[0] - b[0]|| a[1] - b[1]); });
3638

3739
// we flip bottommost points across y axis so we can use the upper hull routine on both
38-
var flipped_points = [];
3940
for (var i = 0; i < n; i++) flipped_points.push([points[i][0], -points[i][1]]);
4041

4142
var uhull = d3_geom_hull_find_upper_hull(points);

0 commit comments

Comments
 (0)