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

from functools import partial
from operator import is_not

class treemapSquarify:
    def __init__(self, content="treemapSquarify"):
        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 ratio(self, ratio=None):
        """
        Source · Specifies the desired aspect ratio of the generated rectangles. The ratio must
        be specified as a number greater than or equal to one. Note that the orientation of the
        generated rectangles (tall or wide) is not implied by the ratio; for example, a ratio
        of two will attempt to produce a mixture of rectangles whose width:height ratio is
        either 2:1 or 1:2. (However, you can approximately achieve this result by generating a
        square treemap at different dimensions, and then stretching the treemap to the desired
        aspect ratio.) Furthermore, the specified ratio is merely a hint to the tiling
        algorithm; the rectangles are not guaranteed to have the specified aspect ratio. If not
        specified, the aspect ratio defaults to the golden ratio, φ = (1 + sqrt(5)) / 2, per
        Kong et al.

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

