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

from functools import partial
from operator import is_not

class scaleOrdinal:
    def __init__(self, content="scaleOrdinal"):
        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 domain(self, domain=None):
        """
        Auto generated method
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (domain,))))
        return scaleOrdinal(content=f"{self.content}.domain({arguments})")


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

            const color = d3.scaleOrdinal().range(["red", "green", "blue"]);

        The first element in the domain will be mapped to the first element in range, the
        second domain value to the second range value, and so on. If there are fewer elements
        in the range than in the domain, the scale will reuse values from the start of the
        range. If range is not specified, this method returns the current range.

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


    def unknown(self, value=None):
        """
        Examples · Source · If value is specified, sets the output value of the scale for
        unknown input values and returns this scale.
        .. code:: javascript

            const color = d3.scaleOrdinal(["a", "b", "c"], d3.schemeTableau10).unknown(null);
            color("a"); // "#4e79a7"
            color("b"); // "#f28e2c"
            color("c"); // "#e15759"
            color("d"); // null

        If value is not specified, returns the current unknown value, which defaults to
        implicit. The implicit value enables implicit domain construction; see ordinal.domain.

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


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

            const c1 = d3.scaleOrdinal(["a", "b", "c"], d3.schemeTableau10);
            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/ordinal#ordinal_copy>`_.
        """
        return scaleOrdinal(content=f"{self.content}.copy()")


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

