Name: d3-geo-polygon
Owner: D3
Description: Clipping and geometric operations for spherical polygons.
Created: 2017-09-13 18:43:12.0
Updated: 2017-11-16 09:07:04.0
Pushed: 2017-12-30 02:27:40.0
Homepage: null
Size: 28
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|---|---|
Philippe Rivière | 2018-03-22 21:01:01.0 | 58 |
Mike Bostock | 2017-10-05 16:27:47.0 | 4 |
Other Committers
User | Most Recent Commit | # Commits |
---|
Clipping and geometric operations for spherical polygons.
If you use NPM, npm install d3-geo-polygon
. Otherwise, download the latest release. You can also load directly from unpkg. AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3
global is exported:
ipt src="https://unpkg.com/d3-geo@1"></script>
ipt src="https://unpkg.com/d3-geo-polygon@1"></script>
ipt>
projection = d3.geoEquirectangular()
.preclip(d3.geoClipPolygon({
type: "Polygon",
coordinates: [[[-10, -10], [-10, 10], [10, 10], [10, -10], [-10, -10]]]
}));
ript>
# d3.geoClipPolygon(polygon) <>
Given a GeoJSON polygon, returns a clip function suitable for projection.preclip.