When you have a large data set and you want to use different colors for different values, expressing the colorMap as a map may be insufficient and an Array isn't very compact. Instead a function should be used.
For example, if 1 is a meaningful threshold for the data, you might want to use:
When you have a large data set and you want to use different colors for different values, expressing the colorMap as a map may be insufficient and an Array isn't very compact. Instead a function should be used.
For example, if 1 is a meaningful threshold for the data, you might want to use:
Or if you want to emphasize the first 5 values:
I'm open to other suggestions for syntax, but this is how I have implemented it in my fork.