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

Feature request; polygon extent #25

Closed
yurukov opened this issue Oct 28, 2017 · 2 comments
Closed

Feature request; polygon extent #25

yurukov opened this issue Oct 28, 2017 · 2 comments

Comments

@yurukov
Copy link

yurukov commented Oct 28, 2017

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.

@mbostock
Copy link
Member

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.

@yurukov
Copy link
Author

yurukov commented Oct 30, 2017

I agree, that's what I ended up doing - clipping the paths with the region path.

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

No branches or pull requests

2 participants