Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Conversation

@Fil
Copy link
Member

@Fil Fil commented Sep 20, 2016

as discussed in #17

@mbostock mbostock self-assigned this Sep 20, 2016
@Fil
Copy link
Member Author

Fil commented Sep 21, 2016

Used here, as an example, to simplify @nbremer 's superb Voronoi interactivity system http://bl.ocks.org/Fil/f49b5cf943a0210212994aa5860ac4a8

@jonsadka
Copy link

Really excited for this 😬

if (ndist < dist) {
dist = ndist;
next = ea.index;
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return has no effect within array.forEach, since there isn’t anything else to do in this function. Did you want to terminate iterating over the halfedges for the current cell in this case? My guess is you want to check all the halfedges regardless, but I could be wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right on both counts:

  • I'd be happy with the first good result (doesn't need to be the best)
  • return doesn't do what I want, so we end up checking all halfedges

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I’ve merged it, but feel free to send a followup PR if you want to make improvements. Thank you!

@mbostock mbostock merged commit dd1c403 into d3:master Oct 27, 2016
@jonsadka
Copy link

Just in time for my project :) 🎊 Awesome work and thanks @Fil and @mbostock

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants