# Announce: node-red-contrib-ui-heatmap (beta release)

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125>\
**Category:** Share Your Nodes\
**Created:** [18 February 2019 23:23 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125 "2019-02-18T23:23:02Z")\
**Posts on this page:** 7\
**Page:** 6

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [5 November 2019 21:13 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/104 "2019-11-05T21:13:18Z")

</div>

> [@Rtholl](#):
>
> As you can see from the following screenshots, the red color is only correctly displayed if the overall size of the heat map is small?

Hi Raphael (@Rtholl),  
That is indeed very weird. I use the [heatmap.js](https://www.patrick-wied.at/static/heatmapjs/) library under the hood, and their source code repository is on [Github](https://github.com/pa7/heatmap.js). Unfortunately the project is not maintained anymore, and there are a lot of other issues and open pull-request. You could register an issue there, and if you are lucky somebody will answer your question. Or you can search through the open issues to find a similar one.

I only wrote this node to help a poor soul on this forum, but I'm not using it myself ...

> [@Rtholl](#):
>
> 25 is around the middle and will be displayed greenish in the heat map but the legend shows a violet color for that temperature?

I have added that legend myself, which means I had to calculate the colors myself (via interpolation) as you can see [here](https://github.com/bartbutenaers/node-red-contrib-ui-heatmap/blob/master/heat_map.js#L379). So it seems the heatmap.js calculates the colors somehow differently as I do ... If you (or anybody else) has time to investigate how I need to calculate it (to get the same result as heatmap.js), please let me know and I will change my code!

By looking at your screenshots, I'm wondering if you the [node-red-contrib-ui-level](https://github.com/hotNipi/node-red-contrib-ui-level) perhaps is a better solution for your use case?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 November 2019 21:20 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/105 "2019-11-05T21:20:31Z")

</div>

I thought the way heatmaps work is down to the density of data - so if there is more overlap (ie the compressed scale on the right) then you get greater density and so the "higher" colour. So I think it is behaving correctly. You would need to increase the radius (or decrease it) proportionately so the density remains the same.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [5 November 2019 21:37 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/106 "2019-11-05T21:37:47Z")

</div>

> [@dceejay](#):
>
> I thought the way heatmaps work is down to the density of data

Dave,  
that might be correct when looking at this [article](https://www.patrick-wied.at/blog/the-inner-life-of-heatmap-js) about heatmap.js:

> the gradient’s alpha starts at a calculated value in relation to the datapoint count

If someone wants to digg into this, that would be very welcome!  
Then I will implement the requirements...

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 November 2019 22:59 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/107 "2019-11-05T22:59:03Z")

</div>

Not sure there is anything to implement - you can configure the radius and the spacing already so the user has control over the density.

---

<div class="post-metadata">

**Author:** ![Rtholl](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@Rtholl](https://discourse.nodered.org/u/Rtholl)\
**Post date:** [7 November 2019 15:33 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/108 "2019-11-07T15:33:57Z")

</div>

@BartButenaers: thanks for the suggestion of the other node module. I guess it doesn't really suit my use case tho. Your heat map is exactly what I need.

@dceejay: Seems like it yes, but how to solve the issues with the borders of the heat map? I increased the radius and If you check out my new screenshot below you'll see the top left value is 25.5°C but "cooler displayed" than other cooler values 😕

 ![42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bc464112e3e36111489ce7e803dec80a949a4c1a.jpeg)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [7 November 2019 16:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/109 "2019-11-07T16:39:01Z")

</div>

Could you perhaps solve it by adding an extra value above the top row, and duplicate there the value from your current top row? If that solves your problem, I could perhaps add a boolean variable 'showValue' for every cell (so you can specify for each cell whether the value should be displayed or not). That way the duplicate value wouldn't become visible. Although it would be more a workaround, and not a solution...

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [6 June 2020 18:57 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125/110 "2020-06-06T18:57:39Z")

</div>

Closed on 6 June 2020 18:57 UTC



[Previous page](https://discourse.nodered.org/t/announce-node-red-contrib-ui-heatmap-beta-release/8125.md?page=5)
