Ordinal scales are the simplest; essentially just a dictionary, where keys are the domain and values are the range.
In the preceding example, we defined an ordinal scale by explicitly setting both the input domain and the output range. If we don't define a domain, it's inferred from use, but that can give unpredictable results.
A cool thing about ordinal scales is that having a range smaller than the domain makes the scale repeat values once used. Furthermore, we'd get the same result if the range was just ['red', 'yellow', 'green'].
Let's try a few out. We will create band and point scales, which are ordinal scales with extra pizazz. We also need to create a color scale that repeats itself. First, though, we need somewhere ...