# Generated by detroit
# See https://github.com/bourbonut/detroit/tree/main/api_maker

from functools import partial
from operator import is_not

class geoCircle:
    def __init__(self, content="geoCircle"):
        self.content = content

    def __repr__(self):
        return self.content

    def __str__(self):
        return self.content

    def __call__(self, *args):
        arguments = ", ".join(map(repr, args))
        return f"{self}({arguments})"

    def center(self, center=None):
        """
        Source · If center is specified, 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. If center is not
        specified, returns the current center accessor, which defaults to:
        .. code:: javascript

            function center() {
              return [0, 0];
            }


        See more informations `here <https://d3js.org/d3-geo/shape#circle_center>`_.
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (center,))))
        return geoCircle(content=f"{self.content}.center({arguments})")


    def radius(self, radius=None):
        """
        Source · If radius is specified, 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. If radius is not specified, returns the
        current radius accessor, which defaults to:
        .. code:: javascript

            function radius() {
              return 90;
            }


        See more informations `here <https://d3js.org/d3-geo/shape#circle_radius>`_.
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (radius,))))
        return geoCircle(content=f"{self.content}.radius({arguments})")


    def precision(self, angle=None):
        """
        Source · If precision is specified, 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. If precision is not specified, returns
        the current precision accessor, which defaults to:
        .. code:: javascript

            function precision() {
              return 2;
            }

        Small circles do not follow great arcs and thus the generated polygon is only an
        approximation. Specifying a smaller precision angle improves the accuracy of the
        approximate polygon, but also increase the cost to generate and render it.

        See more informations `here <https://d3js.org/d3-geo/shape#circle_precision>`_.
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (angle,))))
        return geoCircle(content=f"{self.content}.precision({arguments})")

