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

from functools import partial
from operator import is_not

class arc:
    def __init__(self, content="arc"):
        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 centroid(self, *arguments):
        """
        Examples · Source · Computes the midpoint [x, y] of the center line of the arc that
        would be generated by the given arguments.
        The arguments are arbitrary; they are propagated to the arc generator’s accessor
        functions along with the this object. To be consistent with the generated arc, the
        accessors must be deterministic, i.e., return the same value given the same arguments.
        The midpoint is defined as (startAngle + endAngle) / 2 and (innerRadius + outerRadius)
        / 2. For example:
        Note that this is not the geometric center of the arc, which may be outside the arc;
        this method is merely a convenience for positioning labels.

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


    def innerRadius(self, radius=None):
        """
        Source · If radius is specified, sets the inner radius to the specified function or
        number and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().innerRadius(40);

        If radius is not specified, returns the current inner radius accessor.
        .. code:: javascript

            arc.innerRadius() // () => 40

        The inner radius accessor defaults to:
        .. code:: javascript

            function innerRadius(d) {
              return d.innerRadius;
            }

        Specifying the inner radius as a function is useful for constructing a stacked polar
        bar chart, often in conjunction with a sqrt scale. More commonly, a constant inner
        radius is used for a donut or pie chart. If the outer radius is smaller than the inner
        radius, the inner and outer radii are swapped. A negative value is treated as zero.

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


    def outerRadius(self, radius=None):
        """
        Source · If radius is specified, sets the outer radius to the specified function or
        number and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().outerRadius(240);

        If radius is not specified, returns the current outer radius accessor.
        .. code:: javascript

            arc.outerRadius() // () => 240

        The outer radius accessor defaults to:
        .. code:: javascript

            function outerRadius(d) {
              return d.outerRadius;
            }

        Specifying the outer radius as a function is useful for constructing a coxcomb or polar
        bar chart, often in conjunction with a sqrt scale. More commonly, a constant outer
        radius is used for a pie or donut chart. If the outer radius is smaller than the inner
        radius, the inner and outer radii are swapped. A negative value is treated as zero.

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


    def cornerRadius(self, radius=None):
        """
        Corner radius:18
        Examples · Source · If radius is specified, sets the corner radius to the specified
        function or number and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().cornerRadius(18);

        If radius is not specified, returns the current corner radius accessor.
        .. code:: javascript

            arc.cornerRadius() // () => 18

        The corner radius accessor defaults to:
        .. code:: javascript

            function cornerRadius() {
              return 0;
            }

        If the corner radius is greater than zero, the corners of the arc are rounded using
        circles of the given radius. For a circular sector, the two outer corners are rounded;
        for an annular sector, all four corners are rounded.
        The corner radius may not be larger than (outerRadius - innerRadius) / 2. In addition,
        for arcs whose angular span is less than π, the corner radius may be reduced as two
        adjacent rounded corners intersect. This occurs more often with the inner corners. See
        the arc corners animation for illustration.

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


    def startAngle(self, angle=None):
        """
        Source · If angle is specified, sets the start angle to the specified function or
        number and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().startAngle(Math.PI / 4);

        If angle is not specified, returns the current start angle accessor.
        .. code:: javascript

            arc.startAngle() // () => 0.7853981633974483

        The start angle accessor defaults to:
        .. code:: javascript

            function startAngle(d) {
              return d.startAngle;
            }

        The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles
        proceeding clockwise. If |endAngle - startAngle| ≥ 2π, a complete circle or annulus is
        generated rather than a sector.

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


    def endAngle(self, angle=None):
        """
        Source · If angle is specified, sets the end angle to the specified function or number
        and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().endAngle(Math.PI);

        If angle is not specified, returns the current end angle accessor.
        .. code:: javascript

            arc.endAngle() // () => 3.141592653589793

        The end angle accessor defaults to:
        .. code:: javascript

            function endAngle(d) {
              return d.endAngle;
            }

        The angle is specified in radians, with 0 at -y (12 o’clock) and positive angles
        proceeding clockwise. If |endAngle - startAngle| ≥ 2π, a complete circle or annulus is
        generated rather than a sector.

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


    def padAngle(self, angle=None):
        """
        Pad angle:0.030
        Examples · Source · If angle is specified, sets the pad angle to the specified function
        or number and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().padAngle(0);

        If angle is not specified, returns the current pad angle accessor.
        .. code:: javascript

            arc.padAngle() // () => 0

        The pad angle accessor defaults to:
        .. code:: javascript

            function padAngle() {
              return d && d.padAngle;
            }

        The pad angle is converted to a fixed linear distance separating adjacent arcs, defined
        as padRadius × padAngle. This distance is subtracted equally from the start and end of
        the arc. If the arc forms a complete circle or annulus, as when |endAngle - startAngle|
        ≥ 2π, the pad angle is ignored.
        If the inner radius or angular span is small relative to the pad angle, it may not be
        possible to maintain parallel edges between adjacent arcs. In this case, the inner edge
        of the arc may collapse to a point, similar to a circular sector. For this reason,
        padding is typically only applied to annular sectors (i.e., when innerRadius is
        positive), as shown in this diagram:
        The recommended minimum inner radius when using padding is outerRadius * padAngle /
        sin(θ), where θ is the angular span of the smallest arc before padding. For example, if
        the outer radius is 200 pixels and the pad angle is 0.02 radians, a reasonable θ is
        0.04 radians, and a reasonable inner radius is 100 pixels. See the arc padding
        animation for illustration.
        Often, the pad angle is not set directly on the arc generator, but is instead computed
        by the pie generator so as to ensure that the area of padded arcs is proportional to
        their value; see pie.padAngle. See the pie padding animation for illustration. If you
        apply a constant pad angle to the arc generator directly, it tends to subtract
        disproportionately from smaller arcs, introducing distortion.

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


    def padRadius(self, radius=None):
        """
        Pad radius:200
        Source · If radius is specified, sets the pad radius to the specified function or
        number and returns this arc generator. If radius is not specified, returns the current
        pad radius accessor, which defaults to null, indicating that the pad radius should be
        automatically computed as sqrt(innerRadius × innerRadius + outerRadius × outerRadius).
        The pad radius determines the fixed linear distance separating adjacent arcs, defined
        as padRadius × padAngle.

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


    def context(self, context=None):
        """
        Source · If context is specified, sets the context and returns this arc generator.
        .. code:: javascript

            const context = canvas.getContext("2d");
            const arc = d3.arc().context(context);

        If context is not specified, returns the current context, which defaults to null.
        .. code:: javascript

            arc.context() // context

        If the context is not null, then the generated arc is rendered to this context as a
        sequence of path method calls. Otherwise, a path data string representing the generated
        arc is returned.

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


    def digits(self, digits=None):
        """
        Source · If digits is specified, sets the maximum number of digits after the decimal
        separator and returns this arc generator.
        .. code:: javascript

            const arc = d3.arc().digits(3);

        If digits is not specified, returns the current maximum fraction digits, which defaults
        to 3.
        .. code:: javascript

            arc.digits() // 3

        This option only applies when the associated context is null, as when this arc
        generator is used to produce path data.

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

