Question

I am making a visualization using heatmap.js by Patrick Wied.

Question: How can I remove the color blending in a heatmap?

Instead of blending/blurring the colors, I would like the colors to look layered like so: http://i.stack.imgur.com/tbfm4.png

I've been trying to figure this out for 2 weeks now... If anyone could help me, I would be very thankful.

Was it helpful?

Solution

Two weeks?

gradient: {
    0     : '#00f',
    0.2   : '#00f',
    0.2001: '#0ff',
    0.4   : '#0ff',
    0.4001: '#0f0',
    0.6   : '#0f0',
    0.6001: '#ff0',
    0.8   : '#ff0',
    0.8001: '#f00',
    1     : '#f00'
}

I haven't tested this, but then again I have never used heatmap.js. I just looked at the docs for thirty seconds, and I figure this should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top