{"id":13481407,"url":"https://github.com/d3/d3-geo-polygon","last_synced_at":"2025-04-12T20:42:46.274Z","repository":{"id":25202860,"uuid":"103437532","full_name":"d3/d3-geo-polygon","owner":"d3","description":"Clipping and geometric operations for spherical polygons.","archived":false,"fork":false,"pushed_at":"2024-11-10T17:16:40.000Z","size":11259,"stargazers_count":116,"open_issues_count":7,"forks_count":24,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-04T00:07:23.407Z","etag":null,"topics":["d3","map","polygon-clipping","projection"],"latest_commit_sha":null,"homepage":"https://d3.observablehq.cloud/d3-geo-polygon/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-13T18:43:12.000Z","updated_at":"2025-03-17T13:46:02.000Z","dependencies_parsed_at":"2024-11-10T18:29:07.204Z","dependency_job_id":null,"html_url":"https://github.com/d3/d3-geo-polygon","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-geo-polygon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-geo-polygon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-geo-polygon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3%2Fd3-geo-polygon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d3","download_url":"https://codeload.github.com/d3/d3-geo-polygon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631666,"owners_count":21136554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d3","map","polygon-clipping","projection"],"created_at":"2024-07-31T17:00:51.552Z","updated_at":"2025-04-12T20:42:46.235Z","avatar_url":"https://github.com/d3.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","👨‍💻 JavaScript Libraries","others","Maps"],"sub_categories":["Data Processing"],"readme":"# d3-geo-polygon\n\nClipping and geometric operations for spherical polygons.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/dodecahedral-dark.png\"\u003e\n  \u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/dodecahedral.png\"\u003e\n\u003c/picture\u003e\n\n```js run=false\nconst projection = geoDodecahedral();\n```\n\nThis module introduces a dozen projections that need polygon clipping. It can also be used to clip a projection with an arbitrary polygon:\n\n```js run=false\nconst projection = geoEquirectangular()\n    .preclip(geoClipPolygon({\n      type: \"Polygon\",\n      coordinates: [[[-10, -10], [-10, 10], [10, 10], [10, -10], [-10, -10]]]\n    }));\n```\n\n## Installing\n\nIn Observable Framework, [import](https://observablehq.com/framework/imports) with the `npm:` protocol:\n\n```html run=false\n\u003cscript type=\"module\"\u003e\nimport {geoCubic} from \"npm:d3-geo-polygon@2\";\nconst projection = geoCubic();\n\u003c/script\u003e\n```\n\nIf 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:\n\n```html run=false\n\u003cscript type=\"module\"\u003e\nimport {geoCubic} from \"https://cdn.skypack.dev/d3-geo-polygon@2\";\nconst projection = geoCubic();\n\u003c/script\u003e\n```\n\nFor legacy environments, you can load d3-geo-projection’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported:\n\n```html run=false\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/d3-array@3\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/d3-geo@3\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/d3-geo-polygon@2\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n\nconst projection = d3.geoCubic();\n\n\u003c/script\u003e\n```\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://observablehq.observablehq.cloud/oss-analytics/d3-geo-polygon/downloads-dark.svg\"\u003e\n  \u003cimg alt=\"Daily downloads of d3-geo-polygon\" src=\"https://observablehq.observablehq.cloud/oss-analytics/d3-geo-polygon/downloads.svg\"\u003e\n\u003c/picture\u003e\n\n\u003csub\u003eDaily downloads of d3-geo-polygon · [oss-analytics](https://observablehq.observablehq.cloud/oss-analytics/@d3/d3-geo-polygon)\u003c/sub\u003e\n\n## API Reference\n\n\u003ca name=\"geoClipPolygon\" href=\"#geoClipPolygon\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoClipPolygon\u003c/b\u003e(\u003ci\u003epolygon\u003c/i\u003e) · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/clip/polygon.js), [Examples](https://observablehq.com/@d3/spherical-clipping)\n\nGiven a GeoJSON *polygon* or *multipolygon*, returns a clip function suitable for [_projection_.preclip](https://d3js.org/d3-geo/projection#projection_preclip).\n\n\u003ca name=\"polygon\" href=\"#polygon\"\u003e#\u003c/a\u003e clip.\u003cb\u003epolygon\u003c/b\u003e([\u003ci\u003egeometry\u003c/i\u003e])\n\nIf \u003ci\u003egeometry\u003c/i\u003e is specified, sets the clipping polygon to the geometry and returns a new \u003ci\u003eclip\u003c/i\u003e function. Otherwise returns the clipping polygon.\n\n\u003ca name=\"clipPoint\" href=\"#clipPoint\"\u003e#\u003c/a\u003e clip.\u003cb\u003eclipPoint\u003c/b\u003e([\u003ci\u003eclipPoint\u003c/i\u003e])\n\nWhether the projection should clip points. If \u003ci\u003eclipPoint\u003c/i\u003e is false, the clip function only clips line and polygon geometries. If \u003ci\u003eclipPoint\u003c/i\u003e is true, points outside the clipping polygon are not projected. Typically set to false when the projection covers the whole sphere, to make sure that all points —even those on the edge of the clipping polygon— get projected.\n\n\u003ca name=\"geoIntersectArc\" href=\"#geoIntersectArc\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoIntersectArc\u003c/b\u003e(\u003ci\u003earcs\u003c/i\u003e) · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/intersect.js), [Examples](https://observablehq.com/@fil/spherical-intersection)\n\nGiven two spherical arcs [point0, point1] and [point2, point3], returns their intersection, or undefined if there is none. See “[Spherical Intersection](https://observablehq.com/@fil/spherical-intersection)”.\n\n## Projections\n\nNew projections are introduced:\n\n\u003ca href=\"#geoPolyhedralVoronoi\" name=\"geoPolyhedralVoronoi\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoPolyhedralVoronoi\u003c/b\u003e([\u003ci\u003eparents\u003c/i\u003e], [\u003ci\u003epolygons\u003c/i\u003e], [\u003ci\u003efaceProjection\u003c/i\u003e], [\u003ci\u003efaceFind\u003c/i\u003e]) · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/voronoi.js)\n\nReturns a polyhedral projection based on the *polygons*, arranged in a tree. \n\nThe tree is specified by passing *parents*, an array of indices indicating the parent of each face. The root of the tree is the first face without a parent (with the array typically specifying -1).\n\n*polygons* are a GeoJSON FeatureCollection of geoVoronoi cells, which should indicate the corresponding sites (see [d3-geo-voronoi](https://github.com/Fil/d3-geo-voronoi)). An optional [_faceProjection_](#geoPolyhedral) is passed to d3.geoPolyhedral() -- note that the gnomonic projection on the polygons’ sites is the only faceProjection that works in the general case.\n\nThe .\u003cb\u003eparents\u003c/b\u003e([\u003ci\u003eparents\u003c/i\u003e]), .\u003cb\u003epolygons\u003c/b\u003e([\u003ci\u003epolygons\u003c/i\u003e]), .\u003cb\u003efaceProjection\u003c/b\u003e([\u003ci\u003efaceProjection\u003c/i\u003e]) set and read the corresponding options. Use \u003ci\u003e.faceFind(voronoi.find)\u003c/i\u003e for faster results.\n\n\u003ca href=\"#geoCubic\" name=\"geoCubic\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoCubic\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/cubic.js), [Examples](https://observablehq.com/@fil/cubic-projections)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/cubic-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/cubic.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@fil/cubic-projections)\n\nThe cubic projection.\n\n\u003ca href=\"#geoDodecahedral\" name=\"geoDodecahedral\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoDodecahedral\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/dodecahedral.js), [Examples](https://observablehq.com/@fil/dodecahedral-projection)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/dodecahedral-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/dodecahedral.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@fil/dodecahedral-projection)\n\nThe pentagonal dodecahedral projection.\n\n\u003ca href=\"#geoRhombic\" name=\"geoRhombic\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoRhombic\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/rhombic.js), [Examples](https://observablehq.com/d/881a8431e638b408)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/rhombic-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/rhombic.png\"\u003e\u003c/picture\u003e](https://observablehq.com/d/881a8431e638b408)\n\nThe rhombic dodecahedral projection.\n\n\u003ca href=\"#geoDeltoidal\" name=\"geoDeltoidal\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoDeltoidal\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/deltoidal.js), [Examples](https://observablehq.com/d/881a8431e638b408)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/deltoidal-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/deltoidal.png\"\u003e\u003c/picture\u003e](https://observablehq.com/d/881a8431e638b408)\n\nThe deltoidal hexecontahedral projection.\n\n\u003ca href=\"#geoIcosahedral\" name=\"geoIcosahedral\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoIcosahedral\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/icosahedral.js), [Examples](https://observablehq.com/@fil/icosahedral-projections)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/icosahedral-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/icosahedral.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@fil/icosahedral-projections)\n\nThe icosahedral projection.\n\n\u003ca href=\"#geoAirocean\" name=\"geoAirocean\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoAirocean\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/airocean.js), [Examples](https://observablehq.com/@fil/airocean-projection)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/airocean-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/airocean.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@fil/airocean-projection)\n\nBuckminster Fuller’s Airocean projection (also known as “Dymaxion”), based on a very specific arrangement of the icosahedron which allows continuous continent shapes. Fuller’s triangle transformation, as formulated by Robert W. Gray (and implemented by Philippe Rivière), makes the projection almost equal-area.\n\n\u003ca href=\"#geoCahillKeyes\" name=\"geoCahillKeyes\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoCahillKeyes\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/cahillKeyes.js), [Examples](https://observablehq.com/@d3/cahill-keyes)\n\u003cbr\u003e\u003ca href=\"#geoCahillKeyesRaw\" name=\"geoCahillKeyesRaw\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoCahillKeyes\u003c/b\u003e\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/cahillKeyes-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/cahillKeyes.png\"\u003e\u003c/picture\u003e](https://www.genekeyes.com/)\n\nThe Cahill-Keyes projection, designed by Gene Keyes (1975), is built on Bernard J. S. Cahill’s 1909 octant design. Implementation by Mary Jo Graça (2011), ported to D3 by Enrico Spinielli (2013).\n\n\u003ca href=\"#geoImago\" name=\"geoImago\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoImago\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/imago.js), [Examples](https://observablehq.com/@fil/the-imago-projection)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/imago-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/imago.png\"\u003e\u003c/picture\u003e](https://kunimune.home.blog/2017/11/23/the-secrets-of-the-authagraph-revealed/)\n\nThe Imago projection, engineered by Justin Kunimune (2017), is inspired by Hajime Narukawa’s AuthaGraph design (1999).\n\n\u003ca href=\"#imago_k\" name=\"imago_k\"\u003e#\u003c/a\u003e \u003ci\u003eimago\u003c/i\u003e.\u003cb\u003ek\u003c/b\u003e([\u003ci\u003ek\u003c/i\u003e])\n\nExponent. Useful values include 0.59 (default, minimizes angular distortion of the continents), 0.68 (gives the closest approximation of the AuthaGraph) and 0.72 (prevents kinks in the graticule).\n\n\u003ca href=\"#imago_shift\" name=\"imago_shift\"\u003e#\u003c/a\u003e \u003ci\u003eimago\u003c/i\u003e.\u003cb\u003eshift\u003c/b\u003e([\u003ci\u003eshift\u003c/i\u003e])\n\nHorizontal shift. Defaults to 1.16.\n\n\u003ca href=\"#geoTetrahedralLee\" name=\"geoTetrahedralLee\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoTetrahedralLee\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/tetrahedralLee.js), [Examples](https://observablehq.com/@fil/lee-projection)\n\u003cbr\u003e\u003ca href=\"#geoLeeRaw\" name=\"geoLeeRaw\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoLeeRaw\u003c/b\u003e\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/tetrahedralLee-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/tetrahedralLee.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/lees-tetrahedral)\n\nLee’s tetrahedral conformal projection.\n\n\u003ca href=\"#tetrahedralLee_angle\" name=\"tetrahedralLee_angle\"\u003e#\u003c/a\u003e Default \u003ci\u003eangle\u003c/i\u003e is +30°, apex up (-30° for base up, apex down).\n\nDefault aspect uses _projection_.rotate([30, 180]) and has the North Pole at the triangle’s center -- use _projection_.rotate([-30, 0]) for the [South aspect](https://observablehq.com/@fil/lee-projection).\n\n\u003ca href=\"#geoCox\" name=\"geoCox\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoCox\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/cox.js), [Examples](https://observablehq.com/@fil/cox-conformal-projection-in-a-triangle)\n\u003cbr\u003e\u003ca href=\"#geoCoxRaw\" name=\"geoCoxRaw\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoCoxRaw\u003c/b\u003e\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/cox-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/cox.png\"\u003e\u003c/picture\u003e](https://visionscarto.net/cox-conformal-projection)\n\nThe Cox conformal projection.\n\n\u003ca href=\"#geoComplexLog\" name=\"geoComplexLog\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoComplexLog\u003c/b\u003e([\u003ci\u003eplanarProjectionRaw\u003c/i\u003e[\u003ci\u003e, cutoffLatitude\u003c/i\u003e]]) · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/complexLog.js), [Example](https://cgmi.github.io/complex-log-projection/)\n\u003cbr\u003e\u003ca href=\"#geoComplexLogRaw\" name=\"geoComplexLogRaw\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoComplexLogRaw\u003c/b\u003e([\u003ci\u003eplanarProjectionRaw\u003c/i\u003e])\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/complexLog-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/complexLog.png\"\u003e\u003c/picture\u003e](https://cgmi.github.io/complex-log-projection/)\n\nComplex logarithmic view. This projection is based on the papers by Joachim Böttger et al.:\n\n- [Detail‐In‐Context Visualization for Satellite Imagery (2008)](https://doi.org/10.1111/j.1467-8659.2008.01156.x)\n- [Complex Logarithmic Views for Small Details in Large Contexts (2006)](https://doi.org/10.1109/TVCG.2006.126)\n\nThe specified raw projection *planarProjectionRaw* is used to project onto the complex plane on which the complex logarithm is applied.\nRecommended are [azimuthal equal-area](https://github.com/d3/d3-geo#geoAzimuthalEqualAreaRaw) (default) or [azimuthal equidistant](https://github.com/d3/d3-geo#geoAzimuthalEquidistantRaw).\n\n*cutoffLatitude* is the latitude relative to the projection center at which to cutoff/clip the projection, lower values result in more detail around the projection center. Value must be \u003c 0 because complex log projects the origin to infinity.\n\n\u003ca href=\"#complexLog_planarProjectionRaw\" name=\"complexLog_planarProjectionRaw\"\u003e#\u003c/a\u003e \u003ci\u003ecomplexLog\u003c/i\u003e.\u003cb\u003eplanarProjectionRaw\u003c/b\u003e([\u003ci\u003eprojectionRaw\u003c/i\u003e])\n\nIf *projectionRaw* is specified, sets the planar raw projection. See above. If *projectionRaw* is not specified, returns the current planar raw projection.\n\n\u003ca href=\"#complexLog_cutoffLatitude\" name=\"complexLog_cutoffLatitude\"\u003e#\u003c/a\u003e \u003ci\u003ecomplexLog\u003c/i\u003e.\u003cb\u003ecutoffLatitude\u003c/b\u003e([\u003ci\u003elatitude\u003c/i\u003e])\n\nIf *latitude* is specified, sets the cutoff latitude. See above. If *latitude* is not specified, returns the current cutoff latitude.\n\n## Updated projections\n\nd3-geo-polygon adds polygon clipping to the polyhedral and interrupted projections from [d3-geo-projection](https://github.com/d3/d3-geo-projection). Thus, it supersedes the following symbols:\n\n\u003ca href=\"#geoPolyhedral\" name=\"geoPolyhedral\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoPolyhedral\u003c/b\u003e(\u003ci\u003etree\u003c/i\u003e, \u003ci\u003eface\u003c/i\u003e) · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/index.js), [Examples](https://observablehq.com/@fil/polyhedral-projections-with-d3-geo-polygon)\n\nDefines a new polyhedral projection. The *tree* is a spanning tree of polygon face nodes; each *node* is assigned a *node*.transform matrix. The *face* function returns the appropriate *node* for a given *lambda* and *phi* in radians.\n\nPolyhedral projections’ default **clipPoint** depends on whether the clipping polygon covers the whole sphere. When the polygon’s area is almost complete (larger than 4π minus .1 steradian), clipPoint is set to false, and all point geometries are displayed, even if they (technically) fall outside the clipping polygon. For smaller polygons, clipPoint defaults to true, thus hiding points outside the clipping region.\n\n\u003ca href=\"#geoPolyhedral_tree\" name=\"geoPolyhedral_tree\"\u003e#\u003c/a\u003e \u003ci\u003epolyhedral\u003c/i\u003e.\u003cb\u003etree\u003c/b\u003e() returns the spanning tree of the polyhedron, from which one can infer the faces’ centers, polygons, shared edges etc.\n\n\u003ca href=\"#geoPolyhedralButterfly\" name=\"geoPolyhedralButterfly\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoPolyhedralButterfly\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/butterfly.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/polyhedralButterfly-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/polyhedralButterfly.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/polyhedral-gnomonic)\n\nThe gnomonic butterfly projection.\n\n\u003ca href=\"#geoPolyhedralCollignon\" name=\"geoPolyhedralCollignon\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoPolyhedralCollignon\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/collignon.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/polyhedralCollignon-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/polyhedralCollignon.png\"\u003e\u003c/picture\u003e](https://www.jasondavies.com/maps/collignon-butterfly/)\n\nThe Collignon butterfly projection.\n\n\u003ca href=\"#geoPolyhedralWaterman\" name=\"geoPolyhedralWaterman\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoPolyhedralWaterman\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/polyhedral/waterman.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/polyhedralWaterman-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/polyhedralWaterman.png\"\u003e\u003c/picture\u003e](https://www.jasondavies.com/maps/waterman-butterfly/)\n\nA butterfly projection inspired by Steve Waterman’s design.\n\n\u003ca href=\"#geoBerghaus\" name=\"geoBerghaus\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoBerghaus\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/berghaus-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/berghaus.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nThe Berghaus projection.\n\n\u003ca href=\"#geoGingery\" name=\"geoGingery\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoGingery\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/gingery-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/gingery.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nThe Gingery projection.\n\n\u003ca href=\"#geoHealpix\" name=\"geoHealpix\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoHealpix\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/healpix-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/healpix.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nThe HEALPix projection.\n\n\u003ca href=\"#geoInterruptedBoggs\" name=\"geoInterruptedBoggs\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoInterruptedBoggs\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedBoggs-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedBoggs.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nBogg’s interrupted eumorphic projection.\n\n\u003ca href=\"#geoInterruptedHomolosine\" name=\"geoInterruptedHomolosine\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoInterruptedHomolosine\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedHomolosine-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedHomolosine.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nGoode’s interrupted homolosine projection.\n\n\u003ca href=\"#geoInterruptedMollweide\" name=\"geoInterruptedMollweide\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoInterruptedMollweide\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedMollweide-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedMollweide.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nGoode’s interrupted Mollweide projection.\n\n\u003ca href=\"#geoInterruptedMollweideHemispheres\" name=\"geoInterruptedMollweideHemispheres\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoInterruptedMollweideHemispheres\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedMollweideHemispheres-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedMollweideHemispheres.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nThe Mollweide projection interrupted into two (equal-area) hemispheres.\n\n\u003ca href=\"#geoInterruptedSinuMollweide\" name=\"geoInterruptedSinuMollweide\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoInterruptedSinuMollweide\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedSinuMollweide-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedSinuMollweide.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nAlan K. Philbrick’s interrupted sinu-Mollweide projection.\n\n\u003ca href=\"#geoInterruptedSinusoidal\" name=\"geoInterruptedSinusoidal\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoInterruptedSinusoidal\u003c/b\u003e · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedSinusoidal-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/interruptedSinusoidal.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/interrupted-clipped)\n\nAn interrupted sinusoidal projection with asymmetrical lobe boundaries.\n\n\u003ca href=\"#geoTwoPointEquidistant\" name=\"geoTwoPointEquidistant\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoTwoPointEquidistant\u003c/b\u003e(point0, point1) · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\nThe two-point equidistant projection, displaying 99.9996% of the sphere thanks to polygon clipping.\n\n\u003ca href=\"#geoTwoPointEquidistantUsa\" name=\"geoTwoPointEquidistantUsa\"\u003e#\u003c/a\u003e d3.\u003cb\u003egeoTwoPointEquidistantUsa\u003c/b\u003e() · [Source](https://github.com/d3/d3-geo-polygon/blob/main/src/reclip.js)\n\n[\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/twoPointEquidistantUsa-dark.png\"\u003e\u003cimg width=\"480\" alt=\"world map\" src=\"https://d3.observablehq.cloud/d3-geo-polygon/snapshots/twoPointEquidistantUsa.png\"\u003e\u003c/picture\u003e](https://observablehq.com/@d3/two-point-equidistant)\n\nThe two-point equidistant projection with points [-158°, 21.5°] and [-77°, 39°], approximately representing Honolulu, HI and Washington, D.C.\n\n*Note:* These re-clipped projections are not supported in the legacy UMD bundle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3%2Fd3-geo-polygon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd3%2Fd3-geo-polygon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3%2Fd3-geo-polygon/lists"}