You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when we specify an array "range": ["pink", "red"], there is no way to force it to interpolate like it does with scheme (to the best of my knowledge).
Of course, it makes sense not to interpolate the color by default, since this is D3 ordinal scale's default behavior. However, since Vega's ordinal scales, unlike D3's, allow interpolation with range.scheme, shouldn't there be a way to enable interpolation when range is an array of color? For example, maybe we could support interpolate property for ordinal scales?
This is not really a pressing issue, but it seems like we're a bit inconsistent here (unless I misunderstand something) so it's worth reporting. :)
The text was updated successfully, but these errors were encountered:
kanitw
changed the title
Ordinal scale
Ordinal scale can interpolate scheme, but not range
Aug 21, 2017
Yes, this is currently unsupported. I think one way to approach this would be to allow "inline" scheme definitions: in addition to scheme name strings, one might provide an explicit color array as the value of the "scheme" property. Then everything else could proceed unchanged. This update would involve modifying a few lines of code in vega-encode's Scale operator, plus modifications to the Vega JSON schema generator in vega-parser.
Vega's ordinal scales accept
scheme
and seems to be able to interpolate sequential color schemeFor example, using the following scale works (full spec)
Full spec: https://pastebin.com/KzifPxmJ.
However, when we specify an array
"range": ["pink", "red"]
, there is no way to force it to interpolate like it does withscheme
(to the best of my knowledge).Of course, it makes sense not to interpolate the color by default, since this is D3 ordinal scale's default behavior. However, since Vega's ordinal scales, unlike D3's, allow interpolation with
range.scheme
, shouldn't there be a way to enable interpolation whenrange
is an array of color? For example, maybe we could supportinterpolate
property for ordinal scales?This is not really a pressing issue, but it seems like we're a bit inconsistent here (unless I misunderstand something) so it's worth reporting. :)
The text was updated successfully, but these errors were encountered: