Source code of Generating window scroll heatmap
- Location of the Source Code
- Create Window Scroll Heat Map
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 Window Scroll. By learning this contents, you can customize the detail of generating the Window Scroll 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 structure of the program is simular to the Source code of Mouse Move Heat map.
The source code is below.
This function calls
They are intialize the y coordinates value, calculate the data from the visitor's window-scroll log, and generate a image of the heat map.
The "HeatmapScroll.initRecords()" function initialize the data value for each y coordinate.
The data structure of window scroll heat map is very simple. It is because the data do not have information about x coordinate.
The "HeatmapScroll.makeScrollData()" function calculate the data used in drawing heat map form the window-scroll action's log.
The "HeatmapScroll.analyzeOnePage()", which is called in this function, actually calculate the stayed time for a single access. This function uses functions whose prefix is "ScrollHeatmap". The are implemented by Java language. It is because Alinous-Core is not good at handle complex algorithm.
The "HeatmapScroll.generateImage()" function creates and draws a heat map image by using Java program. After creating the heat map image, it encodes the image in Base64 format and store it into the "hm_scroll_result_image" table.