Skip to content

Commit

Permalink
Added bigger bounds.
Browse files Browse the repository at this point in the history
  • Loading branch information
danalex97 committed May 22, 2018
1 parent ebe580d commit 57c5cfd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion visual/js/draw/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ let GroupDrawer = function(ctx, groups, nodeDrawer) {
}

function get_hull(id) {
let bound = 50;

let coords = nodeDrawer.node
.filter(d => d.group == id)
.data()
.map(d => [d.x, d.y]);
.map(d => [
[d.x - bound, d.y],
[d.x, d.y - bound],
[d.x + bound, d.y],
[d.x, d.y + bound]
])
.reduce((arr, curr) => arr.concat(curr), []);

return d3.polygonHull(coords);
}
Expand Down

0 comments on commit 57c5cfd

Please sign in to comment.