Controlling Vega-Lite-API scale range

Hi all! In this Obervable notebook I’m trying to use range to color the dots based on weather condition.

This is similar to what @mbostock helped me with here but what I’m trying now is less complex/more humble, and I’m trying to see if I can do it with just Vega-Lite-API.

I’ve got notes in the notebook. Any thoughts?

Solved! :slight_smile:

scale accepts a domain array as well as a scale array.

From the docs: " Ordinal scales have a discrete domain and range. These scales function as a “lookup table” from a domain value to a range value."

Therefore, this did it…

  domain: ["CLR", "SKC", "FEW", "SCT", "BKN", "OVC", "VV"],
  range: ["deepskyblue", "deepskyblue", "lightskyblue", "lightblue", "#aaaaaa", "#666666", "#666666"]

That same notebook has the working example now.