I’m using heatmap.js on my website, which looks great. One slight issue is that when the event to generate the heat map is triggered, the page becomes unusable for a few seconds while the canvas loads.
I’ve created a modal dialog with a load bar that will eventually hide the page during this process, I’m just having difficulty creating a function to call the modal.
On another (slightly less useful) heat map library called heatcanvas, there are two functions to handle this:
heatmap.onRenderingStart = function(){document.getElementById('status').innerHTML = 'rendering...'}
heatmap.onRenderingEnd = function(){document.getElementById('status').innerHTML = 'ready'}
Is there a way I can create two similar functions with the heatmap.js (http://www.patrick-wied.at/static/heatmapjs/) library?
Thanks
Unfortunately, it seems that heatmap.js does not provide such callbacks by default. The best you can do is to fork the project and add this functionality by yourself. I will try to point you some places which need to be changed.
First of all, you need to provide functionality to add callbacks:
configuremethod:The last thing is to call these callbacks if they are attached. I guess that the best place to do this is a
setDataSetmethod:Please note that I’ve not tested this solution and it may need some fixes and improvements. Hope it will help you.