heatmap.js
heatmap.js copied to clipboard
Interpolated values between points are additive rather than averaged
i'm using h337 to visually display the temperature of our datacenter. so i have a bunch of cheapo sensors reporting temperatures scattered around our racks. when i plot the data, i notice that the points in-between the sensors appear to be additive in value: eg if two neighbouring sensors are say reporting 15C, then the area in between the two sensors (the distance between points is approximately the same distance as the radius valu) appear to be reporting a higher value of ~30C (like with constructive wave interference):
for the heatmap above, i have
max: 50
radius: 13
gradient:
0.0: 'gray'
0.3: 'cyan'
0.5: 'yellow'
0.7: 'orange'
0.9: 'red'
for me, this is undesirable and should, for my use case, provide the average value of the overlap rather than a higher value.
Are you using the latest version of heatmap.js? (v2)
heatmap.js v2.0.0 according to the (minified) js file. just tried with v2.0.1 and it appears to be the same :(
Same issue although for a much more complex project.
Is this fixed by pull request #90?
Any updates on this?
Showing average instead of sum would be great for our project too. Measuring temperature, time, quality... needs average. Thanks
Hey @juliojgarciaperez & @MadStyleCow , just wanted to let you know that I'm working on resolving that issue. I tried a few approaches over the last weeks, one of them was the technique used in the mentioned PR #90 . I'm still evaluating what would be the best thing to do as all the approaches come with a ~10x performance decrease so far. Performance was one of my top priorities with heatmap.js, so I'm thinking of pushing a version where you can configure to render averages, but that's not a default setting.
Thanks @pa7, I appreciate it
@pa7 @juliojgarciaperez was this issue resolved?
@pa7 @juliojgarciaperez was this issue resolved?
I am using the latest version and points still sum instead of average.
@pa7 Hi Patrick, thank you for this beautiful library. I am having the same issue when using the leaflet plugin. I am wondering if this issue has been solved. I tried @woracheth solution/version but the problem persists. I would appreciate any help in this matter.
Thank you.
This is how the heat map looks:
@pa7 @juliojgarciaperez was this issue resolved?
I am using the latest version and points still sum instead of average.
Same issue for me because same needs to display average values. @pa7 : did you find a solution for it ? Thanks
@pa7 @juliojgarciaperez was this issue resolved? I am using the latest version and points still sum instead of average.
Same issue for me because same needs to display average values. @pa7 : did you find a solution for it ? Thanks
Using gmaps plugin, "maxIntensity" does the job according to google. I tried and it seems to. Let me know if i'm wrong. Thanks
Is there any solution yet. In our projet we also need this feature
Hi @MrTob ,
For my version #90. I had commented else where. In summary, it is near impossible to do true averaging, due to HTML5 canvas technique would limit operations to do within unsigned byte integer as the RGB color would be in the range 0-255. My thought to do workaround on buffer limitation, it might be dumping canvas buffer after every canvas operation, or separating value and count to different logical canvas.
Other than my interim solution, there is WIP in the data-interpolation branch. I didn't have a look at it yet.