There was an error while loading. Please reload this page.
1 parent c2f2d43 commit 59bdea2Copy full SHA for 59bdea2
1 file changed
src/geom/hull.js
@@ -45,10 +45,12 @@ d3.geom.hull = function(vertices) {
45
var skip_l = (lhull[0] === uhull[0]),
46
skip_r = (lhull[lhull.length - 1] === uhull[uhull.length - 1]),
47
poly = [];
48
+
49
for (var i=uhull.length - 1; i >= 0; i--)
- poly.push(data[points[uhull[i]][2]]);
50
+ poly.push(data[points[uhull[i]][2]]); // add upper hull in r->l order
51
for (var i = +skip_l; i < lhull.length - skip_r; i++)
- poly.push(data[points[lhull[i]][2]]);
52
+ poly.push(data[points[lhull[i]][2]]); // add lower hull in l->r order
53
54
return poly;
55
}
56
0 commit comments