May 2019
Beginner to intermediate
650 pages
14h 50m
English
Some projections in D3 require clipping to the sphere because, due to how the projection is applied, features may be rendered outside the outline of the sphere. This is true for all interrupted projections and for some others. Polygonal projections from the d3-geo-polygon module don't require clipping.
Clipping to the sphere uses a special GeoJSON object:
{type: "Sphere"}
It doesn't take any additional arguments and can be used in functions that accept GeoJSON geometries.
The simplest way to clip to a sphere is to create a clipping mask from a {type: "Sphere"} object. In SVG you can do this with a <clipPath> element containing a <path> that describes the clipping path. This is usually defined in an SVG <defs> header. ...
Read now
Unlock full access