Interface GeoCircleGenerator<This, Datum>

A new circle generator

The first generic corresponds to the "this"-context within which the geo circle generator will be invoked.

The second generic corresponds to the type of the Datum which will be passed into the geo circle generator.

interface GeoCircleGenerator {
    center(): ((this, d, ...args) => [number, number]);
    center(center): GeoCircleGenerator<This, Datum>;
    precision(): ((this, d, ...args) => number);
    precision(precision): GeoCircleGenerator<This, Datum>;
    radius(): ((this, d, ...args) => number);
    radius(radius): GeoCircleGenerator<This, Datum>;
    (this, d?, ...args): Polygon;
}

Type Parameters

  • This = any

  • Datum = any

  • Returns a new GeoJSON geometry object of type “Polygon” approximating a circle on the surface of a sphere, with the current center, radius and precision. Any arguments are passed to the accessors.

    Parameters

    • this: This
    • Optional d: Datum
    • Rest ...args: any[]

    Returns Polygon

Methods

  • Returns the current center accessor, which defaults to a function returning [0, 0].

    Returns ((this, d, ...args) => [number, number])

      • (this, d, ...args): [number, number]
      • Returns the current center accessor, which defaults to a function returning [0, 0].

        Parameters

        • this: This
        • d: Datum
        • Rest ...args: any[]

        Returns [number, number]

  • Sets the circle center to the specified point [longitude, latitude] in degrees, and returns this circle generator. The center may also be specified as a function; this function will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator.

    Parameters

    • center: [number, number] | ((this, d, ...args) => [number, number])

    Returns GeoCircleGenerator<This, Datum>

  • Returns the current precision accessor, which defaults to a function returning 6.

    Returns ((this, d, ...args) => number)

      • (this, d, ...args): number
      • Returns the current precision accessor, which defaults to a function returning 6.

        Parameters

        • this: This
        • d: Datum
        • Rest ...args: any[]

        Returns number

  • Sets the circle precision to the specified angle in degrees, and returns this circle generator. The precision may also be specified as a function; this function will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator.

    Parameters

    • precision: number | ((this, d, ...args) => number)

    Returns GeoCircleGenerator<This, Datum>

  • Returns the current radius accessor, which defaults to a function returning 90.

    Returns ((this, d, ...args) => number)

      • (this, d, ...args): number
      • Returns the current radius accessor, which defaults to a function returning 90.

        Parameters

        • this: This
        • d: Datum
        • Rest ...args: any[]

        Returns number

  • Sets the circle radius to the specified angle in degrees, and returns this circle generator. The radius may also be specified as a function; this function will be invoked whenever a circle is generated, being passed any arguments passed to the circle generator.

    Parameters

    • radius: number | ((this, d, ...args) => number)

    Returns GeoCircleGenerator<This, Datum>