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

from functools import partial
from operator import is_not

class zoomTransform:
    def __init__(self, content="zoomTransform"):
        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 scale(self, k=None):
        """
        Source · Returns a transform whose scale k₁ is equal to k₀k, where k₀ is this
        transform’s scale.

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


    def translate(self, x=None, y=None):
        """
        Source · Returns a transform whose translation tx1 and ty1 is equal to tx0 + tk x and
        ty0 + tk y, where tx0 and ty0 is this transform’s translation and tk is this
        transform’s scale.

        See more informations `here <https://d3js.org/d3-zoom#transform_translate>`_.
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (x, y))))
        return zoomTransform(content=f"{self.content}.translate({arguments})")


    def apply(self, point=None):
        """
        Source · Returns the transformation of the specified point which is a two-element array
        of numbers [x, y]. The returned point is equal to [xk + tx, yk + ty].

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


    def applyX(self, x=None):
        """
        Source · Returns the transformation of the specified x-coordinate, xk + tx.

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


    def applyY(self, y=None):
        """
        Source · Returns the transformation of the specified y coordinate, yk + ty.

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


    def invert(self, point=None):
        """
        Source · Returns the inverse transformation of the specified point which is a
        two-element array of numbers [x, y]. The returned point is equal to [(x - tx) / k, (y -
        ty) / k].

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


    def invertX(self, x=None):
        """
        Source · Returns the inverse transformation of the specified x-coordinate, (x - tx) /
        k.

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


    def invertY(self, y=None):
        """
        Source · Returns the inverse transformation of the specified y coordinate, (y - ty) /
        k.

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


    def rescaleX(self, x=None):
        """
        Source · Returns a copy of the continuous scale x whose domain is transformed. This is
        implemented by first applying the inverse x-transform on the scale’s range, and then
        applying the inverse scale to compute the corresponding domain:
        .. code:: javascript

            function rescaleX(x) {
              var range = x.range().map(transform.invertX, transform),
                  domain = range.map(x.invert, x);
              return x.copy().domain(domain);
            }

        The scale x must use interpolateNumber; do not use continuous.rangeRound as this
        reduces the accuracy of continuous.invert and can lead to an inaccurate rescaled
        domain. This method does not modify the input scale x; x thus represents the
        untransformed scale, while the returned scale represents its transformed view.

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


    def rescaleY(self, y=None):
        """
        Source · Returns a copy of the continuous scale y whose domain is transformed. This is
        implemented by first applying the inverse y-transform on the scale’s range, and then
        applying the inverse scale to compute the corresponding domain:
        .. code:: javascript

            function rescaleY(y) {
              var range = y.range().map(transform.invertY, transform),
                  domain = range.map(y.invert, y);
              return y.copy().domain(domain);
            }

        The scale y must use interpolateNumber; do not use continuous.rangeRound as this
        reduces the accuracy of continuous.invert and can lead to an inaccurate rescaled
        domain. This method does not modify the input scale y; y thus represents the
        untransformed scale, while the returned scale represents its transformed view.

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


    def toString(self):
        """
        Source · Returns a string representing the SVG transform corresponding to this
        transform. Implemented as:
        .. code:: javascript

            function toString() {
              return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
            }


        See more informations `here <https://d3js.org/d3-zoom#transform_toString>`_.
        """
        return zoomTransform(content=f"{self.content}.toString()")

