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

from functools import partial
from operator import is_not

class chord:
    def __init__(self, content="chord"):
        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 padAngle(self, angle=None):
        """
        Source · If angle is specified, sets the pad angle between adjacent groups to the
        specified number in radians and returns this chord layout. If angle is not specified,
        returns the current pad angle, which defaults to zero.

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


    def sortGroups(self, compare=None):
        """
        Source · If compare is specified, sets the group comparator to the specified function
        or null and returns this chord layout. If compare is not specified, returns the current
        group comparator, which defaults to null. If the group comparator is non-null, it is
        used to sort the groups by their total outflow. See also ascending and descending.

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


    def sortSubgroups(self, compare=None):
        """
        Source · If compare is specified, sets the subgroup comparator to the specified
        function or null and returns this chord layout. If compare is not specified, returns
        the current subgroup comparator, which defaults to null. If the subgroup comparator is
        non-null, it is used to sort the subgroups corresponding to matrix[i][0 … n - 1] for a
        given group i by their total outflow. See also ascending and descending.

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


    def sortChords(self, compare=None):
        """
        Source · If compare is specified, sets the chord comparator to the specified function
        or null and returns this chord layout. If compare is not specified, returns the current
        chord comparator, which defaults to null. If the chord comparator is non-null, it is
        used to sort the chords by their combined flow; this only affects the z-order of the
        chords. See also ascending and descending.

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

