Source code of generating mouse move heatmap
The source code of this function is in the "[ALINOUS_HOME]/admin/heatmap/" folder.
In this page, I'll explain how to generate the heat map of mouse move. By learning this contents, you can customize the detail of generating the Mouse Move Heat Map.
You can generate the heat map by pushing "Create New Heat Map" button.
Then the job to create a heat map is executed as the back ground job with progress bar. The "createHeatMap.anls" in the "new" folder is the source code.
The source code is below.
This program is doing operations below.
- Init the raster buffer
- Create the heat map
The "Heatmap.initRaster()" function initialize the all pixcel's value into 0.
The "hm_raster_line" table has information about the line's pixcel value. The "line_idx" column means y coordinate, and values separated by " "(space).
This table's information is used when the heat map image generated.
The "" function calculate the value of the stayed time of visitor's mouse pointer, generate a heat map image, and save the image encoded in Base64 format into the database.
This function calls
The "Heatmap.analyzePageAccesses()" function is to calculate values of the raster from recorded visitor's action log. If you want to customize the formula to make heatmap value, customize inside of this function.
The "Heatmap.updateRasterLine()" is just updating the raster information after the calculation.
The "Heatmap.createHeatmapImage()" is to create image and draw the heat map using Java functions.