Closed yurukov closed 7 years ago
I think it’s unlikely that we’re going to implement arbitrary clipping of 2D polygons, but if we do, it would be in the d3-polygon repo rather than here; see d3/d3-polygon#4. See also this JavaScript implementation of Greiner–Hormann.
Alternatively, you can use SVG or Canvas clipping to clip the Voronoi diagram rather than doing it in JavaScript.
I agree, that's what I ended up doing - clipping the paths with the region path.
I have a viz I want to make where I have a map segmented along district lines. I have points in each district and want to do a voronoi segmentation of that district along certain points. I would like to use the district polygon outline as extent, instead of a triangle.