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

from functools import partial
from operator import is_not

class partition:
    def __init__(self, content="partition"):
        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 size(self, size=None):
        """
        Source · If size is specified, sets this partition layout’s size to the specified
        two-element array of numbers [width, height] and returns this partition layout. If size
        is not specified, returns the current size, which defaults to [1, 1].

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


    def round(self, round=None):
        """
        Source · If round is specified, enables or disables rounding according to the given
        boolean and returns this partition layout. If round is not specified, returns the
        current rounding state, which defaults to false.

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


    def padding(self, padding=None):
        """
        Source · If padding is specified, sets the padding to the specified number and returns
        this partition layout. If padding is not specified, returns the current padding, which
        defaults to zero. The padding is used to separate a node’s adjacent children.

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

