-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
voronoi.cellPolygons skips null cells, and doesn’t report the cell’s index. #106
Comments
Yes it's a problem. The README says "Returns an iterable over the polygons for each cell, in order" and was written after e641963, so the situation is a bit fuzzy. I'm not sure why you would want to skip null polygons, but the cell.index solution is fine. |
Hmm. Yielding null might be fine, too? (I’m also not really sure it’s useful that these methods are generators rather than returning an array or sparse array…) |
Yielding null is fine IMO, but reverting to it might break someone's assumption (though not the documentation). I have no preference. Generators are nice to look at in observable, but I don't know if there's a practical use, since we can in any case use voronoi.cellPolygon(i) to enumerate. |
…erty fixes #106 (Also fixes the test case, in which the clipped cell had 0 point but was not null, resulting in [undefined, undefined] values.)
…erty fixes #106 (Also fixes the test case, in which the clipped cell had 0 point but was not null, resulting in [undefined, undefined] values.)
As a result, it’s not very useful: you can’t tell which cell polygon corresponds to which site.
Perhaps it could just assign cell.index on the yielded cell?
The text was updated successfully, but these errors were encountered: