mourner / simpleheat

A tiny JavaScript library for drawing heatmaps with Canvas

Home Page:http://mourner.github.io/simpleheat/demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Radius does not change

S-Berhane opened this issue · comments

I've been trying to change the radius using heat.radius(r,blur) but it never changes.
I suspect that something is reverting the radius to the default. I added a console.log to the radius method and called it once in my script. For some reason though radius change function ran twice. The first run my input is the same but the second one, the variable blur becomes undefined, which gives it a value of 15.

Can you set up a minimal JSFiddle test case reproducing the issue?

https://jsfiddle.net/mta044yy/1/

This is somewhat close to my actual implementation, but the problem is reproduced. I may be implementing this the wrong way though.

Yeah, turned out to be a misuse of the library. You created a new simpleheat object every time instead of calling draw on the original one. Working JSFiddle: https://jsfiddle.net/mta044yy/2/