The logic to get the color based on the value is using a d3 scale, seen here:
Oddly, the width of the bar is using the same data point as the color, so we can see from your examples that the red bar looks like it’s about 95% of the total, but it is pulling back the color that is found under the .1 range. In both cases, the bottom bar (the shortest, which looks to be about 1%) should have been colored red.
I’m wondering if this is some kind of localization issue where percentages are being interpreted strangely? Although, it’s strange that the width of the bars are matching a percentage, but the color from the same value is not… Let me try to investigate.
It looks like that we could use thresholdScales in d3 to perform the color mapping, it could be that when we migrated to d3 v4, this behavior has changed with the quantizedScale and we should use thresholdScale. I’ll create an issue in atlas and work on a fix.