I have a set of numbers from 1 to 100 -- they're rankings, so 1 is greater than 2 (30 is greater than 100, etc.)
This is my color function right now:
var color = d3.scale.linear()
.domain([0, 100])
.range(colorbrewer.Reds[3]);
Except this maps 1's and 2's as the lighter shades or Red.
Any ideas how to go about this? I think my terminology (reverse? inverse color mapping?) is incorrect because I can't find this in the documentation.
Thank you.
D'oh.
Reverse the domain .....
var color = d3.scale.linear()
.domain([100, 0])
.range(colorbrewer.Reds[3]);
YOLO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With