Support gradients as scale ranges
Author: scottysseusCreated May 28, 2025Updated Aug 26, 2026
Labelsfeature-request
Here's an example spec showing what I'd like to end up with (it fails to parse currently).
{
"name": "fillGradient",
"domain": {"data": "table", "field": "amount"},
"range": {
"gradient": "linear",
"stops": [
{"offset": 0, "color": "red"},
{"offset": 0.5, "color": "white"},
{"offset": 1, "color": "blue"}
]
}
}This should produce solid-colored bars, where each bar's color is determined by mapping its domain value onto the gradient. The goal here is mainly the stops feature of gradients: there doesn't seem to be a way to accomplish that with color scheme scales.
Here's a similar example spec using a color scheme, but without any control over the stops.
Source: vega/vega