Renders the given object, which may be any GeoJSON feature or geometry object:
The type Sphere is also supported, which is useful for rendering the outline of the globe; a sphere has no coordinates.
Any additional arguments are passed along to the pointRadius accessor.
IMPORTANT: If the rendering context of the geoPath generator is null, then the geoPath is returned as an SVG path data string.
Separate path elements are typically slower than a single path element. However, distinct path elements are useful for styling and interaction (e.g., click or mouseover). Canvas rendering (see path.context) is typically faster than SVG, but requires more effort to implement styling and interaction.
The first generic type of the GeoPath generator used, must correspond to the "this" context bound to the function upon invocation.
An object to be rendered.
Rest
...args: any[]Renders the given object, which may be any GeoJSON feature or geometry object:
The type Sphere is also supported, which is useful for rendering the outline of the globe; a sphere has no coordinates.
Any additional arguments are passed along to the pointRadius accessor.
IMPORTANT: If the geoPath generator has been configured with a rendering context, then the geoPath is rendered to this context as a sequence of path method calls and this function returns void.
Separate path elements are typically slower than a single path element. However, distinct path elements are useful for styling and interaction (e.g., click or mouseover). Canvas rendering (see path.context) is typically faster than SVG, but requires more effort to implement styling and interaction.
The first generic type of the GeoPath generator used, must correspond to the "this" context bound to the function upon invocation.
An object to be rendered.
Rest
...args: any[]Returns the projected planar area (typically in square pixels) for the specified GeoJSON object. Point, MultiPoint, LineString and MultiLineString geometries have zero area. For Polygon and MultiPolygon geometries, this method first computes the area of the exterior ring, and then subtracts the area of any interior holes. This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoArea.
An object for which the area is to be calculated.
Returns the projected planar bounding box (typically in pixels) for the specified GeoJSON object. The bounding box is represented by a two-dimensional array: [[x₀, y₀], [x₁, y₁]], where x₀ is the minimum x-coordinate, y₀ is the minimum y-coordinate, x₁ is maximum x-coordinate, and y₁ is the maximum y-coordinate.
This is handy for, say, zooming in to a particular feature. (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoBounds.
An object for which the bounds are to be calculated.
Returns the projected planar centroid (typically in pixels) for the specified GeoJSON object. This is handy for, say, labeling state or county boundaries, or displaying a symbol map. For example, a noncontiguous cartogram might scale each state around its centroid. This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoCentroid.
An object for which the centroid is to be calculated.
Returns the current render context which defaults to null.
Use the generic to cast the return type of the rendering context, if it is known for a specific application.
sets the current render context and returns the path generator. If the context is null, then the path generator will return an SVG path string; if the context is non-null, the path generator will instead call methods on the specified context to render geometry.
Returns the projected planar length (typically in pixels) for the specified GeoJSON object. Point and MultiPoint geometries have zero length. For Polygon and MultiPolygon geometries, this method computes the summed length of all rings.
This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoLength.
An object for which the measure is to be calculated.
Returns the current radius or radius accessor used to determine the radius for the display of Point and MultiPoint geometries. The default is a constant radius of 4.5.
Sets the radius used to display Point and MultiPoint geometries to the specified number. While the radius is commonly specified as a number constant, it may also be specified as a function which is computed per feature, being passed the any arguments passed to the path generator. For example, if your GeoJSON data has additional properties, you might access those properties inside the radius function to vary the point size; alternatively, you could d3.symbol and a projection for greater flexibility.
Get the current projection. The generic parameter can be used to cast the result to the correct, known type of the projection, e.g. GeoProjection or GeoConicProjection. Otherwise, the return type defaults to the minimum type requirement for a projection which can be passed into a GeoPath.
Use the generic to cast the return type of the projection, if it is known for a specific application.
Sets the current projection to the specified projection. The null projection represents the identity transformation: the input geometry is not projected and is instead rendered directly in raw coordinates. This can be useful for fast rendering of pre-projected geometry, or for fast rendering of the equirectangular projection.
A Geo Path generator
The first generic corresponds to the "this"-context within which the geo path generator will be invoked. This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator.
The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering.