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

from functools import partial
from operator import is_not

class scaleQuantize:
    def __init__(self, content="scaleQuantize"):
        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 invertExtent(self, value=None):
        """
        Examples · Source · Returns the extent of values in the domain [x0, x1] for the
        corresponding value in the range: the inverse of quantize. This method is useful for
        interaction, say to determine the value in the domain that corresponds to the pixel
        location under the mouse.
        .. code:: javascript

            const width = d3.scaleQuantize([10, 100], [1, 2, 4]);
            width.invertExtent(2); // [40, 70]


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


    def domain(self, domain=None):
        """
        Auto generated method
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (domain,))))
        return scaleQuantize(content=f"{self.content}.domain({arguments})")


    def range(self, range=None):
        """
        Examples · Source · If range is specified, sets the scale’s range to the specified
        array of values.
        .. code:: javascript

            const color = d3.scaleQuantize();
            color.range(d3.schemeBlues[5]);

        The array may contain any number of discrete values. The elements in the given array
        need not be numbers; any value or type will work.
        If range is not specified, returns the scale’s current range.
        .. code:: javascript

            color.range() // ["#eff3ff", "#bdd7e7", "#6baed6", "#3182bd", "#08519c"]


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


    def thresholds(self):
        """
        Examples · Source · Returns the array of computed thresholds within the domain.
        .. code:: javascript

            color.thresholds() // [0.2, 0.4, 0.6, 0.8]

        The number of returned thresholds is one less than the length of the range: values less
        than the first threshold are assigned the first element in the range, whereas values
        greater than or equal to the last threshold are assigned the last element in the range.

        See more informations `here <https://d3js.org/d3-scale/quantize#quantize_thresholds>`_.
        """
        return scaleQuantize(content=f"{self.content}.thresholds()")


    def copy(self):
        """
        Examples · Source · Returns an exact copy of this scale.
        .. code:: javascript

            const c1 = d3.scaleQuantize(d3.schemeBlues[5]);
            const c2 = c1.copy();

        Changes to this scale will not affect the returned scale, and vice versa.

        See more informations `here <https://d3js.org/d3-scale/quantize#quantize_copy>`_.
        """
        return scaleQuantize(content=f"{self.content}.copy()")


    def nice(self):
        """
        Auto generated method
        """
        return scaleQuantize(content=f"{self.content}.nice()")

