-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: scale.colors() does not respect the change in domain #329
Comments
chroma.scale('Spectral').domain([1,0]).colors(12)
, Colors does not respect the change in domain chroma.scale('Spectral').domain([1,0]).colors(12)
, Colors() does not respect the change in domain
chroma.scale('Spectral').domain([1,0]).colors(12)
, Colors() does not respect the change in domain
Not really sure it's a bug, but more your expectation about it (not saying its not a logical expectation). Colors returns n equidistant colors, and the output is right in both cases. If you change the domain to any other value, not an inversion, the output is "right". You are expecting that inverting the domain equals to inverting the scale, but that's not the current design. The scale is set according to the original color array passed, and .colors() just creates a new array using that reference. The domain has nothing to do with it. If you want to invert the scale, invert the colors output. In fact, if you try any other scale modification (like .mode), .colors is not affected by it. Whatever method you apply to the scale does not change the scale, just its representation. They are different things. colors() is only related to the scale, not its representation. |
idk, using |
chroma.scale('Spectral').domain([1,0])
vschroma.scale('Spectral').domain([1,0]).colors(12)
do not match.That is to say
chroma.scale('Spectral').domain([1,0]).colors(12) === chroma.scale('Spectral').colors(12)
The text was updated successfully, but these errors were encountered: