d3/d3-geo-polygon

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

UserMost Recent Commit# Commits
Philippe Rivière2018-03-22 21:01:01.058
Mike Bostock2017-10-05 16:27:47.04

Other Committers

UserEmailMost Recent Commit# Commits

README

d3-geo-polygon

Clipping and geometric operations for spherical polygons.

Installing

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>
API Reference

# d3.geoClipPolygon(polygon) <>

Given a GeoJSON polygon, returns a clip function suitable for projection.preclip.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.