-
Notifications
You must be signed in to change notification settings - Fork 56
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 edges() and connected neighbors() convenience functions #97
Comments
Closing as duplicate of #96 Is this something that should be mentioned in the documentation? |
Yes, if simply put in documentation would have been great for me. |
voronoi.neighbors are now available, thank you for the suggestion. As to the suggestion for voronoi.edges(), would this be a manner of getting a list of cells that are clipped out? Note that some cells might be clipped out entirely and are not rendered at all. I'm wondering about the use case, but a solution might be to compare delaunay.neighbors(i).length and voronoi.neighbors(i).length : if they are equal then we have a "central" cell, if different an "edge" cell, and if voronoi.neighbors(i).length === 0 we have an "invisible" cell. |
Basically I wanted to draw cells as a "river" from top to bottom , but the graph jumped the cells at the edge as they had smaller cost. |
There should be functions for voronoi.neighbors() that returns the connected edge cells of the structure and voronoi.edges() for the edge cells .
I was shocked when I found this this observable after implementing a few hacks to prevent a messy graph, searched quite some time for a solution and found nothing. Maybe as an Issue other people will see the solution at least.
https://observablehq.com/@fil/unconnected-delaunay-neighbors?collection=@fil/voronoi
The text was updated successfully, but these errors were encountered: