From a09f1cf632f95cb87d7fc199616eb919eb3bca9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 8 Oct 2024 11:55:10 +0200 Subject: [PATCH] Update README.md --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 83dc7b2..7fd7728 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,25 @@ Clipping and geometric operations for spherical polygons. + + + world map + + +```html run=false +const projection = geoDodecahedral(); +``` + +This module introduces a dozen projections that need polygon clipping. It can also be used to clip a projection with an arbitrary polygon: + +```html run=false +const projection = geoEquirectangular() + .preclip(geoClipPolygon({ + type: "Polygon", + coordinates: [[[-10, -10], [-10, 10], [10, 10], [10, -10], [-10, -10]]] + })); +``` + ## Installing If you use npm, `npm install d3-geo-polygon`. You can also download the [latest release on GitHub](https://github.com/d3/d3-geo-polygon/releases/latest). For vanilla HTML in modern browsers, import d3-geo-polygon from Skypack: @@ -26,15 +45,12 @@ const projection = d3.geoCubic(); ``` -This module introduces a handful of additional projections. It can also be used to clip a projection with an arbitrary polygon: + + + Daily downloads of d3-geo-polygon + -```html run=false -const projection = d3.geoEquirectangular() - .preclip(d3.geoClipPolygon({ - type: "Polygon", - coordinates: [[[-10, -10], [-10, 10], [10, 10], [10, -10], [-10, -10]]] - })); -``` +Daily downloads of d3-geo-polygon ยท [oss-analytics](https://observablehq.observablehq.cloud/oss-analytics/) ## API Reference