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

from functools import partial
from operator import is_not

class scaleQuantile:
    def __init__(self, content="scaleQuantile"):
        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 quantile.
        .. code:: javascript

            color.invertExtent("#eff3ff"); // [2700, 3475]
            color.invertExtent("#6baed6"); // [3800, 4300]
            color.invertExtent("#08519c"); // [4950, 6300]

        This method is useful for interaction, say to determine the value in the domain that
        corresponds to the pixel location under the mouse.

        See more informations `here <https://d3js.org/d3-scale/quantile#quantile_invertExtent>`_.
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (value,))))
        return scaleQuantile(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 scaleQuantile(content=f"{self.content}.domain({arguments})")


    def range(self, range=None):
        """
        Examples · Source · If range is specified, sets the discrete values in the range.
        .. code:: javascript

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

        The array must not be empty, and may contain any type of value. The number of values in
        (the cardinality, or length, of) the range array determines the number of quantiles
        that are computed. For example, to compute quartiles, range must be an array of four
        elements such as [0, 1, 2, 3].
        If range is not specified, returns the current range.
        .. code:: javascript

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


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


    def quantiles(self):
        """
        Examples · Source · Returns the quantile thresholds.
        .. code:: javascript

            color.quantiles() // [3475, 3800, 4300, 4950]

        If the range contains n discrete values, the returned array will contain n - 1
        thresholds. Values less than the first threshold are considered in the first quantile;
        values greater than or equal to the first threshold but less than the second threshold
        are in the second quantile, and so on. Internally, the thresholds array is used with
        bisect to find the output quantile associated with the given input value.

        See more informations `here <https://d3js.org/d3-scale/quantile#quantile_quantiles>`_.
        """
        return scaleQuantile(content=f"{self.content}.quantiles()")


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

            const c1 = d3.scaleQuantile(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/quantile#quantile_copy>`_.
        """
        return scaleQuantile(content=f"{self.content}.copy()")


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

