Function geoPath

  • Creates a new geographic path generator.

    The default projection is the null projection. The null projection represents the identity transformation, i.e. 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.

    The default context is null, which implies that the path generator will return an SVG path string.

    Parameters

    • Optional projection: GeoProjection | GeoStreamWrapper

      An (optional) current projection to be used. Typically this is one of D3’s built-in geographic projections; however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. See D3’s transforms for more examples of arbitrary geometric transformations. Setting the projection to "null" uses the identity projection. The default value is "null", the identity projection.

    • Optional context: GeoContext

      An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null".

    Returns GeoPath

  • Creates a new geographic path generator with the default settings.

    The default projection is the null 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.

    The default context is null, which implies that the path generator will return an SVG path string.

    The generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering

    Type Parameters

    Parameters

    • Optional projection: GeoProjection | GeoStreamWrapper

      An (optional) current projection to be used. Typically this is one of D3’s built-in geographic projections; however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. See D3’s transforms for more examples of arbitrary geometric transformations. Setting the projection to "null" uses the identity projection. The default value is "null", the identity projection.

    • Optional context: GeoContext

      An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null".

    Returns GeoPath<any, DatumObject>

  • Creates a new geographic path generator with the default settings.

    The default projection is the null 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.

    The default context is null, which implies that the path generator will return an SVG path string.

    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.

    Type Parameters

    Parameters

    • Optional projection: GeoProjection | GeoStreamWrapper

      An (optional) current projection to be used. Typically this is one of D3’s built-in geographic projections; however, any object that exposes a projection.stream function can be used, enabling the use of custom projections. See D3’s transforms for more examples of arbitrary geometric transformations. Setting the projection to "null" uses the identity projection. The default value is "null", the identity projection.

    • Optional context: GeoContext

      An (optional) rendering context to be used. If a context is provided, it must at least implement the interface described by GeoContext, a subset of the CanvasRenderingContext2D API. Setting the context to "null" means that the path generator will return an SVG path string representing the to be rendered object. The default is "null".

    Returns GeoPath<This, DatumObject>