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

from functools import partial
from operator import is_not

class ribbon:
    def __init__(self, content="ribbon"):
        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 source(self, source=None):
        """
        Source · If source is specified, sets the source accessor to the specified function and
        returns this ribbon generator. If source is not specified, returns the current source
        accessor, which defaults to:
        .. code:: javascript

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


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


    def target(self, target=None):
        """
        Source · If target is specified, sets the target accessor to the specified function and
        returns this ribbon generator. If target is not specified, returns the current target
        accessor, which defaults to:
        .. code:: javascript

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


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


    def radius(self, radius=None):
        """
        Source · If radius is specified, sets the source and target radius accessor to the
        specified function and returns this ribbon generator. For example to set a fixed radius
        of 240 pixels:
        .. code:: javascript

            const ribbon = d3.ribbon().radius(240);

        Now the arguments you pass to ribbon do not need to specify a radius property on the
        source and target.
        .. code:: javascript

            ribbon({
              source: {startAngle: 0.7524114, endAngle: 1.1212972},
              target: {startAngle: 1.8617078, endAngle: 1.9842927}
            }) // "M164.0162810494058,-175.21032946354026A240,240,0,0,1,216.1595644740915,-104.28347273835429Q0,0,229.9158815306728,68.8381247563705A240,240,0,0,1,219.77316791012538,96.43523560788266Q0,0,164.0162810494058,-175.21032946354026Z"

        If radius is not specified, returns the current source radius accessor, which defaults
        to:
        .. code:: javascript

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


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


    def sourceRadius(self, radius=None):
        """
        Source · If radius is specified, sets the source radius accessor to the specified
        function and returns this ribbon generator. If radius is not specified, returns the
        current source radius accessor, which defaults to:
        .. code:: javascript

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


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


    def targetRadius(self, radius=None):
        """
        Source · If radius is specified, sets the target radius accessor to the specified
        function and returns this ribbon generator. If radius is not specified, returns the
        current target radius accessor, which defaults to:
        .. code:: javascript

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

        By convention, the target radius in asymmetric chord diagrams is typically inset from
        the source radius, resulting in a gap between the end of the directed link and its
        associated group arc.

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


    def startAngle(self, angle=None):
        """
        Source · If angle is specified, sets the start angle accessor to the specified function
        and returns this ribbon generator. If angle is not specified, returns the current start
        angle accessor, which 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.

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


    def endAngle(self, angle=None):
        """
        Source · If angle is specified, sets the end angle accessor to the specified function
        and returns this ribbon generator. If angle is not specified, returns the current end
        angle accessor, which 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.

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


    def padAngle(self, angle=None):
        """
        Source · If angle is specified, sets the pad angle accessor to the specified function
        and returns this ribbon generator. If angle is not specified, returns the current pad
        angle accessor, which defaults to:
        .. code:: javascript

            function padAngle() {
              return 0;
            }

        The pad angle specifies the angular gap between adjacent ribbons.

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


    def context(self, context=None):
        """
        Source · If context is specified, sets the context and returns this ribbon generator.
        If context is not specified, returns the current context, which defaults to null. If
        the context is not null, then the generated ribbon is rendered to this context as a
        sequence of path method calls. Otherwise, a path data string representing the generated
        ribbon is returned. See also d3-path.

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

